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
@@ -7,7 +7,7 @@ reads ONLY the run workspace — no model call, no network.
7
7
 
8
8
  Checklist:
9
9
 
10
- 1. research_frame_valid frame.json validates against education-frame.schema.json
10
+ 1. research_frame_valid frame.json validates against the run domain frame schema
11
11
  2. sources_valid sources.jsonl non-empty and schema-valid
12
12
  3. evidence_schema_valid evidence.jsonl non-empty and schema-valid
13
13
  4. source_dedupe no duplicate sources remain (dedupe applied)
@@ -58,7 +58,7 @@ for _p in (str(ROOT), str(ROOT / "scripts")):
58
58
 
59
59
  from validate_schema import SchemaError, Validator # noqa: E402
60
60
  from evidence_score import independent_samples, independent_studies # noqa: E402
61
- from evidence_semantics import claim_relation # noqa: E402
61
+ from evidence_semantics import claim_relation, decision_relation # noqa: E402
62
62
  from run_workspace import utc_now # noqa: E402
63
63
 
64
64
  GATE_VERSION = "2026-08-13.v1"
@@ -66,29 +66,52 @@ GATE_VERSION = "2026-08-13.v1"
66
66
  CONFIDENCE_RANK = {"Insufficient": 0, "Low": 1, "Moderate": 2, "High": 3}
67
67
 
68
68
  #: Advisory taxonomy for verdict outcome keys (shared with claim_audit).
69
- SUPPORTED_OUTCOMES = {
70
- "knowledge_gain", "concept_understanding", "retention", "transfer",
71
- "independent_problem_solving", "completion_time", "accuracy",
72
- "code_quality", "assignment_score", "engagement", "motivation",
73
- "cognitive_load", "help_seeking", "metacognition", "ai_dependency",
74
- "over_reliance", "reduced_effort", "reduced_transfer",
75
- "academic_integrity_risk", "false_confidence",
76
- }
69
+ def _supported_outcomes() -> set[str]:
70
+ """Every registered outcome token, read from the domain registry.
71
+
72
+ This was a hand-copied 20-token education list in three separate files;
73
+ it silently rejected policy tokens such as policy_effectiveness. The
74
+ registry (domains/<id>/outcome_taxonomy.json) is the single authority.
75
+ """
76
+ from engine.taxonomy import all_tokens_ordered
77
+
78
+ return set(all_tokens_ordered())
79
+
80
+
81
+ SUPPORTED_OUTCOMES = _supported_outcomes()
77
82
 
78
83
  _CLAIM_ID_RE = re.compile(r"\b[A-Z]{1,3}-\d{2,4}\b")
79
84
 
80
85
  _SCHEMA_CACHE: dict[str, dict[str, Any]] = {}
81
86
 
82
87
 
88
+ def _schema_path(name: str) -> Path:
89
+ """Resolve a schema name to a file.
90
+
91
+ Accepts a bare name in schemas/ as well as a repository-relative path,
92
+ because a domain may own its frame contract outside schemas/ (policy does:
93
+ domains/policy/frame.schema.json).
94
+ """
95
+ candidate = ROOT / "schemas" / name
96
+ if candidate.is_file():
97
+ return candidate
98
+ owned = ROOT / name
99
+ if owned.is_file():
100
+ return owned
101
+ return candidate # missing: the caller reports it
102
+
103
+
83
104
  def _schema(name: str) -> dict[str, Any]:
84
- if name not in _SCHEMA_CACHE:
85
- _SCHEMA_CACHE[name] = json.loads((ROOT / "schemas" / name).read_text(encoding="utf-8"))
86
- return _SCHEMA_CACHE[name]
105
+ path = _schema_path(name)
106
+ key = str(path)
107
+ if key not in _SCHEMA_CACHE:
108
+ _SCHEMA_CACHE[key] = json.loads(path.read_text(encoding="utf-8"))
109
+ return _SCHEMA_CACHE[key]
87
110
 
88
111
 
89
112
  def _validate_records(records: list[dict[str, Any]], schema_name: str, path: str) -> list[str]:
90
113
  schema = _schema(schema_name)
91
- validator = Validator(schema, base_dir=(ROOT / "schemas"))
114
+ validator = Validator(schema, base_dir=_schema_path(schema_name).parent)
92
115
  errors = []
93
116
  for idx, record in enumerate(records):
94
117
  try:
@@ -133,11 +156,43 @@ def _item_res(status: str, detail: str, *, blocks_high: bool | None = None) -> d
133
156
  return res
134
157
 
135
158
 
159
+ def workspace_domain(ws: Path) -> str:
160
+ """The domain this run/pack registered; defaults to education when absent.
161
+
162
+ A run workspace records it in run_manifest.json, but an example pack has
163
+ no manifest: reading only that file made a policy pack validate against the
164
+ education frame schema and fail item 1. Fall back to the same declared
165
+ places the read model uses, in the same order.
166
+ """
167
+ manifest = _load_ws_json(ws, "run_manifest.json")
168
+ if manifest.get("domain"):
169
+ return str(manifest["domain"])
170
+ frame = _load_ws_json(ws, "frame.json")
171
+ declared = (frame.get("extensions") or {}).get("domain")
172
+ if declared:
173
+ return str(declared)
174
+ result_meta = (_load_ws_json(ws, "result.json").get("meta") or {})
175
+ if result_meta.get("domain"):
176
+ return str(result_meta["domain"])
177
+ return "education"
178
+
179
+
180
+ def frame_schema_name(domain: str) -> str:
181
+ """Registered frame schema for a domain (repository-relative path)."""
182
+ from engine.evidencecore import load_domain
183
+
184
+ return str(load_domain(domain)["frame_schema"])
185
+
186
+
136
187
  def check_research_frame(ws: Path) -> dict[str, str]:
137
188
  frame = _load_ws_json(ws, "frame.json")
138
189
  if not frame:
139
190
  return _item_res("fail", "frame.json missing or empty (research question not framed)")
140
- errors = _validate_records([frame], "education-frame.schema.json", "frame")
191
+ try:
192
+ schema_name = frame_schema_name(workspace_domain(ws))
193
+ except KeyError as exc:
194
+ return _item_res("fail", f"run declares an unknown domain: {exc}")
195
+ errors = _validate_records([frame], schema_name, "frame")
141
196
  if errors:
142
197
  return _item_res("fail", f"frame.json schema invalid: {errors[0]}")
143
198
  return _item_res("pass", f"frame.json valid (question={frame.get('question', '')[:80]})")
@@ -182,11 +237,41 @@ def check_counter_evidence(ws: Path) -> dict[str, str]:
182
237
  return _item_res("fail", "skeptic.json missing or empty (counter-evidence search not performed)")
183
238
  if skeptic.get("search_performed") is not True:
184
239
  return _item_res("fail", "skeptic.json lacks search_performed=true")
185
- contradictions = skeptic.get("contradictions", []) or []
186
- null_results = skeptic.get("null_results", []) or []
187
- detail = f"search_performed=true; contradictions={len(contradictions)}, null_results={len(null_results)}"
188
- if skeptic.get("no_contradictory_evidence_found"):
189
- detail += "; no contradictory evidence found"
240
+
241
+ # The nine fixed checks are the contract (skill/task-briefs/challenge.md).
242
+ # A two-key shell used to pass this gate, which made the counter-evidence
243
+ # check cosmetic on every deterministic path.
244
+ required_checks = (
245
+ "1_null_result", "2_negative_result", "3_contradictory_evidence",
246
+ "4_alternative_explanation", "5_measurement_mismatch", "6_sampling_bias",
247
+ "7_novelty_effect", "8_ai_dependency", "9_scope_overreach",
248
+ )
249
+ findings = skeptic.get("skeptic_findings")
250
+ if not isinstance(findings, list) or not findings:
251
+ return _item_res(
252
+ "fail", "skeptic.json lacks skeptic_findings[] (nine fixed checks not run)")
253
+ present = {str(f.get("check")) for f in findings if isinstance(f, dict)}
254
+ missing = [c for c in required_checks if c not in present]
255
+ if missing:
256
+ return _item_res("fail", f"skeptic findings incomplete; missing {missing}")
257
+ for item in findings:
258
+ if not isinstance(item, dict) or item.get("status") not in ("found", "not_found"):
259
+ return _item_res(
260
+ "fail", f"skeptic finding {item.get('check')!r} lacks a found/not_found status")
261
+
262
+ found = bool(skeptic.get("contradictory_evidence_found"))
263
+ statement = skeptic.get("no_contradictory_evidence_statement")
264
+ if not found and not statement:
265
+ # Absence of counter-evidence must be asserted, not left implicit.
266
+ return _item_res(
267
+ "fail", "no contradictory evidence found but no statement recorded")
268
+ if found and statement:
269
+ return _item_res(
270
+ "fail", "contradictory_evidence_found=true together with a no-evidence statement")
271
+
272
+ found_checks = sum(1 for f in findings if f.get("status") == "found")
273
+ detail = (f"search_performed=true; 9/9 checks run; findings={found_checks}; "
274
+ f"contradictory_evidence_found={found}")
190
275
  return _item_res("pass", detail)
191
276
 
192
277
 
@@ -270,6 +355,96 @@ def check_claim_evidence(ws: Path) -> dict[str, str]:
270
355
  return _item_res("pass", "all verdict claims bind to existing evidence with consistent categories")
271
356
 
272
357
 
358
+ def _primary_evidence_summary(ws: Path) -> dict[str, Any]:
359
+ """Re-derive ADOPT eligibility from the pack's own evidence records.
360
+
361
+ The gate audits an artifact another party wrote, so it cannot trust the
362
+ verdict about itself: primary-result directness is read back from the
363
+ corpus (frame primary outcomes + per-record D5 Directness), using the same
364
+ domain registry and directness threshold the tribunal imports.
365
+ """
366
+ from engine.decision_policy import (
367
+ ADOPT_DIRECTNESS,
368
+ outcome_category,
369
+ primary_effect_categories,
370
+ )
371
+
372
+ domain = workspace_domain(ws)
373
+ try:
374
+ primary = primary_effect_categories(domain)
375
+ except (KeyError, ValueError) as exc:
376
+ return {"domain": domain, "primary": (), "direct": False, "error": str(exc)}
377
+
378
+ frame = _load_ws_json(ws, "frame.json")
379
+ declared_primary = [
380
+ str(token) for token in ((frame.get("outcomes") or {}).get("primary") or [])
381
+ ]
382
+ evidence = _load_ws_jsonl(ws, "evidence.jsonl")
383
+ direct_hits: list[str] = []
384
+ for ev in evidence:
385
+ token = str(ev.get("outcome_type") or "")
386
+ category = outcome_category(domain, token, primary)
387
+ if category is None or category not in primary:
388
+ continue
389
+ dims = ev.get("quality_dimensions") or {}
390
+ d5 = dims.get("D5_directness")
391
+ if isinstance(d5, bool) or not isinstance(d5, int):
392
+ continue
393
+ if d5 >= ADOPT_DIRECTNESS:
394
+ direct_hits.append(str(ev.get("evidence_id") or "?"))
395
+ return {
396
+ "domain": domain,
397
+ "primary": primary,
398
+ "declared_primary": declared_primary,
399
+ "direct": bool(direct_hits),
400
+ "direct_evidence_ids": direct_hits,
401
+ }
402
+
403
+
404
+ def check_decision_action(ws: Path) -> dict[str, str]:
405
+ """The stated action must be the action the evidence supports.
406
+
407
+ A verdict cannot hand itself ADOPT: the gate requires High confidence, a
408
+ supporting decisive relation, and primary-outcome evidence at directness 2.
409
+ Anything less is capped to pilot - the conservative bound - because the
410
+ underlying evidence may still justify a bounded trial.
411
+ """
412
+ verdict = _verdict_for_audit(ws)
413
+ if not verdict:
414
+ return _item_res("warn", "no verdict artifact yet; action not audited")
415
+ action = str(verdict.get("recommended_action") or "").lower()
416
+ if action != "adopt":
417
+ label = action or "unset"
418
+ return _item_res("pass", "action=" + label + " is within the conservative bound")
419
+
420
+ from engine.decision_policy import ADOPT_REQUIRED_LABEL, decision_action
421
+
422
+ evidence = _load_ws_jsonl(ws, "evidence.jsonl")
423
+ relations = [decision_relation(ev) for ev in evidence]
424
+ decisive = {str(index): rel for index, rel in enumerate(relations)
425
+ if rel in ("support_adoption", "oppose_adoption")}
426
+ label = str(verdict.get("confidence") or "")
427
+ summary = _primary_evidence_summary(ws)
428
+ expected = decision_action(
429
+ confidence_label=label,
430
+ decisive_relations=decisive,
431
+ has_direct_primary_evidence=bool(summary.get("direct")),
432
+ )
433
+ if expected == "ADOPT":
434
+ detail = "ADOPT is supported: " + label + " confidence with direct primary-outcome evidence"
435
+ return _item_res("pass", detail)
436
+ reasons: list[str] = []
437
+ if label != ADOPT_REQUIRED_LABEL:
438
+ reasons.append("confidence=" + (label or "unset") + " (needs " + ADOPT_REQUIRED_LABEL + ")")
439
+ if "support_adoption" not in relations:
440
+ reasons.append("no decisive supporting evidence")
441
+ if not summary.get("direct"):
442
+ reasons.append("no primary-outcome evidence at directness 2")
443
+ detail = ("recommended_action=adopt is not supported (" + "; ".join(reasons)
444
+ + "); the evidence bounds this decision to pilot")
445
+ return _item_res("fail", detail)
446
+
447
+
273
448
  def check_outcome_mapping(ws: Path) -> dict[str, str]:
274
449
  verdict = _verdict_for_audit(ws)
275
450
  frame = _load_ws_json(ws, "frame.json")
@@ -282,18 +457,35 @@ def check_outcome_mapping(ws: Path) -> dict[str, str]:
282
457
  issues.append(f"unknown outcome key(s) in verdict: {', '.join(sorted(unknown))}")
283
458
 
284
459
  evidence_outcomes = {e.get("outcome_type") for e in _load_ws_jsonl(ws, "evidence.jsonl")}
460
+ frame_outcomes = frame.get("outcomes", {}) or {}
285
461
  declared = set()
286
462
  for group in ("primary", "secondary", "risk"):
287
- declared.update((frame.get("outcomes", {}) or {}).get(group, []) or [])
463
+ declared.update(frame_outcomes.get(group, []) or [])
288
464
  if declared:
289
465
  missing = sorted(d for d in declared if d and d not in evidence_outcomes)
290
466
  if missing:
291
- notes.append(f"frame-declared outcomes without evidence: {', '.join(missing)}")
467
+ # Missing evidence is not a zero effect, and a secondary or risk
468
+ # outcome the frame named but the corpus never measured does not
469
+ # contaminate the decision. Only a PRIMARY outcome with no
470
+ # evidence at all means the decision rests on the wrong construct,
471
+ # so only that case blocks High confidence.
472
+ primary_missing = sorted(
473
+ d for d in (frame_outcomes.get("primary", []) or [])
474
+ if d and d not in evidence_outcomes)
475
+ note = f"frame-declared outcomes without evidence: {', '.join(missing)}"
476
+ if primary_missing:
477
+ return _item_res(
478
+ "warn",
479
+ note + f"; primary outcomes unmeasured: {', '.join(primary_missing)}",
480
+ blocks_high=True)
481
+ notes.append(note)
482
+ else:
483
+ notes.append("all frame-declared outcomes are covered by evidence")
292
484
 
293
485
  if issues:
294
486
  return _item_res("fail", "; ".join(issues))
295
- if notes:
296
- return _item_res("warn", "outcome keys known; " + notes[0])
487
+ if notes and "without evidence" in notes[0]:
488
+ return _item_res("warn", "outcome keys known; " + notes[0], blocks_high=False)
297
489
  if not declared:
298
490
  return _item_res("warn", "outcome keys known; frame declares no outcomes to map")
299
491
  return _item_res("pass", f"outcome mapping complete ({len(evidence_outcomes)} outcome type(s) covered)")
@@ -375,13 +567,15 @@ GATE_ITEMS: list[dict[str, Any]] = [
375
567
  {"id": "claim_evidence_audit", "title": "Claim-Evidence Audit", "critical": True,
376
568
  "blocks_high": False, "check": check_claim_evidence},
377
569
  {"id": "outcome_mapping", "title": "Outcome mapping", "critical": False,
378
- "blocks_high": False, "check": check_outcome_mapping},
570
+ "blocks_high": True, "check": check_outcome_mapping},
379
571
  {"id": "scope_calibration", "title": "Scope calibration", "critical": False,
380
- "blocks_high": False, "check": check_scope_calibration},
572
+ "blocks_high": True, "check": check_scope_calibration},
381
573
  {"id": "independent_study_count", "title": "Independent study-sample count", "critical": True,
382
574
  "blocks_high": True, "check": check_study_count},
383
575
  {"id": "deterministic_confidence", "title": "Deterministic confidence", "critical": True,
384
576
  "blocks_high": True, "check": None},
577
+ {"id": "decision_action_consistency", "title": "Decision action consistency",
578
+ "critical": True, "blocks_high": False, "check": check_decision_action},
385
579
  ]
386
580
 
387
581
 
@@ -437,6 +631,7 @@ def apply_enforcement(verdict: dict[str, Any], gate: dict[str, Any]) -> dict[str
437
631
 
438
632
  - gate failed -> confidence at most Low; adopt downgraded to pilot
439
633
  - gate passed but High blocked -> confidence at most Moderate
634
+ - stated adopt the evidence does not support -> downgraded to pilot
440
635
  Always records the enforcement inside verdict.extensions.gate_enforcement.
441
636
  """
442
637
  import copy
@@ -448,6 +643,9 @@ def apply_enforcement(verdict: dict[str, Any], gate: dict[str, Any]) -> dict[str
448
643
  out["confidence"] = cap
449
644
  if not gate.get("passed", False) and out.get("recommended_action") == "adopt":
450
645
  out["recommended_action"] = "pilot"
646
+ action_item = (gate.get("items") or {}).get("decision_action_consistency") or {}
647
+ if action_item.get("status") == "fail" and out.get("recommended_action") == "adopt":
648
+ out["recommended_action"] = "pilot"
451
649
  extensions = out.setdefault("extensions", {})
452
650
  if not isinstance(extensions, dict):
453
651
  extensions = {}
@@ -40,8 +40,23 @@ STAGE_BRIEFS = {
40
40
  }
41
41
 
42
42
 
43
+ def runs_root() -> Path:
44
+ """Runs directory, honouring EDUEVIDENCE_RUNS_DIR like the orchestrator does.
45
+
46
+ Without this the quickstart wrote into the repository even when the user had
47
+ pointed the runs directory elsewhere.
48
+ """
49
+ import os
50
+
51
+ return Path(os.environ.get("EDUEVIDENCE_RUNS_DIR") or (ROOT / "runs"))
52
+
53
+
43
54
  def newest_run_dir() -> Path:
44
- runs_dir = ROOT / "runs"
55
+ runs_dir = runs_root()
56
+ if not runs_dir.is_dir():
57
+ raise SystemExit(
58
+ f"no runs directory at {runs_dir}; run `eduevidence run --question ...` first "
59
+ "(or set EDUEVIDENCE_RUNS_DIR)")
45
60
  candidates = sorted((p for p in runs_dir.iterdir() if p.is_dir()),
46
61
  key=lambda p: p.stat().st_mtime, reverse=True)
47
62
  if not candidates:
@@ -86,7 +101,8 @@ def build_next_steps(run_dir: Path, question: str, depth: str) -> str:
86
101
  "",
87
102
  "## 可信度自检",
88
103
  "",
89
- "- 引用逐条核验报告:`benchmarks/doi-audit/report.md` 与包内 `citation_check.md`",
104
+ "- 引用逐条核验报告:包内 `citation_check.md`"
105
+ "(源码仓库另见 `benchmarks/doi-audit/report.md`)",
90
106
  "- 报告头徽章标注 data_origin;synthetic 演示不得当作实证引用",
91
107
  ""]
92
108
  return "\n".join(lines)
@@ -10,8 +10,7 @@ from pathlib import Path
10
10
  ROOT = Path(__file__).resolve().parent.parent
11
11
 
12
12
  PROJECTS = [
13
- "examples/highschool-math-ai-tutor",
14
- "examples/esl-academic-writing-ai",
13
+ "examples/workplace-ai-assistant",
15
14
  "examples/ai-coding-assistant-evidence"
16
15
  ]
17
16