Repository navigation
[PR] feat: verif module kickoff — sub-language guard for Tier A kernel decision core + TS→z3 symex MVP + counterexample replay lock - #3861
Conversation
…ision core + TS→z3 symex MVP + counterexample replay lock Piece 1 (guard): allowlist-based AST scan over the 10 Tier A files (#3848). Unrecognized builtins/methods/imports, async, generators, classes, eval-family, env access, and escaping closures all turn CI red. Exceptions must be registered (file+rule+function+reason); a stale exception is itself a failure. Current stock: 4 exceptions + 1 excluded function (optional BPE probe), each with a stated reason. Piece 2 (symex MVP): translates real function bodies from source into z3 (Int domain) via DAW value-merge (linear in if-count, no path enumeration). First proof on refs.ts indexToRef: in-bounds [1, 9999999] no-throw = UNSAT; out-of-bounds solver witness replays as RangeError on the real compiled function; a deliberately skewed boundary lens produces a phantom witness that the replay lock catches as REPLAY MISMATCH. z3-solver (wasm) added as devDependency; tsconfig include gains verif/. No production code touched; guard constrains only the listed files.
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.4560-pr.3861.cc3b555This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3861.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。 独立检索了 open+closed 的 issue 与 PR(关键词 verif / symbolic / z3 / subset guard / 子语言守卫 / 符号执行):无既有同主题条目或并行 PR。相关条目均为本单自身链路——#3848(路线,owner 已拍板)、#3853(本 PR 的 kickoff issue, 标签: pr + scope/ci + p3 —— 纯增量 CI/测试基建(dev tooling + devDependency),零生产代码改动、无用户可见故障面,功能类不打 bug。 开始审核:先核对分支代码与 diff 完整性,再跑定向测试(guard/symbolic 两个文件),最后按八问给结论。注:当前到 GitHub 的网络瞬断(connection reset),CI check-run 状态稍后补查;本地 ref 已有 PR head |
(ai: vllm-qwen/qwen3.8-27b) 审查结论:可合并。 本地定向验证全绿(guard 23/23 + symbolic 6/6 + typecheck 干净);CI check-run 状态待补——沙箱到 GitHub 的出口网络当前中断(连接被重置,重试多次),按纪律全量回归以远端 CI test 腿为准,恢复后我补一条 CI 确认。 独立验证做了什么(不复述 PR 描述,全部自己重跑/重读)
结构化八问
非阻塞发现(已同步登记到 #3848 路线清单,含修法):① 守卫缺 判定:两项验收标准(守卫进 CI 且 Tier A 全绿 + 每个偏差有显式理由;symex 首靶「界内无反例」+ 注入歪斜即红)均达成且经独立复现;方向符合路线、diff 干净、测试有牙。可合并——建议先 rebase 最新 master(当前落后 190 提交、无冲突),push 后看 CI test 腿绿即可合。 |
Closes #3853 (kickoff deliverable of the #3848 route).
交付内容
1. 子语言守卫(独立有效,立刻进 CI)
verif/subset-guard.ts+verif/guarded-files.ts+verif/exceptions.ts;tests/verif-subset-guard.test.ts(23 用例)随tests/*.test.ts自动收集,各 OS 腿都会跑(约 1s)2. 符号执行器 MVP(真代码,不是模型)
verif/symbolic.ts:tsc AST → z3(Int 域);DAW 值合并——每个变量持 (值,条件) 对列表,读时折成 ITE 链,路径数与 if 数线性,不枚举路径verif/replay.ts:回放锁——被验证的始终是真代码,翻译器只是镜头,镜头歪了当场暴露UnsupportedShape大声拒绝未建模形状(循环、switch、除模、字符串运算、正则、组合子、跨函数调用)——静默近似被设计禁止;无循环体的「界内无 throw」证明是 sound 的,throw 可达性 witness 可能过近似(故必须回放)风险与成本
后续(#3848 路线,不在本 PR)
数组组合子内联 → 符号消息序列;正则 → z3 re.;padStart/int→str 精确化;不变量 oracle(结构树比较);然后逐个打靶 #3676/#3691/#3769/#3805。
验证
本地定向:typecheck 干净 + 29/29 通过(guard 23 + symbolic 6);全量回归以远端 CI test 腿为准。