Repository navigation
fix: exclude legacy no-class fold anchors from non-reasoning drift evidence (#2903) - #2909
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.3239-pr.2909.0d0e9c1This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2909.tgz
npm install -g packageInstall instructions are refreshed on each push. |
339d53e to
36870e4
Compare
已 review PR #2909(Closes #2903)。结论:方向正确、修法打到根因、回归测试有牙、diff 干净,可合并。另发现并修复了一个 stale-base 导致的 CI 红灯(与本 PR 改动无关,详见末尾)。按八问作答: 1. 是什么问题 2. 什么原因导致的 3. 影响范围与严重程度 4. 怎么修复的 5. 是否有回归问题 6. 是否破坏缓存 7. 是否改了设计方向 8. 是否引入新的配置 测试有效性:新增 3 个用例直接驱动 diff 整洁度:单提交、2 文件(src +14/-1,test +66),每行都服务于目的,无无关改动 / 空白 churn / 锁文件变更。干净。
收工判定:单行口径修正 + 有牙回归钉死,方向正确、无回归、无配置面变更;stale-base 红灯已 rebase 解决。等 CI 新 commit 转绿即可人工合并(合并留给人工)。 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.334-master.f59cd01 # this exact build
npm install -g billion-context@master # always the newest merged build
|
Closes #2903
What
Old builds (≤0.1.191) persisted
foldAnchorswithout thec(content-type class) field. Those legacy anchors belong to an old id space: once their id leaves the wire they can never re-match and can never be backfilled (the #2732 backfill needs live bytes), so the reconciler reports them "missing" every pass, forever.The destroy-drift classifier counted them as non-reasoning loss —
anchors[id]?.c !== "reasoning"treatsc === undefinedas non-reasoning — so a healthy long session carrying that permanent bili self-debt latchedfoldDriftEscalated: trueafter 3 consecutive passes, and every later diagnosis blamed "host destroyed the history".Why this fix
Only a known non-reasoning class counts toward the destroy threshold now:
A genuine client-side rewrite/deletion still carries a concrete
c, so real loss still escalates; pure-legacy debt alone never does. This matches the accounting correction proposed in the issue (suggestion #1) and the reporter's local patch.Behavior change (old → new)
Drift-escalation evidence: previously
c === undefined(a legacy anchor) was classified as non-reasoning and could push the session over the>= 10 unmatcheddestroy threshold → permanentfoldDriftEscalated. Now unknown-class anchors are excluded from that count. Net effect: sessions whose only permanently-missing ids are pre-0.1.192 legacy anchors stop being misdiagnosed as substrate-destruction; sessions with genuinely-missing known-class ids escalate exactly as before.Scope notes
src/fold-reconcile.ts+ regression tests. No config surface, no wire/persistence-format change, no kernel change.c !== "reasoning"pattern atsrc/fold-reconcile.ts:1146(per-block zombie/reap test, [Bug][proxy] unframed host-side history deletion leaves zombie fold blocks rendering carriers forever — one carrier flaps in/out every turn (persistent prefix-cache churn) #2695) was examined and intentionally left unchanged: there, counting a legacy-absent id as "gone" is correct (it really is absent → feeds desired orphan-reap cleanup), unlike the destruction-evidence path where the absence is bili's own fault.Tests
tests/fold-drift.test.tsdrivesreconcileFoldCoverageover a synthetic pre-0.1.192 ledger:foldDriftEscalated; asserts the total-loss streak reached the escalate pass first so the negative isn't vacuous. This case fails on the unfixed code (verified by temporarily reverting the filter).Verified locally:
npm run typecheckclean; all 93 tests intests/fold-{drift,reconcile,reconcile-positional}.test.tsgreen. Full suite to CI.