Repository navigation
[PR] verif judges batch 2: view-latch / anthropic / google / conflict-watch / snapshot-render + engine soundness fixes — finds #4052 | verif 判官第二批 + 引擎健全性修复 - #4071
Merged
Conversation
added 7 commits
October 20, 2026 23:06
Symbolic: applyViewLatch through the real translator with fully-free texts/ids/refs/latch bytes; Q1 UNSAT — on a quiet turn the latched bytes replay verbatim for ANY input values (empty-id, CCR-placeholder and BLOCKED-ref domains pinned as documented unlatchable classes). Prefix guard witnesses surfaced a real engine bug: Term.prefixOf/suffixOf emitted SMT-LIB arguments swapped ((str.prefixof s t) means s is a prefix of t) — fixed to JS receiver.startsWith semantics. Q2 (fresh pass-through) kept as diagnostic only: nested loop+branch array-slot merges still admit ghost arms (false SAT); the concrete matrix pins the property on real code — quiet replay / arrival latch / fold reset / steady-state no-churn. Gap documented in README. 17/17 verif tests green.
Two real soundness defects, both found by the view-latch pass-through property refusing to go UNSAT: 1. Symbolic-key read fan first layer used iteVal: merging an obj/arr entry with its null neutral LOST the nullUnder tag, so prev?.[ref] with a key MISS still handed out the entry (truthy + phantom field reads). fanLayer now uses iteStrict; member() gates every field read of a nullUnder object by ¬nullUnder. 2. mergeVal array one-arm slots collapsed via undef-loses: a branch's pushed value became unconditionally reachable (ghost arm). One-arm slots now use guardedNeutral(cond, v) — the value carries its branch guard inside. Domain note: distinct raw ids hold distinct numeric refs in real byRaw states — pinned r1≠r2 (same-ref-different-id is unreachable; the equal-ref witness was CORRECT latch semantics, not a bug). Q2 (fresh messages pass their own transform output through) is now asserted and UNSAT; README known-gap section replaced with the fix record. 17/17 green.
…te-back fixes
Engine (verif/symbolic.ts):
- invokeCallback write-back must read the PRE-CALL env value before any
target write: when target0 IS env.vars, its own set(k, v) made later
targets' skip check see the updated map and skip the caller frame —
the caller's stale copy then won the next iteration merge and the
closure's push was lost (flush() pattern: out.len 1 instead of 2).
- switch clauses start from a COMMON pre-switch base frame (copying the
accumulated frame let later arms see earlier arms' pushes — iteration
merges fused two arms' objects into field-union ghosts); empty case
labels are grouping, not fallthrough (openai.ts system/developer).
- callback and inline-call PARAMETER BINDING restored (arrows now bind
Identifier params + ArrayBindingPattern elements, later defaults may
read earlier params).
- Object.keys/entries/values over concrete fields + symbolic-key
bindings (fan read); string slice folds known-string/const-start
slices (keeps JSON.parse(raw.slice(raw.indexOf('{'))) concrete).
- member() on null/undefined reads as undef; typeof/Array.isArray
const answers on non-num/undef.
Harness tests/verif-wire-anthropic-roundtrip.test.ts (#3848 phase 2):
parse+rebuild over the real anthropic codec with symbolic block types
and payloads. Same-role pairs: first/second rebuilt block must carry
block 1/2's type+payload (UNSAT-asserted); thinking keeps its own
message after a same-role group (cross-message order, UNSAT-asserted);
real-code replay baseline pins both directions.
Suite 20/20.
Engine bug (ret null with zero degradations): a break/continue inside a loop left breakCond set on the RunState when the loop handler returned — the flag was never consumed. execSeq then treated post-loop statements as unreachable (stopCond === "true" skips the rest-on-copy path), so the function's final return never executed in any state. A break terminates only its own loop: all three loop kinds (for/while/for-of) now clear breakCond/continueCond on the hard-exit path. Found by the google normalize probe (findIndex + for-let + break silently swallowed the function's return value). tests/verif-wire-google-rebuild-stability.test.ts (#3938/#3939⑥ wire byte-stability on the google adapter, rebuild direction): - alternating append (user text → assistant text): earlier contents byte-identical, UNSAT for any violation; - same-side tool-result append: merged content keeps the text part byte-identical (normalizeGoogleUserPartOrder movable-text contract), UNSAT; - real-code replay baseline. Suite: 23/23.
…g) + engine fixes
Engine fixes found by the judge work:
- named module-level function references as array-method callbacks
(filter(isSuspectedEvent) degraded before; cbNode resolver + widened
guards for filter/find/findIndex/some/every/forEach/map)
- SMT-LIB string literals: escape ALL non-printable-ASCII as unicode;
cvc5 rejects printable Unicode bytes ('Non-printable character') —
advice strings carry em-dashes/middle dots
- String(number) holes are now constrained digit-only via str.in_re
(str.+ (re.range "0" "9")) asserted in smt2Of AFTER declare-funs —
uninterpreted count strings could otherwise model as containing any
substring and fake contains() violations on every count-bearing line
- module-level truthy(): inline and-fold (no andFold in module scope);
typeof base as plain ternary
J1 (dshNativeCompactionWitness): shrinking-history discipline — firing
without shrinkage (inc >= 0.75*known) is UNSAT for arbitrary PA/REF/INC/
KN; landing shapes (#2709 320/771, 427/875) SAT; gates UNSAT; missing
fingerprint (fold-reconcile site) SAT. Replay: all calibration shapes +
749/750 boundary + #3806 restart shapes.
J2 (formatConflictSection): the one-compressor command requires
confirmed ACTIVE foreign evidence — no-foreign UNSAT, all-stale UNSAT
over arbitrary kinds (6-value ConflictKind domain) and ages; non-vacuity
SAT. Replay: #3806 unannounced-only → 'not confirmed', #2709 inferred →
'do not go hunting', fresh foreign → command, stale → none, neutral
sibling → stand-down. 27/27 verif tests green.
…ss fixes Engine fixes (both found by judges turning red, both minimized to <30-line repros, both would over-admit violations AND lose real writes): 1. symFields both-arm merge erased write guards. An entry present on both arms of a merge with the SAME write guard (created in an earlier loop iteration, copied unchanged) got g:=const-true and its else-arm degraded to a neutral value — the pre-write binding vanished. refs.ts 3-message shape reproduced it (2 messages correct, 3 broken): y's guarded write survived y's iteration merge but z's iteration saw the entry on both sides and clobbered the guard. Fix: the merge-level condition goes into the VALUE only (ite(cond, va, vb)); .g keeps the disjunction (cond∧ga)∨(¬cond∧gb). No double-count: the read fan tests key∧g and g already carries cond. Cured the generic-append Q2 over-admission (#3945 family) while keeping #3805 green. 2. Loop iterations after a symbolic break kept running. for-of conjoined the accumulated breakCond ITSELF into the next iteration's guard (guard = len>k ∧ breakCond) — inverted: iteration k+1 runs only when NO break happened. for/while had the same hole (unconditional merge under the bare loop condition). snapshot-render chain repro: the bySig candidate pick loop (`first idx < cursor`, break on hit) returned the SECOND candidate after breaking on the first — joinRow off by one, clientJoin over-admitted, the judge saw tails vanish. Fix: all three loop kinds gate subsequent iterations by ¬break-so-far. Judge (tests/verif-snapshot-render.test.ts): - replay half: maybeSnapshotView on real JS (success shape / #3812 lone-dup seam-too-short / GHOST block-unanchored). - symbolic half: buildView translated from src/server/snapshot-render.ts with JSON-template row parsing kept symbolic (zero degradations). C1 (collision-free tail content preserved) UNSAT; C2 anchor presence UNSAT. - C1b pins bug #4052: tail message whose (role|ct|text) equals a COVERED row's sig-binds to that row and the anchor swallows the content — replayed on real code (view loses the newest user message). SAT today, must flip to UNSAT when fixed. Suite: 29/29 (guard 2, smoke 3, #3691 2, #3769 2, #3676 2, #3805 2, generic 1, induction 2, view-latch 2, conflict-watch 4, anthropic 3, google 3, snapshot-render 2, replay 1 counted within).
Contributor
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.4852-pr.4071.fa98799This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr4071.tgz
npm install -g packageInstall instructions are refreshed on each push. |
Contributor
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.697-master.022395d # this exact build
npm install -g billion-context@master # always the newest merged build
|
This was referenced Oct 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
续 #3853(已合并的 MVP)。这条分支(verif/extend-modules)是后续扩展批次,共 6 个提交,之前只有里程碑评论贴在 #3853 下、没带动代码 —— 本 PR 把它们正式提出来。与当前 master 合并无冲突(已验 merge-tree clean)。
内容
6 个新判官(harness),全部走真代码翻译 + 反例回放锁(README 五条反作弊规则):
新真 bug:#4052(判官自己挖出,已建 issue + 回放确认) —— 客户端最新消息与一条已被摘要覆盖的旧行(角色+类型+文本)相同时,sig 兜底把新消息绑到 covered 行,anchor 吞掉内容,模型视图丢失用户刚说的话。C1b 是回归钉:修复前 SAT、修复后翻 UNSAT(可用来验收 #4057)。
引擎健全性修复(每条都有 <30 行最小复现,修错会让判官双向说谎——既漏报真 bug 也虚报):
return undefined是真值不是未写槽(undefUnder 标签;=== 不能把它折成 const)m.get(k).push(v)要穿过 map 可见)测试
VERIF_PYTHON=… node --import tsx --test tests/verif-*.test.ts→ 29/29 全绿(guard 2 / smoke 3 / 4 个定向 ×2 / generic / induction ×2 / view-latch ×2 / conflict-watch ×4 / anthropic ×3 / google ×3 / snapshot-render ×2)。tsc 干净(pi-subagents/mysql 噪声为既有)。无求解器环境自动跳过,不阻塞 CI。按仓库规则由人审人并,bot 只提交。