Commit Graph

5 Commits

Author SHA1 Message Date
hongjr03 79505e6d44 fix: use startedAt instead of createdAt in trigger integration test
AgentRun model has startedAt, not createdAt. Codex introduced this
typo when refactoring the trigger queue integration tests.
2026-07-08 23:30:28 +08:00
sjfhsjfh ebcb3a7589 feat(model+spec): .cph-version 契约文件 + CphVersionMismatch 诊断(ADR-0016);bump 0.0.2
教研工程文件根放 .cph-version(内容=面向的 cph 版本)。cph 加载时比对自身版本
(CARGO_PKG_VERSION),不相容报 CphVersionMismatch error 并拒绝。当前判定为版本完全
相等(MVP);判定逻辑孤立在 versions_compatible 单谓词,后续可放宽为 semver 区间而
不动诊断分类/spec/CLI。

spec(7 类诊断,原 6 类):
- Diagnostic.lean: DiagKind 增 cphVersionMismatch(error 级),分类注释 6→7
- Pipeline.lean: load 阶段含 .cph-version 兼容性判定
- Courseware.lean: ADR 区间 →0016

实现:
- cph-diag: DiagCode::CphVersionMismatch("E-CPH-VERSION")
- cph-model: load() 解析 manifest 成功后 check_cph_version;versions_compatible
  谓词(完全相等);CPH_VERSION const。missing .cph-version 暂跳过(迁移期 OPEN);
  空文件报 error
- examples/TH-141、valid/mini fixture、KenKen 课各加 .cph-version=0.0.2

测试:cph-model 4 个版本门测试;全 workspace 53 passed;lake 25 jobs 绿。
负向验证:9.9.9 .cph-version → E-CPH-VERSION error + check 拒绝(exit 1)。

bump: workspace.package 0.0.1→0.0.2;cph --version 报 cph 0.0.2;README 同步
(含版本契约说明)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 16:03:54 +08:00
sjfhsjfh cadf8ad0d3 test(examples): TH-141 to template model — exports/*.typ + manifest v2 (WU-E')
Acceptance fixture for ADR-0011's template build model. TH-141 gains
exports/student.typ + exports/teacher.typ (the framework default templates,
copied from render/templates/ — these should be auto-seeded at project creation,
out of scope this round). manifest.toml [targets.*] converted to v2: artifact =
{type="single-file", filepath} + a typst-compile step naming the template;
numbering removed (it now lives in the template).

Verified end-to-end through the new path (template compiled as main + augmented
manifest, no generated driver): `cph check` → 0 errors/0 warnings; `cph build`
student → 9pp PDF, teacher → 12pp PDF; numbering correct (一、 / 2.1 / 2.2, zero
"二、一"); real content rendered.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22 10:06:31 +08:00
sjfhsjfh c93503de50 test(examples): TH-141 declares structured target build config (WU-E)
Acceptance fixture for the export-as-build model. TH-141's [targets.student] /
[targets.teacher] now carry artifact = "single-file" + an explicit per-level
heading numbering override (一、 / 1.1 / 1.1.1), exercising ADR-0009's
file-resident override path end-to-end.

Verified: `cph check` → 0 errors / 0 warnings; `cph build` both targets → PDFs
(student 9pp, teacher 12pp) with correct numbering — zero "二、一" occurrences
(the bug the override layer was missing to fix). numbly resolves offline through
the embedded engine via the vendored package.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22 08:49:21 +08:00
sjfhsjfh c73a2c903f feat(examples): migrate TH-141 sample to declarative layout (WU-6)
Real-content fixture for the end-to-end pipeline. TH-141 (39 parts: 22 segment,
15 lemma, 2 example) migrated from the prototype's typst `#let parts` manifest
to ADR-0008: declarative manifest.toml (project+info+ordered parts+targets) +
per-element element.toml (kind + scalars; examples carry `source`). Content .typ
files copied byte-identical (no math corruption); per-element main.typ + meta.toml
dropped (wiring is now generated). Part order matches source exactly; 5 lemmas
have no proof.typ (optional); no cross-file imports / paralearn refs / figs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22 01:33:40 +08:00