Code review after the initial prove commit found and fixed: 1. Calls inside table/list literals were silently dropped — a function with side-effectful cells lowered to "no ops" and claimed purity in Lean. lower_expr's fallback now rejects with proof.unsupported (author must bind the call to a variable first). 2. Same-callee call sites with different arities (optional params) shared one Op whose ctor declared the first-seen arity, emitting uncompilable Lean. register_op now suffixes `/N` per arity. 3. proof.name_shadow fired once per walked function (N functions → N duplicates) and checked params of claim-free functions. Predicate check runs once per module; param check only for functions that carry claims. 4. 长度(轨迹) = 2 emitted mqEq (Nat) (Val) — type-mismatched Lean. Nat-context detection renders trace-length comparisons natively; untranslatable shapes become comments instead of broken Lean. Hardening: lean_ident reserves 轨迹₀ / h_前提 (theorem binder collision); emit_theorems dedups repeated claim ids. Tests: +4 integration regressions (p2_a..p2_d), 23 prove tests total; full suite green except the documented env-limited failures (one host::foreign_session flake passes standalone). Business validation (doc §12): e-commerce order-approval SKILL with 3 theorems cross-checked against the real interpreter — 5000 → auto (1-step trace), 20000/60000 → manual ticket T-20000/T-60000 (需人工→创建, exactly 2 steps); corrupted claim tables hit check --proof codes while staying default-off; double emit byte-identical.
测试夹具(金样例)
金样例与集成测试同处 tests/,用子目录区分类别。设计见 examples-and-tests.md。
| 路径 | 内容 |
|---|---|
structure/ |
函数、调用、分支、循环、表、导入、位置实参 |
keywords/ |
print、布尔与 and/or/not |
markup-v03/ |
Markup v0.3 草案金样例(#[ignore] 至旗标落地;见目录 README) |
errors/ |
期望失败(诊断文案) |
web_handbook.rs |
直接执行双语 Web 手册,验证递归布局参考工程的离线/在线一致性;先构建 Web 插件 |
quantum_handbook.rs |
直接执行 Quantum 双语手册围栏,校验科学期望、真实契约及双后端;先构建量子插件 |
gold.rs |
集成测试:跑上述夹具并比对 stdout / stderr |
cargo test
marqdo run tests/structure/hello.mq.md
marqdo view tests
marqdo catalog tests -o .marqdo
面向访客的可执行介绍在 public/(不含 errors/),见 user-site.md。