Repository navigation
[PR] fix: stale fold ledger after model switch — attribute the failure so the breaker offers acp_status - #4044
ranxianglei wants to merge 2 commits into
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.4934-pr.4044.78922d8This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr4044.tgz
npm install -g packageInstall instructions are refreshed on each push. |
98dae19 to
adc27a0
Compare
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。 本 issue 是 GitHub PR #4044(Closes #4038)的镜像;检索 open PR 无其他条目处理同一缺陷(引用 #4038 的仅本 PR,#4057 为无关的 snapshot-render 工作)。PR 第二个 commit( 标签: bug / dsh / scope/wiring / p1(保留既有 pr)。理由:缺陷类;复现环境 DSH desktop;修复在宿主侧请求管道(receipt/breaker/attribution 层,src/stream.ts,不触 kernel → wiring);p1 = 可用性类(触发后压缩整体不可用至 /clear)。 以下是我对该 PR 的独立审核——重新拉取分支,独读 diff、全部消费端与 kernel 源码,未复用 #4038 线程结论: 已核实的证据
行为变更披露(旧→新)
结构化八问
一个观察(非阻塞):snapshot 句 "can never compress again" 在「切回原上游再次改写历史导致块复活」的极端边缘略绝对,实际影响可忽略,且措辞已被测试钉住——属有意措辞选择,不改。 判定:代码层面可合。 方向正确(可用性修复、归因层、最小爆炸半径),机制经源码验证,测试有牙,未发现回归。4 个红 CI shard 均为已知 flake 家族,需人工点 rerun-failed-jobs(我无 API rerun 权限);转绿后即可合并,合并动作本身留给你。修复随合并后第一个包含此 commit 的版本发布(报告者用的 0.1.202,需 ≥ 下一版本)。 |
16c3378 to
8077178
Compare
…ers acp_status (#4038) A model/upstream switch that reuses the session id rewrites the history out-of-band; every pre-switch fold block deactivates but stays resident, so remembered bN refs keep resolving to inactive blocks and compress fails with 'already compressed' next to '0 active block(s)' forever. The classifier had no branch for the shape (cause ''), so the breaker armed with the loop-noise paragraph that forbids polling acp_status — the one recovery step. Zero-active + already-compressed now routes into the substrate-destruction family (single recovery step in the breaker, FOLD SUBSTRATE INVALID on acp_status), and the refs snapshot names the dead ledger. Loop-noise wording stays verbatim for all other causes; both directions pinned by tests.
…failing (#4049) The generic append-only stability harness called t.skip() without return when no SMT solver is installed. t.skip() alone does not stop the test body, so execution fell through to the first real solveSmt2 call, which throws 'no solver available' — every solver-less CI runner reported the test as 'not ok ... # SKIP' (failureType testCodeFailure), turning its shard red deterministically. Introduced by 74eca4e (#3939); local dev machines carry cvc5 under $HOME/tmp/cvc5, which is why only CI went red. All other verif harnesses already use 'return t.skip(...)'; this restores the same pattern and the documented 'no-solver environments auto-skip' contract (AGENTS.md Key Design Decisions 14). Verified both directions: solver hidden -> ok/SKIP, fail 0; solver present -> real solve passes.
69dcac9 to
b1c22d3
Compare
(ai: vllm-qwen/qwen3.8-27b) 冲突已解决,分支已 rebase 到当前 master 并 force-push( 冲突原因:本分支基于旧 base( 处置(union-of-intent):rebase 时冲突取 master 版本,并把本分支那个重复提交整个丢弃(它的功能已被 #4087 覆盖,保留只会留下无意义的注释差异)。最终分支 = master 之上 2 个干净提交,实质 diff 与之前完全一致(3 文件,+203/-2):
八问:
补充:floor 3 记录的 4 片 CI 红是已知的 #3769/#4049 存储水合 flake,与本 PR diff 零交集;本次 force-push 已触发新 head 上的全新 CI 运行,以那轮结果为准。结论:冲突已清,等 CI 绿后可由人工合并。 |
|
随 #4038 关闭:PR 的三个修复点建立在 0.1.202 的机制上,现 master 已无对应入口——①'代际切换调用点'不存在(resetSessionCompression 仅 session.ts:1501 一个调用点,原子清);②③的前提(refs 重铸但账本残留)已被 #4316 ledgerSeq + id 键稳定发号取代。 ②的思路(把 'already compressed' + 0 active blocks 防御性归类为 substrate-destruction,让断路器切到 substrateDestructionPauseParagraph 那条带 acp_status 指引的文案)本身便宜且合理,如果未来出现复现,欢迎从本 PR 历史里捡回来单独提。 |
Closes #4038
Problem
A mid-conversation model/upstream switch reuses the session id and re-sends a rewritten history; every pre-switch fold block deactivates, but nothing rebases or archives the state. The deactivated blocks stay resident, so remembered bN refs keep resolving against them and every compress fails with
Requested range(s) already compressed (e.g. b1..b43)next to0 active block(s)in the SAME receipt — a self-contradicting verdict the model retries forever. After 3 failures the circuit breaker arms with the loop-noise wording ("do not poll acp_status") — forbidding the one recovery step. The session is stuck until /clear.Root cause (verified at source level; master == v0.1.202 == reporter version)
Fix (host-side, src/stream.ts only)
Recovery semantics: the model runs acp_status once (the live table was already advertised in the same receipt), folds a live range, one success clears the streak; zombie blocks stay inert (decompress/search still serve them).
Behavior changes (disclosed per policy)
Tests
tests/issue4038-stale-fold-ledger.test.ts — gate discipline (#3617), both directions asserted:
Local targeted run green: issue4038 + issue2146/issue2432/issue2360/issue847/issue3126 (34 tests). Full-suite verdict = CI.
Addendum (commit 16c3378): en-passing fix — verif harness left CI red on solver-less runners
Tracked down while monitoring this PR's CI: a deterministic red UNRELATED to #4038.
tests/verif-generic-append-stability.test.ts:50calledt.skip(...)WITHOUT areturn, so in solver-less environments the body fell through to the first realsolveSmt2()call and threw "no solver available" — TAP printednot ok ... # SKIP ...but node:test still counted it as a code failure, making every test shard containing that file red on solver-less runners (introduced by 74eca4e / #3939; dev machines carry cvc5, which is why every local run stayed green). Fixed with the missing one-linereturn, verified both directions locally (solver hidden → clean documented skip, fail 0; solver present → real solve passes).Behavior change: solver-less environments go from deterministic red to the documented auto-skip (the AGENTS.md KDD 14 contract); solver-present environments are untouched. Full root cause + timeline + evidence posted to tracking issue #4049 (sub-defect 3). Shipped as an independent labeled commit per the 几行级小修 policy (fix-in-current-PR).