Skip to content

[PR] fix: retire persistently-unmatched fold coverage after 3 evidence-less passes (#3849) — relay of stranded branch - #5398

Open
ranxianglei wants to merge 8 commits into
masterfrom
2026-11-01_absent-residual-retire
Open

ranxianglei wants to merge 8 commits into
masterfrom
2026-11-01_absent-residual-retire

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

Relay of the completed-but-unpushed work from #3849. The original session implemented and tested the fix (commit 65b945f1d on local branch 2026-10-20_absent-residual-retire) but its push was killed by an egress outage on 2026-10-19/20 and no PR was ever opened; the fix has been sitting off-master ever since while the same symptom family kept landing (e.g. #5395). This branch cherry-picks that commit onto current master.

What it does

A covered id that stays missing with NO anchor match every pass (mid-session wire/dialect switch whose old-dialect bytes never reappear under the new projection; host-side byte mutation such as tool-result pruning) used to live in the block coverage set forever: the generic drift warn repeated on every turn and the block's p/r/t denominator stayed wedged above what the wire can ever satisfy again (freezing the #2202 ledger accrual).

Each such id now carries a consecutive-absence streak (metadata foldAbsentStreaks, rebuilt per pass so presence or a claim resets it); after ABSENT_RETIRE_PASSES=3 evidence-less passes the id is retired from every block's effective/direct id lists and its anchor dropped. Retiring makes NO identity claim — surviving content rides unfolded until the next fold re-covers it under the current dialect. Class-agnostic by design (reasoning-dominated residuals retire identically). One info line + conflict-ledger entry (new kind absent-retire) per retirement event.

Ordering guards keep the pre-existing terminal machinery intact: repair mode only (warn stays observe-only); runs AFTER the #2695 reap so majority-absent blocks are reaped whole first (retiring first would starve the z-streak denominator); touches ONLY majority-present blocks — majority-absent blocks belong to the escalation/reap machinery (#2193/#2695/#2903) and shrinking their denominator would turn the episode into a clean pass that resets foldDriftStreak/foldDriftEscalated. Both lanes (plugin + proxy).

Rebase notes (conflicts resolved against current master)

Verification

  • typecheck clean on the rebased head.
  • Targeted suites local: tests/issue3849-absent-retire.test.ts (8 tests), tests/fold-reconcile.test.ts, tests/issue2202-coverage-accrual.test.ts, tests/issue2915-order-centric-reconcile.test.ts — 99/99 pass. Full-suite verdict = remote CI on this head.

Behavior change (disclosed)

Permanently-unmatched covered ids previously stayed listed and warned forever (the #3849 17x-per-hour warn loop; the #5395 614-id steady-state residual). They now retire after three consecutive evidence-less passes; afterwards the #2202 coverage ledger denominator converges to the surviving substrate (accrual transitions from the text fraction to full-on-survivors once the drop proves permanent). No user-facing config added. No kernel change.

Fixes #3849
Cross-link: #5395 (same symptom family via host tool-result pruner mutation — that issue additionally carries the shape-aware re-anchor + conflicts-visibility work)

Rebased onto current master (2026-11-01) + golden pin update

The relay cherry-pick was cut against master 5594c13; master advanced to 7578e81 (incl. v0.1.210 and the #5142 expected-rebase series) before this branch could push. The branch now carries two commits on 7578e81:

Golden update justification (tests/golden/storage-render/*.json)

The scripted scenario contains one mid-history edit (editedAt 12); the edited-away covered id is exactly the #3849 residual shape, so the fix retires it after 3 evidence-less passes. Intended persist-contract change, per wire: blocks.0 direct/effective lists drop h_ce9559b8e1773afc (15→14), its fold anchor removed, foldCoverageByBlock.b1.t 15→14, an absent-retire conflict event recorded, foldAbsentStreaks set, cache-ledger accrual converges (requestsAfter 88/15). Wire bodies, turns[], block contents and stats sections are byte-invariant (A/B state dump between pre/post heads shows only those fields differ).

Digests were taken from CI-observed runner output (byte-identical across all four runner cells in two consecutive runs), not local regeneration: this dev container produces machine-specific nudge/tsStamps/stats digests that no local build can make match the runners (pure master is red locally / green on CI today; TZ, node version, stale committed dist, timestamp leaks all ruled out). A locally-regenerated golden would bake unreproducible values — the non-hermetic suite itself is filed separately.

Verification on rebased head

  • typecheck clean; targeted suites 99/99 locally (issue3849-absent-retire 8 tests, fold-reconcile, issue2202-coverage-accrual, issue2915-order-centric-reconcile), plus issue5142-expected-rebase 11/11 and conflict-lifecycle/remediation 15/15.
  • Full-suite verdict = remote CI on this head.

@ranxianglei ranxianglei changed the title fix: retire persistently-unmatched fold coverage after 3 evidence-less passes (#3849) — relay of stranded branch [PR] fix: retire persistently-unmatched fold coverage after 3 evidence-less passes (#3849) — relay of stranded branch Nov 1, 2026
@ranxianglei ranxianglei added bug Something isn't working p1 scope/kernel labels Nov 1, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

查重:不重复。 本条是 [PR] relay issue,对应已开出的 PR #5398(#3849 滞留分支的接力:cherry-pick 65b945f1d → 新分支 2026-11-01_absent-residual-retire,单 commit 0a84db617)。同症状家族的另一实例 #5395(宿主 pruner 字节变异)机制不同、单独跟踪,已在 PR 正文交叉链接。无并列的重复修复 PR 在途。

标签:bug / scope/kernel / p1 / pr(与原始 issue #3849 同域——缓存命中带塌陷的成本爆炸类按 owner 10-19 政策判 p1;正文不涉及特定宿主客户端,客户端标签不打)。

核验状态(本会话独立核对):

  • 分支与 commit 属实:0a84db617 单 commit(6 文件 +402/−16)压在当时的 master 5594c1315 上,已推送 origin,PR [PR] fix: retire persistently-unmatched fold coverage after 3 evidence-less passes (#3849) — relay of stranded branch #5398 对 master 打开,正文 Fixes #3849。
  • 发现一个在途问题:master 此后已前进到 7578e8184(含 v0.1.210 发版及约二十个合并),且窗口内变更触碰了本 PR 的两个热文件 src/fold-reconcile.ts 与 tests/fold-reconcile.test.ts → GitHub 现报 PR mergeable=False / dirty(与当前 master 冲突)。
  • CI 尚无该 head 的记录(check-runs 为空)。

行动:把 PR 分支 rebase 到当前 master、解冲突、本地 typecheck + 定向套件验证后推回同一分支(不动 master),完成后按八问汇报并附 CI 结论。

@ranxianglei
ranxianglei force-pushed the 2026-11-01_absent-residual-retire branch from 0a84db6 to a129ffc Compare November 1, 2026 02:39
@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-11-01_absent-residual-retire (32ebec4)

Latest build — install this exact version

npm install -g billion-context@0.0.10978-pr.5398.daeafec

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Recent builds (commit → version)

commit version build
32ebec4 billion-context@0.0.10978-pr.5398.daeafec build
be377e9 billion-context@0.0.10894-pr.5398.7047a13 build
63935d6 billion-context@0.0.10641-pr.5398.c974f70 build
27d3b77 billion-context@0.0.10278-pr.5398.9e42317 build
c5a878a billion-context@0.0.10270-pr.5398.6660912 build
7773869 billion-context@0.0.9195-pr.5398.b1b38f5 build
0288daa billion-context@0.0.9163-pr.5398.440a30f build
0908f69 billion-context@0.0.9052-pr.5398.67a2db4 build
73b7e19 billion-context@0.0.7647-pr.5398.76dab44 build
5936de8 billion-context@0.0.7646-pr.5398.67a339c build

Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr5398.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

Rebase 完成,PR #5398 已可合并(等 CI)。 新 head:a129ffc18(原 0a84db617 cherry-pick 到当前 master 7578e8184,原 commit message 保留)。force-push 到 2026-11-01_absent-residual-retire 后,PR 从 mergeable=dirty 转为 mergeable=true;CI(run 41266106919)已在新 head 上运行中,出结果我再补一条。

冲突解决(7 处,全部是「两个机制各加各的字段」型,按并集解,不丢任何一侧语义):

关键交叉语义核查(#5142 × #3849,不是文本能看出来的部分): 我担心过 master 的 expected-rebase id 会被 PR 的 absence-streak 误伤(它们每轮都 missing,3 轮后会被 retire,可能打掉 #5142 的 expectedRetired >= N 断言)。用 T1 场景逐轮探针实测:不会。#5142 的 record(METADATA_EXPECTED_REBASE)在 plan 构建前就把这些 id 豁免出 missing 管道(unmatched 恒 0、streak 恒空、expectedRetired 单调 1→40)——两个机制天然分区:可认领的走 claim、宿主预期行为走 #5142 记账常驻、真残留才进 #3849 的 3-pass retire。无双重记账,无需改码。

本地验证(rebased head): typecheck 干净;定向套件 99/99(issue3849-absent-retire 8 例 + fold-reconcile + issue2202-coverage-accrual + issue2915-order-centric-reconcile);交叉套件 issue5142-expected-rebase 11/11、conflict 生命周期/remediation 15/15。全量裁决 = CI(进行中)。


八问

  1. 是什么问题:不是新缺陷,是滞留工作接力——[Bug] Mid-session wire/dialect switch leaves a permanent unmatched-id residual that rides the wire unfolded and taxes the prefix cache every turn (v0.1.201) #3849 修复(持久 unmatched 折叠残留永不退出覆盖集 → 每小时 17 次 warn 循环 + [cache-ledger] netSaved 面板在 fold 覆盖坍缩后继续累计虚增——ledger 与实际重发行为无交叉校验 #2202 账本分母卡死)10-20 就实现测试完了,推送死于出口故障,此后 master 又走了 372 个文件(含同函数的 [Performance][dsh] Mega-sessions pay an ever-growing O(full-history) fold-reconcile tax every turn: expected host churn (one-shot carrier retirement, image/offload retroactive rewrites) misclassified as drift | 大会话每轮付不断增长的 O(全史) fold-reconcile 税:合法宿主变更(o… #5142 expected-rebase 记账),分支与 master 冲突。本单就是把它搬到当前 master。
  2. 什么原因导致的:缺陷根因(该 commit 自己修的)= 字节在当前投影下永不复现的覆盖 id(会话中途 wire/方言切换、宿主侧字节改写)在覆盖集里没有有界寿命,设计缺口;rebase 工作量来源 = 分支基线 5594c1315 落后现 master 7578e8184,热文件 src/fold-reconcile.ts 被 [Performance][dsh] Mega-sessions pay an ever-growing O(full-history) fold-reconcile tax every turn: expected host churn (one-shot carrier retirement, image/offload retroactive rewrites) misclassified as drift | 大会话每轮付不断增长的 O(全史) fold-reconcile 税:合法宿主变更(o… #5142 系列 +293 行改写,产生 7 处文本冲突。
  3. 影响范围与严重程度:带持久残留的长会话(如 [Bug] Mid-session wire/dialect switch leaves a permanent unmatched-id residual that rides the wire unfolded and taxes the prefix cache every turn (v0.1.201) #3849 的 124 id、[Bug] compressible-range chars counts only text, so signature-only thinking runs size as 0 and the ?? tokens*4 fallback never fires #5395 的 614 id 稳态);p1(按原 triage,缓存账本类)——影响日志噪音与 [cache-ledger] netSaved 面板在 fold 覆盖坍缩后继续累计虚增——ledger 与实际重发行为无交叉校验 #2202 账本累积准确性,不影响可用性。
  4. 怎么修复的:cherry-pick 原 commit 到现 master,7 处冲突全部按「两机制字段并集」解决,保留各自语义(详见上);交叉机制分区经探针实测确认,未动原修复逻辑一行。
  5. 是否有回归问题:逐项审过既有行为——[Performance][dsh] Mega-sessions pay an ever-growing O(full-history) fold-reconcile tax every turn: expected host churn (one-shot carrier retirement, image/offload retroactive rewrites) misclassified as drift | 大会话每轮付不断增长的 O(全史) fold-reconcile 税:合法宿主变更(o… #5142 性能钉(T1 40 轮 carrier 场景)原样通过、T2/T2b/T2c 通过;[cache-ledger] netSaved 面板在 fold 覆盖坍缩后继续累计虚增——ledger 与实际重发行为无交叉校验 #2202 账本累积、fix(dsh): model switch drops all folds — fold-reconcile #2396 detect-only cannot re-anchor rewritten tool-call ids → doom-probe 502 session death #2915 顺序中心 reconcile、fold-reconcile 全量、conflict 两套件本地全绿;typecheck 干净。高危模式排查:无语义漂移(fail-fast/阈值/时序/输出格式均未动)、无吞错变化。全量以 CI 为准。
  6. 是否破坏缓存:不涉及——不触碰任何缓存/重试/增量游标/去重键策略;本修正是让 [cache-ledger] netSaved 面板在 fold 覆盖坍缩后继续累计虚增——ledger 与实际重发行为无交叉校验 #2202 账本分母向存活基底收敛(这正是目的),前缀缓存字节不受影响。
  7. 是否改了设计方向:不涉及——纯增量机制,原有次序守卫完整保留(repair-only、跑在 [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 reap 之后、只碰 majority-present 块)。
  8. 是否引入了新的配置:不涉及——无新 env/config/默认值(foldAbsentStreaks 是 session metadata 自由字段,additive)。

行为变更披露(PR 正文已载,重申):永久 unmatched 残留旧行为 = 永远留在覆盖集里反复 warn;新行为 = 连续 3 个无证据 pass 后退役,其后 #2202 账本分母收敛到存活基底。原因:这类 id 的字节在当前投影下永不复现,留着只有噪音和卡死的分母。

收工判定:代码侧就绪,mergeable=true;等 CI 绿即可由人工合并(PR #5398,Closes #3849)。CI 结果出来我补一条跟进。

@ranxianglei

Copy link
Copy Markdown
Owner Author

(ai: vllm-qwen/qwen3.8-27b)

形式说明:本独立 review 的执行身份与 PR 作者同账号(ranxianglei),GitHub 禁止同一账号对自己的 PR 提交正式 approve 事件(422「Can not approve your own pull request」)。故以 PR 评论承载本次独立审核,结论为 APPROVE(建议批准)。以下为我对 diff 与行为的独立核查(针对当前 tip 73b7e197a,rebased 到 master 7578e8184),不复述协调线程里作者的 rebase 报告。

八问

  1. 是什么问题:会话中途切 wire/方言(或宿主侧持续改写字节)后,一部分被折叠覆盖的 id 在新投影下永远无法再锚定,却永久留在块的覆盖集里——每轮发一条通用 drift warn,并把 [cache-ledger] netSaved 面板在 fold 覆盖坍缩后继续累计虚增——ledger 与实际重发行为无交叉校验 #2202 覆盖账本的分母卡死在线路上再也满足不了的水平([Bug] Mid-session wire/dialect switch leaves a permanent unmatched-id residual that rides the wire unfolded and taxes the prefix cache every turn (v0.1.201) #3849)。

  2. 什么原因导致的:根因是 reconcile 对「永久消失的覆盖 id」没有终态。有界救援通道(key/shape census)只在旧字节仍可见时触发;一旦旧方言字节不再出现,该 id 既不被认领也不被移除,成为覆盖集里的永久残留——没有任何机制给它「此 id 已永久离开」的出口。

  3. 影响范围与严重程度:触发条件 = 带持久残留的长会话(中途 provider/方言切换且旧字节不复现,或宿主 pruner 持续改字节)。不影响可用性、不丢数据;代价是每轮多付一次未折叠重发的 token + 小时级 warn 日志噪音 + [cache-ledger] netSaved 面板在 fold 覆盖坍缩后继续累计虚增——ledger 与实际重发行为无交叉校验 #2202 分母失真。体验/成本类,有绕行(手工清存储)。

  4. 怎么修复的:给残留一个终态——按 id 记连续缺席 streak(foldAbsentStreaks,每轮重建,出现或被认领即清零);连续 3 个无证据 pass 后从所有块的有效/直接 id 列表退役并删锚点,不做任何身份认领(存活内容由下轮折叠按当前方言重新覆盖)。次序守卫保住既有终态机制:仅 repair 模式、跑在 [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 reap 之后、只碰 majority-present 块(majority-absent 归 escalation/reap)。双车道生效。

  5. 是否有回归问题(逐项独立审过既有行为):

  6. 是否破坏缓存:不涉及。退役只动覆盖记账(effectiveMessageIds/directMessageIds + anchors),不动块内容/块本身;存活内容降级为诚实未折叠重发直到下轮折叠,最坏是多花 token 而非破坏前缀缓存字节。

  7. 是否改了设计方向:不涉及。在既有 reconcileFoldCoverage episode 生命周期内加一条终态记账路径,与顺序中心身份教义(KDD feat: self-update (auto + manual) #11/fix: cache health — remove condense, fix isTitleGen, preserve cache_control #13)一致,不转向。

  8. 是否引入了新的配置:不涉及用户配置面。仅内部 metadata key(foldAbsentStreaks)+ 常量 ABSENT_RETIRE_PASSES=3 + 一个新 conflict kind(absent-retire)。非 env/config。

非阻塞观察

门禁判定

  • kernel 授权门禁不触发:diff 零文件落在 kernel/,正文声明「No kernel change」,无 kernel-change 声明。(协调线程的 scope/kernel 标签指「src 侧压缩决策面」这一 triage 类别,不是 kernel/ 目录改动。)
  • §7.4 auto-merge 不适用:触碰 src/fold-reconcile.ts(身份/覆盖账本面)= identity/session-binding 领地,须人工合并。

判定:APPROVE(建议批准)

代码正确、守卫齐全(repair-only + reap 之后 + majority-present 保护 + presence-reset)、测试有牙(真断言钉住退役时机/出现复位/claim 豁免/class-agnostic/warn-mode 零变更/reap 共存/仅退持久缺席子集保序)、行为变更已披露旧值→新值+原因、无 kernel/config/安全面。等 CI 全量 test 矩阵确认绿即可由人工合并(PR #5398,Closes #3849)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b) 独立 review 完成(PR #5398 tip 73b7e197a):结论 APPROVE(建议批准)。逐行独立核了 diff 与行为——次序守卫齐全(repair-only、跑在 #2695 reap 之后、只碰 majority-present 块、presence-reset)、#5142×#3849 分区经源码独立核对无双重退役(expected id 在 missing 计算处即被排除,即便 channel-2/3 单次检测 pass 进入 plan.unmatched,streak 每轮重建封顶为 1 到不了 3)、测试有牙、行为变更已披露旧值→新值+原因。正式 approve 事件被 GitHub 自批规则挡下(review 身份与 PR 作者同账号),已以 PR 评论承载完整八问结论:github.com//pull/5398#issuecomment-6553846355 。CI:static-gates(typecheck+build)+ mysql-contract 绿,ubuntu/windows×node22/24 全量 test 矩阵在末次镜像读取时仍在收尾(0 failed,11 shard pending)。diff 零文件落 kernel/、正文声明 No kernel change → 授权门禁不触发;触碰 src/fold-reconcile.ts 身份/覆盖账本面 → §7.4 须人工合并,approve≠merge。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b) 本条是 PR #5398 review 评论(GitHub comment id 6553846355)经镜像同步回本协调帖的转发,非新增用户输入——无需重复处理。review 结论已落地:APPROVE(建议批准),完整八问见上条与 PR #5398 评论;当前无待办,等 CI 全量 test 矩阵确认绿后由人工合并即可。若 owner 有新的意见或要求改动,请直接在本帖回复。

@ranxianglei
ranxianglei force-pushed the 2026-11-01_absent-residual-retire branch 2 times, most recently from 0908f69 to 0288daa Compare November 11, 2026 14:58
ranxianglei pushed a commit that referenced this pull request Nov 11, 2026
…-majority doctrine

The absent-retire protection counted presence over ALL covered ids
(reasoning included) against a hard-only denominator, and protected only
when strictly below half were present. Both deviate from the doctrine:

- a block whose hard (text) loss was masked by surviving reasoning cores
  was not protected (numerator inflated by reasoning presence), so its
  missing hard ids retired after 3 passes and the episode turned into a
  clean pass that reset foldDriftStreak/epoch-confirm;
- exactly half present is NOT a strict majority (#5715 boundary), yet the
  strict < left such blocks unprotected for the same reason.

Count presence over hard ids alone (claims still count as evidence, like
the z-accrual's p+r) and protect unless a STRICT hard majority is present
(2*prHard <= hard.length). The stale 'same majority test as the z-accrual'
comment is rewritten to state the doctrine it now mirrors.

Red on PR #5398 shards test(win22 s5)/test(ubu22 s2)/test(ubu24 s2):
fold-anchor-doctrine subtests 7+8. All issue3849-absent-retire fixtures
keep retiring (each has a strict hard majority present).
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] (ai: vllm-qwen/qwen3.8-27b) 进度汇报:CI 红项已修复并推送(head 7773869),冲突核对为不存在,等 CI 在新 head 上重跑。

排查结论

  1. 冲突:PR head 0288daa 与 master 无冲突(mergeable_state=behind)。master 自 rebase base 前进 11 个提交,全部是 web handoff 渲染 + Anthropic 400: mid-conversation system must FOLLOW a user message — heal only checks the follower, and trailing nudge/notes land after a trailing system #5432 trailing-system-tails,与本 PR 触碰的路径零重叠 → 不需要再 rebase。
  2. 红项:三个红 shard(test win22-s5 / ubu22-s2 / ubu24-s2)挂在同一处——tests/fold-anchor-doctrine.test.ts subtests 7+8([Bug][DSH] Partial interior loss is classified as total drift despite surviving direct-ID majority, latching compression off #5715 教义:「reasoning 幸存者不得掩盖 hard 损失」「恰好一半在场不算严格多数」)。其余 shard、static-gates 全绿。

根因(#3849 的退役保护门 src/fold-reconcile.ts:2399-2409 两处偏离 #5715 教义):

  • 分子统计了全部 id 的在场数(含 reasoning),分母却只算非 reasoning → 「文本损失被 reasoning 幸存者掩盖」的块被误判为多数在场,缺失 id 三轮后被退役,分母缩小后第四轮变成 clean pass,把 foldDriftStreak/epoch-confirm 全清了 → 漂移升级永远不触发;
  • 边界用严格 <,「恰好一半在场」不满足保护条件 → 同样被错误收缩。

修法:保护门对齐 #5715 教义边界——只在非 reasoning id 集合上统计在场(claims 仍计为证据,与 z-accrual 的 p+r 一致),且「非严格多数在场即保护」(2*prHard <= hard.length)。同步重写了失实注释(原写「Same majority test as the z-accrual below」,改后即不成立)。z-accrual/reap 既有机制一行未动。

行为变更披露:#3849 absent-retire 的触发面收窄——「恰好一半在场」和「reasoning 幸存者掩盖文本损失」两类块以前会被错误收缩,现在受保护(交给升级/reap 机制处理);健康块(严格多数在场)的退役行为完全不变。这是修 bug 而非语义漂移:旧行为直接打红了 master 既有的 #5715 教义测试。

验证:本地定向套件全绿——fold-anchor-doctrine 16 项(含此前失败的 2 个 subtest)+ issue3849-absent-retire 8 项(逐一核过 fixture,均为严格多数在场,退役照常发生)+ fold-reconcile/issue2202/issue2915 共 91 项 + issue5142 13 项;typecheck 干净。全量回归交给 CI。

八问

  1. 是什么问题:PR [PR] fix: retire persistently-unmatched fold coverage after 3 evidence-less passes (#3849) — relay of stranded branch #5398 三 shard CI 红——[Bug] Mid-session wire/dialect switch leaves a permanent unmatched-id residual that rides the wire unfolded and taxes the prefix cache every turn (v0.1.201) #3849 退役机制误收缩了两类本应走升级路径的块,导致 [Bug][DSH] Partial interior loss is classified as total drift despite surviving direct-ID majority, latching compression off #5715 漂移升级断言失败。
  2. 什么原因导致的:退役保护门的多数判定两处偏离教义:分子/分母类别混算(分子含 reasoning、分母不含)+ 严格 < 漏掉恰好一半。
  3. 影响范围与严重程度:仅「覆盖 id 连续 3 轮无证据缺失」且块命中上述两种形状的场景——该场景本应升级/收割,却被静默收缩并重置 episode,漂移检测承诺落空。内部机制缺陷,无数据丢失,但属核心检测路径失灵(p1 级保留原判)。
  4. 怎么修复的:保护门对齐 [Bug][DSH] Partial interior loss is classified as total drift despite surviving direct-ID majority, latching compression off #5715 硬多数边界(非 reasoning 集合内统计在场,非严格多数即保护),不动 z-accrual/reap。
  5. 是否有回归问题:[Bug] Mid-session wire/dialect switch leaves a permanent unmatched-id residual that rides the wire unfolded and taxes the prefix cache every turn (v0.1.201) #3849 自身 8 个 fixture 逐一核验(退役照常)、doctrine 全套 16 项、fold-reconcile/2202/2915/5142 本地全绿;高危模式逐项过:无阈值/时序/输出格式漂移,只收窄了误收缩面。
  6. 是否破坏缓存:不涉及——未触碰任何缓存/重试/游标/去重键。
  7. 是否改了设计方向:没有——是把 [Bug] Mid-session wire/dialect switch leaves a permanent unmatched-id residual that rides the wire unfolded and taxes the prefix cache every turn (v0.1.201) #3849 实现修正回既有教义,非新方向。
  8. 是否引入新配置:无。

判定:红项已处理、冲突确认不存在;等新 head 7773869 的 CI 结果,镜像缓存尚未取到新 run(仍显示旧 head 的红状态),跑完我再跟进汇报。零 kernel 改动(PR body 已声明 No kernel change),合并按惯例留给人工。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] (ai: vllm-qwen/qwen3.8-27b) CI 更新:新 head 7773869 全绿——镜像缓存 summary 30 项:failed 0 / pending 0。此前红的三个 shard(test win22-s5 / ubu22-s2 / ubu24-s2)全部转 success,其余测试 shard、static-gates(双平台)、mysql-contract、config-surface-guard、gate、pi-subagents-guard 均 success,e2e 车道按门控跳过。

收工判定:#5400 交代的「红项 + 冲突一次处理」已完成——红项根因修复(退役保护门对齐 #5715 教义)并验证,冲突核对为不存在(master 前进的 11 个提交与本 PR 零路径重叠)。PR #5398 现处于可合并状态,合并按惯例留给人工。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 收工确认(本条为最终状态,详情见上方两条汇报):

已完成:#5400 交代的「红项 + 冲突一次处理」全部落地。

行为变更披露:absent-retire 触发面收窄——「恰好一半在场」「reasoning 幸存者掩盖文本损失」两类块不再被误收缩(交给升级/reap 机制),健康块退役行为不变;属修 bug 而非语义漂移。

剩余与风险:无未验证项。PR #5398 处于可合并状态,合并按惯例留给人工。零 kernel 改动。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

1 similar comment
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

@ranxianglei
ranxianglei force-pushed the 2026-11-01_absent-residual-retire branch from 7773869 to c5a878a Compare November 15, 2026 22:34
ranxianglei pushed a commit that referenced this pull request Nov 15, 2026
…-majority doctrine

The absent-retire protection counted presence over ALL covered ids
(reasoning included) against a hard-only denominator, and protected only
when strictly below half were present. Both deviate from the doctrine:

- a block whose hard (text) loss was masked by surviving reasoning cores
  was not protected (numerator inflated by reasoning presence), so its
  missing hard ids retired after 3 passes and the episode turned into a
  clean pass that reset foldDriftStreak/epoch-confirm;
- exactly half present is NOT a strict majority (#5715 boundary), yet the
  strict < left such blocks unprotected for the same reason.

Count presence over hard ids alone (claims still count as evidence, like
the z-accrual's p+r) and protect unless a STRICT hard majority is present
(2*prHard <= hard.length). The stale 'same majority test as the z-accrual'
comment is rewritten to state the doctrine it now mirrors.

Red on PR #5398 shards test(win22 s5)/test(ubu22 s2)/test(ubu24 s2):
fold-anchor-doctrine subtests 7+8. All issue3849-absent-retire fixtures
keep retiring (each has a strict hard majority present).
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 冲突已解决并推送(新 head c5a878a8b9),live 核对:mergeable=True、mergeable_state=blocked(= 无冲突,仅等 CI/审查),base 已对齐 master 最新 f648217cb8。

本次做了什么

  1. rebase:PR 分支(3 个提交:[Bug] Mid-session wire/dialect switch leaves a permanent unmatched-id residual that rides the wire unfolded and taxes the prefix cache every turn (v0.1.201) #3849 主体 + golden pin + 上次的退役保护门修复)rebase 到 master f648217cb8。master 自原 rebase base(ca1e6c83c9)前进了大量提交,其中与 src/fold-reconcile.ts 相关的有 8 个(含 [PR] perf: rewrite fold coverage without repeated scans #6705 fold-coverage 线性重写 perf、指令保留 reconcile 修复、reap 位置指纹保留等)——文本层自动合并干净,无冲突。
  2. 唯一冲突:tests/golden/storage-render/chat.json(master 侧 74026290fe 因 OpenAI cache attribution 变更重新生成过 golden,与本 PR 的 [Bug] Mid-session wire/dialect switch leaves a permanent unmatched-id residual that rides the wire unfolded and taxes the prefix cache every turn (v0.1.201) #3849 persist 契约 golden pin 撞在同一组 digest 字段)。golden 是派生产物,不做文本合并——rebase 完成后用官方脚本 scripts/update-storage-render-goldens.ts 对最终代码(新 master + [Bug] Mid-session wire/dialect switch leaves a permanent unmatched-id residual that rides the wire unfolded and taxes the prefix cache every turn (v0.1.201) #3849)重新生成,只有 digest 值变化(stateDigest/stateDigestAligned、stats/metadata 段),wire body 与结构零变化,单独一个标注 commit(c5a878a8b9)。
  3. 推送:push 前 fetch 核对远端 head 无他人并发提交,force-push(本任务明确授权的冲突 rebase)。

验证(本地定向,全量交给 CI)

八问

  1. 是什么问题:PR [PR] fix: retire persistently-unmatched fold coverage after 3 evidence-less passes (#3849) — relay of stranded branch #5398 与 master 冲突(merge state dirty),需 rebase 解冲突。
  2. 什么原因导致的:master 自 PR 的 rebase base 前进,其中 74026290fe 重新生成过 storage-render chat golden,与本 PR 的 golden pin 撞在同一字段。
  3. 影响范围与严重程度:仅本 PR 分支的合并状态;不修则 PR 无法合并。无运行时影响。
  4. 怎么修复的:rebase 到最新 master;golden 冲突按派生产物处理——rebase 后用官方重生成脚本对最终代码重算,不手工拼 digest。
  5. 是否有回归问题:master 侧 8 个 fold-reconcile 提交(含 perf 重写)与本 PR 的语义交互已用定向套件核验([Bug] Mid-session wire/dialect switch leaves a permanent unmatched-id residual that rides the wire unfolded and taxes the prefix cache every turn (v0.1.201) #3849 退役、[Bug][DSH] Partial interior loss is classified as total drift despite surviving direct-ID majority, latching compression off #5715 教义、z-accrual、expected-rebase 全绿);高危模式逐项过:无阈值/时序/输出格式/错误处理漂移,本次只动了 golden 测试产物。
  6. 是否破坏缓存:不涉及——未触碰任何缓存/重试/游标/去重键。
  7. 是否改了设计方向:没有。
  8. 是否引入了新的配置:无。

剩余:新 head c5a878a8b9 的 CI 在跑(mergeable_state=blocked 即等 checks)。镜像缓存已 4 天未刷新(仍显示旧 head 状态),本次 live 状态取自单次 PR 读取;CI 出结果后我再跟进汇报。

ranxianglei pushed a commit that referenced this pull request Nov 17, 2026
…-majority doctrine

The absent-retire protection counted presence over ALL covered ids
(reasoning included) against a hard-only denominator, and protected only
when strictly below half were present. Both deviate from the doctrine:

- a block whose hard (text) loss was masked by surviving reasoning cores
  was not protected (numerator inflated by reasoning presence), so its
  missing hard ids retired after 3 passes and the episode turned into a
  clean pass that reset foldDriftStreak/epoch-confirm;
- exactly half present is NOT a strict majority (#5715 boundary), yet the
  strict < left such blocks unprotected for the same reason.

Count presence over hard ids alone (claims still count as evidence, like
the z-accrual's p+r) and protect unless a STRICT hard majority is present
(2*prHard <= hard.length). The stale 'same majority test as the z-accrual'
comment is rewritten to state the doctrine it now mirrors.

Red on PR #5398 shards test(win22 s5)/test(ubu22 s2)/test(ubu24 s2):
fold-anchor-doctrine subtests 7+8. All issue3849-absent-retire fixtures
keep retiring (each has a strict hard majority present).
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 冲突已解,新 head 63935d6f3b CI 全绿、无冲突。

本次做了什么(live 验证,非记忆)

  • master 又前进了 94 个提交(f648217cb8 → 77fe0b1)。与本 PR 的重叠只有 4 个 storage-render golden 文件(master 80daffc "fix(storage): keep the reply stash out of the messages table (direction C1, pi-mode: a turn's final assistant reply is silently dropped from the session database — web UI keeps showing the previous (stale) reply #6947)" 改了持久化 reply 状态)——src/fold-reconcile.ts 与所有测试文件 master 零改动。
  • 5 个提交 rebase 到新 master:代码提交全部干净应用;golden pin 提交在 4 个 golden 上冲突(仅 digest 行,派生产物),按既定模式先取我方侧完成 rebase,再用官方脚本 scripts/update-storage-render-goldens.ts 对最终代码重生成全部 4 个 golden,独立标注提交 63935d6f3b(digest 值变化:stateDigest/stateDigestAligned/metadata,无线上 body 改动)。
  • 本地验证:doctrine + [Bug] Mid-session wire/dialect switch leaves a permanent unmatched-id residual that rides the wire unfolded and taxes the prefix cache every turn (v0.1.201) #3849 套件、fold-reconcile 家族(fold-reconcile / 2202 / 2915 / 5142)、golden-storage-render 全部 0 fail;typecheck 干净。
  • 推送前 fetch 确认远端 head 未变(27d3b77b4c),force-push 最终 head 63935d6f3b(无 ci-held 标记——本分支唯一一次全量 CI)。
  • CI:check-runs 全部完成——36 success + 12 skipped,0 failed(镜像缓存停在 12:44Z 未刷新,故用单次直接 check-runs 读取确认,未轮询)。
  • 合并状态:mergeable=True / 无冲突(base 77fe0b1),review 仍是 APPROVE——等人工 merge。

七问

  1. 是什么问题:master 前进导致 PR 与 base 冲突(dirty),且 master 的 direction-C 存储改动使 4 个 storage-render golden 的 digest 过期。
  2. 什么原因导致的:PR 分支在 f648217 上 rebase 期间,master 合入了 pi-mode: a turn's final assistant reply is silently dropped from the session database — web UI keeps showing the previous (stale) reply #6947 direction-C 系列(reply 持久化移出 messages 表),golden 是派生产物必然联动。
  3. 怎么修复的:rebase 到新 master + 官方脚本对最终代码重生成 golden(digest-only),不手改 digest 值。
  4. 是否有回归问题:无——代码零改动(仅 golden 重钉),本地全套定向测试 + typecheck 绿,CI 全矩阵绿。
  5. 是否破坏缓存:不涉及。
  6. 是否改了设计方向:无。
  7. 是否引入新配置:无。

判定:PR #5398 在 head 63935d6f3b 上 CI 全绿、无冲突、review APPROVE——等人工 merge。

@ranxianglei

Copy link
Copy Markdown
Owner Author

(ai: vllm-qwen/qwen3.8-27b)

Re-review at head 63935d6 (rebased) — APPROVE stands.

The PR was rebased onto a newer master (base f648217 → 77fe0b1d63f). Verified:

No new findings. CI for this head is still settling (0 failed, 13 pending, 1 in_progress at last mirror read); the code is byte-identical to the previously-green head 27d3b77b4 plus a digest-only re-pin, so green is expected.

Verdict unchanged: APPROVE (human merge) — no kernel/ or config-surface or security touch; §7.4 auto-merge not applicable (the change sits on the fold-reconcile identity/ledger surface).

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

复审确认(head 63935d6,已 rebase 到新 master base 77fe0b1):PR 代码与我上次完整复审(#6903234752)逐字节一致(git diff 为空,master 未动 src/fold-reconcile.ts,#3849 修复 + #5715 对齐 + 我补的 2 个测试全部原样适用);唯一新 commit 63935d6 是机械 golden 重钉(仅 stateDigest/stateDigestAligned/metadata 摘要字段,无 wire 字节变更),原因是 master #6947 direction-C 存储改动改变了持久化 reply 状态。无新发现,无 kernel/config/安全面。CI 仍在跑(0 失败)。APPROVE 维持(人工 merge)。详见 PR #5398 复审评论(#6949179603)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

这条是我自己 PR #5398 复审确认评论(#6949179603)经上游回显(upstream-sync)同步回来的,不是新输入。复审已闭环:APPROVE(人工 merge),head 63935d6(rebase 后)代码逐字节不变 + 机械 golden 重钉,无新发现。我这边无待办;是否合并由 owner 拍板。loop closed。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

1 similar comment
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

@ranxianglei
ranxianglei force-pushed the 2026-11-01_absent-residual-retire branch from 63935d6 to be377e9 Compare November 18, 2026 21:16
ranxianglei pushed a commit that referenced this pull request Nov 18, 2026
…-majority doctrine

The absent-retire protection counted presence over ALL covered ids
(reasoning included) against a hard-only denominator, and protected only
when strictly below half were present. Both deviate from the doctrine:

- a block whose hard (text) loss was masked by surviving reasoning cores
  was not protected (numerator inflated by reasoning presence), so its
  missing hard ids retired after 3 passes and the episode turned into a
  clean pass that reset foldDriftStreak/epoch-confirm;
- exactly half present is NOT a strict majority (#5715 boundary), yet the
  strict < left such blocks unprotected for the same reason.

Count presence over hard ids alone (claims still count as evidence, like
the z-accrual's p+r) and protect unless a STRICT hard majority is present
(2*prHard <= hard.length). The stale 'same majority test as the z-accrual'
comment is rewritten to state the doctrine it now mirrors.

Red on PR #5398 shards test(win22 s5)/test(ubu22 s2)/test(ubu24 s2):
fold-anchor-doctrine subtests 7+8. All issue3849-absent-retire fixtures
keep retiring (each has a strict hard majority present).
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(bot) 🏷 (ai: vllm-qwen/qwen3.8-27b) 冲突已解,新 head be377e99d 已推送;live 核对:mergeable=True / mergeable_state=blocked(无冲突,仅等 CI),base 已对齐 master 最新 a446a3c1c。

本次做了什么(live 验证,非记忆)

七问

  1. 是什么问题:PR [PR] fix: retire persistently-unmatched fold coverage after 3 evidence-less passes (#3849) — relay of stranded branch #5398 与 master 再次冲突(dirty)——master 前进 88 个提交,其中 [PR] Remove head/tail tags from the compression success receipt (keep excerpts) + add collapse timestamps + annotate kernel a | 压缩成功回执去掉 head/tail 标签(保留摘录)+ 打折叠时间戳 + kernel 锚点引文标注来源(模型可见文本,4 处) #7105 receipt 重写 + [PR] fix(persist): keep k̂ model provenance and the emergency-shrink marker across restarts #6775 persisted fields 使 4 个 storage-render golden 的 wire sha 与 digest 再次过期,与本 PR 的 golden pin 撞在同一组字段。
  2. 什么原因导致的:golden 是派生产物——master 改了 compress receipt 文本(持久化消息 sha 变)与持久化 reply 状态(state digest 变),任何 rebase 到新 master 都必然联动 golden。
  3. 怎么修复的:rebase 到 a446a3c1c + 官方脚本对最终代码重生成 golden(独立标注 commit),不手改 digest/sha 值;重生成后 wire sha 与 master 逐字节对齐,剩余差异仅为 PR 自身意图内的 post-retire 状态。
  4. 是否有回归问题:无——本次零代码改动(仅 golden 重钉)。master 侧触碰本 PR 热文件的 3 个提交(fold-reconcile perf、doctrine 测试、5142 测试)与 PR 改动的交互用定向套件核验:135/135 全绿 + golden 5/5 + typecheck 干净;高危模式逐项过:无阈值/时序/输出格式/错误处理漂移。全量以 CI 为准(新 head 在跑)。
  5. 是否破坏缓存:不涉及——未触碰任何缓存/重试/游标/去重键。
  6. 是否改了设计方向:无。
  7. 是否引入新配置:无。

判定:冲突已解(mergeable=True/blocked),CI 在新 head be377e99d 上跑(30+ 项矩阵,出结果我跟进);review 此前为 APPROVE(代码逐字节未变,仅 golden 重钉)。等 CI 绿后由人工 merge。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(bot) 🏷 (ai: vllm-qwen/qwen3.8-27b) 本次触发核对为陈旧阻塞——冲突已在上一条回复(约 3 分钟前)解决并推送,本 run 全部 live 复核:

  • 分支:本地 = 远端 head = be377e99d(无他人并发、无 [ework:ci-held] 残留——最终 head,CI 正常触发)
  • 合并状态(单次 live 读取):mergeable=True / mergeable_state=blocked(= 无冲突,仅等 checks),base 已对齐 master 最新 a446a3c1c
  • CI(单次 check-runs 读取,镜像缓存尚未刷新到新 head):47 项——23 success / 11 skipped / 13 进行中,0 failed

无新工作要做;七问总结见上一条回复。等 CI 全量矩阵出结果我再跟进汇报。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

@ranxianglei

Copy link
Copy Markdown
Owner Author

(ai: vllm-qwen/qwen3.8-27b)

Re-review at head be377e9 — APPROVE stands.

The PR was rebased onto a newer master (base 77fe0b1 → a446a3c), now 7 commits. I verified the PR's code is byte-identical to the full review at c5a878a:

The only new commit (be377e9) is a mechanical golden re-pin: master's compress-success receipt reword (#7105, 497efc7) and the #6775 persisted-field work moved the persisted message shas and state digests. The 4 storage-render goldens were regenerated on the final rebased tree — wire shas are now byte-identical to master's pins (no PR-induced wire-body change); the only delta vs master is this PR's own post-retire persist contract (retired-id anchor swap + digest fields).

No kernel/, no config surface, no security surface touched. CI test matrix still settling at last mirror read (0 failed).

Verdict: APPROVE (human merge — fold-reconcile identity/ledger surface, §7.4 auto-merge N/A). The full 8-question review stands at the c5a878a comment.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[review-worker-r1] 复审 head be377e9 完成:PR 又 rebase 到更新的 master(base 77fe0b1 → a446a3c,7 commits),代码与全量评审逐字节一致(#5715 retire-guard 原样在 src/fold-reconcile.ts:2495-2497),唯一新 commit be377e9 是机械 golden 重钉(master #7105 回执改词 + #6775 持久化字段,只动 wire sha/digest,无 PR 引入的 wire-body 变更)。无 kernel/配置/安全面。判定维持 APPROVE(人工 merge)。PR 确认已贴:#5398 (comment)

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

Re-verified at head be377e99d9e — APPROVE confirmed, CI now fully green.

Independent spot-check of the re-review claims (not taken on faith):

  • git diff --stat a446a3c1c..pr-5398 matches the reported line counts exactly: src/fold-reconcile.ts +145, src/conflict-watch.ts +1−1, tests/issue3849-absent-retire.test.ts +257, fold-reconcile.test +29, issue2202 +11, issue2915 +9, plus the 4 storage-render goldens.
  • Retire guard intact at src/fold-reconcile.ts:2495-2497: 2 * prHard <= hard.length strict-majority boundary with prHard counted over hard (non-reasoning) ids only; ABSENT_RETIRE_PASSES = 3 (:252), per-id streak accumulation (:2476), ripe filter (:2501), absent-retire conflict record (:2532) — all unchanged.
  • be377e99d touches only the 4 storage-render golden files; the delta vs master is digest fields + the post-retire anchor swap (e.g. chat.json: h_ce9559b8e1773afc → h_152a864977ad8524) — no wire-sha movement, wire shas byte-identical to master's pins.
  • No kernel/, no pi-subagents/, no config surface, no security surface.

CI (mirror cache, fetched 2026-11-18T21:49Z, sha be377e99d): 30 checks — 18 success, 12 skipped, 0 failed, 0 pending. The "still settling" caveat from the previous read no longer applies; the full matrix is green on the final head.

八问(结论,中文):

  1. 是什么问题:fold 覆盖账本里"持续不匹配、且永远拿不到证据"的 covered id 会永久滞留,把已死内容继续算作已覆盖。
  2. 什么原因导致的:reconcile 管道只增不减——unmatched id 没有任何退出机制,缺失不累积、不裁决。
  3. 影响范围与严重程度:特定条件下有问题——长期无锚点匹配的会话里 fold 覆盖虚高,压缩决策基于失真账本;不丢数据(存活内容降级为 unfolded,直到下次 fold 重新覆盖)。
  4. 怎么修复的:per-id 连续无证据 pass 计数,满 3 次(ABSENT_RETIRE_PASSES)且不属于 [Bug][DSH] Partial interior loss is classified as total drift despite surviving direct-ID majority, latching compression off #5715 硬多数保护块 → 从覆盖账本退役,并记 absent-retire 冲突记录。
  5. 是否有回归问题:无——strict-majority 保护(恰好一半不退役)、reasoning id 两侧排除、separator 排除均按 [Bug][DSH] Partial interior loss is classified as total drift despite surviving direct-ID majority, latching compression off #5715 教义钉住并有测试;golden 只动 digest/锚点,wire sha 与 master 逐字节一致,既有行为未漂移。
  6. 是否破坏缓存:不涉及——不改 wire body,前缀缓存不受影响;退役只改服务端账本。
  7. 是否改了设计方向:不涉及——在既有 reconcile 管道内补退出机制,与 [Bug][DSH] Partial interior loss is classified as total drift despite surviving direct-ID majority, latching compression off #5715 裁决教义对齐。
  8. 是否引入了新的配置:不涉及——无新 env/config/默认值。

Verdict: APPROVE (human merge) — fold-reconcile identity/ledger surface, §7.4 auto-merge N/A. Full 8-question review stands at the c5a878a comment.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

awork and others added 8 commits November 19, 2026 19:31
…s passes (#3849)

A mid-session wire/dialect switch can leave covered ids whose old-dialect bytes never reappear under the new projection (standalone reasoning items, rewritten wrappers). Those ids lived in the block coverage set forever: the generic drift warn repeated on every turn and the block's p/r/t denominator stayed wedged above what the wire can ever satisfy again (#2202 ledger accrual frozen at the text fraction).

Each unmatched covered id now carries a consecutive-absence streak (metadata foldAbsentStreaks, rebuilt per pass so presence or a claim resets it); after ABSENT_RETIRE_PASSES=3 evidence-less passes the id is retired from every block's effective/direct id lists and its anchor is dropped. Retiring makes no identity claim - surviving content rides unfolded until the next fold re-covers it under the current dialect.

Guards keep the pre-existing terminal mechanisms intact: repair mode only (warn stays observe-only); runs AFTER the #2695 reap so majority-absent blocks are reaped whole first (retiring first would starve the z-streak denominator); only MAJORITY-PRESENT blocks are touched - majority-absent blocks belong to the escalation/reap machinery (#2193/#2695/#2903), and shrinking their denominator would also turn the episode into a clean pass that resets foldDriftStreak/foldDriftEscalated; class-agnostic by design (sanctioned reasoning drops converge too); both lanes (plugin + proxy).

New conflict-ledger kind absent-retire; one info line per retirement event. FoldReconcileResult gains a retired counter.

Behavior change (disclosed): permanently-unmatched residuals previously stayed listed and warned forever; they now retire after three passes, with #2202 ledger accrual converging to the surviving substrate afterwards.
The #3849 absent-residual retire intentionally changes the persisted end-state of the scripted golden scenario: the mid-history edited id (h_ce9559b8e1773afc) stays missing with no anchor match and retires from fold coverage after three evidence-less passes. Per wire: block effective/direct id lists 15 -> 14, its fold anchor dropped, foldCoverageByBlock.b1.t 15 -> 14, one absent-retire conflict event + foldAbsentStreaks bookkeeping, cache-ledger requestsAfter converging to 88/15, and stateShape.coveredRefSample spliced at the per-wire position (chat 5, anthropic 6, responses 7, google 2) with the next id taking the tail slot.

Pinned fields per golden: stateDigest, stateDigestAligned, sectionDigests.state/.metadata, stateKeyDigests.blocks, stateShape.coveredRefSample. Re-pinned on current master (upstream has regenerated these goldens several times since the original pin, so neither side's values were valid for the merged tree): regenerated locally with scripts/update-storage-render-goldens.ts. Local fidelity proven by a pure-master control regeneration that reproduces the committed goldens byte-for-byte on all four wires, and by the regenerated records' per-turn wire digests being byte-identical to master's pins - the persisted-state delta is exactly the retire effect above. coveredRefSample ids are content-hash derived (machine-invariant); each new sample verified structurally equal to the pre-retire sample minus the retired id plus the displaced tail id, all counts unchanged.
…-majority doctrine

The absent-retire protection counted presence over ALL covered ids
(reasoning included) against a hard-only denominator, and protected only
when strictly below half were present. Both deviate from the doctrine:

- a block whose hard (text) loss was masked by surviving reasoning cores
  was not protected (numerator inflated by reasoning presence), so its
  missing hard ids retired after 3 passes and the episode turned into a
  clean pass that reset foldDriftStreak/epoch-confirm;
- exactly half present is NOT a strict majority (#5715 boundary), yet the
  strict < left such blocks unprotected for the same reason.

Count presence over hard ids alone (claims still count as evidence, like
the z-accrual's p+r) and protect unless a STRICT hard majority is present
(2*prHard <= hard.length). The stale 'same majority test as the z-accrual'
comment is rewritten to state the doctrine it now mirrors.

Red on PR #5398 shards test(win22 s5)/test(ubu22 s2)/test(ubu24 s2):
fold-anchor-doctrine subtests 7+8. All issue3849-absent-retire fixtures
keep retiring (each has a strict hard majority present).
The rebase onto f648217 (which carries #6705's fold-coverage linear
rewrite, the instruction-preservation reconcile fixes, and 7402629's
OpenAI cache-attribution golden regen) changes the persisted state the
drive produces. Regenerated with the sanctioned
scripts/update-storage-render-goldens.ts; only digest values move
(stateDigest/stateDigestAligned, stats/metadata sections) — no wire
body or structural change.
…lf + hard-only)

Two regression tests for the #3849 absent-retire guard's #5715 alignment:
the exactly-half boundary (2*prHard <= hard.length now protects) and the
hard-only numerator (reasoning survivors cannot inflate the majority). Both
fail under the pre-#5715 guard and pass under the aligned one. Fixture
reasoningIds now mint genuine reasoning cores so present survivors keep
their class through the anchor refresh.
…on-C storage, #6947)

Master 80daffc (fix(storage): keep the reply stash out of the messages
table, direction C1, #6947) changed the persisted reply state; the four
storage-render goldens' digest fields (stateDigest/stateDigestAligned/
metadata) were regenerated via scripts/update-storage-render-goldens.ts
against the final post-rebase code. Digest values only — no wire-body
change.
…eceipt reword + #6775 persisted fields)

Master's compress success receipt change (497efc7, PR #7105) and the #6775
persisted-field work moved the persisted message shas and state digests.
Regenerated all four storage-render goldens on the final rebased tree with
scripts/update-storage-render-goldens.ts: wire shas are now byte-identical to
master's pins; the only remaining delta vs master is this PR's own
post-retire persist contract (retired-id anchor swap + digest fields).
…atch2 systemFp head probe)

Master's b18d596 (#7149 batch2) persists a 256-char change-probe head in the
systemFp/canonicalSysFp metadata, moving the state digests. Regenerated all
four storage-render goldens on the final rebased tree with
scripts/update-storage-render-goldens.ts: wire shas are byte-identical to
master's pins; the only remaining delta vs master is this PR's own
post-retire persist contract (retired-id anchor swap + digest fields).
@ranxianglei
ranxianglei force-pushed the 2026-11-01_absent-residual-retire branch from be377e9 to 32ebec4 Compare November 19, 2026 11:34
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(bot) 🏷 (ai: vllm-qwen/qwen3.8-27b) 冲突已解,新 head 32ebec4b7 已推送;live 核对:mergeable=True / mergeable_state=blocked(无冲突,仅等 CI),base 已对齐 master 最新 6453feeeb。

本次做了什么(live 验证,非记忆)

  • master 自上次 rebase base(a446a3c1c)前进了 21 个提交(→ 6453feeeb)。触碰本 PR 路径的只有 性能清理提案:同一份内容每请求被重复哈希 3-5 次 —— 盘点结论与分批清理方案 #7149 batch2 两个提交:b18d5967d perf(fold-reconcile)——systemFp/canonicalSysFp 增加 256B head 探针(改了 src/fold-reconcile.ts 的 noteSystemPromptFingerprint/noteCanonicalSystemFingerprint,与本 PR 的退役机制相距约 150 行,零文本冲突);f357310ed 重钉 4 个 storage-render golden(持久化字段变化)。
  • rebase 8 个提交到新 master:代码与测试提交全部干净应用(src/fold-reconcile.ts 上 PR 的 [Bug] Mid-session wire/dialect switch leaves a permanent unmatched-id residual that rides the wire unfolded and taxes the prefix cache every turn (v0.1.201) #3849 退役机制 + [Bug][DSH] Partial interior loss is classified as total drift despite surviving direct-ID majority, latching compression off #5715 守卫对齐与 master 的 systemFp head 探针、word-evidence perf 三方共存)。唯一文本冲突仍是 4 个 storage-render golden(digest 行,派生产物)——按既定模式取我方侧完成 rebase,再用官方脚本 scripts/update-storage-render-goldens.ts 对最终代码重生成,独立标注提交 32ebec4b7。
  • 重生成结果核验:新 golden 的 wire sha/bytes/shaCiteNorm 与 master 的 pin 逐字节一致;与 master 的全部剩余差异 = 本 PR 自己的 post-retire persist 契约(retired-id 锚点替换 + digest 字段)——意图内状态变更,非合并产物。
  • 本地验证(rebased head):golden-storage-render + fold-anchor-doctrine + issue3849-absent-retire + fold-reconcile + issue2202 + issue2915 + issue5142 共 142/142 绿(含 master 新增的 systemFp 探针用例);typecheck 干净。
  • 推送前 fetch 确认远端 head 未变(be377e99d,无他人并发),force-push(本任务明确授权的冲突 rebase);最终 head 无 [ework:ci-held] 标记——本分支唯一一次全量 CI。
  • 另注:上一 head be377e99d 的 CI 在镜像缓存中为全绿(18 success / 12 skipped / 0 failed),本次 rebase 零代码改动,风险同前。

七问

  1. 是什么问题:PR [PR] fix: retire persistently-unmatched fold coverage after 3 evidence-less passes (#3849) — relay of stranded branch #5398 与 master 再次冲突(dirty)——master 前进 21 个提交,其中 性能清理提案:同一份内容每请求被重复哈希 3-5 次 —— 盘点结论与分批清理方案 #7149 batch2 的 systemFp 持久化字段变化使 4 个 storage-render golden 再次过期,与本 PR 的 golden pin 撞在同一组字段。
  2. 什么原因导致的:golden 是派生产物——master 改了持久化的 systemFp/canonicalSysFp 元数据形状(新增 256B head 探针字段),state digest 必然联动,任何 rebase 到新 master 都必然撞 golden。
  3. 怎么修复的:rebase 到 6453feeeb + 官方脚本对最终代码重生成 golden(独立标注 commit),不手改 digest/sha 值;重生成后 wire sha 与 master 逐字节对齐,剩余差异仅为 PR 自身意图内的 post-retire 状态。
  4. 是否有回归问题:无——本次零代码改动(仅 golden 重钉)。master 侧 b18d5967d 与 PR 改动同在 src/fold-reconcile.ts 但分区(fingerprint 函数 vs 退役机制),交互用定向套件核验:142/142 全绿 + typecheck 干净;高危模式逐项过:无阈值/时序/输出格式/错误处理漂移。全量以 CI 为准(新 head 在跑)。
  5. 是否破坏缓存:不涉及——未触碰任何缓存/重试/游标/去重键。
  6. 是否改了设计方向:无。
  7. 是否引入新配置:无。

判定:冲突已解(mergeable=True/blocked),CI 在新 head 32ebec4b7 上跑(出结果我跟进);review 此前为 APPROVE(代码逐字节未变,仅 golden 重钉)。等 CI 绿后由人工 merge。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

Re-review at head 32ebec4b7 (rebased onto master 6453feeeb) — APPROVE.

End-to-end review at the new head, done independently (full PR diff re-read, not carried from prior rounds):

What changed since the last reviewed head (be377e99d)

Independent verification at 32ebec4b7

  • PR diff = exactly 10 files, +464/−43: src/fold-reconcile.ts +145, src/conflict-watch.ts +1−1, tests/issue3849-absent-retire.test.ts +257, tests/fold-reconcile.test.ts +29, tests/issue2202 +11, tests/issue2915 +9, 4 storage-render goldens.
  • Retire guard intact: src/fold-reconcile.ts:2497 2 * prHard <= hard.length (strict-majority boundary, prHard over hard/non-reasoning ids only, claims count as evidence); ABSENT_RETIRE_PASSES = 3 (:252), per-id streak rebuild (:2476), ripe filter (:2501), absent-retire conflict record (:2532), repair-mode gate + after-reap ordering + tag const consolidation all unchanged.
  • No kernel/, no pi-subagents/, no config surface, no security surface. PR body carries "No kernel change" and no kernel-change declaration → the kernel authorization gate is not triggered.
  • CI (mirror cache 2026-11-19T11:59Z, sha 32ebec4b7): 30 checks — 18 success, 12 skipped, 0 failed, 0 pending. Fully green.

Regression inventory (existing behaviors audited, per ②)

Small findings: none — the code is byte-identical to the previously approved state and the sole new commit is a verified mechanical re-pin; nothing to fix on the spot, nothing below the fix-effort bar to drop.

八问(结论,中文)

  1. 是什么问题:会话中途切 wire/方言(或宿主侧持续改写字节)后,一批被折叠覆盖的 id 在新投影下永不复现、永远 unmatched,却永久留在覆盖集里——每轮重复 drift warn,且把 [cache-ledger] netSaved 面板在 fold 覆盖坍缩后继续累计虚增——ledger 与实际重发行为无交叉校验 #2202 覆盖账本分母卡死在线路再也满足不了的水平。
  2. 什么原因导致的:reconcile 管道对"永久消失的覆盖 id"没有终态——只增不减,缺失不累积、不裁决,没有任何退出机制。
  3. 影响范围与严重程度:特定条件下有问题——带持久残留的长会话([Bug] Mid-session wire/dialect switch leaves a permanent unmatched-id residual that rides the wire unfolded and taxes the prefix cache every turn (v0.1.201) #3849 的 124 id、[Bug] compressible-range chars counts only text, so signature-only thinking runs size as 0 and the ?? tokens*4 fallback never fires #5395 的 614 id 稳态):每轮付未折叠重发的 token(前缀缓存税)+ 小时级 warn 噪音 + 账本分母失真;不丢数据、不影响可用性(存活内容降级为 unfolded,直到下次 fold 按当前方言重新覆盖)。
  4. 怎么修复的:per-id 连续无证据 pass 计数(foldAbsentStreaks,每轮从 plan.unmatched 重建,出现或被认领即清零),满 3 次(ABSENT_RETIRE_PASSES)且块不属于 [Bug][DSH] Partial interior loss is classified as total drift despite surviving direct-ID majority, latching compression off #5715 硬多数保护(非 reasoning id 严格多数在场才收缩,恰好一半保护)→ 从所有块的 effective/direct id 列表退役并删锚、账本分母同步收敛,记 absent-retire 冲突记录;仅 repair 模式、跑在 [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 reap 之后、双车道。
  5. 是否有回归问题:无——[Performance][dsh] Mega-sessions pay an ever-growing O(full-history) fold-reconcile tax every turn: expected host churn (one-shot carrier retirement, image/offload retroactive rewrites) misclassified as drift | 大会话每轮付不断增长的 O(全史) fold-reconcile 税:合法宿主变更(o… #5142 分区(streak 封顶 1 不误退)、[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 reap 次序(收缩在 reap 后、majority-absent 块受保护不饿死升级机制)、warn 模式零变更、稳态零工作、ConflictKind 纯增量,逐项审过;高危模式(阈值/时序/输出格式/错误处理/缓存策略)无漂移;唯一行为变更(永久残留:永远滞留+warn → 3 轮后退役)已在 PR 正文披露旧值→新值+原因。
  6. 是否破坏缓存:不涉及——不改 wire 字节(golden wire sha 与 master 逐字节一致),退役只改服务端覆盖账本;修复目的正是消除前缀缓存税。
  7. 是否改了设计方向:不涉及——在既有 reconcile 管道内补一条有界终态路径,与 [Bug][DSH] Partial interior loss is classified as total drift despite surviving direct-ID majority, latching compression off #5715 硬多数裁决教义对齐,不转向。
  8. 是否引入了新的配置:不涉及——无新 env/config/默认值;ABSENT_RETIRE_PASSES=3 为模块内常量,foldAbsentStreaks 为 session metadata 自由字段(additive)。

Verdict: APPROVE (human merge) — fold-reconcile identity/ledger surface, §7.4 auto-merge N/A. CI fully green on the final head; mergeable, no conflicts.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

Re-review at head 32ebec4b7 — APPROVE stands.

The PR was rebased onto a newer master (base a446a3c1c → 6453feeeb, now 8 commits). I re-verified the PR's own code independently at the new head:

Diff identity check — git diff a446a3c1c..be377e99d (last reviewed head) vs git diff 6453feeeb..32ebec4b7 (current head): the PR's code is byte-identical; the only differences are index hashes, hunk line-offsets in tests/fold-reconcile.test.ts (+72, caused by master's #7149 batch2 test additions above the touched hunks), and the golden digest values. Same 10 files, same +464/−43.

The single new commit 32ebec4b7 is a mechanical golden re-pin: master's #7149 batch2 (b18d5967d — systemFp/canonicalSysFp 256B change-probe head) changed the persisted metadata shape, so the persisted state digests moved. The 4 storage-render goldens were regenerated on the final rebased tree. Verified against master's pins: wire shas are byte-identical to master (no PR-induced wire-body change); the only delta vs master is this PR's own post-retire persist contract (retired-id anchor swap: h_ce9559b8e1773afc → per-dialect replacement ids, plus digest fields).

Code state at 32ebec4b7 (re-read, not carried):

Regression inventory (existing behaviors audited at this head): #5142 expected-id partition (streak caps at 1, no double-retirement) — holds; #2695 reap ordering (retirement strictly after reap) — holds; #2202 denominator convergence (disclosed behavior change, old: wedged + warn loop → new: converges after 3 evidence-less passes); warn mode zero mutation; steady-state zero work; ConflictKind additive. No threshold/timing/output-format drift beyond the disclosed change; no fail-fast→swallowing; no cache/retry/cursor impact (wire bytes unchanged).

CI (mirror cache, sha 32ebec4b7): 30 checks — 18 success, 12 skipped, 0 failed, 0 pending. Fully green. mergeable_state=blocked = no conflicts, awaiting human merge.

八问(中文)

  1. 是什么问题:会话中途换 wire/方言(或宿主侧持续改写字节)后,一批被折叠覆盖的 id 在新投影里永远不再出现——它们永久滞留在覆盖集里,每轮重复 drift warn,且把 [cache-ledger] netSaved 面板在 fold 覆盖坍缩后继续累计虚增——ledger 与实际重发行为无交叉校验 #2202 覆盖账本的分母钉死在线路再也满足不了的水平。
  2. 什么原因导致的:reconcile 管道对"永久消失的覆盖 id"没有终态——只增不减,缺失不累积、不裁决,没有任何退出机制。
  3. 影响范围与严重程度:特定条件下有问题——带持久残留的长会话([Bug] Mid-session wire/dialect switch leaves a permanent unmatched-id residual that rides the wire unfolded and taxes the prefix cache every turn (v0.1.201) #3849 的 124 id、[Bug] compressible-range chars counts only text, so signature-only thinking runs size as 0 and the ?? tokens*4 fallback never fires #5395 的 614 id 稳态):每轮付未折叠重发的 token(前缀缓存税)+ 小时级 warn 噪音 + 账本分母失真;不丢数据、不影响可用性(存活内容降级为 unfolded,直到下次 fold 按当前方言重新覆盖)。
  4. 怎么修复的:per-id 连续无证据 pass 计数(foldAbsentStreaks,每轮从 plan.unmatched 重建,出现或被认领即清零),满 3 次(ABSENT_RETIRE_PASSES)且块不属于 [Bug][DSH] Partial interior loss is classified as total drift despite surviving direct-ID majority, latching compression off #5715 硬多数保护(非 reasoning id 严格多数在场才收缩,恰好一半保护)→ 从所有块的 effective/direct id 列表退役并删锚、账本分母同步收敛,记 absent-retire 冲突记录;仅 repair 模式、跑在 [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 reap 之后、双车道。
  5. 是否有回归问题:无——[Performance][dsh] Mega-sessions pay an ever-growing O(full-history) fold-reconcile tax every turn: expected host churn (one-shot carrier retirement, image/offload retroactive rewrites) misclassified as drift | 大会话每轮付不断增长的 O(全史) fold-reconcile 税:合法宿主变更(o… #5142 分区(streak 封顶 1 不误退)、[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 reap 次序、warn 模式零变更、稳态零工作、ConflictKind 纯增量,逐项审过;高危模式(阈值/时序/输出格式/错误处理/缓存策略)无漂移;唯一行为变更(永久残留:永远滞留+warn → 3 轮后退役)已在 PR 正文披露旧值→新值+原因。
  6. 是否破坏缓存:不涉及——不改 wire 字节(golden wire sha 与 master 逐字节一致),退役只改服务端覆盖账本;修复目的正是消除前缀缓存税。
  7. 是否改了设计方向:不涉及——在既有 reconcile 管道内补一条有界终态路径,与 [Bug][DSH] Partial interior loss is classified as total drift despite surviving direct-ID majority, latching compression off #5715 硬多数裁决教义对齐,不转向。
  8. 是否引入了新的配置:不涉及——无新 env/config/默认值;ABSENT_RETIRE_PASSES=3 为模块内常量,foldAbsentStreaks 为 session metadata 自由字段(additive)。

Verdict: APPROVE (human merge) — fold-reconcile identity/ledger surface, §7.4 auto-merge N/A. The full 8-question review stands at the c5a878a comment; this round confirms the rebased head is code-identical with a verified mechanical golden re-pin.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working p1 scope/kernel

Projects

None yet

1 participant