cflmy
73bf574a55
ci: proof.yml Full sweep 接真任务——40 夹具单调性 + T4 一致性 + 分歧注入红线
...
- corpus monotonicity(offline_checked ⊆ lean_proved)与 T4 差分一致性
进 CI(MARQDO_PROOF_REQUIRE_LEAN=1);
- Full sweep 改为分歧注入红线:--fault-inject offline-claim 必须触发
error[proof.divergence] 且退 1,护栏失灵(静默落绿)即 CI 失败;
本地实测 exit=1 + proof.divergence 诊断。
2026-11-18 10:28:18 +08:00
cflmy
4fae71342d
prove: P3 — --all 目录模式、T4 差分一致性、库语义对齐、2.8.0 收口
...
- main.rs:prove --all/--max-files(递归收集,目录不带 --all 拒绝;
聚合 JSON kind=prove-all,整体状态差者胜);--fault-inject offline-claim
(调试分歧注入,A3 护栏验证入口)
- tests/conformance.rs:T4 差分一致性——5 例纯函数语料(算术/中文标识符/
分支比较/字符串拼接/i64 边界)解释器求值 == Lean example(simp+try rfl);
B4 result.ok 结构字段 access 两侧一致
- MarqdoProof.lean:mqAdd 补文本拼接与 num 混合(与解释器 eval_binary(Add)
对齐——T4 实测抓出的真分歧);mqDisplay 显示串(标量精确,容器一层,
有意简化并记录)
- 文档:design §12 P3 落地 + §12.4 延期理由(foreach/assume-guarantee/T3
→ 2.9)+ §12.5 权限受限待合入清单;roadmap 状态 → 已实施;
教程 §13.8 prove 章节;skills/marqdo/reference.md 定理表;
doc/verification/skill-proof-theory.md(库形式化说明);
doc/roadmap/prove-release-2.8.0.md(双语发版说明 + CHANGELOG/README/
skills/marqdo-dev prove 任务待合入原文)
- Cargo.toml/Cargo.lock:2.7.1 → 2.8.0
实测:全量 516 通过(仅 2 个已记录环境基线失败);prove 23 + prove_lean 10
+ corpus 40 夹具 + conformance 6 例全绿;biz 定理 proved、假定理反例、
--all 聚合与护栏目录模式同样生效。
2026-11-18 10:28:18 +08:00
cflmy
63d60e3ba1
prove: P2 — 离线符号执行(F1–F5)+ 单调性护栏 + 语料库
...
- offline.rs:SymVal 符号执行(Const/Struct/OpResult/Param/Unknown);
If 分支克隆状态并接续后续语句(修复 Return-in-outer 编排丢结果);
可行性检查(前提∩路径条件为空 → 空真关闭,Lean 假设矛盾同构);
F2 轨迹包含/长度、F3 构造器结构求值、F4 自由原子二分、
F5 区间:字面重述关闭 + 区间违反反例(区间端点见证,如 金额 = 10001);
区间蕴含保守 unverified(当前 Lean 脚本无 Val 传递引理,先于 Lean
关闭即触发 divergence——诚实优先)
- 判定编排:离线先行(毫秒级 checked ≠ proved)→ Lean 复核升级 proved;
分歧护栏:checked 但 Lean 关不掉 / 反例被 Lean 证出 ⇒
error[proof.divergence] 退 1 永不落绿;MARQDO_PROOF_INJECT_DIVERGENCE 验证
- emit:try split 按 if 嵌套深度重复(三路分支可达);simp 清单补
mqResultError/mqValueOr/mqAnd/mqOr/mqNot(分歧护栏暴露)
- tests/prove_corpus.rs:8 类 × 5 = 40 夹具语料库,
offline_checked ⊆ lean_proved 强制 + 无 Lean 禁 proved;
f5_interval_closure_scope 单测锁定 F5 诚实范围
- 设计文档 §12 记录 P2 落地、修复与文法限制
实测:biz 3 定理离线 checked→Lean proved;假定理反例 金额 = 10001
指回定理表行;注入分歧 → error/divergence 退 1;全量 516 通过
(仅剩 2 个已记录环境基线失败)。
2026-11-18 10:28:18 +08:00
cflmy
44d2928c06
prove: P1 — Lean 判定接入 CLI(driver + 证书缓存 + CI)
...
- driver.rs:工具链发现(--lean → MARQDO_PROOF_LEAN → PATH;显式坏路径
error[proof.lean_missing] 不回退);MarqdoProof 库内嵌进二进制,按内容
哈希缓存、lean -o 直接构建(运行时零 lake/elan 依赖);lean 调用带超时
(--timeout/--heartbeats);unsolved→unproved、error→error、
sorry→unverified;-- mq: 注释 + 定理头注释 → 证据映射指回源行
- cache.rs:复合键证书(源码⊕plan⊕库sha256⊕lean版本⊕版本),
命中跳判定(lean.cache: hit),--no-cache/MARQDO_PROOF_NO_CACHE 绕过
- mod.rs:per-claim 判定面(status/decided_by/evidence/source_line)、
lean JSON 对象、proof.claim_failed 诊断;文件状态只聚合有定理与被拒函数
- main.rs:--lean/--timeout/--no-cache/--heartbeats 旗标;prove emit
子命令只生成不判定;策略 none → sorry(绝不冒充 proved)
- tests/prove_lean.rs:A1/E1/E4/F2/F3/F4/G1/G2/G2b 矩阵,无工具链 SKIP、
MARQDO_PROOF_REQUIRE_LEAN=1 硬性要求;实测抓出并修复错误行/列解析、
逐定理记录缺失、含点函数名归因三处判定缺陷
- CI proof.yml:装 Lean 4.35.0 → 底座校验 → 判定矩阵(CI 不许静默降级)
- 设计文档 §12 记录 P1 落地与偏差(直接 lean -o,不经 lake)
实测:业务样例 3 定理 proved;假定理 unproved 退 1 指回定理表行;
缓存命中后跳判定(假 lean 计数器验证);全量 Rust 测试 508 通过
(仅剩 2 个已记录环境基线失败)。
2026-11-18 10:28:18 +08:00
cflmy
fa832268b3
prove: fix issues found in Lean verification round
...
- p2_len fixture claim corrected: pure function's trace is always empty,
so '长度(轨迹) = 2' was an authoring mistake -> '长度(轨迹) = 0'
(Nat-path coverage unchanged); all 7 claim-bearing files now prove
- generated Lean headers set linter.unusedVariables/unusedSimpArgs off:
machine-emitted artifacts should not trigger human-authoring lints
(0 warnings now)
- verification driver script + updated results in design doc 12 and
library README
2026-11-18 10:28:18 +08:00
cflmy
9576188a2e
prove: real Lean 4.35.0 verification round
...
- MarqdoProof semantic base (Val + mq* helpers + branch-contradiction
lemmas, no axiom/opaque), lake-built; sources under doc/verification/
- emitter: ASCII-only namespaces (uXXXX encoding), guillemet wrapping
for all non-ASCII identifiers, ':' -> '_' inside op ctor names,
ctor pattern arg binding, ASCII-safe rename forms, placeholder ctor
via op_ctor, flipped run equation (outputs on the left), try-split
for branchless bodies, validated proof script (simp_all + .elim
contradiction + omega)
- business example: 3/3 theorems proved by real Lean; 5/6 claim
fixtures proved, p2_len honestly unproved (false claim)
- design doc section 12: Lean round findings + results
2026-11-18 10:28:18 +08:00
cflmy
528a1f0dbc
prove: fix 4 review defects (honesty + compilability) + business validation
...
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.
2026-11-18 10:28:18 +08:00
cflmy
a11b347659
prove: add marqdo prove (P0 emit/audit + P1 claim tables & check --proof)
...
Language layer (ADR 0010):
- claim tables (定理|结论|前提|策略) parsed before first executable
statement, extracted into Function.claims, removed from body
- check --proof (default off): proof.claim_malformed / claim_ambiguous /
claim_misplaced / claim_duplicate / claim_unknown_symbol /
claim_unsupported / name_shadow
Runtime layer (src/prove/):
- ir.rs: Plan IR with stable hand-rolled JSON (schema 1)
- lower.rs: subset acceptance (proof.while / proof.recursion /
proof.dynamic_call), inlining for straight-line pure callees, opaque
ops with effect labels, --allow-opaque whole-function downgrade
- types.rs: literal-driven inference + branch confluence
(proof.type_mismatch, exit 1)
- emit.rs: deterministic Lean emission (Val × List Op, continuation
style, -- mq: line:col anchors, «…» for dotted idents, theorem
scaffolds from claims with unfold/split script)
- mod.rs: prove/emit/audit/clean commands, Verdict taxonomy
(error > unproved > rejected > unverified > checked > proved),
exit codes 0/1/2 per design §3.3
Tests: tests/prove.rs 19 integration cases (no Lean required) + module
unit tests; full suite stays green except the 3 documented
env-limited failures.
Docs: doc/design/prove-cli.md (§12 records deviations: result.ok/error
vs drafted success/failure, Val-based run at P1, op arity, opaque
effect label), doc/roadmap/prove.md, doc/adr/0010.
Env fixes carried in: scratch dirs in test helpers honor
CARGO_TARGET_DIR (needed on this machine's read-only target/debug).
2026-11-18 10:28:18 +08:00
cflmy
8e437e2cd3
ci(agent): permit native ABI loading in offline Agent integration tests
2026-11-18 10:17:47 +08:00
cflmy
23229a6ac9
ci(agent): permit native ABI loading in offline Agent integration tests
2026-11-18 10:17:44 +08:00
cflmy
58b65215a1
test(agent): show the failed native choice result in interpreter smoke diagnostics
2026-11-18 10:16:43 +08:00
cflmy
92c3f80055
fix(agent): compare branch labels using explicit text conversion
2026-11-18 09:59:27 +08:00
cflmy
8a66f803cb
feat(agent): add validated forward-only branching from model choices to registered SKILL steps
2026-11-18 09:59:16 +08:00
cflmy
3ce59a4da8
test(ai): verify JSON-formatted small-model option parsing from Marqdo
2026-11-18 09:57:47 +08:00
cflmy
90688741c5
feat(agent): parse bounded JSON choice envelopes without relaxing skill allowlist
2026-11-18 09:57:37 +08:00
cflmy
70b88b3767
security(agent): require explicit read-only classification before automatic SKILL/parallel dispatch
2026-11-18 09:57:06 +08:00
cflmy
f859e6eeea
test(ai): include required short model prompt in workflow fixture
2026-11-18 09:56:55 +08:00
cflmy
6705e2e6b7
fix(agent): require explicit local prompt for model workflow steps
2026-11-18 09:56:49 +08:00
cflmy
6e8a62928b
test(ai): verify plugin-only tick returns waiting input and commits final step
2026-11-18 09:56:39 +08:00
cflmy
398a0b7222
ci(agent): introduce focused plugin-only native workflow gate separate from long EK suite
2026-11-18 09:56:28 +08:00
cflmy
e8f1a3e126
fix(agent): deduplicate equivalent numbered and labeled user replies
2026-11-18 09:56:16 +08:00
cflmy
8ea56cbe30
test(ai): exercise ABI failed-only recovery without executing already successful children
2026-11-18 09:55:42 +08:00
cflmy
8085d06124
feat(ai): expose failed-only read-only child recovery as a short Marqdo workflow
2026-11-18 09:55:30 +08:00
cflmy
6f929dc2da
feat(agent): publish safe partial fan-out recovery through Agent ABI
2026-11-18 09:55:19 +08:00
cflmy
dd22180269
feat(agent): recover failed read-only children only, preserving successful subtask results
2026-11-18 09:55:11 +08:00
cflmy
cc48bf6d05
docs(agent): document plugin-only durable step state engine and safety boundaries
2026-11-18 09:54:45 +08:00
cflmy
19f986953a
test(ai): prove successful parallel child outputs survive failed sibling and checkpoint reload
2026-11-18 09:54:21 +08:00
cflmy
770dee5199
fix(agent): prevent EffectLedger atomic temp collisions under parallel operations
2026-11-18 09:54:06 +08:00
cflmy
f6612813e3
fix(agent): remove resume test global cwd races and make atomic temp names unique
2026-11-18 09:53:58 +08:00
cflmy
643ea06340
feat(ai): add one-step native workflow driver for model input and bounded child tasks
2026-11-18 09:53:17 +08:00
cflmy
0cd64a7450
fix(agent): persist partial child outcomes and require verified process success before workflow commit
2026-11-18 09:53:02 +08:00
cflmy
981faac022
ci(ai): test native workflow plugin through actual Marqdo interpreter
2026-11-18 09:52:42 +08:00
cflmy
f818834ec1
test(ai): exercise ABI-only durable workflow in actual Marqdo interpreter
2026-11-18 09:52:35 +08:00
cflmy
8d47507d15
feat(ai): expose a concise ABI-backed durable workflow library
2026-11-18 09:52:13 +08:00
cflmy
1e1f05c087
feat(agent): register ABI workflow state transitions and cancellation
2026-11-18 09:51:59 +08:00
cflmy
06e61efc51
feat(agent): implement plugin-only durable step workflow with deterministic next/commit/cancel and tests
2026-11-18 09:51:51 +08:00
cflmy
2dfa0b2a5b
fix(ai): do not mistake LLM transport errors for choices or trigger format repair
2026-11-18 09:46:24 +08:00
cflmy
629ad8ed39
feat(agent): tolerate short deterministic small-model selection phrases
2026-11-18 09:43:59 +08:00
cflmy
ee677478be
test(ai): verify file/class/function context composition in Marqdo interpreter
2026-11-18 09:43:30 +08:00
cflmy
edbf241d99
feat(ai): compose current user and scoped file/class/function source into a bounded context pack
2026-11-18 09:43:24 +08:00
cflmy
add6a7d32c
docs(agent): record implemented contracts and precise VM/runtime completion gates
2026-11-18 09:42:07 +08:00
cflmy
c64ec99115
feat(ai): expose minimal ask/start/wait on top of native LLM and subtask APIs
2026-11-18 09:41:28 +08:00
cflmy
60a3b84a84
test(ai): exercise durable input and reply from a real Marqdo program
2026-11-18 09:41:08 +08:00
cflmy
02a4f2d20d
fix(agent): skip YAML setext lookalikes in document-scope parser
2026-11-18 09:40:50 +08:00
cflmy
88490e3092
ci(ai): execute real native choice and scoped-context Marqdo smoke
2026-11-18 09:40:15 +08:00
cflmy
9031c106a1
test(ai): add offline Marqdo interpreter smoke for native choice and scoped context
2026-11-18 09:40:08 +08:00
cflmy
633436e40f
fix(agent): compare owned JSON values with dereferenced optional identity values
2026-11-18 09:39:53 +08:00
cflmy
cf73fcf1ef
feat(ai): add allowlisted SKILL enter via standard Marqdo subtasks
2026-11-18 09:39:37 +08:00
cflmy
e48fd5b0f4
feat(ai): aggregate concurrent child status without losing successful siblings
2026-11-18 09:39:06 +08:00
cflmy
b2f97e72c3
build(agent): lock pulldown-cmark dependency for native scoped context
2026-11-18 09:38:58 +08:00