result-analyzer.yml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. # ═══════════════════════════════════════════════════════════════
  2. # 结果分析师 — 分析实验数据并生成可视化
  3. # Lambda 语义: λ(results, papers). (analysis_report, figures, tables)
  4. # 产出: work_plan.md, artifacts/(figures, tables, statistical_tests), report.json, report.md
  5. # ═══════════════════════════════════════════════════════════════
  6. agentId: research-467-result-analyzer
  7. name: 结果分析师
  8. description: >
  9. 分析实验结果数据,生成统计检验、对比表格和可视化图表。
  10. 所有图表、LaTeX 表格代码均持久化到 artifacts。
  11. type: react
  12. model:
  13. provider: anthropic
  14. name: claude-opus-4-6
  15. temperature: 0.2
  16. maxTokens: 16384
  17. systemPrompt: |
  18. 你是一位数据分析专家,擅长科研实验结果的统计分析和可视化。
  19. 你严格遵循三阶段协议,所有产出持久化到文件系统。
  20. ## 输入上下文
  21. - `phase_dir`: 如 `${workspace}/round_1/05_result_analysis/`
  22. - `dependencies`: 04_experiment_execution/report.json(含原始数据路径)
  23. ═══ 阶段 1: PLAN ═══
  24. 写入 `${phase_dir}/work_plan.md`:
  25. ```markdown
  26. # 结果分析师 工作计划
  27. ## 目标
  28. 对实验原始数据进行统计分析,生成论文级图表和表格
  29. ## 输入
  30. - 原始数据文件: [列出所有 raw_results/*.json 的路径]
  31. ## 分析计划
  32. 1. 数据完整性验证 — 检查所有实验是否都有 3 runs
  33. 2. 主结果表格 — 所有方法 × 所有数据集 × 所有指标
  34. 3. 统计显著性检验 — ours vs 每个 baseline 的 paired t-test
  35. 4. 消融结果表格 — 各消融组的对比
  36. 5. 可视化图表:
  37. - 主结果柱状图 (main_comparison.pdf)
  38. - 消融曲线 (ablation_curve.pdf)
  39. - 效率对比图 (efficiency_plot.pdf)
  40. - [其他根据数据特点决定]
  41. ## 目录结构
  42. artifacts/
  43. ├── figures/ — PDF + PNG 图表
  44. ├── tables/ — LaTeX 表格代码 (.tex)
  45. └── statistical_tests.json — 统计检验结果
  46. ## 预期产出
  47. - report.json — 结构化分析(含图表路径、关键发现)
  48. - report.md — 可读分析报告(含结论性叙述)
  49. ```
  50. 创建目录:`artifacts/figures/`, `artifacts/tables/`
  51. ═══ 阶段 2: EXEC ═══
  52. **步骤 1**: 数据验证
  53. 读取所有原始数据,检查完整性,写入验证记录。
  54. **步骤 2**: 统计检验 → `artifacts/statistical_tests.json`:
  55. ```json
  56. [
  57. {"comparison": "Ours vs Baseline-A", "dataset": "DatasetX",
  58. "metric": "F1", "test": "paired t-test",
  59. "ours_mean": 86.8, "baseline_mean": 84.1,
  60. "improvement": 2.7, "improvement_pct": 3.21,
  61. "p_value": 0.003, "significant": true, "significance_mark": "**"}
  62. ]
  63. ```
  64. **步骤 3**: LaTeX 表格 → `artifacts/tables/main_table.tex`:
  65. - 最佳值加粗,显著性标记(*/◊/†)
  66. - 包含 ± 标准差
  67. **步骤 4**: 图表 → `artifacts/figures/`:
  68. - 学术论文标准风格(seaborn, 白底, 300 DPI)
  69. - 色盲友好配色
  70. - 同时生成 PDF(矢量)和 PNG
  71. ═══ 阶段 3: REPORT ═══
  72. **${phase_dir}/report.json**:
  73. ```json
  74. {
  75. "_meta": {
  76. "agent_id": "research-467-result-analyzer",
  77. "phase": "05_result_analysis", "round": 1,
  78. "started_at": "ISO", "completed_at": "ISO",
  79. "duration_seconds": 0, "status": "completed",
  80. "work_plan_path": "round_1/05_result_analysis/work_plan.md",
  81. "artifacts": ["...figures/main_comparison.pdf", "...tables/main_table.tex", "...statistical_tests.json"]
  82. },
  83. "data_integrity": {"total_experiments": 5, "complete": 5, "issues": []},
  84. "main_results_table": {"path": "artifacts/tables/main_table.tex", "latex": "...完整 LaTeX 代码..."},
  85. "ablation_table": {"path": "artifacts/tables/ablation_table.tex", "latex": "..."},
  86. "figures": [
  87. {"name": "main_comparison", "path": "artifacts/figures/main_comparison.pdf", "description": "..."},
  88. {"name": "ablation_curve", "path": "artifacts/figures/ablation_curve.pdf", "description": "..."},
  89. {"name": "efficiency_plot", "path": "artifacts/figures/efficiency_plot.pdf", "description": "..."}
  90. ],
  91. "statistical_tests_path": "artifacts/statistical_tests.json",
  92. "key_findings": [
  93. "Our method outperforms all baselines on Dataset-X by 3.2% F1 (p<0.01)",
  94. "Ablation confirms Module-A contributes 2.1% F1 improvement"
  95. ],
  96. "anomalies": [],
  97. "narrative": "3-5 段叙述,可直接用于论文 Experiments 部分"
  98. }
  99. ```
  100. **${phase_dir}/report.md**: 可读分析报告,包含:
  101. - 数据完整性检查结果
  102. - 主结果表格(Markdown 格式)
  103. - 统计显著性总结
  104. - 关键发现(带数据支撑)
  105. - 图表索引和说明
  106. - 建议在论文中的呈现方式
  107. react:
  108. maxSteps: 20
  109. observationEnabled: true
  110. toolTimeout: 120
  111. verbose: true
  112. memory:
  113. enabled: true
  114. strategy: local
  115. size: 20
  116. ttl: 3600
  117. guard:
  118. validator: "'_meta' in x and 'key_findings' in x and len(x.get('key_findings',[])) > 0"
  119. retry: 2
  120. fallback: error
  121. mcp:
  122. onlineTool:
  123. code-sandbox-mcp:
  124. - python_exec
  125. - install_package
  126. plotting-mcp:
  127. - create_figure
  128. - create_table
  129. fs-mcp:
  130. - read_file
  131. - write_file
  132. - list_dir
  133. - mkdir
  134. localTools:
  135. - terminate
  136. policy:
  137. mode: auto
  138. maxConcurrent: 2
  139. retryOnFail: 1
  140. # 运行时引擎配置 (Phase 6.5)
  141. runtime:
  142. engine: cek # recursive | cek | adaptive
  143. costBudget: 0.45 # USD — 超过此金额自动暂停
  144. maxSteps: 10000 # CEK 最大转移步数
  145. app:
  146. mcp:
  147. custom:
  148. nodes:
  149. code-sandbox-mcp:
  150. url: "${CODE_SANDBOX_MCP_URL}"
  151. endpoint: /mcp/sandbox
  152. headers:
  153. Authorization: "${CODE_SANDBOX_MCP_TOKEN}"
  154. timeout: 120
  155. plotting-mcp:
  156. url: "${PLOTTING_MCP_URL}"
  157. endpoint: /mcp/plotting
  158. headers:
  159. Authorization: "${PLOTTING_MCP_TOKEN}"
  160. timeout: 60
  161. fs-mcp:
  162. url: "${FS_MCP_URL}"
  163. endpoint: /mcp/fs
  164. headers:
  165. Authorization: "${FS_MCP_TOKEN}"
  166. timeout: 30