eduevidence 5.2.0 → 6.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (386) hide show
  1. package/CONTRIBUTING.md +105 -0
  2. package/README.md +142 -75
  3. package/README.zh-CN.md +73 -30
  4. package/SKILL.md +397 -131
  5. package/agents/openai.yaml +4 -0
  6. package/assets/readme/controlled-execution.svg +34 -0
  7. package/assets/readme/landing-tour.gif +0 -0
  8. package/assets/readme/logo.png +0 -0
  9. package/assets/readme/research-workflow.svg +56 -0
  10. package/assets/readme/studio-graph.png +0 -0
  11. package/assets/readme/studio-overview.png +0 -0
  12. package/assets/readme/studio-reports.png +0 -0
  13. package/assets/readme/studio-tour.gif +0 -0
  14. package/autoevolve/config.yaml +17 -0
  15. package/autoevolve/program.md +25 -0
  16. package/autoevolve/protected.manifest.yaml +34 -0
  17. package/benchmarks/adversarial/cases.jsonl +7 -0
  18. package/benchmarks/evidence-library.json +5268 -0
  19. package/benchmarks/partitions.json +8 -0
  20. package/bin/eduevidence.js +2 -1
  21. package/docs/architecture.md +496 -0
  22. package/docs/autoresearch-evolution-plan.md +2903 -0
  23. package/docs/autoresearch-implementation-status.md +101 -0
  24. package/docs/demo-storyboard.md +20 -0
  25. package/docs/demo-workplace-ai.md +92 -0
  26. package/docs/demo.md +32 -0
  27. package/docs/install-guide.md +150 -0
  28. package/docs/orchestration-role-model.md +1254 -0
  29. package/docs/release-closeout/README.md +17 -0
  30. package/docs/release-closeout/frontend-acceptance.md +23 -0
  31. package/docs/release-closeout/issues.md +19 -0
  32. package/docs/release-closeout/verification.md +28 -0
  33. package/docs/release-contract.md +108 -0
  34. package/docs/research-studio-guide.zh-CN.md +166 -0
  35. package/docs/sciverse-api.md +125 -0
  36. package/eduevidence_cli.py +29 -13
  37. package/engine/_resources.py +13 -0
  38. package/engine/autoevolve/__init__.py +3 -0
  39. package/engine/autoevolve/agent_view.py +167 -0
  40. package/engine/autoevolve/core.py +357 -0
  41. package/engine/autoevolve/events.py +11 -0
  42. package/engine/autoevolve/git_workspace.py +77 -0
  43. package/engine/autoevolve/projection.py +23 -0
  44. package/engine/autoevolve/runner.py +413 -0
  45. package/engine/autoevolve/trust.py +146 -0
  46. package/engine/autoresearch/__init__.py +6 -0
  47. package/engine/autoresearch/commit.py +132 -0
  48. package/engine/autoresearch/contracts.py +126 -0
  49. package/engine/autoresearch/controller.py +207 -0
  50. package/engine/autoresearch/events.py +12 -0
  51. package/engine/autoresearch/gap_priority.py +168 -0
  52. package/engine/autoresearch/projection.py +30 -0
  53. package/engine/autoresearch/research_memory.py +59 -0
  54. package/engine/autoresearch/saturation.py +91 -0
  55. package/engine/briefs.py +2 -1
  56. package/engine/capabilities.py +1 -0
  57. package/engine/contracts.py +3 -1
  58. package/engine/decision_policy.py +96 -0
  59. package/engine/evidence_graph.py +14 -10
  60. package/engine/evidencecore.py +7 -5
  61. package/engine/gaps.py +132 -73
  62. package/engine/ids.py +2 -0
  63. package/engine/judge_pack.py +65 -0
  64. package/engine/library.py +6 -2
  65. package/engine/library_builtin.py +3 -1
  66. package/engine/living.py +36 -5
  67. package/engine/meta_synthesis.py +3 -1
  68. package/engine/migration.py +88 -3
  69. package/engine/orchestration.py +460 -0
  70. package/engine/paths.py +2 -0
  71. package/engine/pilot.py +36 -33
  72. package/engine/project.py +2 -2
  73. package/engine/research_service.py +113 -0
  74. package/engine/studio_read_model.py +400 -0
  75. package/engine/taxonomy.py +211 -0
  76. package/engine/tribunal.py +44 -33
  77. package/engine/update.py +1 -0
  78. package/engine/versions.py +1 -1
  79. package/engine/worker_result.py +109 -0
  80. package/engine/workflows.py +70 -0
  81. package/examples/ai-coding-assistant-evidence/EduEvidence_Report.html +2934 -0
  82. package/examples/ai-coding-assistant-evidence/artifact_manifest.json +15 -0
  83. package/examples/ai-coding-assistant-evidence/citation_check.json +79 -0
  84. package/examples/ai-coding-assistant-evidence/claims.jsonl +12 -0
  85. package/examples/ai-coding-assistant-evidence/evaluation.json +35 -0
  86. package/examples/ai-coding-assistant-evidence/evidence.jsonl +12 -0
  87. package/examples/ai-coding-assistant-evidence/final_verdict.json +107 -0
  88. package/examples/ai-coding-assistant-evidence/frame.json +48 -0
  89. package/examples/ai-coding-assistant-evidence/gate_report.json +101 -0
  90. package/examples/ai-coding-assistant-evidence/intervention.json +51 -0
  91. package/examples/ai-coding-assistant-evidence/methodology.json +36 -0
  92. package/examples/ai-coding-assistant-evidence/raw_verdict.json +86 -0
  93. package/examples/ai-coding-assistant-evidence/report_spec.json +230 -0
  94. package/examples/ai-coding-assistant-evidence/reports-5themes/EduEvidence_Report_academic.html +2934 -0
  95. package/examples/ai-coding-assistant-evidence/reports-5themes/EduEvidence_Report_claude.html +2934 -0
  96. package/examples/ai-coding-assistant-evidence/reports-5themes/EduEvidence_Report_datalab-dark.html +2934 -0
  97. package/examples/ai-coding-assistant-evidence/reports-5themes/EduEvidence_Report_datalab.html +2934 -0
  98. package/examples/ai-coding-assistant-evidence/reports-5themes/EduEvidence_Report_presentation.html +2934 -0
  99. package/examples/ai-coding-assistant-evidence/reports-5themes/report_academic.html +2934 -0
  100. package/examples/ai-coding-assistant-evidence/reports-5themes/report_claude.html +2934 -0
  101. package/examples/ai-coding-assistant-evidence/reports-5themes/report_datalab-dark.html +2934 -0
  102. package/examples/ai-coding-assistant-evidence/reports-5themes/report_datalab.html +2934 -0
  103. package/examples/ai-coding-assistant-evidence/reports-5themes/report_presentation.html +2934 -0
  104. package/examples/ai-coding-assistant-evidence/result.json +1457 -0
  105. package/examples/ai-coding-assistant-evidence/result.zh.json +1457 -0
  106. package/examples/ai-coding-assistant-evidence/skeptic.json +72 -0
  107. package/examples/ai-coding-assistant-evidence/sources.jsonl +8 -0
  108. package/examples/ai-coding-assistant-evidence/verdict.json +107 -0
  109. package/examples/spaced-retrieval-practice/applicability.json +14 -0
  110. package/examples/spaced-retrieval-practice/artifact_manifest.json +15 -0
  111. package/examples/spaced-retrieval-practice/claims.jsonl +3 -0
  112. package/examples/spaced-retrieval-practice/evidence.jsonl +6 -0
  113. package/examples/spaced-retrieval-practice/final_verdict.json +93 -0
  114. package/examples/spaced-retrieval-practice/frame.json +58 -0
  115. package/examples/spaced-retrieval-practice/gate_report.json +101 -0
  116. package/examples/spaced-retrieval-practice/methodology.json +78 -0
  117. package/examples/spaced-retrieval-practice/report_spec.json +212 -0
  118. package/examples/spaced-retrieval-practice/reports-5themes/EduEvidence_Report_academic.html +2728 -0
  119. package/examples/spaced-retrieval-practice/reports-5themes/EduEvidence_Report_claude.html +2728 -0
  120. package/examples/spaced-retrieval-practice/reports-5themes/EduEvidence_Report_datalab-dark.html +2728 -0
  121. package/examples/spaced-retrieval-practice/reports-5themes/EduEvidence_Report_datalab.html +2728 -0
  122. package/examples/spaced-retrieval-practice/reports-5themes/EduEvidence_Report_presentation.html +2728 -0
  123. package/examples/spaced-retrieval-practice/reports-5themes/report_academic.html +2728 -0
  124. package/examples/spaced-retrieval-practice/reports-5themes/report_claude.html +2728 -0
  125. package/examples/spaced-retrieval-practice/reports-5themes/report_datalab-dark.html +2728 -0
  126. package/examples/spaced-retrieval-practice/reports-5themes/report_datalab.html +2728 -0
  127. package/examples/spaced-retrieval-practice/reports-5themes/report_presentation.html +2728 -0
  128. package/examples/spaced-retrieval-practice/result.json +942 -0
  129. package/examples/spaced-retrieval-practice/result.zh.json +942 -0
  130. package/examples/spaced-retrieval-practice/skeptic.json +70 -0
  131. package/examples/spaced-retrieval-practice/sources.jsonl +7 -0
  132. package/examples/spaced-retrieval-practice/verdict.json +93 -0
  133. package/examples/workplace-ai-assistant/artifact_manifest.json +15 -0
  134. package/examples/workplace-ai-assistant/claims.jsonl +4 -0
  135. package/examples/workplace-ai-assistant/evaluation.json +19 -0
  136. package/examples/workplace-ai-assistant/evidence.jsonl +4 -0
  137. package/examples/workplace-ai-assistant/evidence_graph.json +444 -0
  138. package/examples/workplace-ai-assistant/final_verdict.json +78 -0
  139. package/examples/workplace-ai-assistant/frame.json +41 -0
  140. package/examples/workplace-ai-assistant/gate_report.json +101 -0
  141. package/examples/workplace-ai-assistant/intervention.json +27 -0
  142. package/examples/workplace-ai-assistant/legacy-link-check.json +16 -0
  143. package/examples/workplace-ai-assistant/methodology.json +60 -0
  144. package/examples/workplace-ai-assistant/report_spec.json +224 -0
  145. package/examples/workplace-ai-assistant/reports-5themes/EduEvidence_Report_academic.html +2814 -0
  146. package/examples/workplace-ai-assistant/reports-5themes/EduEvidence_Report_claude.html +2814 -0
  147. package/examples/workplace-ai-assistant/reports-5themes/EduEvidence_Report_datalab-dark.html +2814 -0
  148. package/examples/workplace-ai-assistant/reports-5themes/EduEvidence_Report_datalab.html +2814 -0
  149. package/examples/workplace-ai-assistant/reports-5themes/EduEvidence_Report_presentation.html +2814 -0
  150. package/examples/workplace-ai-assistant/reports-5themes/report_academic.html +2814 -0
  151. package/examples/workplace-ai-assistant/reports-5themes/report_claude.html +2814 -0
  152. package/examples/workplace-ai-assistant/reports-5themes/report_datalab-dark.html +2814 -0
  153. package/examples/workplace-ai-assistant/reports-5themes/report_datalab.html +2814 -0
  154. package/examples/workplace-ai-assistant/reports-5themes/report_presentation.html +2814 -0
  155. package/examples/workplace-ai-assistant/result.json +615 -0
  156. package/examples/workplace-ai-assistant/result.zh.json +615 -0
  157. package/examples/workplace-ai-assistant/search_log.json +19 -0
  158. package/examples/workplace-ai-assistant/skeptic.json +72 -0
  159. package/examples/workplace-ai-assistant/sources.jsonl +3 -0
  160. package/examples/workplace-ai-assistant/validation_result.json +9 -0
  161. package/examples/workplace-ai-assistant/verdict.json +78 -0
  162. package/install.sh +7 -7
  163. package/integrations/agent_mcp.py +2 -2
  164. package/integrations/orchestration_dispatch.py +146 -0
  165. package/package.json +46 -3
  166. package/pyproject.toml +14 -22
  167. package/references/autoresearch.md +30 -0
  168. package/references/evaluation-policy.md +24 -0
  169. package/references/orchestration.md +22 -0
  170. package/references/report-copy-style.md +67 -0
  171. package/references/retrieval-compliance.md +75 -0
  172. package/references/retrieval-protocol.md +20 -0
  173. package/references/scientific-invariants.md +19 -0
  174. package/retrieval/audit.py +178 -0
  175. package/retrieval/fetch.py +96 -0
  176. package/retrieval/sciverse.py +398 -0
  177. package/retrieval/search.py +47 -7
  178. package/schemas/applicability.schema.json +94 -0
  179. package/schemas/chart-spec.schema.json +10 -3
  180. package/schemas/evidence.schema.json +316 -43
  181. package/schemas/fetch-result.schema.json +2 -1
  182. package/schemas/intervention.schema.json +106 -21
  183. package/schemas/report-result.schema.json +12 -4
  184. package/schemas/report-spec.schema.json +98 -100
  185. package/schemas/skeptic.schema.json +86 -0
  186. package/schemas/source.schema.json +21 -2
  187. package/schemas/v2/finding.schema.json +5 -1
  188. package/schemas/v2/methodology-audit.schema.json +5 -1
  189. package/schemas/v2/outcome.schema.json +28 -5
  190. package/schemas/v2/project.schema.json +2 -2
  191. package/schemas/v2/run.schema.json +1 -1
  192. package/schemas/v2/study.schema.json +5 -1
  193. package/schemas/vNext/autoevolve-session.schema.json +34 -0
  194. package/schemas/vNext/eval-snapshot.schema.json +77 -0
  195. package/schemas/vNext/execution-plan.schema.json +50 -0
  196. package/schemas/vNext/gap-priority.schema.json +54 -0
  197. package/schemas/vNext/negative-search-record.schema.json +68 -0
  198. package/schemas/vNext/research-iteration.schema.json +87 -0
  199. package/schemas/vNext/research-strategy.schema.json +62 -0
  200. package/schemas/vNext/skill-experiment.schema.json +90 -0
  201. package/schemas/vNext/task-spec.schema.json +156 -0
  202. package/schemas/vNext/worker-result.schema.json +60 -0
  203. package/schemas/verdict.schema.json +164 -28
  204. package/scripts/benchmark_judge.py +2 -2
  205. package/scripts/benchmark_v3.py +26 -43
  206. package/scripts/build_esl_artifacts.py +4 -4
  207. package/scripts/build_evidence_library.py +2 -2
  208. package/scripts/build_gh_pages.py +98 -0
  209. package/scripts/build_readme_diagrams.py +72 -0
  210. package/scripts/build_report_variants.py +101 -0
  211. package/scripts/build_result.py +74 -9
  212. package/scripts/check_autoresearch_invariants.py +95 -0
  213. package/scripts/check_package_parity.py +85 -0
  214. package/scripts/check_protocol_alignment.py +375 -0
  215. package/scripts/check_versioned_schemas.py +254 -0
  216. package/scripts/claim_audit.py +13 -8
  217. package/scripts/compute_confidence.py +10 -0
  218. package/scripts/daily_evolve.py +30 -0
  219. package/scripts/dashboard_server.py +130 -101
  220. package/scripts/did_regression.py +17 -32
  221. package/scripts/enrich_projects_human_and_lieflat.py +1 -1
  222. package/scripts/evidence_score.py +5 -2
  223. package/scripts/generate_metrics.py +4 -3
  224. package/scripts/generate_new_projects.py +5 -5
  225. package/scripts/orchestrator.py +286 -36
  226. package/scripts/pre_verdict_gate.py +224 -26
  227. package/scripts/quickstart.py +18 -2
  228. package/scripts/rebake_all_5themes.py +1 -2
  229. package/scripts/research_auto_cli.py +475 -0
  230. package/scripts/run_workspace.py +24 -8
  231. package/scripts/search_provenance.py +64 -0
  232. package/scripts/serve_web.py +9 -10
  233. package/scripts/skill_lint.py +1 -1
  234. package/scripts/skill_payload.py +81 -0
  235. package/scripts/test_adversarial_empirical.py +26 -19
  236. package/scripts/validate_schema.py +46 -2
  237. package/scripts/vnext_cli.py +133 -0
  238. package/setup.py +12 -0
  239. package/skill/agents/evaluation-designer.md +20 -4
  240. package/skill/agents/evidence-analyst.md +19 -3
  241. package/skill/agents/evidence-judge.md +50 -2
  242. package/skill/agents/evidence-retriever.md +20 -3
  243. package/skill/agents/intervention-designer.md +20 -4
  244. package/skill/agents/method-reviewer.md +18 -2
  245. package/skill/agents/{education-planner.md → research-planner.md} +19 -3
  246. package/skill/agents/skeptic.md +18 -2
  247. package/skill/roles/registry.yaml +45 -0
  248. package/skill/sub-skills/aihot-trend-analysis/SKILL.md +28 -9
  249. package/skill/sub-skills/contradiction-analysis/SKILL.md +31 -11
  250. package/skill/sub-skills/data-analysis/SKILL.md +34 -15
  251. package/skill/sub-skills/ethics-review/SKILL.md +33 -10
  252. package/skill/sub-skills/evidence-extraction/SKILL.md +29 -11
  253. package/skill/sub-skills/evidence-review/SKILL.md +31 -12
  254. package/skill/sub-skills/gap-analysis/SKILL.md +31 -9
  255. package/skill/sub-skills/literature-review/SKILL.md +35 -14
  256. package/skill/sub-skills/methodology-audit/SKILL.md +29 -12
  257. package/skill/sub-skills/report-generation/SKILL.md +40 -6
  258. package/skill/sub-skills/research-planning/SKILL.md +41 -14
  259. package/skill/sub-skills/study-design/SKILL.md +30 -9
  260. package/skill/task-briefs/adjudicate.md +32 -7
  261. package/skill/task-briefs/applicability.md +38 -0
  262. package/skill/task-briefs/audit.md +32 -7
  263. package/skill/task-briefs/challenge.md +34 -5
  264. package/skill/task-briefs/evaluate.md +30 -5
  265. package/skill/task-briefs/extract.md +31 -8
  266. package/skill/task-briefs/frame.md +39 -10
  267. package/skill/task-briefs/intervene.md +32 -6
  268. package/skill/task-briefs/present.md +32 -8
  269. package/skill/task-briefs/projection.md +37 -0
  270. package/skill/task-briefs/retrieve.md +36 -6
  271. package/skill/workflows/decision-and-pilot.md +85 -0
  272. package/skill/workflows/evaluate-and-update.md +93 -0
  273. package/skill/workflows/evidence-review.md +117 -0
  274. package/visualization/eduevidence-report/assets/base.css +2 -2
  275. package/visualization/eduevidence-report/assets/reader.css +752 -0
  276. package/visualization/eduevidence-report/assets/reader.js +132 -0
  277. package/visualization/eduevidence-report/references/chart-selection-catalog.md +109 -0
  278. package/visualization/eduevidence-report/references/lieflat-composition.md +3 -1
  279. package/visualization/eduevidence-report/scripts/build_figures.py +25 -3
  280. package/visualization/eduevidence-report/scripts/build_infographics.py +5 -1
  281. package/visualization/eduevidence-report/scripts/build_report.py +561 -121
  282. package/visualization/eduevidence-report/scripts/charts_data.py +2 -0
  283. package/visualization/eduevidence-report/scripts/lieflat_engine.py +371 -136
  284. package/visualization/eduevidence-report/scripts/zh_labels.py +80 -1
  285. package/visualization/eduevidence-report/themes/academic.css +1 -1
  286. package/visualization/eduevidence-report/themes/claude.css +1 -1
  287. package/visualization/eduevidence-report/themes/datalab-dark.css +2 -2
  288. package/visualization/eduevidence-report/themes/datalab.css +2 -2
  289. package/visualization/eduevidence-report/themes/presentation.css +2 -2
  290. package/web/README.md +18 -0
  291. package/web/architecture.html +14885 -0
  292. package/web/index.html +53 -0
  293. package/web/studio/THIRD_PARTY_LICENSES.txt +146 -0
  294. package/web/studio/assets/index-B8tkF44Q.css +1 -0
  295. package/web/studio/assets/index-CQ6Keoyc.js +230 -0
  296. package/web/studio/config.json +1 -0
  297. package/web/studio/index.html +14 -0
  298. package/engine/__pycache__/__init__.cpython-312.pyc +0 -0
  299. package/engine/__pycache__/analysis.cpython-312.pyc +0 -0
  300. package/engine/__pycache__/bias.cpython-312.pyc +0 -0
  301. package/engine/__pycache__/briefs.cpython-312.pyc +0 -0
  302. package/engine/__pycache__/capabilities.cpython-312.pyc +0 -0
  303. package/engine/__pycache__/citation_check.cpython-312.pyc +0 -0
  304. package/engine/__pycache__/contracts.cpython-312.pyc +0 -0
  305. package/engine/__pycache__/datasets.cpython-312.pyc +0 -0
  306. package/engine/__pycache__/events.cpython-312.pyc +0 -0
  307. package/engine/__pycache__/evidence_graph.cpython-312.pyc +0 -0
  308. package/engine/__pycache__/evidence_review.cpython-312.pyc +0 -0
  309. package/engine/__pycache__/evidencecore.cpython-312.pyc +0 -0
  310. package/engine/__pycache__/gap_lens.cpython-312.pyc +0 -0
  311. package/engine/__pycache__/gaps.cpython-312.pyc +0 -0
  312. package/engine/__pycache__/graph_store.cpython-312.pyc +0 -0
  313. package/engine/__pycache__/graph_validate.cpython-312.pyc +0 -0
  314. package/engine/__pycache__/ids.cpython-312.pyc +0 -0
  315. package/engine/__pycache__/library.cpython-312.pyc +0 -0
  316. package/engine/__pycache__/library_builtin.cpython-312.pyc +0 -0
  317. package/engine/__pycache__/living.cpython-312.pyc +0 -0
  318. package/engine/__pycache__/log.cpython-312.pyc +0 -0
  319. package/engine/__pycache__/meta_analysis.cpython-312.pyc +0 -0
  320. package/engine/__pycache__/meta_synthesis.cpython-312.pyc +0 -0
  321. package/engine/__pycache__/migration.cpython-312.pyc +0 -0
  322. package/engine/__pycache__/mode_router.cpython-312.pyc +0 -0
  323. package/engine/__pycache__/paths.cpython-312.pyc +0 -0
  324. package/engine/__pycache__/pilot.cpython-312.pyc +0 -0
  325. package/engine/__pycache__/planner.cpython-312.pyc +0 -0
  326. package/engine/__pycache__/project.cpython-312.pyc +0 -0
  327. package/engine/__pycache__/projections.cpython-312.pyc +0 -0
  328. package/engine/__pycache__/robustness.cpython-312.pyc +0 -0
  329. package/engine/__pycache__/run.cpython-312.pyc +0 -0
  330. package/engine/__pycache__/semantics.cpython-312.pyc +0 -0
  331. package/engine/__pycache__/study_design.cpython-312.pyc +0 -0
  332. package/engine/__pycache__/synthesis.cpython-312.pyc +0 -0
  333. package/engine/__pycache__/tribunal.cpython-312.pyc +0 -0
  334. package/engine/__pycache__/update.cpython-312.pyc +0 -0
  335. package/engine/__pycache__/versions.cpython-312.pyc +0 -0
  336. package/integrations/__pycache__/__init__.cpython-312.pyc +0 -0
  337. package/integrations/__pycache__/agent_mcp.cpython-312.pyc +0 -0
  338. package/integrations/__pycache__/smart_web_fetch.cpython-312.pyc +0 -0
  339. package/retrieval/__pycache__/__init__.cpython-312.pyc +0 -0
  340. package/retrieval/__pycache__/corpus_store.cpython-312.pyc +0 -0
  341. package/retrieval/__pycache__/dedupe.cpython-312.pyc +0 -0
  342. package/retrieval/__pycache__/failures.cpython-312.pyc +0 -0
  343. package/retrieval/__pycache__/fetch.cpython-312.pyc +0 -0
  344. package/retrieval/__pycache__/search.cpython-312.pyc +0 -0
  345. package/retrieval/__pycache__/source.cpython-312.pyc +0 -0
  346. package/retrieval/__pycache__/validate.cpython-312.pyc +0 -0
  347. package/scripts/__pycache__/__init__.cpython-312.pyc +0 -0
  348. package/scripts/__pycache__/benchmark.cpython-312.pyc +0 -0
  349. package/scripts/__pycache__/benchmark_evaluator.cpython-312.pyc +0 -0
  350. package/scripts/__pycache__/benchmark_judge.cpython-312.pyc +0 -0
  351. package/scripts/__pycache__/benchmark_routing.cpython-312.pyc +0 -0
  352. package/scripts/__pycache__/benchmark_v2.cpython-312.pyc +0 -0
  353. package/scripts/__pycache__/benchmark_v3.cpython-312.pyc +0 -0
  354. package/scripts/__pycache__/build_result.cpython-312.pyc +0 -0
  355. package/scripts/__pycache__/claim_audit.cpython-312.pyc +0 -0
  356. package/scripts/__pycache__/complexity_gate.cpython-312.pyc +0 -0
  357. package/scripts/__pycache__/compute_confidence.cpython-312.pyc +0 -0
  358. package/scripts/__pycache__/dashboard_server.cpython-312.pyc +0 -0
  359. package/scripts/__pycache__/did_regression.cpython-312.pyc +0 -0
  360. package/scripts/__pycache__/effect_calculator.cpython-312.pyc +0 -0
  361. package/scripts/__pycache__/evidence_matrix.cpython-312.pyc +0 -0
  362. package/scripts/__pycache__/evidence_score.cpython-312.pyc +0 -0
  363. package/scripts/__pycache__/evidence_semantics.cpython-312.pyc +0 -0
  364. package/scripts/__pycache__/fetch_benchmark.cpython-312.pyc +0 -0
  365. package/scripts/__pycache__/lint_report_layout.cpython-312.pyc +0 -0
  366. package/scripts/__pycache__/orchestrator.cpython-312.pyc +0 -0
  367. package/scripts/__pycache__/pre_verdict_gate.cpython-312.pyc +0 -0
  368. package/scripts/__pycache__/recompute_demo_quality.cpython-312.pyc +0 -0
  369. package/scripts/__pycache__/render_report.cpython-312.pyc +0 -0
  370. package/scripts/__pycache__/render_report_html.cpython-312.pyc +0 -0
  371. package/scripts/__pycache__/run_workspace.cpython-312.pyc +0 -0
  372. package/scripts/__pycache__/skill_lint.cpython-312.pyc +0 -0
  373. package/scripts/__pycache__/startup_probe.cpython-312.pyc +0 -0
  374. package/scripts/__pycache__/sync_killer_demo_report.cpython-312.pyc +0 -0
  375. package/scripts/__pycache__/test_adversarial_empirical.cpython-312-pytest-9.0.2.pyc +0 -0
  376. package/scripts/__pycache__/test_adversarial_empirical.cpython-312-pytest-9.1.1.pyc +0 -0
  377. package/scripts/__pycache__/validate_schema.cpython-312.pyc +0 -0
  378. package/visualization/eduevidence-report/scripts/__pycache__/adapter_contract.cpython-312.pyc +0 -0
  379. package/visualization/eduevidence-report/scripts/__pycache__/build_artifact_manifest.cpython-312.pyc +0 -0
  380. package/visualization/eduevidence-report/scripts/__pycache__/build_charts.cpython-312.pyc +0 -0
  381. package/visualization/eduevidence-report/scripts/__pycache__/build_figures.cpython-312.pyc +0 -0
  382. package/visualization/eduevidence-report/scripts/__pycache__/build_infographics.cpython-312.pyc +0 -0
  383. package/visualization/eduevidence-report/scripts/__pycache__/build_report.cpython-312.pyc +0 -0
  384. package/visualization/eduevidence-report/scripts/__pycache__/charts_data.cpython-312.pyc +0 -0
  385. package/visualization/eduevidence-report/scripts/__pycache__/lieflat_engine.cpython-312.pyc +0 -0
  386. package/visualization/eduevidence-report/scripts/__pycache__/zh_labels.cpython-312.pyc +0 -0
@@ -19,6 +19,9 @@ import json
19
19
  import math
20
20
  import sys
21
21
  from pathlib import Path
22
+ from typing import Any, Dict, List
23
+
24
+
22
25
  def _two_tailed_p_from_z(z: float) -> float:
23
26
  """Standard normal two-tailed p-value."""
24
27
  return 2.0 * (1.0 - 0.5 * (1.0 + math.erf(abs(z) / math.sqrt(2.0))))
@@ -39,51 +42,40 @@ def _null_inference() -> Dict[str, Any]:
39
42
  def _solve_linear_system(A: List[List[float]], b: List[float]) -> List[float]:
40
43
  """Gaussian elimination with partial pivoting for small OLS systems (p <= 10)."""
41
44
  n = len(b)
42
- # Augmented matrix
43
45
  M = [A[i][:] + [b[i]] for i in range(n)]
44
-
45
46
  for i in range(n):
46
- # Pivot
47
47
  max_row = max(range(i, n), key=lambda r: abs(M[r][i]))
48
48
  if abs(M[max_row][i]) < 1e-12:
49
49
  raise ValueError("Singular matrix in OLS estimation")
50
50
  M[i], M[max_row] = M[max_row], M[i]
51
-
52
51
  pivot = M[i][i]
53
52
  for j in range(i, n + 1):
54
53
  M[i][j] /= pivot
55
-
56
54
  for r in range(n):
57
55
  if r != i:
58
56
  factor = M[r][i]
59
57
  for c in range(i, n + 1):
60
58
  M[r][c] -= factor * M[i][c]
61
-
62
59
  return [M[i][n] for i in range(n)]
63
60
 
64
61
 
65
62
  def _matrix_inverse(A: List[List[float]]) -> List[List[float]]:
66
63
  """Inverts an n x n matrix using Gauss-Jordan elimination."""
67
64
  n = len(A)
68
- # Augment with identity
69
65
  M = [A[i][:] + [1.0 if i == j else 0.0 for j in range(n)] for i in range(n)]
70
-
71
66
  for i in range(n):
72
67
  max_row = max(range(i, n), key=lambda r: abs(M[r][i]))
73
68
  if abs(M[max_row][i]) < 1e-12:
74
69
  raise ValueError("Singular matrix in inversion")
75
70
  M[i], M[max_row] = M[max_row], M[i]
76
-
77
71
  pivot = M[i][i]
78
72
  for j in range(2 * n):
79
73
  M[i][j] /= pivot
80
-
81
74
  for r in range(n):
82
75
  if r != i:
83
76
  factor = M[r][i]
84
77
  for c in range(2 * n):
85
78
  M[r][c] -= factor * M[i][c]
86
-
87
79
  return [[M[i][n + j] for j in range(n)] for i in range(n)]
88
80
 
89
81
 
@@ -104,19 +96,28 @@ def run_did_analysis(csv_path: str) -> Dict[str, Any]:
104
96
  return {"status": "error", "error_code": "ERR_INSUFFICIENT_ROWS",
105
97
  "message": "Insufficient data rows (minimum 4 required)"}
106
98
 
107
- # Normalize column names (+ cluster candidates; exact names only, never guessed)
108
99
  field_map = {}
109
100
  cluster_columns: List[str] = []
110
101
  for col in rows[0].keys():
111
102
  cl = col.strip().lower()
112
103
  if cl in ("cluster_id", "class_id", "school_id", "group_id") or cl.endswith("_cluster"):
113
104
  cluster_columns.append(col)
105
+ # Order matters. An outcome column is often named "post_test_score",
106
+ # which also contains "post": matching the period rule first stole the
107
+ # outcome column and the run failed with ERR_MISSING_COLUMNS. Outcome
108
+ # and treatment are the more specific patterns, so they are tested
109
+ # before the period keyword.
114
110
  if "treat" in cl or cl in ("group", "condition", "is_treatment"):
115
111
  field_map["treat"] = col
116
- elif "post" in cl or "after" in cl or "period" in cl or "time" in cl or "pre_post" in cl:
112
+ elif cl in ("post", "posttest", "pre_post", "period", "time_period"):
117
113
  field_map["post"] = col
118
- elif "score" in cl or "outcome" in cl or "grade" in cl or "result" in cl or "performance" in cl or cl == "y":
114
+ elif ("score" in cl or "outcome" in cl or "grade" in cl or "result" in cl
115
+ or "performance" in cl or cl == "y"):
119
116
  field_map["outcome"] = col
117
+ elif "post" in cl or "after" in cl or "period" in cl or "time" in cl:
118
+ # Generic period/phase column, only after the specific patterns
119
+ # above have had their chance.
120
+ field_map.setdefault("post", col)
120
121
 
121
122
  if "treat" not in field_map or "post" not in field_map or "outcome" not in field_map:
122
123
  return {
@@ -124,13 +125,10 @@ def run_did_analysis(csv_path: str) -> Dict[str, Any]:
124
125
  "message": f"CSV missing required columns (need treat/post/outcome). Found: {list(rows[0].keys())}"
125
126
  }
126
127
 
127
- # Parse numeric arrays
128
128
  y_vals: List[float] = []
129
129
  treat_vals: List[float] = []
130
130
  post_vals: List[float] = []
131
131
  treat_post_vals: List[float] = []
132
-
133
- # Cells for 2x2 table
134
132
  cell_y = {(0, 0): [], (0, 1): [], (1, 0): [], (1, 1): []}
135
133
 
136
134
  for r in rows:
@@ -138,7 +136,6 @@ def run_did_analysis(csv_path: str) -> Dict[str, Any]:
138
136
  t = 1.0 if float(r[field_map["treat"]]) > 0.5 else 0.0
139
137
  p = 1.0 if float(r[field_map["post"]]) > 0.5 else 0.0
140
138
  y = float(r[field_map["outcome"]])
141
-
142
139
  treat_vals.append(t)
143
140
  post_vals.append(p)
144
141
  treat_post_vals.append(t * p)
@@ -152,7 +149,6 @@ def run_did_analysis(csv_path: str) -> Dict[str, Any]:
152
149
  return {"status": "error", "error_code": "ERR_PARSE",
153
150
  "message": "Failed to parse sufficient numeric rows"}
154
151
 
155
- # Cell means
156
152
  means = {}
157
153
  stds = {}
158
154
  for k, v in cell_y.items():
@@ -165,7 +161,6 @@ def run_did_analysis(csv_path: str) -> Dict[str, Any]:
165
161
  means[k] = 0.0
166
162
  stds[k] = 1.0
167
163
 
168
- # --- Estimability gates (fail closed; never fabricate inference) ---
169
164
  if len(set(treat_vals)) < 2:
170
165
  return {
171
166
  "status": "error", "error_code": "ERR_NO_TREAT_VARIATION",
@@ -205,15 +200,12 @@ def run_did_analysis(csv_path: str) -> Dict[str, Any]:
205
200
  y_t_pre = means[(1, 0)]
206
201
  y_t_post = means[(1, 1)]
207
202
 
208
- # Simple 2x2 delta
209
- delta_simple = (y_t_post - y_t_pre) - (y_c_post - y_c_pre)
203
+ # Keep the simple 2x2 contrast as a diagnostic equivalence check.
204
+ _delta_simple = (y_t_post - y_t_pre) - (y_c_post - y_c_pre)
210
205
 
211
- # OLS Estimation: Y = X * beta + e, X = [1, Treat, Post, Treat*Post]
212
- # Build X^T X (4x4) and X^T Y (4x1)
213
206
  X = [[1.0, treat_vals[i], post_vals[i], treat_post_vals[i]] for i in range(n)]
214
207
  XtX = [[0.0] * 4 for _ in range(4)]
215
208
  XtY = [0.0] * 4
216
-
217
209
  for i in range(n):
218
210
  row = X[i]
219
211
  yi = y_vals[i]
@@ -232,7 +224,6 @@ def run_did_analysis(csv_path: str) -> Dict[str, Any]:
232
224
  **_null_inference(),
233
225
  }
234
226
 
235
- # Residual sum of squares & Standard Error
236
227
  rss = 0.0
237
228
  for i in range(n):
238
229
  y_hat = beta[0] + beta[1] * treat_vals[i] + beta[2] * post_vals[i] + beta[3] * treat_post_vals[i]
@@ -241,7 +232,6 @@ def run_did_analysis(csv_path: str) -> Dict[str, Any]:
241
232
  df_resid = n - 4
242
233
  sigma2 = rss / df_resid
243
234
  r_squared = max(0.0, 1.0 - (rss / tss)) if tss > 0 else 0.0
244
-
245
235
  if rss <= 0:
246
236
  return {
247
237
  "status": "error", "error_code": "ERR_ZERO_RESIDUAL",
@@ -252,16 +242,12 @@ def run_did_analysis(csv_path: str) -> Dict[str, Any]:
252
242
  t_stat = beta[3] / se_delta if se_delta > 0 else 0.0
253
243
  p_val = _two_tailed_p_from_z(t_stat)
254
244
 
255
- # Standardized Effect Size: Hedges' g
256
245
  s_pooled_pre = math.sqrt((stds[(0, 0)] ** 2 + stds[(1, 0)] ** 2) / 2.0) if stds[(0, 0)] and stds[(1, 0)] else 1.0
257
246
  hedges_j = 1.0 - (3.0 / (4.0 * df_resid - 1.0)) if df_resid > 2 else 1.0
258
247
  hedges_g = round(hedges_j * (beta[3] / s_pooled_pre), 3) if s_pooled_pre > 0 else 0.0
259
248
 
260
- # Baseline Equivalence
261
249
  baseline_diff = y_t_pre - y_c_pre
262
250
  baseline_g = baseline_diff / s_pooled_pre if s_pooled_pre > 0 else 0.0
263
- # QED/DID can never meet WWC 5.0 standards WITHOUT reservations; and without
264
- # covariate-adjustment fields a 0.05<|g|<=0.25 baseline is not passable.
265
251
  if abs(baseline_g) <= 0.05:
266
252
  wwc_rating = "Meets Standards With Reservations"
267
253
  elif abs(baseline_g) <= 0.25:
@@ -273,7 +259,6 @@ def run_did_analysis(csv_path: str) -> Dict[str, Any]:
273
259
  round(beta[3] - 1.96 * se_delta, 3),
274
260
  round(beta[3] + 1.96 * se_delta, 3)
275
261
  ]
276
-
277
262
  cluster_note = (
278
263
  f"cluster column(s) detected ({', '.join(cluster_columns)}) but cluster-robust "
279
264
  "inference is not implemented in this build; p-value is not cluster-robust"
@@ -7,7 +7,7 @@ import json
7
7
  from pathlib import Path
8
8
 
9
9
  ROOT = Path(__file__).resolve().parent.parent
10
- EXAMPLES_DIR = ROOT / "examples"
10
+ EXAMPLES_DIR = ROOT / "tests" / "fixtures" / "legacy-examples"
11
11
 
12
12
 
13
13
  def enrich_math_project():
@@ -36,8 +36,11 @@ from evidence_semantics import claim_relation, decision_relation
36
36
  DIMENSIONS = ["D1_study_design", "D2_sample_quality", "D3_measurement_validity",
37
37
  "D4_temporal_strength", "D5_directness"]
38
38
 
39
- #: Version of the deterministic confidence policy (bump on any formula change).
40
- CONFIDENCE_POLICY_VERSION = "2026-08-12.v2"
39
+ #: Version of the deterministic confidence policy. Imported from the engine so
40
+ #: there is one authority: evidence_score previously hard-coded ".v2" while
41
+ #: engine/versions.py declared ".v3", so verdicts recorded a policy version the
42
+ #: engine did not recognise and nothing compared the two.
43
+ from engine.versions import CONFIDENCE_POLICY_VERSION # noqa: F401 (re-export)
41
44
 
42
45
 
43
46
  def quality_score(dimensions: dict[str, int]) -> float:
@@ -10,10 +10,11 @@ Metrics:
10
10
  - engine_version from engine/versions.py (the version authority)
11
11
  - test_functions grep 'def test_' across tests/
12
12
  - test_files number of collected test modules in tests/
13
- - schema_count schemas/*.json at root + v2/ + v3/ + v4/
13
+ - schema_count schemas/*.json recursively
14
14
  - reference_doc_count references/*.md
15
15
  - gold_annotation_count benchmarks/annotations/gold-Q*.json
16
- - example_packs examples/*/ directories shipping result.json
16
+ - example_packs real examples/*/ directories shipping result.json
17
+ (compatibility symlink aliases are excluded)
17
18
 
18
19
  Usage:
19
20
  python3 scripts/generate_metrics.py # regenerate docs/metrics.json
@@ -56,7 +57,7 @@ def collect() -> dict:
56
57
 
57
58
  example_packs = sorted(
58
59
  p.name for p in (REPO_ROOT / "examples").iterdir()
59
- if p.is_dir() and (p / "result.json").exists()
60
+ if not p.is_symlink() and p.is_dir() and (p / "result.json").exists()
60
61
  ) if (REPO_ROOT / "examples").is_dir() else []
61
62
 
62
63
  return {
@@ -12,7 +12,7 @@ import json
12
12
  from pathlib import Path
13
13
 
14
14
  ROOT = Path(__file__).resolve().parent.parent
15
- EXAMPLES_DIR = ROOT / "examples"
15
+ EXAMPLES_DIR = ROOT / "tests" / "fixtures" / "legacy-examples"
16
16
 
17
17
 
18
18
  def build_math_project():
@@ -194,7 +194,7 @@ def build_math_project():
194
194
  "execution": {
195
195
  "complexity": "L",
196
196
  "mode": "agent_mcp_enhanced",
197
- "agents": ["education-planner", "evidence-retriever", "evidence-analyst", "skeptic", "method-reviewer", "evidence-judge", "intervention-designer", "evaluation-designer"]
197
+ "agents": ["research-planner", "evidence-retriever", "evidence-analyst", "skeptic", "method-reviewer", "evidence-judge", "intervention-designer", "evaluation-designer"]
198
198
  },
199
199
  "research_frame": {
200
200
  "question": question_en,
@@ -266,7 +266,7 @@ def build_math_project():
266
266
  "execution": {
267
267
  "complexity": "L",
268
268
  "mode": "agent_mcp_enhanced",
269
- "agents": ["education-planner", "evidence-retriever", "evidence-analyst", "skeptic", "method-reviewer", "evidence-judge", "intervention-designer", "evaluation-designer"]
269
+ "agents": ["research-planner", "evidence-retriever", "evidence-analyst", "skeptic", "method-reviewer", "evidence-judge", "intervention-designer", "evaluation-designer"]
270
270
  },
271
271
  "research_frame": {
272
272
  "question": question_zh,
@@ -512,7 +512,7 @@ def build_writing_project():
512
512
  "execution": {
513
513
  "complexity": "L",
514
514
  "mode": "agent_mcp_enhanced",
515
- "agents": ["education-planner", "evidence-retriever", "evidence-analyst", "skeptic", "method-reviewer", "evidence-judge", "intervention-designer", "evaluation-designer"]
515
+ "agents": ["research-planner", "evidence-retriever", "evidence-analyst", "skeptic", "method-reviewer", "evidence-judge", "intervention-designer", "evaluation-designer"]
516
516
  },
517
517
  "research_frame": {
518
518
  "question": question_en,
@@ -584,7 +584,7 @@ def build_writing_project():
584
584
  "execution": {
585
585
  "complexity": "L",
586
586
  "mode": "agent_mcp_enhanced",
587
- "agents": ["education-planner", "evidence-retriever", "evidence-analyst", "skeptic", "method-reviewer", "evidence-judge", "intervention-designer", "evaluation-designer"]
587
+ "agents": ["research-planner", "evidence-retriever", "evidence-analyst", "skeptic", "method-reviewer", "evidence-judge", "intervention-designer", "evaluation-designer"]
588
588
  },
589
589
  "research_frame": {
590
590
  "question": question_zh,