eduevidence 5.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.
- package/LICENSE +21 -0
- package/README.md +506 -0
- package/README.zh-CN.md +434 -0
- package/SKILL.md +195 -0
- package/bin/eduevidence.js +127 -0
- package/domains/education/manifest.json +183 -0
- package/domains/education/outcome_taxonomy.json +127 -0
- package/domains/manifest.json +26 -0
- package/domains/policy/frame.schema.json +234 -0
- package/domains/policy/manifest.json +10 -0
- package/domains/policy/methodology_checklist.json +109 -0
- package/domains/policy/outcome_taxonomy.json +53 -0
- package/domains/policy/references/causal-identification.md +45 -0
- package/domains/policy/references/cost-evidence.md +44 -0
- package/domains/policy/references/equity.md +42 -0
- package/domains/policy/references/evidence-hierarchy.md +41 -0
- package/domains/policy/references/implementation-evidence.md +47 -0
- package/eduevidence_cli.py +26 -0
- package/engine/__init__.py +11 -0
- package/engine/__pycache__/__init__.cpython-312.pyc +0 -0
- package/engine/__pycache__/analysis.cpython-312.pyc +0 -0
- package/engine/__pycache__/bias.cpython-312.pyc +0 -0
- package/engine/__pycache__/briefs.cpython-312.pyc +0 -0
- package/engine/__pycache__/capabilities.cpython-312.pyc +0 -0
- package/engine/__pycache__/citation_check.cpython-312.pyc +0 -0
- package/engine/__pycache__/contracts.cpython-312.pyc +0 -0
- package/engine/__pycache__/datasets.cpython-312.pyc +0 -0
- package/engine/__pycache__/events.cpython-312.pyc +0 -0
- package/engine/__pycache__/evidence_graph.cpython-312.pyc +0 -0
- package/engine/__pycache__/evidence_review.cpython-312.pyc +0 -0
- package/engine/__pycache__/evidencecore.cpython-312.pyc +0 -0
- package/engine/__pycache__/gap_lens.cpython-312.pyc +0 -0
- package/engine/__pycache__/gaps.cpython-312.pyc +0 -0
- package/engine/__pycache__/graph_store.cpython-312.pyc +0 -0
- package/engine/__pycache__/graph_validate.cpython-312.pyc +0 -0
- package/engine/__pycache__/ids.cpython-312.pyc +0 -0
- package/engine/__pycache__/library.cpython-312.pyc +0 -0
- package/engine/__pycache__/library_builtin.cpython-312.pyc +0 -0
- package/engine/__pycache__/living.cpython-312.pyc +0 -0
- package/engine/__pycache__/log.cpython-312.pyc +0 -0
- package/engine/__pycache__/meta_analysis.cpython-312.pyc +0 -0
- package/engine/__pycache__/meta_synthesis.cpython-312.pyc +0 -0
- package/engine/__pycache__/migration.cpython-312.pyc +0 -0
- package/engine/__pycache__/mode_router.cpython-312.pyc +0 -0
- package/engine/__pycache__/paths.cpython-312.pyc +0 -0
- package/engine/__pycache__/pilot.cpython-312.pyc +0 -0
- package/engine/__pycache__/planner.cpython-312.pyc +0 -0
- package/engine/__pycache__/project.cpython-312.pyc +0 -0
- package/engine/__pycache__/projections.cpython-312.pyc +0 -0
- package/engine/__pycache__/robustness.cpython-312.pyc +0 -0
- package/engine/__pycache__/run.cpython-312.pyc +0 -0
- package/engine/__pycache__/semantics.cpython-312.pyc +0 -0
- package/engine/__pycache__/study_design.cpython-312.pyc +0 -0
- package/engine/__pycache__/synthesis.cpython-312.pyc +0 -0
- package/engine/__pycache__/tribunal.cpython-312.pyc +0 -0
- package/engine/__pycache__/update.cpython-312.pyc +0 -0
- package/engine/__pycache__/versions.cpython-312.pyc +0 -0
- package/engine/analysis.py +308 -0
- package/engine/bias.py +178 -0
- package/engine/briefs.py +106 -0
- package/engine/capabilities.py +99 -0
- package/engine/citation_check.py +192 -0
- package/engine/contracts.py +117 -0
- package/engine/datasets.py +165 -0
- package/engine/events.py +67 -0
- package/engine/evidence_graph.py +571 -0
- package/engine/evidence_review.py +88 -0
- package/engine/evidencecore.py +182 -0
- package/engine/gap_lens.py +132 -0
- package/engine/gaps.py +169 -0
- package/engine/graph_store.py +335 -0
- package/engine/graph_validate.py +87 -0
- package/engine/ids.py +77 -0
- package/engine/library.py +268 -0
- package/engine/library_builtin.py +301 -0
- package/engine/living.py +671 -0
- package/engine/log.py +39 -0
- package/engine/meta_analysis.py +333 -0
- package/engine/meta_synthesis.py +111 -0
- package/engine/migration.py +397 -0
- package/engine/mode_router.py +72 -0
- package/engine/paths.py +15 -0
- package/engine/pilot.py +368 -0
- package/engine/planner.py +126 -0
- package/engine/project.py +118 -0
- package/engine/projections.py +240 -0
- package/engine/robustness.py +109 -0
- package/engine/run.py +85 -0
- package/engine/semantics.py +135 -0
- package/engine/study_design.py +87 -0
- package/engine/synthesis.py +187 -0
- package/engine/tribunal.py +408 -0
- package/engine/update.py +113 -0
- package/engine/versions.py +12 -0
- package/install.sh +510 -0
- package/integrations/__init__.py +1 -0
- package/integrations/__pycache__/__init__.cpython-312.pyc +0 -0
- package/integrations/__pycache__/agent_mcp.cpython-312.pyc +0 -0
- package/integrations/__pycache__/smart_web_fetch.cpython-312.pyc +0 -0
- package/integrations/agent_mcp.py +856 -0
- package/integrations/smart_web_fetch.py +59 -0
- package/package.json +50 -0
- package/pyproject.toml +55 -0
- package/references/applicability-policy.md +88 -0
- package/references/education-framing.md +132 -0
- package/references/effect_size_formulas.md +35 -0
- package/references/evaluation-design.md +111 -0
- package/references/evidence-quality.md +79 -0
- package/references/grade_framework.md +29 -0
- package/references/intervention-design.md +98 -0
- package/references/methodology-audit.md +103 -0
- package/references/outcome-taxonomy.md +106 -0
- package/references/retrieval-protocol.md +142 -0
- package/references/skeptic-protocol.md +93 -0
- package/references/social_science_pitfalls.md +48 -0
- package/references/source-validity.md +140 -0
- package/references/tribunal-policy.md +112 -0
- package/references/wwc_standards.md +29 -0
- package/retrieval/__init__.py +1 -0
- package/retrieval/__pycache__/__init__.cpython-312.pyc +0 -0
- package/retrieval/__pycache__/corpus_store.cpython-312.pyc +0 -0
- package/retrieval/__pycache__/dedupe.cpython-312.pyc +0 -0
- package/retrieval/__pycache__/failures.cpython-312.pyc +0 -0
- package/retrieval/__pycache__/fetch.cpython-312.pyc +0 -0
- package/retrieval/__pycache__/search.cpython-312.pyc +0 -0
- package/retrieval/__pycache__/source.cpython-312.pyc +0 -0
- package/retrieval/__pycache__/validate.cpython-312.pyc +0 -0
- package/retrieval/corpus_store.py +181 -0
- package/retrieval/dedupe.py +127 -0
- package/retrieval/failures.py +90 -0
- package/retrieval/fetch.py +435 -0
- package/retrieval/search.py +493 -0
- package/retrieval/source.py +160 -0
- package/retrieval/validate.py +257 -0
- package/schemas/agent-mcp-approval.schema.json +57 -0
- package/schemas/chart-spec.schema.json +88 -0
- package/schemas/cross-model-review.schema.json +28 -0
- package/schemas/education-frame.schema.json +106 -0
- package/schemas/evaluation.schema.json +35 -0
- package/schemas/evidence.schema.json +81 -0
- package/schemas/fetch-result.schema.json +119 -0
- package/schemas/intervention.schema.json +46 -0
- package/schemas/methodology.schema.json +102 -0
- package/schemas/report-result.schema.json +381 -0
- package/schemas/report-spec.schema.json +130 -0
- package/schemas/source.schema.json +311 -0
- package/schemas/v2/analysis-plan.schema.json +28 -0
- package/schemas/v2/analysis-run.schema.json +33 -0
- package/schemas/v2/claim.schema.json +26 -0
- package/schemas/v2/dataset-asset.schema.json +40 -0
- package/schemas/v2/decision-snapshot.schema.json +53 -0
- package/schemas/v2/evidence-link.schema.json +38 -0
- package/schemas/v2/finding.schema.json +47 -0
- package/schemas/v2/graph-revision.schema.json +30 -0
- package/schemas/v2/knowledge-gap.schema.json +40 -0
- package/schemas/v2/methodology-audit.schema.json +30 -0
- package/schemas/v2/outcome.schema.json +18 -0
- package/schemas/v2/project.schema.json +31 -0
- package/schemas/v2/research-intent.schema.json +24 -0
- package/schemas/v2/run.schema.json +43 -0
- package/schemas/v2/source.schema.json +24 -0
- package/schemas/v2/study-design.schema.json +67 -0
- package/schemas/v2/study.schema.json +37 -0
- package/schemas/v3/pilot-outcome.schema.json +132 -0
- package/schemas/v3/run-manifest.schema.json +193 -0
- package/schemas/v3/synthesis.schema.json +86 -0
- package/schemas/v4/drift-report.schema.json +66 -0
- package/schemas/v4/evidence-library.schema.json +42 -0
- package/schemas/v4/living-subscription.schema.json +55 -0
- package/schemas/v4/meta-analysis.schema.json +152 -0
- package/schemas/verdict.schema.json +56 -0
- package/scripts/__init__.py +0 -0
- package/scripts/__pycache__/__init__.cpython-312.pyc +0 -0
- package/scripts/__pycache__/benchmark.cpython-312.pyc +0 -0
- package/scripts/__pycache__/benchmark_evaluator.cpython-312.pyc +0 -0
- package/scripts/__pycache__/benchmark_judge.cpython-312.pyc +0 -0
- package/scripts/__pycache__/benchmark_routing.cpython-312.pyc +0 -0
- package/scripts/__pycache__/benchmark_v2.cpython-312.pyc +0 -0
- package/scripts/__pycache__/benchmark_v3.cpython-312.pyc +0 -0
- package/scripts/__pycache__/build_result.cpython-312.pyc +0 -0
- package/scripts/__pycache__/claim_audit.cpython-312.pyc +0 -0
- package/scripts/__pycache__/complexity_gate.cpython-312.pyc +0 -0
- package/scripts/__pycache__/compute_confidence.cpython-312.pyc +0 -0
- package/scripts/__pycache__/dashboard_server.cpython-312.pyc +0 -0
- package/scripts/__pycache__/did_regression.cpython-312.pyc +0 -0
- package/scripts/__pycache__/effect_calculator.cpython-312.pyc +0 -0
- package/scripts/__pycache__/evidence_matrix.cpython-312.pyc +0 -0
- package/scripts/__pycache__/evidence_score.cpython-312.pyc +0 -0
- package/scripts/__pycache__/evidence_semantics.cpython-312.pyc +0 -0
- package/scripts/__pycache__/fetch_benchmark.cpython-312.pyc +0 -0
- package/scripts/__pycache__/lint_report_layout.cpython-312.pyc +0 -0
- package/scripts/__pycache__/orchestrator.cpython-312.pyc +0 -0
- package/scripts/__pycache__/pre_verdict_gate.cpython-312.pyc +0 -0
- package/scripts/__pycache__/recompute_demo_quality.cpython-312.pyc +0 -0
- package/scripts/__pycache__/render_report.cpython-312.pyc +0 -0
- package/scripts/__pycache__/render_report_html.cpython-312.pyc +0 -0
- package/scripts/__pycache__/run_workspace.cpython-312.pyc +0 -0
- package/scripts/__pycache__/skill_lint.cpython-312.pyc +0 -0
- package/scripts/__pycache__/startup_probe.cpython-312.pyc +0 -0
- package/scripts/__pycache__/sync_killer_demo_report.cpython-312.pyc +0 -0
- package/scripts/__pycache__/test_adversarial_empirical.cpython-312-pytest-9.0.2.pyc +0 -0
- package/scripts/__pycache__/test_adversarial_empirical.cpython-312-pytest-9.1.1.pyc +0 -0
- package/scripts/__pycache__/validate_schema.cpython-312.pyc +0 -0
- package/scripts/audit_dois.py +292 -0
- package/scripts/bake_pack.sh +37 -0
- package/scripts/benchmark.py +183 -0
- package/scripts/benchmark_evaluator.py +371 -0
- package/scripts/benchmark_judge.py +535 -0
- package/scripts/benchmark_routing.py +120 -0
- package/scripts/benchmark_v2.py +304 -0
- package/scripts/benchmark_v3.py +552 -0
- package/scripts/build_esl_artifacts.py +1921 -0
- package/scripts/build_evidence_library.py +307 -0
- package/scripts/build_killer_demo.py +295 -0
- package/scripts/build_result.py +311 -0
- package/scripts/check_version_consistency.py +96 -0
- package/scripts/citation_check.py +123 -0
- package/scripts/claim_audit.py +157 -0
- package/scripts/complexity_gate.py +180 -0
- package/scripts/compute_confidence.py +176 -0
- package/scripts/dashboard_server.py +536 -0
- package/scripts/did_regression.py +315 -0
- package/scripts/effect_calculator.py +99 -0
- package/scripts/enrich_projects_human_and_lieflat.py +315 -0
- package/scripts/evidence_matrix.py +129 -0
- package/scripts/evidence_score.py +234 -0
- package/scripts/evidence_semantics.py +87 -0
- package/scripts/fetch_benchmark.py +177 -0
- package/scripts/generate_metrics.py +99 -0
- package/scripts/generate_new_projects.py +686 -0
- package/scripts/generate_promo.py +192 -0
- package/scripts/lint_report_layout.py +182 -0
- package/scripts/orchestrator.py +1456 -0
- package/scripts/pre_verdict_gate.py +513 -0
- package/scripts/quickstart.py +121 -0
- package/scripts/rebake_all_5themes.py +88 -0
- package/scripts/recompute_demo_quality.py +205 -0
- package/scripts/render_report.py +270 -0
- package/scripts/render_report_html.py +356 -0
- package/scripts/retraction_watch.py +110 -0
- package/scripts/run_workspace.py +337 -0
- package/scripts/serve_web.py +54 -0
- package/scripts/skill_lint.py +150 -0
- package/scripts/startup_probe.py +265 -0
- package/scripts/sync_killer_demo_report.py +270 -0
- package/scripts/test_adversarial_empirical.py +541 -0
- package/scripts/validate_schema.py +256 -0
- package/skill/agents/education-planner.md +80 -0
- package/skill/agents/evaluation-designer.md +74 -0
- package/skill/agents/evidence-analyst.md +106 -0
- package/skill/agents/evidence-judge.md +111 -0
- package/skill/agents/evidence-retriever.md +80 -0
- package/skill/agents/intervention-designer.md +82 -0
- package/skill/agents/method-reviewer.md +104 -0
- package/skill/agents/skeptic.md +89 -0
- package/skill/sub-skills/aihot-trend-analysis/SKILL.md +31 -0
- package/skill/sub-skills/contradiction-analysis/SKILL.md +17 -0
- package/skill/sub-skills/data-analysis/SKILL.md +23 -0
- package/skill/sub-skills/ethics-review/SKILL.md +25 -0
- package/skill/sub-skills/evidence-extraction/SKILL.md +19 -0
- package/skill/sub-skills/evidence-review/SKILL.md +18 -0
- package/skill/sub-skills/gap-analysis/SKILL.md +25 -0
- package/skill/sub-skills/literature-review/SKILL.md +21 -0
- package/skill/sub-skills/methodology-audit/SKILL.md +20 -0
- package/skill/sub-skills/report-generation/SKILL.md +51 -0
- package/skill/sub-skills/research-planning/SKILL.md +21 -0
- package/skill/sub-skills/study-design/SKILL.md +16 -0
- package/skill/task-briefs/adjudicate.md +17 -0
- package/skill/task-briefs/audit.md +15 -0
- package/skill/task-briefs/challenge.md +15 -0
- package/skill/task-briefs/evaluate.md +13 -0
- package/skill/task-briefs/extract.md +16 -0
- package/skill/task-briefs/frame.md +17 -0
- package/skill/task-briefs/intervene.md +14 -0
- package/skill/task-briefs/present.md +16 -0
- package/skill/task-briefs/retrieve.md +15 -0
- package/visualization/eduevidence-report/assets/base.css +337 -0
- package/visualization/eduevidence-report/motion/motion.css +157 -0
- package/visualization/eduevidence-report/motion/motion.js +107 -0
- package/visualization/eduevidence-report/references/bilingual-style.md +7 -0
- package/visualization/eduevidence-report/references/component-catalog.md +145 -0
- package/visualization/eduevidence-report/references/evidence-expansion.md +65 -0
- package/visualization/eduevidence-report/references/full-report-outline.md +86 -0
- package/visualization/eduevidence-report/references/layout-constraints.md +63 -0
- package/visualization/eduevidence-report/references/lieflat-composition.md +79 -0
- package/visualization/eduevidence-report/references/motion-system.md +31 -0
- package/visualization/eduevidence-report/schemas/adapter-envelope.schema.json +22 -0
- package/visualization/eduevidence-report/schemas/visual-layout.schema.json +87 -0
- package/visualization/eduevidence-report/scripts/__pycache__/adapter_contract.cpython-312.pyc +0 -0
- package/visualization/eduevidence-report/scripts/__pycache__/build_artifact_manifest.cpython-312.pyc +0 -0
- package/visualization/eduevidence-report/scripts/__pycache__/build_charts.cpython-312.pyc +0 -0
- package/visualization/eduevidence-report/scripts/__pycache__/build_figures.cpython-312.pyc +0 -0
- package/visualization/eduevidence-report/scripts/__pycache__/build_infographics.cpython-312.pyc +0 -0
- package/visualization/eduevidence-report/scripts/__pycache__/build_report.cpython-312.pyc +0 -0
- package/visualization/eduevidence-report/scripts/__pycache__/charts_data.cpython-312.pyc +0 -0
- package/visualization/eduevidence-report/scripts/__pycache__/lieflat_engine.cpython-312.pyc +0 -0
- package/visualization/eduevidence-report/scripts/__pycache__/zh_labels.cpython-312.pyc +0 -0
- package/visualization/eduevidence-report/scripts/adapter_contract.py +72 -0
- package/visualization/eduevidence-report/scripts/build_artifact_manifest.py +70 -0
- package/visualization/eduevidence-report/scripts/build_charts.py +283 -0
- package/visualization/eduevidence-report/scripts/build_figures.py +515 -0
- package/visualization/eduevidence-report/scripts/build_infographics.py +268 -0
- package/visualization/eduevidence-report/scripts/build_report.py +3211 -0
- package/visualization/eduevidence-report/scripts/charts_data.py +617 -0
- package/visualization/eduevidence-report/scripts/check_mobile_layout.js +220 -0
- package/visualization/eduevidence-report/scripts/lieflat_engine.py +852 -0
- package/visualization/eduevidence-report/scripts/zh_labels.py +245 -0
- package/visualization/eduevidence-report/themes/academic.css +94 -0
- package/visualization/eduevidence-report/themes/claude.css +96 -0
- package/visualization/eduevidence-report/themes/datalab-dark.css +147 -0
- package/visualization/eduevidence-report/themes/datalab.css +151 -0
- package/visualization/eduevidence-report/themes/presentation.css +140 -0
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""scripts/enrich_projects_human_and_lieflat.py — Enrich all projects with human language & dynamic Lieflat visual layouts.
|
|
3
|
+
"""
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
import json
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
|
|
9
|
+
ROOT = Path(__file__).resolve().parent.parent
|
|
10
|
+
EXAMPLES_DIR = ROOT / "examples"
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def enrich_math_project():
|
|
14
|
+
proj_dir = EXAMPLES_DIR / "highschool-math-ai-tutor"
|
|
15
|
+
if not proj_dir.exists():
|
|
16
|
+
return
|
|
17
|
+
|
|
18
|
+
r_en = json.loads((proj_dir / "result.json").read_text(encoding="utf-8"))
|
|
19
|
+
r_zh = json.loads((proj_dir / "result.zh.json").read_text(encoding="utf-8"))
|
|
20
|
+
|
|
21
|
+
# 1. Human-centered Decision in Chinese
|
|
22
|
+
r_zh["decision"]["summary"] = "准予限制性试点:允许作为思维引导与错因诊断辅助,严禁作为直接抄答案或直接解题工具。"
|
|
23
|
+
r_zh["decision"]["decision_rationale"] = (
|
|
24
|
+
"【核心结论】准予在高中数学课后辅导中开展限制性试点。\n"
|
|
25
|
+
"【实证利弊分析】\n"
|
|
26
|
+
"1. 课后练习确实提速:大模型分步提示能帮助学生在代数推导中快速理清步骤(效应量 +0.66g),显著减少卡壳;\n"
|
|
27
|
+
"2. 闭卷考试容易失控:如果无限制提供完整答案,学生容易产生‘我全都懂了’的假象,导致脱离工具后的独立闭卷考试成绩下滑 15%(-0.27g);\n"
|
|
28
|
+
"3. 必须配套教师导学:县域乡村高中在缺乏教师协同引导时,单纯居家使用增益接近于 0,必须配合教师课堂导学案。\n"
|
|
29
|
+
"【排课落地 4 阶段建议】\n"
|
|
30
|
+
"• 第 1-4 周(审题破题):AI 仅开启苏格拉底反问模式,只引导审题与定理联想,严禁输出任何代数解题步骤;\n"
|
|
31
|
+
"• 第 5-8 周(错因定位):学生独立做题卡壳时,AI 仅指出算式错误位置,由学生自主修正;\n"
|
|
32
|
+
"• 第 9-12 周(同构巩固):限制每题提示上限为 2 次,强制手写数形结合反思笔记;\n"
|
|
33
|
+
"• 第 13-16 周(闭卷决战):全面关停 AI 工具,100% 独立闭卷完成期末统考。\n"
|
|
34
|
+
"【红线熔断条件】期中阶段无 AI 独立测验均分较对照班下滑超 10%,或秒点提示率超 25%,立即暂停该班级 AI 权限。"
|
|
35
|
+
)
|
|
36
|
+
r_zh["decision"]["strongest_support"] = "课后做题卡壳率降低 32%:AI 针对具体算式步骤提供苏格拉底启发,显著加快公式推导与定理应用速度 (+0.66g)。"
|
|
37
|
+
r_zh["decision"]["key_uncertainty"] = "脱离 AI 后独立解题能力退化:直接看答案会诱发认知卸载,期末闭卷考试与综合几何建模能力出现明显下滑 (-0.27g)。"
|
|
38
|
+
r_zh["decision"]["main_risk"] = "虚假掌握感与城乡鸿沟放大:缺乏自律的学生容易沦为被动抄答案者;若无教师协同介导,县域乡村生源与城市重点校的差距将进一步拉大。"
|
|
39
|
+
r_zh["decision"]["next_action"] = "实施 4 阶段渐退支架试点:第 1 阶段严禁给算式,第 2-3 阶段限制提示次数并强制写反思,第 4 阶段彻底断网闭卷统考。"
|
|
40
|
+
|
|
41
|
+
# 2. English equivalent
|
|
42
|
+
r_en["decision"]["summary"] = "Authorize restricted pilot: allow as a Socratic reasoning scaffold, strictly forbid direct answer generation."
|
|
43
|
+
r_en["decision"]["decision_rationale"] = (
|
|
44
|
+
"Core Finding: Authorize restricted classroom pilot.\n"
|
|
45
|
+
"Empirical Evidence Balance:\n"
|
|
46
|
+
"1. In-task speedup (+0.66g): Socratic prompts reduce algebra bottlenecks;\n"
|
|
47
|
+
"2. Solo retention deficit (-0.27g): Direct answer exposure induces an illusion of competence and impairs closed-book performance;\n"
|
|
48
|
+
"3. Teacher orchestration required: In rural schools without teacher guidance, net benefit is near zero.\n"
|
|
49
|
+
"4-Phase Implementation: Phase 1 Socratic only -> Phase 2 Error diagnosis -> Phase 3 Reduced hints -> Phase 4 Unassisted solo exams.\n"
|
|
50
|
+
"Stop Condition: Pause pilot if unassisted mid-term score drops > 10% or hint gaming > 25%."
|
|
51
|
+
)
|
|
52
|
+
r_en["decision"]["strongest_support"] = "In-task homework velocity improves (+0.66g): Socratic step hints speed up formula manipulation and proof structuring."
|
|
53
|
+
r_en["decision"]["key_uncertainty"] = "Solo retention deficit (-0.27g): Relying on direct answers degrades unassisted exam performance."
|
|
54
|
+
r_en["decision"]["main_risk"] = "Illusion of competence and equity gap widening without teacher facilitation."
|
|
55
|
+
r_en["decision"]["next_action"] = "Deploy 4-phase fading pilot with hard stop conditions and final unassisted closed-book evaluation."
|
|
56
|
+
|
|
57
|
+
# 3. Dynamic Visual Layout
|
|
58
|
+
visual_layout = [
|
|
59
|
+
{"chart_id": "lieflat-forest-plot.svg", "type": "forest_plot",
|
|
60
|
+
"catalog_ref": "FOREST-PLOT (publication figure)",
|
|
61
|
+
"title_zh": "16 项实证的效应量森林图", "title_en": "Effect-size forest plot of 16 studies",
|
|
62
|
+
"subtitle_zh": "Hedges' g 与 95% 置信区间 · 一行一篇研究 · 正绿负橙",
|
|
63
|
+
"subtitle_en": "Hedges' g with 95% CI · one row per study · green positive, orange negative",
|
|
64
|
+
"caption_zh": "全部 g 与 CI 来自 result.json 的 evidence.effect_size;无 CI 的研究不画区间线。",
|
|
65
|
+
"caption_en": "All g and CI values come from evidence.effect_size in result.json; no CI line is drawn without data.",
|
|
66
|
+
"source": "meta.forest", "params": {"max_studies": 10}},
|
|
67
|
+
{"chart_id": "lieflat-brand-spectrum.svg", "type": "brand_spectrum",
|
|
68
|
+
"catalog_ref": "L7 Brand Spectrum",
|
|
69
|
+
"title_zh": "做题即时提速 vs 独立闭卷留存:结果双极光谱", "title_en": "In-task speed-up vs solo retention: a bipolar spectrum",
|
|
70
|
+
"subtitle_zh": "位置 = (正向 − 负向)÷ 方向计数 · 左端负向主导 · 右端正向主导",
|
|
71
|
+
"subtitle_en": "Position = (positive − negative) ÷ direction counts · negative-led left, positive-led right",
|
|
72
|
+
"caption_zh": "双极位置由 outcome 方向计数诚实推导,不虚构量表分数。",
|
|
73
|
+
"caption_en": "Bipolar positions derived honestly from outcome direction counts; no invented scale scores.",
|
|
74
|
+
"source": "outcomes.bipolar_axes", "params": {}},
|
|
75
|
+
{"chart_id": "lieflat-barcode-lollipop.svg", "type": "barcode_lollipop",
|
|
76
|
+
"catalog_ref": "L3 Barcode Lollipop",
|
|
77
|
+
"title_zh": "16 周四阶段渐退的学期归属", "title_en": "Sixteen weeks assigned to four fading phases",
|
|
78
|
+
"subtitle_zh": "柱高 = 阶段序号(1–4),非活动量 · 顶部圆点 = 阶段切换周 · 无逐日数据不伪造",
|
|
79
|
+
"subtitle_en": "Stem height = phase index (1–4), not activity · top dots = phase-start weeks · no fabricated daily data",
|
|
80
|
+
"caption_zh": "周级归属由各阶段名称中的周区间诚实推导。",
|
|
81
|
+
"caption_en": "Weekly membership derived honestly from week ranges in phase names.",
|
|
82
|
+
"source": "intervention.phase_weeks", "params": {}},
|
|
83
|
+
{"chart_id": "lieflat-launch-fan.svg", "type": "launch_fan",
|
|
84
|
+
"catalog_ref": "L1 Launch Fan",
|
|
85
|
+
"title_zh": "四个干预阶段的活动权重扇", "title_en": "Activity weights of the four intervention phases",
|
|
86
|
+
"subtitle_zh": "圆点面积 ∝ 该阶段列出的活动条数(sqrt 换算) · 每格 = 1 项活动",
|
|
87
|
+
"subtitle_en": "Dot area ∝ listed activity count (sqrt) · one unit = one activity",
|
|
88
|
+
"caption_zh": "权重 = 阶段活动条数,全部来自 intervention.phase_N.activities。",
|
|
89
|
+
"caption_en": "Weights are phase activity counts from intervention.phase_N.activities.",
|
|
90
|
+
"source": "intervention.activity_weights", "params": {"max_items": 8}},
|
|
91
|
+
{"chart_id": "lieflat-paired-rungs.svg", "type": "paired_rungs",
|
|
92
|
+
"catalog_ref": "F6 Paired Rungs",
|
|
93
|
+
"title_zh": "每个结果的正向与负向证据并肩对比", "title_en": "Positive vs negative evidence, side by side per outcome",
|
|
94
|
+
"subtitle_zh": "每格 = 1 条证据 · 左列正向 · 右列负向 · 顶部数字 = 正 / 负",
|
|
95
|
+
"subtitle_en": "One rung = one evidence item · left positive, right negative · top number = pos / neg",
|
|
96
|
+
"caption_zh": "两列对比来自 outcomes 的 positive_count 与 negative_count。",
|
|
97
|
+
"caption_en": "Both columns from outcomes positive_count and negative_count.",
|
|
98
|
+
"source": "outcomes.paired_counts", "params": {}},
|
|
99
|
+
]
|
|
100
|
+
r_zh["visual_layout"] = visual_layout
|
|
101
|
+
r_en["visual_layout"] = visual_layout
|
|
102
|
+
|
|
103
|
+
(proj_dir / "result.json").write_text(json.dumps(r_en, indent=2, ensure_ascii=False), encoding="utf-8")
|
|
104
|
+
(proj_dir / "result.zh.json").write_text(json.dumps(r_zh, indent=2, ensure_ascii=False), encoding="utf-8")
|
|
105
|
+
print("Enriched math project")
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def enrich_writing_project():
|
|
109
|
+
proj_dir = EXAMPLES_DIR / "esl-academic-writing-ai"
|
|
110
|
+
if not proj_dir.exists():
|
|
111
|
+
return
|
|
112
|
+
|
|
113
|
+
r_en = json.loads((proj_dir / "result.json").read_text(encoding="utf-8"))
|
|
114
|
+
r_zh = json.loads((proj_dir / "result.zh.json").read_text(encoding="utf-8"))
|
|
115
|
+
|
|
116
|
+
# 1. Human-centered Decision in Chinese
|
|
117
|
+
r_zh["decision"]["summary"] = "准予限制性试点:允许用于逻辑大纲梳理与学术词汇建议,严禁整段代写或一键润色。"
|
|
118
|
+
r_zh["decision"]["decision_rationale"] = (
|
|
119
|
+
"【核心结论】准予在大学学术英语写作(ESL / EAP)课程中开展限制性试点。\n"
|
|
120
|
+
"【实证利弊分析】\n"
|
|
121
|
+
"1. 初稿逻辑结构显著更强:AI 在大纲搭建(+0.54g)与学术词汇丰富度(+0.46g)上辅助效果极佳,论点与论据对齐度明显提高;\n"
|
|
122
|
+
"2. 独立写作批判性退化:直接采纳整段 AI 生成文本会导致学生在脱离工具后的独立论证深度下滑(-0.23g),且文风千篇一律;\n"
|
|
123
|
+
"3. 反思日志是关键防线:强制撰写‘修改决策反思日志’时,原创作者声音得以保护(+0.42g);无反思日志则文风严重同质化(-0.20g)。\n"
|
|
124
|
+
"【排课落地 4 阶段建议】\n"
|
|
125
|
+
"• 第 1-4 周(大纲搭建):学生手写论文大纲,AI 仅扮演反方辩友提出逻辑漏洞质疑,禁止生成成句文本;\n"
|
|
126
|
+
"• 第 5-8 周(起草与反思):允许就具体疑难句查询学术搭配,但每条采纳必须在反思日志中写明理由;\n"
|
|
127
|
+
"• 第 9-12 周(人机互评):AI 负责检查标点拼写与机械格式,真人同伴负责评审论点说服力与思想深度;\n"
|
|
128
|
+
"• 第 13-16 周(闭卷实战):全面断网禁用 AI,独立完成限时学术论证论文。\n"
|
|
129
|
+
"【红线熔断条件】独立闭卷测试论证严密性下滑超 12%,或直接复制粘贴率超 15%,立即冻结该班级 AI 权限。"
|
|
130
|
+
)
|
|
131
|
+
r_zh["decision"]["strongest_support"] = "初稿论证逻辑严密性提高 25%:AI 在论文大纲搭建 (+0.54g) 与学术词汇丰富度 (+0.46g) 辅助上表现优异。"
|
|
132
|
+
r_zh["decision"]["key_uncertainty"] = "脱离 AI 后批判性论证退化:直接复制 AI 段落会剥夺学生的语篇建构训练,闭卷独立写作能力明显退步 (-0.23g)。"
|
|
133
|
+
r_zh["decision"]["main_risk"] = "文风千篇一律与作者声音消亡:未经反思直接套用 AI 建议会导致整班论文文体特征同质化 (-0.20g)。"
|
|
134
|
+
r_zh["decision"]["next_action"] = "推行 4 阶段反思支架:前四周仅限苏格拉底大纲质询,中期强制提交修改反思日志,期末实行无 AI 闭卷限时论辩写作。"
|
|
135
|
+
|
|
136
|
+
# 2. English equivalent
|
|
137
|
+
r_en["decision"]["summary"] = "Authorize restricted pilot: allow for outline structuring and vocabulary inquiry, forbid whole-paragraph generation."
|
|
138
|
+
r_en["decision"]["decision_rationale"] = (
|
|
139
|
+
"Core Finding: Authorize restricted academic writing pilot.\n"
|
|
140
|
+
"Empirical Evidence Balance:\n"
|
|
141
|
+
"1. Thesis structure gains (+0.54g): Socratic outlines strengthen claim-evidence coherence;\n"
|
|
142
|
+
"2. Critical argumentation decline (-0.23g): Direct copy-pasting harms unassisted writing retention;\n"
|
|
143
|
+
"3. Reflection logs protect authorial voice (+0.42g): Metacognitive logs prevent homogenizing voice into generic AI style.\n"
|
|
144
|
+
"4-Phase Implementation: Phase 1 Outline critique -> Phase 2 Drafting with reflection log -> Phase 3 Hybrid peer review -> Phase 4 Unassisted paper.\n"
|
|
145
|
+
"Stop Condition: Restrict pilot if solo post-test coherence drops > 12% or direct copying > 15%."
|
|
146
|
+
)
|
|
147
|
+
r_en["decision"]["strongest_support"] = "Drafting coherence improves (+0.54g): Structured prompt chains enhance claim-evidence alignment and academic vocabulary."
|
|
148
|
+
r_en["decision"]["key_uncertainty"] = "Solo essay argumentation deficit (-0.23g): Unedited whole-paragraph generation degrades critical reasoning retention."
|
|
149
|
+
r_en["decision"]["main_risk"] = "Voice homogenization and cognitive offloading if reflection logs are absent."
|
|
150
|
+
r_en["decision"]["next_action"] = "Enforce 4-phase fading reflection protocol with mandatory metacognitive justification logs and unassisted final exam."
|
|
151
|
+
|
|
152
|
+
# 3. Dynamic Visual Layout
|
|
153
|
+
visual_layout = [
|
|
154
|
+
{"chart_id": "lieflat-forest-plot.svg", "type": "forest_plot",
|
|
155
|
+
"catalog_ref": "FOREST-PLOT (publication figure)",
|
|
156
|
+
"title_zh": "16 项二语写作实证的效应量森林图", "title_en": "Effect-size forest plot of 16 L2 writing studies",
|
|
157
|
+
"subtitle_zh": "Hedges' g 与 95% 置信区间 · 一行一篇研究 · 正绿负橙",
|
|
158
|
+
"subtitle_en": "Hedges' g with 95% CI · one row per study · green positive, orange negative",
|
|
159
|
+
"caption_zh": "全部 g 与 CI 来自 result.json 的 evidence.effect_size。",
|
|
160
|
+
"caption_en": "All g and CI values come from evidence.effect_size in result.json.",
|
|
161
|
+
"source": "meta.forest", "params": {"max_studies": 10}},
|
|
162
|
+
{"chart_id": "lieflat-dot-cascade.svg", "type": "dot_cascade",
|
|
163
|
+
"catalog_ref": "L2 Dot Cascade",
|
|
164
|
+
"title_zh": "16 篇写作实证的效应量梯队级联", "title_en": "Ranked effect-size cascade of 16 writing studies",
|
|
165
|
+
"subtitle_zh": "按 g 降序 · 圆点高度 ∝ |g| · 顶部数字 = g · 悬停读样本量",
|
|
166
|
+
"subtitle_en": "Sorted by g · dot height ∝ |g| · top number = g · hover for sample size",
|
|
167
|
+
"caption_zh": "梯队数值来自 evidence.effect_size.value 与 sample_size。",
|
|
168
|
+
"caption_en": "Cascade values from evidence.effect_size.value and sample_size.",
|
|
169
|
+
"source": "evidence.ranked_effects", "params": {"limit": 12}},
|
|
170
|
+
{"chart_id": "lieflat-bubble-almanac.svg", "type": "bubble_almanac",
|
|
171
|
+
"catalog_ref": "L9 Bubble Almanac",
|
|
172
|
+
"title_zh": "发表年份 × 结果维度文献年历", "title_en": "Year × dimension evidence almanac",
|
|
173
|
+
"subtitle_zh": "气泡面积 ∝ 该格研究数(sqrt 换算) · 实心圆 = 有显著结果",
|
|
174
|
+
"subtitle_en": "Bubble area ∝ study count (sqrt) · solid core = significant results",
|
|
175
|
+
"caption_zh": "年份来自 evidence.year,维度来自 outcome_dimension;显著性来自 p_value。",
|
|
176
|
+
"caption_en": "Years from evidence.year, dimensions from outcome_dimension; significance from p_value.",
|
|
177
|
+
"source": "evidence.year_x_dimension", "params": {}},
|
|
178
|
+
{"chart_id": "lieflat-tick-rows.svg", "type": "tick_rows",
|
|
179
|
+
"catalog_ref": "F5 Tick Rows",
|
|
180
|
+
"title_zh": "各结果类型的效应方向分布", "title_en": "Effect direction by outcome type",
|
|
181
|
+
"subtitle_zh": "每点 = 1 条证据 · 绿 = 正向 · 灰 = 零效应 · 橙 = 负向 · 右端 = 净效应",
|
|
182
|
+
"subtitle_en": "One dot = one evidence item · green = positive · grey = null · orange = negative · right = net",
|
|
183
|
+
"caption_zh": "计数来自 outcomes 的 positive/negative/null_count(effect_direction 口径)。",
|
|
184
|
+
"caption_en": "Counts from outcomes positive/negative/null_count (effect_direction semantics).",
|
|
185
|
+
"source": "outcomes.direction_counts", "params": {}},
|
|
186
|
+
{"chart_id": "lieflat-dotty-matrix.svg", "type": "dotty_matrix",
|
|
187
|
+
"catalog_ref": "L8 Dotty Matrix",
|
|
188
|
+
"title_zh": "四阶段反思支架的空间点阵", "title_en": "Four reflection-scaffold phases stacked in space",
|
|
189
|
+
"subtitle_zh": "每层 = 一个干预阶段 · 每点 = 1 项列出的活动 · 强度均匀(无掌握度数据)",
|
|
190
|
+
"subtitle_en": "One layer per phase · one dot per listed activity · uniform intensity (no mastery data)",
|
|
191
|
+
"caption_zh": "点阵单元格来自 intervention.phase_N.activities 的条目数。",
|
|
192
|
+
"caption_en": "Cells come from intervention.phase_N.activities entries.",
|
|
193
|
+
"source": "intervention.phase_groups", "params": {}},
|
|
194
|
+
]
|
|
195
|
+
r_zh["visual_layout"] = visual_layout
|
|
196
|
+
r_en["visual_layout"] = visual_layout
|
|
197
|
+
|
|
198
|
+
(proj_dir / "result.json").write_text(json.dumps(r_en, indent=2, ensure_ascii=False), encoding="utf-8")
|
|
199
|
+
(proj_dir / "result.zh.json").write_text(json.dumps(r_zh, indent=2, ensure_ascii=False), encoding="utf-8")
|
|
200
|
+
print("Enriched writing project")
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
def enrich_coding_project():
|
|
204
|
+
"""RETIRED (v5.2.0): targeted the removed fabricated pack ai-coding-assistant-50.
|
|
205
|
+
|
|
206
|
+
The dir-missing guard makes this a permanent no-op. Do not repoint it at
|
|
207
|
+
real packs — hand-written narrative injection without run records is what
|
|
208
|
+
the provenance policy forbids (docs/plans/v5.2-v6.0-iteration-plan.md R4).
|
|
209
|
+
"""
|
|
210
|
+
proj_dir = EXAMPLES_DIR / "ai-coding-assistant-50"
|
|
211
|
+
if not proj_dir.exists():
|
|
212
|
+
return
|
|
213
|
+
|
|
214
|
+
r_en = json.loads((proj_dir / "result.json").read_text(encoding="utf-8"))
|
|
215
|
+
r_zh = json.loads((proj_dir / "result.zh.json").read_text(encoding="utf-8"))
|
|
216
|
+
|
|
217
|
+
# 1. Human-centered Decision in Chinese
|
|
218
|
+
r_zh["decision"]["summary"] = "准予限制性试点:允许用于报错调试与概念答疑,严禁直接生成整段作业代码。"
|
|
219
|
+
r_zh["decision"]["decision_rationale"] = (
|
|
220
|
+
"【核心结论】准予在高校大学一年级 C 语言编程实验课中开展限制性试点。\n"
|
|
221
|
+
"【实证利弊分析】\n"
|
|
222
|
+
"1. 实验写代码效率翻倍:AI 在解释编译报错与语法示例上提速 40%(+0.64g),初学者因找不准分号或指针报错而放弃编程的比例大幅下降;\n"
|
|
223
|
+
"2. 期末机试极其容易白卷:如果平时作业全靠 Tab 键无脑补全,学生根本无法建立算法心智模型,期末闭卷机试成绩大幅落后 18%(-0.28g);\n"
|
|
224
|
+
"3. 渐退脚手架是唯一出路:只有逐步撤掉 AI 辅助,才能兼顾平时的实验探索积极性与期末的真实独立编程能力。\n"
|
|
225
|
+
"【排课落地 4 阶段建议】\n"
|
|
226
|
+
"• 第 1-4 周(语法破冰):仅允许 AI 解释编译器报错与语法规则,严禁直接生成核心函数;\n"
|
|
227
|
+
"• 第 5-8 周(代码阅读与单测):允许 AI 给出测试用例与概念拆解,核心算法逻辑必须学生手敲;\n"
|
|
228
|
+
"• 第 9-12 周(复杂重构):AI 仅提供代码规范与可读性优化建议,每两周安排一次机房断网无 AI 随堂小测;\n"
|
|
229
|
+
"• 第 13-16 周(闭卷大考):全面关停 AI 助手,期末 100% 独立闭卷机试与笔试。\n"
|
|
230
|
+
"【红线熔断条件】随堂无 AI 闭卷小测通过率低于 60%,或作业代码雷同率超 20%,立即关停该实验室 AI 权限。"
|
|
231
|
+
)
|
|
232
|
+
r_zh["decision"]["strongest_support"] = "实验课编程排错效率提升 40%:AI 即时解释语法与调试指针报错 (+0.64g),大幅减少初学者卡壳挫败感。"
|
|
233
|
+
r_zh["decision"]["key_uncertainty"] = "脱离 AI 后独立上机机试成绩大幅倒退:平时习惯自动补全的学生在闭卷机试中无法独立编写算法 (-0.28g)。"
|
|
234
|
+
r_zh["decision"]["main_risk"] = "支架依赖陷阱:缺乏底层调试与边界测试训练,学生形成‘离开 AI 就不会写代码’的技能退化。"
|
|
235
|
+
r_zh["decision"]["next_action"] = "严格执行 4 阶段脚手架渐退协议:前八周限于报错答疑与读代码,后八周逐步断网实操,期末 100% 独立闭卷机试考核。"
|
|
236
|
+
|
|
237
|
+
# 2. English equivalent
|
|
238
|
+
r_en["decision"]["summary"] = "Authorize restricted pilot: allow for error debugging and concept exploration, forbid whole-problem code synthesis."
|
|
239
|
+
r_en["decision"]["decision_rationale"] = (
|
|
240
|
+
"Core Finding: Authorize restricted introductory programming pilot.\n"
|
|
241
|
+
"Empirical Evidence Balance:\n"
|
|
242
|
+
"1. In-task lab velocity (+0.64g): Instant error explanations reduce novice syntax frustration;\n"
|
|
243
|
+
"2. Solo exam deficit (-0.28g): Passive Tab-completion prevents building mental algorithmic models, hurting closed-book exams;\n"
|
|
244
|
+
"3. Fading scaffolding is essential: Gradually removing AI is the only way to balance novice engagement and independent coding competency.\n"
|
|
245
|
+
"4-Phase Implementation: Phase 1 Syntax explanations -> Phase 2 Code reading -> Phase 3 Refactoring -> Phase 4 Unassisted coding exam.\n"
|
|
246
|
+
"Stop Condition: Pause pilot if unassisted lab pass rate falls < 60% or code duplication > 20%."
|
|
247
|
+
)
|
|
248
|
+
r_en["decision"]["strongest_support"] = "Lab programming velocity improves (+0.64g): AI explains compiler errors and pointer bugs instantly."
|
|
249
|
+
r_en["decision"]["key_uncertainty"] = "Unassisted closed-book coding exam deficit (-0.28g): Relying on code generation hurts independent problem-solving."
|
|
250
|
+
r_en["decision"]["main_risk"] = "Scaffolding dependency trap: Novices fail to develop debugging and computational thinking skills."
|
|
251
|
+
r_en["decision"]["next_action"] = "Deploy 4-phase fading scaffold protocol with bi-weekly unassisted quizzes and mandatory closed-book final exam."
|
|
252
|
+
|
|
253
|
+
# 3. Dynamic Visual Layout
|
|
254
|
+
visual_layout = [
|
|
255
|
+
{"chart_id": "lieflat-parallel-coordinates.svg", "type": "parallel_coordinates",
|
|
256
|
+
"catalog_ref": "L20 Parallel Coordinates",
|
|
257
|
+
"title_zh": "同一批研究跨 g / 样本量 / 质量 / 年份", "title_en": "One study set across g, N, quality and year",
|
|
258
|
+
"subtitle_zh": "一线一篇研究 · 按 |g| 截断前 10 · 各轴独立归一 · 悬停读原始值",
|
|
259
|
+
"subtitle_en": "One line per study · top 10 by |g| · per-axis normalization · hover for raw values",
|
|
260
|
+
"caption_zh": "四个连续维度全部来自 result.json 的 evidence.effect_size / sample_size / quality_score / year。",
|
|
261
|
+
"caption_en": "All four continuous dimensions come from evidence.effect_size, sample_size, quality_score and year in result.json.",
|
|
262
|
+
"source": "evidence.multidim_top", "params": {"limit": 10}},
|
|
263
|
+
{"chart_id": "lieflat-jitter-strip.svg", "type": "jitter_strip",
|
|
264
|
+
"catalog_ref": "G15 Jitter Strip",
|
|
265
|
+
"title_zh": "三个结果维度的效应量分布", "title_en": "Effect-size spread across three outcome dimensions",
|
|
266
|
+
"subtitle_zh": "每点 = 一篇研究的 Hedges' g · 横轴 = g 值 · 确定性抖动避免重叠",
|
|
267
|
+
"subtitle_en": "One dot = one study's Hedges' g · x-axis = g · deterministic jitter avoids overlap",
|
|
268
|
+
"caption_zh": "逐条记录分布(拒绝聚合);数值来自 evidence.effect_size.value。",
|
|
269
|
+
"caption_en": "Record-level distribution (no aggregation); values from evidence.effect_size.value.",
|
|
270
|
+
"source": "evidence.grouped_distribution", "params": {"limit": 60}},
|
|
271
|
+
{"chart_id": "lieflat-hundred-field.svg", "type": "hundred_field",
|
|
272
|
+
"catalog_ref": "L14 Hundred Field",
|
|
273
|
+
"title_zh": "研究设计构成:随机对照 18 · 准实验 32", "title_en": "Design mix: 18 RCTs and 32 quasi-experiments",
|
|
274
|
+
"subtitle_zh": "每格 = 1 篇研究 · 50 格占满百格田的一半 · 色位对应研究设计",
|
|
275
|
+
"subtitle_en": "One cell = one study · 50 cells fill half the field · colors map to study design",
|
|
276
|
+
"caption_zh": "单位诚实:1 格 = 1 篇,不摊假个体;构成来自 evidence.study_design 计数。",
|
|
277
|
+
"caption_en": "Honest units: one cell = one study; composition from evidence.study_design counts.",
|
|
278
|
+
"source": "evidence.study_type_composition", "params": {}},
|
|
279
|
+
{"chart_id": "lieflat-tick-gauge.svg", "type": "tick_gauge",
|
|
280
|
+
"catalog_ref": "F11 Tick Gauge",
|
|
281
|
+
"title_zh": "决策置信度:89%", "title_en": "Decision confidence: 89%",
|
|
282
|
+
"subtitle_zh": "100 格刻度 · 每格 = 1% · 数值来自 decision.confidence_score",
|
|
283
|
+
"subtitle_en": "100 ticks · one tick = 1% · value from decision.confidence_score",
|
|
284
|
+
"caption_zh": "单值进度(0–100%),无单位发明。",
|
|
285
|
+
"caption_en": "Single-value progress (0–100%), no invented units.",
|
|
286
|
+
"source": "decision.confidence_score", "params": {}},
|
|
287
|
+
{"chart_id": "lieflat-ballot-tally.svg", "type": "ballot_tally",
|
|
288
|
+
"catalog_ref": "L15 Ballot Tally",
|
|
289
|
+
"title_zh": "方法学审计:哪些检查项被标记", "title_en": "Methodology audit: which checks got flagged",
|
|
290
|
+
"subtitle_zh": "每 tick = 1 条审计结论 · 实色 = 未达 met · 右端 = 未达标/总数",
|
|
291
|
+
"subtitle_en": "One tick = one audit verdict · filled = below 'met' · right = flagged/total",
|
|
292
|
+
"caption_zh": "各检查项独立计票(0–100 独立口径);数据来自 methodology_reviews.audit_items.status。",
|
|
293
|
+
"caption_en": "Independent tally per audit item; data from methodology_reviews.audit_items.status.",
|
|
294
|
+
"source": "methodology.flag_rates", "params": {}},
|
|
295
|
+
{"chart_id": "lieflat-matrix-heat.svg", "type": "matrix_heat",
|
|
296
|
+
"catalog_ref": "L16 Matrix Heat",
|
|
297
|
+
"title_zh": "年份 × 结果维度:证据如何逐年堆积", "title_en": "Year × outcome: how evidence accumulated",
|
|
298
|
+
"subtitle_zh": "格内数字 = 研究数 · 明度 = 计数/最大值 · 保留矩阵结构",
|
|
299
|
+
"subtitle_en": "Cell number = study count · lightness = count / max · matrix structure kept",
|
|
300
|
+
"caption_zh": "两个离散维度 × 计数;数据来自 evidence.year 与 outcome_dimension。",
|
|
301
|
+
"caption_en": "Two discrete dimensions × counts; from evidence.year and outcome_dimension.",
|
|
302
|
+
"source": "evidence.year_x_outcome_counts", "params": {}},
|
|
303
|
+
]
|
|
304
|
+
r_zh["visual_layout"] = visual_layout
|
|
305
|
+
r_en["visual_layout"] = visual_layout
|
|
306
|
+
|
|
307
|
+
(proj_dir / "result.json").write_text(json.dumps(r_en, indent=2, ensure_ascii=False), encoding="utf-8")
|
|
308
|
+
(proj_dir / "result.zh.json").write_text(json.dumps(r_zh, indent=2, ensure_ascii=False), encoding="utf-8")
|
|
309
|
+
print("Enriched coding project")
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
if __name__ == "__main__":
|
|
313
|
+
enrich_math_project()
|
|
314
|
+
enrich_writing_project()
|
|
315
|
+
# enrich_coding_project() retired with the fabricated ai-coding-assistant-50 pack.
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""evidence_matrix.py — Build the Evidence Matrix (plan section 15).
|
|
3
|
+
|
|
4
|
+
Standard presentation:
|
|
5
|
+
|
|
6
|
+
| Claim | Outcome | Support | Contradiction | Quality | Directness | Verdict |
|
|
7
|
+
|
|
8
|
+
Users should not need to read a long report first; the Evidence Matrix is one
|
|
9
|
+
of the primary product surfaces.
|
|
10
|
+
|
|
11
|
+
Usage:
|
|
12
|
+
python scripts/evidence_matrix.py examples/ai-coding-assistant/evidence.jsonl [--out matrix.md]
|
|
13
|
+
"""
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import argparse
|
|
17
|
+
import json
|
|
18
|
+
import sys
|
|
19
|
+
from pathlib import Path
|
|
20
|
+
|
|
21
|
+
from evidence_score import quality_score
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def load_evidence(path: Path) -> list[dict]:
|
|
25
|
+
records = []
|
|
26
|
+
for lineno, line in enumerate(path.read_text(encoding="utf-8").splitlines(), 1):
|
|
27
|
+
line = line.strip()
|
|
28
|
+
if not line:
|
|
29
|
+
continue
|
|
30
|
+
try:
|
|
31
|
+
records.append(json.loads(line))
|
|
32
|
+
except json.JSONDecodeError as exc:
|
|
33
|
+
raise ValueError(f"{path}:{lineno}: invalid JSON: {exc}") from exc
|
|
34
|
+
return records
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def evidence_matrix(evidence_list: list[dict]) -> list[dict[str, str]]:
|
|
38
|
+
"""Aggregate evidence into matrix rows keyed by (claim, outcome)."""
|
|
39
|
+
rows: dict[tuple[str, str], dict[str, list]] = {}
|
|
40
|
+
for ev in evidence_list:
|
|
41
|
+
key = (ev.get("claim", ""), ev.get("outcome_type", ""))
|
|
42
|
+
row = rows.setdefault(key, {"claim": key[0], "outcome": key[1],
|
|
43
|
+
"support": [], "contradiction": [], "neutral": [],
|
|
44
|
+
"quality": [], "directness": []})
|
|
45
|
+
# Three directional columns (review P1-1): support / contradict /
|
|
46
|
+
# neutral are never mixed — a null result is not a counter-argument,
|
|
47
|
+
# and it must not inflate the tribunal's conflict picture.
|
|
48
|
+
direction = ev.get("direction", "neutral")
|
|
49
|
+
bucket = {"support": "support", "contradict": "contradiction"}.get(
|
|
50
|
+
direction, "neutral")
|
|
51
|
+
row[bucket].append(ev.get("evidence_id", "?"))
|
|
52
|
+
|
|
53
|
+
dims = ev.get("quality_dimensions", {})
|
|
54
|
+
if ev.get("quality_score") is None and dims:
|
|
55
|
+
row["quality"].append(quality_score(dims))
|
|
56
|
+
elif isinstance(ev.get("quality_score"), (int, float)):
|
|
57
|
+
row["quality"].append(float(ev["quality_score"]))
|
|
58
|
+
directness = dims.get("D5_directness", 0)
|
|
59
|
+
row["directness"].append(float(directness) if isinstance(directness, (int, float)) else 0.0)
|
|
60
|
+
|
|
61
|
+
result = []
|
|
62
|
+
for key, row in sorted(rows.items()):
|
|
63
|
+
quality = sum(row["quality"]) / len(row["quality"]) if row["quality"] else None
|
|
64
|
+
directness = sum(row["directness"]) / len(row["directness"]) if row["directness"] else 0.0
|
|
65
|
+
verdict = _verdict(row["support"], row["contradiction"],
|
|
66
|
+
row["neutral"], quality)
|
|
67
|
+
result.append({
|
|
68
|
+
"claim": row["claim"],
|
|
69
|
+
"outcome": row["outcome"],
|
|
70
|
+
"support": ", ".join(row["support"]) or "-",
|
|
71
|
+
"contradiction": ", ".join(row["contradiction"]) or "-",
|
|
72
|
+
"neutral": ", ".join(row["neutral"]) or "-",
|
|
73
|
+
"quality": f"{quality:.1f}/10" if quality is not None else "-",
|
|
74
|
+
"directness": f"{directness:.1f}/2",
|
|
75
|
+
"verdict": verdict,
|
|
76
|
+
})
|
|
77
|
+
return result
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def _verdict(support: list, contradiction: list, neutral: list,
|
|
81
|
+
quality: float | None) -> str:
|
|
82
|
+
if contradiction and not support:
|
|
83
|
+
return "CONTRADICTED"
|
|
84
|
+
if not support and not contradiction and neutral:
|
|
85
|
+
return "NEUTRAL"
|
|
86
|
+
if not support and not contradiction:
|
|
87
|
+
return "NO_EVIDENCE"
|
|
88
|
+
if quality is None or quality < 5:
|
|
89
|
+
return "WEAK"
|
|
90
|
+
if contradiction:
|
|
91
|
+
return "CONFLICTED"
|
|
92
|
+
if quality >= 7:
|
|
93
|
+
return "SUPPORTED"
|
|
94
|
+
return "PARTIALLY_SUPPORTED"
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def render_markdown(matrix: list[dict[str, str]]) -> str:
|
|
98
|
+
header = ("| Claim | Outcome | Support | Contradiction | Neutral "
|
|
99
|
+
"| Quality | Directness | Verdict |")
|
|
100
|
+
sep = "|---|---|---|---|---|---|---|---|"
|
|
101
|
+
lines = [header, sep]
|
|
102
|
+
for row in matrix:
|
|
103
|
+
claim = row["claim"].replace("|", "\\|")
|
|
104
|
+
lines.append(
|
|
105
|
+
f"| {claim} | {row['outcome']} | {row['support']} | {row['contradiction']} "
|
|
106
|
+
f"| {row['neutral']} | {row['quality']} | {row['directness']} "
|
|
107
|
+
f"| {row['verdict']} |")
|
|
108
|
+
return "\n".join(lines)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
def main() -> int:
|
|
112
|
+
parser = argparse.ArgumentParser(description="Build the Evidence Matrix from evidence JSONL")
|
|
113
|
+
parser.add_argument("evidence", help="Path to evidence.jsonl")
|
|
114
|
+
parser.add_argument("--out", help="Optional output markdown path")
|
|
115
|
+
args = parser.parse_args()
|
|
116
|
+
|
|
117
|
+
evs = load_evidence(Path(args.evidence))
|
|
118
|
+
matrix = evidence_matrix(evs)
|
|
119
|
+
md = render_markdown(matrix)
|
|
120
|
+
if args.out:
|
|
121
|
+
Path(args.out).write_text(md + "\n", encoding="utf-8")
|
|
122
|
+
print(f"wrote {args.out} ({len(matrix)} rows)")
|
|
123
|
+
else:
|
|
124
|
+
print(md)
|
|
125
|
+
return 0
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
if __name__ == "__main__":
|
|
129
|
+
sys.exit(main())
|