Skip to content

[PR] fix(preflight): continue the multi-round convergence walk past the doom bar when fold state exists (#4920) - #4928

Open
ranxianglei wants to merge 16 commits into
masterfrom
2026-10-27_preflight-multiround-recovery
Open

ranxianglei wants to merge 16 commits into
masterfrom
2026-10-27_preflight-multiround-recovery

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

Part of #4920 (dsh-lane provider-switch death spiral). This PR fixes the two decision-free facets of that issue — the broken 502→413 recovery path and the silent lost-fold visibility. The remaining facets stay open in-thread on #4920 (nudge backlog-driven firing = cadence doctrine, owner decision; reconcile claim policy for watch-list near-duplicates; epoch-pause deadlock).

What breaks without this

Incident shape (#4920, v0.1.208, dsh lane): provider switch → host re-renders history → content-hash coverage breaks → ~3.1M tok of folded content rides the wire raw → payload ≈ 7.7× window. Preflight then does its job: folds 31 ranges in one pass, saves 2.5M tok, still misses the window, and exits 502 retryable=true with the #3918 promise — "the 31 ranges folded this turn persist — the next attempt starts from a smaller baseline".

The next request broke that promise. The 502 path's estimate writeback (lastInputTokens = post-fold estimate, source="estimate") arms the evidence-probe regime, where the doomed-probe gate prices raw inbound bytes against max(2MB, window × 7.5). The raw history is over-bar by bytes while the post-fold payload is under-window in tokens — so the request died at a terminal non-retryable 413 plus a route-scoped local refusal, before any fold ran. The second convergence round never happened; with nudge's growth floor an idle session then never folds again. Session stuck at 3–6M tokens permanently.

Fix

  • Recovery path (src/server.ts): when the over-bar condition holds AND the session has fold state with viable compressible ranges, fall through to the fold-first regime instead of refusing — the multi-round walk resumes exactly as the 502 promised. Each attempt stays bounded by the per-regime budget (≤32 rounds) and folded ranges persist across attempts, so convergence is progress-monotone; billion-context 卡死问题 —— 上报材料 usage获取不到导致上下文估计失误 #2313's livelock concern is bounded by construction.
  • Visibility (src/fold-reconcile.ts + src/session.ts + src/acp-status.ts): lost coverage is no longer log-only. reconcileFoldCoverage records truly-lost (unmatched) coverage on the session at the single point that sees every verdict class (including mutation passes that deactivate blocks before the lane snapshots run); re-anchored claims are NOT counted as lost; clean passes clear the record. acp_status renders it as a FOLD DRIFT (session-level) section. The [acp-drift] warn lines are byte-identical to before.

Behavior change (disclosed)

  • Old: an over-bar-by-bytes payload was refused with terminal 413 (retryable=false) for ALL sessions once the baseline had demoted to estimate — including sessions mid-convergence whose post-fold payload fits the window.
  • New: such payloads on sessions WITH fold state continue a bounded preflight walk (fold → 502-with-progress → next attempt), reaching the same terminal states only when there is genuinely nothing left to fold (fresh sessions: unchanged immediate 413; exhausted-but-nothing-viable: unchanged 413 via the existing deterministic-exhaustion path). Fresh-session behavior is pinned by the negative test (zero upstream calls, zero summary calls).
  • Why: availability over performance (§7.3 / [Bug/Enhancement] Codex 超过 100 MiB 的请求在 ACP 处理前断开:希望返回明确 413 并支持配置字节预算(#2606 后续) #3128) — restoring availability outranks the probe's cost-saving purpose; the probe exists to avoid paying doomed upstream calls, and here the alternative is a permanently dead session.
  • No wire format change, no config surface change, no kernel/ touch. One additive persisted-state field: session.metadata.lastFoldDrift = {matched, expected, at} (epoch-ms at, masked as __TS__ by the storage canonicalizer exactly like savedAt/lastSeen); absent when there is no drift or after a clean pass — existing sessions are unaffected on load (the reader rejects anything but that shape).
  • Consequence: the four storage-render golden files were regenerated (node --import tsx scripts/update-storage-render-goldens.ts). Justification per the test header: the scripted golden conversation triggers a real coverage mismatch, so the new metadata key appears; the diff is metadata-only — stateDigest, stateDigestAligned and the metadata-section digest change, while state/blockContents/stats digests and foldAt 9 / editedAt 12 are byte-identical across all four lanes (chat/anthropic/responses/google).

Tests

…om bar when fold state exists (#4920)

A preflight pass that folds but still misses the window exits 502 with the #3918 promise 'the N ranges folded this turn persist - the next attempt starts from a smaller baseline'. The next request broke that promise: the 502 path's estimate writeback (lastInputTokens = post-fold estimate, source 'estimate') arms the evidence-probe regime, where the doomed-probe gate prices RAW inbound bytes against max(2MB, window*7.5). A raw history that is over-bar by bytes but post-fold under-window in tokens died at a terminal non-retryable 413 plus a route-scoped local refusal - before any fold ran. A 7.7x-window payload could never run its second convergence round; the session stayed stuck at 3-6M tokens forever.

Fix: when the payload is over-bar AND the session has fold state with viable compressible ranges, fall through to the fold-first regime instead of refusing - the multi-round walk resumes exactly as the 502 promised. Fresh sessions (no blocks) keep the immediate 413 (#2490/#2847 preserved); the post-fold doom check on actual forwards is untouched.

Also makes lost fold coverage visible: reconcileFoldCoverage records truly-lost (unmatched) coverage on the session and acp_status renders it as a FOLD DRIFT section; clean passes clear it. The [acp-drift] log lines are unchanged.

Tests: tests/issue4920-multiround-doombar.test.ts (e2e convergence walk + fresh-session negative + unit round-trip).
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-27_preflight-multiround-recovery (d29d7c4)

Latest build — install this exact version

npm install -g billion-context@0.0.10976-pr.4928.c71fec6

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
d29d7c4 billion-context@0.0.10976-pr.4928.c71fec6 build
0cae5a0 billion-context@0.0.10913-pr.4928.8de912d build
cd8f5f2 billion-context@0.0.10909-pr.4928.59d8875 build
3ae51e5 billion-context@0.0.10829-pr.4928.1da9d22 build
aa713af billion-context@0.0.10778-pr.4928.f0e6744 build
e738a01 billion-context@0.0.10594-pr.4928.b4ad912 build
d479033 billion-context@0.0.10268-pr.4928.cf834a0 build
e74a506 billion-context@0.0.10262-pr.4928.2f737da build
981d891 billion-context@0.0.9240-pr.4928.95729e6 build
0ef19bd billion-context@0.0.7371-pr.4928.6223f6f build

Download artifact

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

Install instructions are refreshed on each push.

@ranxianglei ranxianglei changed the title fix(preflight): continue the multi-round convergence walk past the doom bar when fold state exists (#4920) [PR] fix(preflight): continue the multi-round convergence walk past the doom bar when fold state exists (#4920) Oct 27, 2026
…Drift metadata field (#4928/#4920)

The #4920 observability fix records session.metadata.lastFoldDrift
{matched, expected, at} when fold coverage is lost to a resent-history
drift. The scripted golden conversation hits exactly that path (fold at
turn 9, content edit at turn 12), so the metadata section digest moves.

Regenerated via scripts/update-storage-render-goldens.ts. The diff is
metadata-only: state/blockContents/stats section digests, foldAt and
editedAt are unchanged in all four lanes. The at value is epoch ms,
masked __TS__ by canonicalize (#2671), so the pins stay stable across
runs.
ci-check added 5 commits October 30, 2026 01:05
…-pass conflict

src/fold-reconcile.ts: both sides rewrote the same clean-pass early-return.
Master (#5142) refined the condition to realUnmatched.length === 0 and added
the expectedRetired field; the PR (#4920) added clearFoldDrift() to drop the
stale lost-coverage record on a fully aligned pass. Merged: keep master's
refined condition + return, add the PR's clearFoldDrift() — the drift record
now clears exactly when a pass has no real (non-expected-rebase) drift.

tests/golden/storage-render/*.json: regenerated via
scripts/update-storage-render-goldens.ts against the merged code. Diff vs
master is only stateDigest/stateDigestAligned/metadata — the PR's additive
lastFoldDrift metadata field; master's state/blockContents/stats digests are
preserved.

Verified: typecheck clean; golden-storage-render 5/5, issue4920 3/3,
fold-reconcile 96/96, issue5142 + issue6021 17/17 pass.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Merge-conflict blocker resolved and pushed. I merged origin/master into the PR branch 2026-10-27_preflight-multiround-recovery (chose merge over rebase — the branch already carries several master-sync merge commits, so a rebase would have rewritten that history for no gain), resolved the two conflict sites, and fast-forward-pushed (no force-push needed; verified the remote head was still the pre-merge 0ef19bd46d before pushing). New head: 981d89156c.

What conflicted and how I resolved it:

Verification (targeted, local): npm run typecheck clean; golden-storage-render 5/5, issue4920-multiround-doombar 3/3, fold-reconcile + fold-reconcile-positional 96/96, issue5142-expected-rebase + issue6021-image-offload-anchor 17/17 — all pass. Post-push, GitHub reports mergeable: true / mergeable_state: behind (the dirty conflict is gone; "behind" is just master having advanced, not a blocker). CI is re-running on the new head with no failures so far.


八问(中文)

  1. 是什么问题:PR [PR] fix(preflight): continue the multi-round convergence walk past the doom bar when fold state exists (#4920) #4928 与 master 存在合并冲突(merge state: dirty),无法合并。
  2. 什么原因导致的:PR 分支与 master 同时改写了 src/fold-reconcile.ts 里同一个 clean-pass 提前返回块——PR 为 # [Bug][dsh] Fold coverage mismatch after provider switch 639/6313 → payload bounces back to 6.07M → preflight folds 32× | # [Bug][dsh] 切换 provider 后折叠覆盖失配 639/6313 → payload 弹回 6.07M → preflight 折叠 32 次仍压不回窗口 #4920 加了 clearFoldDrift(),master 的 [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 把条件收紧为 realUnmatched.length === 0 并新增 expectedRetired 字段;另外 storage-render 四个 golden 的摘要也分叉(PR 加了 lastFoldDrift 元数据字段,master 在 1222 个提交里改了 state)。
  3. 影响范围与严重程度:仅阻塞该 PR 合并(冲突本身无运行时行为影响)。严重度:合并阻塞,非运行时缺陷。
  4. 怎么修复的:把 origin/master 合入 PR 分支。fold-reconcile.ts 冲突取 master 收紧后的条件 + expectedRetired 返回,并在其中加入 PR 的 clearFoldDrift()——即"无真实(非预期 rebase)漂移"的 pass 才清漂移记录,两个意图都保留。四个 golden 用官方脚本对合并后代码重新生成(相对 master 只变 stateDigest/stateDigestAligned/metadata,即新增字段所致)。
  5. 是否有回归问题:无。typecheck 干净;golden-storage-render 5/5、issue4920 3/3、fold-reconcile 96/96、issue5142+issue6021 17/17 全过。master 的 state/blockContents/stats 摘要原样保留,只有 metadata 与整体 state 摘要按预期变化。
  6. 是否破坏缓存:不涉及。未触碰缓存/重试/增量游标/去重键逻辑,改动仅限 clean-pass 上报与对齐 pass 的漂移记录清理。
  7. 是否改了设计方向:不涉及。无架构/边界/数据流转向,纯冲突消解,整合两个既有意图(# [Bug][dsh] Fold coverage mismatch after provider switch 639/6313 → payload bounces back to 6.07M → preflight folds 32× | # [Bug][dsh] 切换 provider 后折叠覆盖失配 639/6313 → payload 弹回 6.07M → preflight 折叠 32 次仍压不回窗口 #4920 漂移清理 + [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 预期-rebase clean-pass)。
  8. 是否引入了新的配置:不涉及。无新增 env/config/默认值。

收工判定:冲突已解、已推送、定向测试全绿、CI 在新 head 上重跑中——本轮 CI 修复任务完成。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

进度汇报:本轮 CI 修复工作实际上在重启前已经完成,不是卡在工作中间——刚在本地重新核对了实时状态(非凭记忆):

之前那条完整八问汇报(已发)仍然有效,核心结论:冲突来自 src/fold-reconcile.ts 的 clean-pass 提前返回块(PR #4920 的 clearFoldDrift() vs master #5142 的 realUnmatched 条件 + expectedRetired)+ 四个 storage-render golden 摘要分叉;解法是保留 master 收紧后的条件并加入 PR 的 clearFoldDrift(),golden 用官方脚本对合并后代码重生成(相对 master 只变 stateDigest/stateDigestAligned/metadata)。定向测试全绿:typecheck 干净;golden-storage-render 5/5、issue4920 3/3、fold-reconcile 96/96、issue5142+issue6021 17/17。

无需决策、无阻塞,等 CI 跑完即可。

@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

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Run summary — merge conflict resolved and pushed.

The PR was dirty (conflicting with base master). Master had advanced 14 commits past my previous merge head (981d89156c → new master tip f648217cb8), which re-triggered the recurring golden conflict.

This run's specific obstacle (infrastructure, not code): the shared local clone (.refs.git, common dir for all worktrees) was shallow (276 boundary commits). The master tip had been fetched at depth 14, so the shallow boundary cut off the common ancestor — git merge-base returned empty and git merge failed with fatal: refusing to merge unrelated histories. I verified against the GitHub compare API that master genuinely descends from the old merge base (33104b1f95, ahead_by 609 / behind_by 0), confirming the local ref was fine and only the local object store was truncated. Fixed with git fetch --unshallow origin (non-destructive; restored full history, 9106 commits) — this also benefits every other worktree sharing that object store.

Resolution:

  • After unshallow, merge-base(981d89156c, f648217cb8) = 33104b1f95 (correct). git merge origin/master proceeded.
  • Code files (src/fold-reconcile.ts, src/server.ts, src/session.ts) auto-merged cleanly. I verified the clean-pass early-return block preserved BOTH sides: the PR's clearFoldDrift(session) (src/fold-reconcile.ts:2469) AND master's refined condition realUnmatched.length === 0 + expectedRetired: expectedSize (src/fold-reconcile.ts:2466,2470).
  • Only one conflict: tests/golden/storage-render/chat.json (content-addressed digest — cannot be hand-merged). Regenerated all 4 goldens via scripts/update-storage-render-goldens.ts. Diff vs master = only stateDigest/stateDigestAligned/metadata (the PR's additive lastFoldDrift metadata field); no content / state / blockContents changes.

Verification (targeted, local): npm run typecheck clean; 121/121 targeted tests pass (golden-storage-render, issue4920-multiround-doombar, fold-reconcile, fold-reconcile-positional, issue5142-expected-rebase, issue6021-image-offload-anchor).

Push: fast-forward (no force; confirmed remote head was still 981d89156c before pushing) → new head e74a506662.

Live state (verified this run): mergeable: True, mergeable_state: blocked — the conflict is gone; "blocked" now means waiting on CI/reviews, not a merge conflict. Mirror-cache CI: 30 checks, 0 failed, 0 pending (14 success, 16 skipped).


八问(中文):

  1. 是什么问题:PR [PR] fix(preflight): continue the multi-round convergence walk past the doom bar when fold state exists (#4920) #4928 与 master 基线冲突(merge state dirty),需把 master 合进 PR 分支解决全部冲突。
  2. 什么原因导致的:master 持续前进(本次又前进 14 个提交),而 4 个 storage-render golden 是内容寻址摘要、无法手工合并,每次 master 前进都会重新触发 golden 冲突。本次运行的额外障碍:共享本地克隆是浅克隆(276 个边界提交),master 尖端以深度 14 拉取,浅边界切断共同祖先,导致 merge-base 为空、git merge 报 "refusing to merge unrelated histories"。
  3. 影响范围与严重程度:仅影响本 PR 分支的合并状态(无法合并);不影响已发布行为或线上。严重度:阻塞 PR 合并,属流程性(非功能性)问题。
  4. 怎么修复的:先 git fetch --unshallow origin 恢复完整历史(非破坏性,补齐 9106 提交)使 merge-base 正确解析为 33104b1;再 git merge origin/master,代码文件自动合并干净(已核对 clean-pass 块同时保留 PR 的 clearFoldDrift() 与 master 的 realUnmatched.length===0 + expectedRetired),唯一冲突 chat.json 用 golden 重生成脚本重新生成;4 个 golden 相对 master 的 diff 仅 stateDigest/stateDigestAligned/metadata,无内容/状态块变更。
  5. 是否有回归问题:无。typecheck 干净;121 个定向测试全绿;golden 相对 master 仅新增元数据,未触碰既有行为。
  6. 是否破坏缓存:不涉及(仅合并 master + 重生成 golden,未改任何缓存/重试/游标/去重键逻辑)。
  7. 是否改了设计方向:不涉及(纯冲突解决,无架构/边界/数据流转向)。
  8. 是否引入了新的配置:不涉及(无新 env/config/默认值)。

收工判定: 冲突已解决,PR 现 mergeable=True(状态 blocked = 等 CI/人工 review,非冲突)。本地已验证 typecheck + 121 定向测试全绿,镜像缓存 CI 0 失败。本次运行完成。

…ched

The new session-level drift record (noteFoldDrift) counted plan.unmatched —
which still includes expected rebases (carrier retirement / offload rewrites,
#5142) — as lost coverage. The clean-pass early return added in the same PR,
the #5142 accounting discipline, and the drift-warn cascade all key on
realUnmatched (= plan.unmatched minus expected rebases). In a pass mixing
genuine drift with expected rebases the acp_status line over-stated the
missing count by counting expected host behavior as lost folds.

Use realUnmatched for the guard and the matched computation, and reword the
acp_status line to a lost/retain-fold-coverage framing so it is accurate
under that caliber. Visibility-only: no fold decision, status, or
persistence-format change; the e2e test is unaffected (no expected rebases
in its scenario, so plan.unmatched === realUnmatched there).
@ranxianglei

Copy link
Copy Markdown
Owner Author

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

APPROVE — the fix does what it claims, the tests are real, and the one finding I had (a caliber inconsistency in the new drift record) is fixed on the spot below.

What I verified (independently, re-derived from the diff — not from the issue):

已顺手修:the new drift record keyed on plan.unmatched, which still counts expected rebases (carrier retirement / offload rewrites, #5142) as lost coverage — inconsistent with the clean-pass early return added in this same PR, the #5142 accounting discipline, and the drift-warn cascade, all of which key on realUnmatched. A pass mixing genuine drift with expected rebases would over-state the acp_status missing count by counting expected host behavior as lost folds. Switched the guard + matched computation to realUnmatched and reworded the acp_status line to a lost/retain-fold-coverage framing so it is accurate under that caliber. Visibility-only — no fold decision, status, or persistence-format change; the e2e test is unaffected (no expected rebases in its scenario, so plan.unmatched === realUnmatched there). + commit d479033

八问:

  1. 是什么问题:provider 切换后宿主重渲染历史 → 内容哈希覆盖断裂 → 已折叠内容以原始形态回到线上,payload 远超窗口。preflight 折了 31 段、存下 2.5M tok 后 502(承诺“下一轮从小基线继续”,[dsh] A healthy 93%-compressed image session becomes permanently uncompressed by ordinary usage: quota → model switch → attribution loss → 413 → rewind → 3,455 dead refs → compress REFUSED forever (0.1.202) | 一个健康压缩率 93% 的图片会话被普通操作永久废掉:额度→换模型→丢归因→413→撤回→… #3918),但下一轮请求在 probe-regime 的 doom bar 上按原始入站字节判价,直接终局 413,多轮收敛从未发生,会话永久卡在 3–6M token。
  2. 什么原因导致的:doom bar 判的是原始入站字节而非折叠后 payload;且该 gate 对“已有折叠历史 + 仍有可折区间”的会话一视同仁地终局拒绝,没给 [dsh] A healthy 93%-compressed image session becomes permanently uncompressed by ordinary usage: quota → model switch → attribution loss → 413 → rewind → 3,455 dead refs → compress REFUSED forever (0.1.202) | 一个健康压缩率 93% 的图片会话被普通操作永久废掉:额度→换模型→丢归因→413→撤回→… #3918 承诺的“下一轮”留路。根因是 gate 把“原始字节超 bar”等同于“无解”,忽略了会话内已存在的收敛能力。
  3. 影响范围与严重程度:任何进入 estimate-baseline probe regime、且原始字节超 bar 的会话——典型是 provider 切换 / 大历史重发场景。严重度:会话完全不可用(永久卡死、无法收敛),属 p1 可用性缺陷。
  4. 怎么修复的:①恢复路径——over-bar 且会话有折叠历史且有可折区间时,fall through 到 fold-first regime 继续有界多轮收敛(而非终局 413);无折叠历史的新会话保持立即 413。②可见性——把“真正丢失”的覆盖记录到 session(acp_status 渲染 FOLD DRIFT 段),不再只落日志。
  5. 是否有回归问题:逐分支审了 probe block——!overDoomBar 路径(localRefusalHere / forward-once)行为字节级不变;overDoomBar && !multiRoundInFlight 的 413 不变;新增的只有 overDoomBar && multiRoundInFlight 分支(旧值:终局 413 → 新值:继续有界收敛,已披露)。新会话(无折叠状态)的立即 413 由负向测试钉死。无 fail-fast 变吞错、无阈值/时序/输出格式漂移。
  6. 是否破坏缓存:不破坏。新增的 session.metadata.lastFoldDrift 是加性持久化字段(无 drift / 干净 pass 后缺席),at 走 __TS__ 掩码,存储 digest 稳定;不触碰任何缓存/重试/增量游标/去重键。
  7. 是否改了设计方向:不改架构/边界/数据流。只是让既有承诺([dsh] A healthy 93%-compressed image session becomes permanently uncompressed by ordinary usage: quota → model switch → attribution loss → 413 → rewind → 3,455 dead refs → compress REFUSED forever (0.1.202) | 一个健康压缩率 93% 的图片会话被普通操作永久废掉:额度→换模型→丢归因→413→撤回→… #3918 的 502 progress promise)真正可兑现,并把既有日志信号提升到 agent 实际查看的面板。
  8. 是否引入了新的配置:无新 env/config/默认值。

判定:可合(APPROVE)。 唯一发现(drift 记录口径不一致)已顺手修掉(commit d479033,已推到本分支,CI 将在新 head 重跑),无阻塞项。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷
(ai: vllm-qwen/qwen3.8-27b)

Verdict: APPROVE — 可合. Reviewed end-to-end (independently re-derived from the diff, not the issue). The fix does what it claims, the tests have teeth, and the one finding I had is fixed on the spot below.

Verified:

已顺手修: the new drift record keyed on plan.unmatched, which still counts expected rebases (carrier retirement / offload rewrites, #5142) as lost coverage — inconsistent with the clean-pass early return this same PR added, the #5142 discipline, and the drift-warn cascade (all key on realUnmatched). A pass mixing genuine drift with expected rebases would over-state the acp_status missing count. Switched the guard + matched computation to realUnmatched and reworded the acp_status line to a lost/retain-fold-coverage framing. Visibility-only, no behavior change. + commit d479033 (pushed to the branch; CI re-runs on the new head).

八问:

  1. 是什么问题:provider 切换后宿主重渲染历史 → 内容哈希覆盖断裂 → 已折叠内容以原始形态回到线上,payload 远超窗口。preflight 折了 31 段、存下 2.5M tok 后 502(承诺“下一轮从小基线继续”,[dsh] A healthy 93%-compressed image session becomes permanently uncompressed by ordinary usage: quota → model switch → attribution loss → 413 → rewind → 3,455 dead refs → compress REFUSED forever (0.1.202) | 一个健康压缩率 93% 的图片会话被普通操作永久废掉:额度→换模型→丢归因→413→撤回→… #3918),但下一轮请求在 probe-regime 的 doom bar 上按原始入站字节判价,直接终局 413,多轮收敛从未发生,会话永久卡在 3–6M token。
  2. 什么原因导致的:doom bar 判的是原始入站字节而非折叠后 payload;且该 gate 对“已有折叠历史 + 仍有可折区间”的会话一视同仁地终局拒绝,没给 [dsh] A healthy 93%-compressed image session becomes permanently uncompressed by ordinary usage: quota → model switch → attribution loss → 413 → rewind → 3,455 dead refs → compress REFUSED forever (0.1.202) | 一个健康压缩率 93% 的图片会话被普通操作永久废掉:额度→换模型→丢归因→413→撤回→… #3918 承诺的“下一轮”留路。根因是 gate 把“原始字节超 bar”等同于“无解”,忽略了会话内已存在的收敛能力。
  3. 影响范围与严重程度:任何进入 estimate-baseline probe regime、且原始字节超 bar 的会话——典型是 provider 切换 / 大历史重发场景。严重度:会话完全不可用(永久卡死、无法收敛),属 p1 可用性缺陷。
  4. 怎么修复的:①恢复路径——over-bar 且会话有折叠历史且有可折区间时,fall through 到 fold-first regime 继续有界多轮收敛(而非终局 413);无折叠历史的新会话保持立即 413。②可见性——把“真正丢失”的覆盖记录到 session(acp_status 渲染 FOLD DRIFT 段),不再只落日志。
  5. 是否有回归问题:逐分支审了 probe block——!overDoomBar 路径(localRefusalHere / forward-once)行为字节级不变;overDoomBar && !multiRoundInFlight 的 413 不变;新增的只有 overDoomBar && multiRoundInFlight 分支(旧值:终局 413 → 新值:继续有界收敛,已披露)。新会话(无折叠状态)的立即 413 由负向测试钉死。无 fail-fast 变吞错、无阈值/时序/输出格式漂移。
  6. 是否破坏缓存:不破坏。新增的 session.metadata.lastFoldDrift 是加性持久化字段(无 drift / 干净 pass 后缺席),at 走 __TS__ 掩码,存储 digest 稳定;不触碰任何缓存/重试/增量游标/去重键。
  7. 是否改了设计方向:不改架构/边界/数据流。只是让既有承诺([dsh] A healthy 93%-compressed image session becomes permanently uncompressed by ordinary usage: quota → model switch → attribution loss → 413 → rewind → 3,455 dead refs → compress REFUSED forever (0.1.202) | 一个健康压缩率 93% 的图片会话被普通操作永久废掉:额度→换模型→丢归因→413→撤回→… #3918 的 502 progress promise)真正可兑现,并把既有日志信号提升到 agent 实际查看的面板。
  8. 是否引入了新的配置:无新 env/config/默认值。

判定:可合(APPROVE)。 唯一发现(drift 记录口径不一致)已顺手修掉(commit d479033),无阻塞项。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷
Heads-up: the comment just forwarded is my own review (posted via the GitHub API under this account, mirrored back with the upstream-sync marker) — not a new instruction, so no action taken on it.

Status unchanged: APPROVE / 可合. Fix commit d479033 (drift-record caliber plan.unmatched→realUnmatched) is pushed to the branch; CI re-runs on the new head. Nothing blocks the merge from the review side.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷
Re-reviewed the new head d479033af (CI green). The only delta from the original head e74a50666 is my own fix commit — verified on disk:

  • 1 commit: d479033af9 fix: key the #4920 fold-drift record on realUnmatched, not plan.unmatched
  • 2 files: src/fold-reconcile.ts (+9/−6), src/acp-status.ts (+1/−1) — exactly the drift-record caliber fix, nothing else.

The fix is visibility-only (which count the acp_status FOLD DRIFT section reports as lost coverage); no behavior change. My full end-to-end review + 八问 is already posted above and stands unchanged on this head: APPROVE / 可合.

CI on d479033af: review-lane reports green; the mirror snapshot confirms static-gates (both), mysql-contract, test-import-graph all green with no failures. Nothing blocks the merge from the review side.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷
Review of PR #4928 is complete — final status:

Verdict: APPROVE / 可合 (both heads).

  • Original head e74a50666: full end-to-end review posted above (correctness, tests, risks, house conventions + 八问).
  • Small finding fixed on the spot: the #4920 fold-drift record was keyed on plan.unmatched (which counts #5142 expected rebases — carrier retirement/offload rewrites — as lost); re-keyed to realUnmatched + reworded the acp_status FOLD DRIFT line to lost/retain-fold-coverage framing. Visibility-only, no behavior change. Commit d479033af9 pushed to 2026-10-27_preflight-multiround-recovery.
  • New head d479033af re-reviewed: the delta from e74a50666 is exactly that one fix commit (2 files, verified on disk). CI green (static-gates/mysql-contract/test-import-graph confirmed in the mirror, no failures; review-lane reports green).
  • No kernel/ touch → no 🔶 需要决策 flow.
  • Verified locally: targeted suites (issue4920 + fold-drift + acp-status + issue4323 = 26/26; fold-reconcile suites = 100/100) + typecheck clean.

Nothing blocks the merge from the review side.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

…nder golden conflict

Rebase-free merge of current master into the PR branch. Only the four
storage-render golden files conflicted (both sides changed the per-turn
state/metadata digests); source merged cleanly. Resolved by regenerating
the goldens via scripts/update-storage-render-goldens.ts against the
merged tree — the combined digest is neither side's, and the
golden-storage-render suite passes 5/5 on the result.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Merge conflict resolved. The PR was dirty (mergeable=False) because master advanced past the PR's last sync. I merged current master into the PR branch and pushed the merge commit.

  • PR branch head: d479033af9 → e738a01fb5 (merge commit, parents d479033af9 + master 6a641f3785)
  • Source merged cleanly — zero code conflicts. Only the four tests/golden/storage-render/*.json files conflicted (both sides had changed the per-turn stateDigest/stateDigestAligned/metadata digest lines).
  • Resolution: regenerated the goldens via scripts/update-storage-render-goldens.ts against the merged tree. The combined digest is neither side's value (it folds in both the PR's additive lastFoldDrift metadata and master's changes), so a hand-pick of either side would have red'd the suite.
  • Verified locally: golden-storage-render suite 5/5 pass, npm run typecheck clean.
  • Push discipline: fetched + confirmed remote head was an ancestor before pushing (no force-push, no branch fight). This is the branch's final head, so the commit carries no [ework:ci-held] marker → it is the one full CI pass.

七问 (structured summary):

  1. 是什么问题:PR [PR] fix(preflight): continue the multi-round convergence walk past the doom bar when fold state exists (#4920) #4928 与 base 分支(master)冲突,merge state = dirty,无法合并。
  2. 什么原因:master 从 f648217cb8 推进到 6a641f3785,PR 分支落后;两侧都改了 storage-render golden 的 per-turn 摘要行,产生文本冲突(纯 base 漂移,非 PR 代码问题)。
  3. 影响范围与严重程度:仅阻塞本 PR 合并,不影响任何运行时行为。PR 原 head 的 CI 本就全绿(30/30),问题只是 mergeable=False。
  4. 怎么修复的:把当前 master merge 进 PR 分支(非 rebase);源码零冲突自动合并,仅 4 个 golden 文件冲突;用官方 regen 脚本对合并后树重新生成 golden(合并摘要既非 PR 侧也非 master 侧),定向测试 5/5 通过。
  5. 是否有回归:无。源码是 master 改动 + PR 改动的干净并集(两侧各自 CI 已绿);我只改了 golden 摘要值且重新生成后定向测试 + typecheck 均通过,未触碰任何运行时逻辑。
  6. 是否破坏缓存:不涉及。golden 是测试基线快照,非运行时缓存;缓存/重试/增量游标/去重键路径均未触碰。
  7. 是否改了设计方向 / 引入新配置:不涉及。纯合并冲突解决,无架构变更、无新 env/config/默认值。

状态:冲突已解决,mergeable=True。新 head e738a01fb5 的 CI 正在跑(55 个 check:9 in_progress / 4 queued / 2 success / 15 skipped)。等 CI 全绿即可由 owner 合并;若 CI 红,我会在后续 attempt 定向排查。

@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

[bot] 🏷
Re-review of the new head e738a01fb (master merge) — APPROVE stands / 可合.

What changed since d479033af: a single merge commit (e738a01fb5, ci-check, 2026-11-17 16:38) merging origin/master 6a641f3785 (v0.1.216) into the PR branch. No new PR code — the PR's own changes are byte-identical to what I reviewed. The review target is the merge itself.

Merge integrity (verified on disk):

  • Source merged cleanly: all 9 PR files intact at the new head — the multiRoundInFlight gate (src/server.ts:4086), the realUnmatched drift record (src/fold-reconcile.ts:2131), noteFoldDrift/METADATA_LAST_FOLD_DRIFT (src/session.ts:2130), and tests/issue4920-multiround-doombar.test.ts unchanged.
  • Golden conflict resolution correct: only the 4 storage-render goldens conflicted (both sides changed the per-turn state/metadata digests); resolved by regeneration against the merged tree. I verified the merged metadata digest is neither side's value in all 4 lanes (e.g. anthropic: merged a56920ee585636c2 vs master 5d34f4fe94270d09 / PR 468a578101e669e0; same pattern in chat/google/responses) — consistent with the union of both sides' metadata changes (the PR's lastFoldDrift + master's storage changes).

Semantic interaction with the master window (f648217cb8..6a641f3785):

  • kernel/src/compress.ts (#6928, Compression conflict banner (bili v0.1.205, node v24.19.0, win32-x64) #4521 status-line removal): read-only w.r.t. the nudge effect — nudge: result.effects.nudge is unchanged, so the PR gate's dependency (prepared.nudge.compressibleRanges populated every turn) is unaffected. No dangling statusLine references in bili src/ (only hit is an unrelated HTTP CONNECT local in upstream-proxy.ts).
  • src/server/handle.ts (#6880 dsh purpose declaration): session identity / persona routing — orthogonal to the doom-bar preflight path.
  • src/storage/* (#6947 direction C reply stash): doesn't touch the PR's lastFoldDrift metadata path (the PR's e2e suite passes in CI).

CI on e738a01fb: fully green — 30 checks, 0 failed, 0 pending (all 11 test shards + static-gates×2 + mysql-contract success).

八问(本轮 = master 合入复审):

  1. 是什么问题: 本轮无新代码——head 是 ci-check 把 master(v0.1.216) 合入 PR 分支的 merge commit,审查对象是这次合并本身。
  2. 什么原因导致的: PR 分支落后 master,四个 storage-render golden 文件两侧都改了(逐轮 state/metadata 摘要),产生文本冲突。
  3. 影响范围与严重程度: 无行为影响——源码干净合并,PR 改动与已审版本逐字节一致;golden 只是测试钉。
  4. 怎么修复的: golden 按合并后树重新生成;我独立验证四条车道的合并摘要均非任一侧的值,与「两侧变更取并集」一致。
  5. 是否有回归问题: 逐项核过 master 窗口——kernel Per-turn '[ACP status: …]' line keeps ordering the model to fold leftover small ranges right after a big fold — the opposite of what the compress receipt says #6928 删 status line 对 nudge effect 只读(PR 门禁依赖不受影响、无悬空引用);handle.ts [Design][dsh] Stop guessing dsh's auxiliary requests — the in-process plugin can declare each request's purpose explicitly #6880 走会话身份路径,与 doom bar 正交;storage pi-mode: a turn's final assistant reply is silently dropped from the session database — web UI keeps showing the previous (stale) reply #6947 不碰 lastFoldDrift 路径。无回归。
  6. 是否破坏缓存: 不涉及。
  7. 是否改了设计方向: 不涉及。
  8. 是否引入了新的配置: 不涉及。

结论: APPROVE / 可合——完整端到端审查与八问维持不变,无任何阻塞合并的问题。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

…probe if-chain conflict

master added the egress-fuse branch (probeBlockedByEgress, #2313/#4079) and PR #4920 added the multiRoundInFlight branch (continue the fold walk past the doom bar). Unioned both: multiRoundInFlight keeps highest precedence, then localRefusalHere (#3846), then probeBlockedByEgress, then forward-once. Typecheck clean; issue4920/issue2313/issue2847 targeted tests 11/11 pass.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: opencode/qwen3.8-27b)

CI auto-fix lane (run 2/6): resolved the merge conflict that reappeared after master advanced again (6a641f3 → 548e396).

What I did

No design decision was needed — this was a mechanical union of two additive preflight changes. No new issue, no needs-decision label.


八问

  1. 是什么问题:PR 分支与 master 再次产生合并冲突(master 又前进了 6a641f3→548e396022),冲突在 src/server.ts 的 preflight 探测 if 链上——两边各自往同一条 if 链加了分支,git 无法自动合并。
  2. 什么原因导致的:PR # [Bug][dsh] Fold coverage mismatch after provider switch 639/6313 → payload bounces back to 6.07M → preflight folds 32× | # [Bug][dsh] 切换 provider 后折叠覆盖失配 639/6313 → payload 弹回 6.07M → preflight 折叠 32 次仍压不回窗口 #4920 加了 multiRoundInFlight 首分支(超 doom bar 但有折叠状态时继续收敛走,而非 413 拒绝);master 加了 probeBlockedByEgress 分支(egress fuse 会拒 estimate-only 探测时先折叠再转发,billion-context 卡死问题 —— 上报材料 usage获取不到导致上下文估计失误 #2313/Context Window Overflow Issue Summary: Raw Requests Sent Directly to Upstream Rejected + Local Intercept Cooldown Lockin | 上下文超窗问题汇总:请求裸冲上游被拒 + 本地拦截冷却锁死会话(统一分析入口) #4079)+ 三个 const。两者改了同一段代码,语义重叠。
  3. 影响范围与严重程度:仅影响 preflight 探测路径的分支优先级顺序。合并前 PR 处于 dirty 无法合并;合并后恢复可合并。无用户可见行为变更——两个分支都保留,只是确定了优先级顺序。
  4. 怎么修复的:取并集(机械合并,非设计决策)——multiRoundInFlight 保持最高优先级(PR 意图:折叠战役优先),其次 localRefusalHere([Bug][preflight] Local 413 is forgotten when the baseline becomes an estimate, reopening oversized probes #3846),再次 probeBlockedByEgress(master egress fuse),最后 forward-once。三个 const 定义在使用前,符号都在作用域内。
  5. 是否有回归问题:无。typecheck 干净;定向测试 11/11 通过——# [Bug][dsh] Fold coverage mismatch after provider switch 639/6313 → payload bounces back to 6.07M → preflight folds 32× | # [Bug][dsh] 切换 provider 后折叠覆盖失配 639/6313 → payload 弹回 6.07M → preflight 折叠 32 次仍压不回窗口 #4920(超 bar 有折叠状态继续走 / 新会话仍 fail-fast,dsh压缩与bili压缩冲突 #2490/[Evidence] pi 车道切供应商(同 modelId)后 fold 不随会话迁移:裸上下文 2.23MB(≥298K est tokens)被 preflight 10 秒拒 3 次;账面 ≤157K 与裸水位背离 10.5h #2847 保留)、billion-context 卡死问题 —— 上报材料 usage获取不到导致上下文估计失误 #2313(egress fuse)、[Evidence] pi 车道切供应商(同 modelId)后 fold 不随会话迁移:裸上下文 2.23MB(≥298K est tokens)被 preflight 10 秒拒 3 次;账面 ≤157K 与裸水位背离 10.5h #2847(doom bar 413 不可重试)。两个分支的既有行为都保留,没有丢弃任何一方。
  6. 是否破坏缓存:不涉及。改动在 preflight 探测分支,不触及缓存/重试/增量游标/去重键。
  7. 是否改了设计方向:不涉及。这是两个增量改动的机械并集,没有架构/边界/数据流转向。
  8. 是否引入了新的配置:不涉及。没有新增 env/config/默认值。

结论:合并冲突已解决,PR 恢复可合并(mergeable=true),CI 在新 head aa713af967 上重跑中。

…nder golden conflict

Master's lean-compress-receipt fix (#7105) and the PR's additive lastFoldDrift metadata field both touched the 4 storage-render goldens. Regenerated from the merged code (scripts/update-storage-render-goldens.ts) so the snapshots reflect BOTH changes; golden suite 5/5 green.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

CI lane run (attempt 1/6) — merge conflict resolved and pushed.

The PR head had fallen behind live master, which had since merged the fix/lean-compress-receipt PR (#7105) plus the kernel lockfile syncs (kernel → 0.0.199). A test-merge confirmed a real content conflict in exactly 4 storage-render golden files — both the PR's additive lastFoldDrift metadata field and master's lean-compress-receipt change touched the same snapshots.

What I did this run:

  1. Verified the live conflict — git merge-tree of the old head (aa713af967) vs live master (3f0c1d2110) exited 1, conflicting only in tests/golden/storage-render/{anthropic,chat,google,responses}.json.
  2. Merged live master into the PR head — all code auto-merged cleanly; only the 4 goldens conflicted.
  3. Regenerated the 4 goldens from the merged code (node --import tsx scripts/update-storage-render-goldens.ts) so the snapshots reflect BOTH changes. Proof it's a true merge, not one side: the merged metadata digest abfbfa9506 differs from the PR side (a56920ee, has lastFoldDrift) AND the master side (d5a483de, has the receipt change).
  4. Verified locally — golden suite 5/5, the PR's own tests/issue4920-multiround-doombar.test.ts 3/3, npm run typecheck clean.
  5. Committed + pushed the merged head 3ae51e56d8 (final head, unmarked — this is the branch's one full CI pass).
  6. Confirmed clean — git merge-tree of the new head vs live master now exits 0 (no conflict); the PR's effective diff vs master is 9 files (4 src + 4 golden + 1 test) with no kernel/ changes (kernel-guard safe) and no version bump.

Note on status freshness: the mirror check cache is stale (still reporting the old head aa713af967, fetched 08:49), so I verified the merge state directly via git merge-tree instead. GitHub CI will run on the new head 3ae51e56d8.


结构化八问(中文)

  1. 是什么问题:PR [PR] fix(preflight): continue the multi-round convergence walk past the doom bar when fold state exists (#4920) #4928 的分支落后于 master,而 master 新合入了 lean-compress-receipt 修复([PR] Remove head/tail tags from the compression success receipt (keep excerpts) + add collapse timestamps + annotate kernel a | 压缩成功回执去掉 head/tail 标签(保留摘录)+ 打折叠时间戳 + kernel 锚点引文标注来源(模型可见文本,4 处) #7105)和 kernel 锁文件同步(kernel 0.0.199),导致 PR 头与 master 产生合并冲突(merge state: dirty,硬阻塞合并)。
  2. 什么原因导致的:冲突只在 4 个 storage-render 黄金文件里。PR 侧为新增的 additive lastFoldDrift metadata 字段重新生成过这批黄金,master 侧的 lean-compress-receipt 又改了压缩回执格式——两边都动了同一批测试快照,内容冲突。
  3. 影响范围与严重程度:仅 4 个测试黄金文件(测试夹具),不涉及运行时代码。不解决则 PR 无法合并;属「合并阻塞」,非运行时缺陷。
  4. 怎么修复的:把 live master 合进 PR 头(代码自动合并干净),再从合并后的代码重新生成 4 个黄金文件,使快照同时反映两边改动;本地跑黄金套件 + PR 自身测试 + typecheck 全绿后,提交并推送合并头(最终头,不带 ci-held 标记,触发本分支唯一一次完整 CI)。
  5. 是否有回归问题:无。合并只带入 master 已有改动(kernel 0.0.199、stream.ts 等,现已进 base,不出现在 PR diff 里);PR 自身的 preflight 修复与 lastFoldDrift 字段完整保留;黄金文件按合并后代码重新生成,不是手抄某一侧。typecheck 干净,PR 自身测试 3/3 通过。
  6. 是否破坏缓存:不涉及。黄金文件 digest 变化是渲染契约(回执格式 + lastFoldDrift 字段)变化的直接结果,属测试夹具,非运行时缓存失效策略。
  7. 是否改了设计方向:不涉及。纯合并 + 黄金重生成,无架构/边界/数据流转向。
  8. 是否引入了新的配置:不涉及。无新 env/config/默认值。

判定:合并冲突已解决并推送(新头 3ae51e56d8,与 live master 无冲突);等 CI 在本分支唯一一次完整跑绿即可合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷
Re-review of the new head 3ae51e56d (another master-sync merge) — APPROVE stands / 可合.

What changed since e738a01fb: two more ci-check master-sync merges (the PR branch tracks a fast-moving master). The new head 3ae51e56d8 merges master 3f0c1d2110 into the PR branch. No new PR code.

Verification (on disk):

  • PR code byte-identical: the merge changed NONE of the PR's source files (git diff on src/server.ts / fold-reconcile.ts / session.ts / acp-status.ts / the e2e test = empty). The multiRoundInFlight gate (src/server.ts:4117, shifted from :4086 by master's added lines) and the realUnmatched drift record (src/fold-reconcile.ts:2131) are intact.
  • Master window (548e396022..3f0c1d2110) did not touch the PR's files (empty diff). The only kernel change is a model-facing text tweak to the projectUnit anchor note (labels the quoted user speech as "historical quote, NOT a new user message", kernel 0.0.198→0.0.199) — no interaction with the PR's gate, which only checks compressibleRanges.length > 0.
  • Golden conflict resolved correctly: again only the 4 storage-render goldens conflicted (both sides advanced the per-turn digests). The merged value is a proper union — distinct from both master's and the PR-head's value in all 4 lanes (master's newer fixture + the PR's lastFoldDrift metadata). CI green confirms it is what the suite produces.

CI on 3ae51e56d: fully green — 30 checks, 0 failed, 0 pending.

八问(本轮 = 又一次 master 同步合并复审):

  1. 是什么问题: 本轮无新代码——head 是 ci-check 又一次把 master(3f0c1d2) 合入 PR 分支的 merge commit,审查对象是这次同步合并本身。
  2. 什么原因导致的: PR 分支持续落后快速前进的 master,四个 storage-render golden 两侧都改了(逐轮摘要),再次产生文本冲突。
  3. 影响范围与严重程度: 无行为影响——PR 源码逐字节未变,与已审版本一致。
  4. 怎么修复的: golden 按合并后树重新生成;我独立验证四条车道合并值均非任一侧,是「master 新 fixture + PR 的 lastFoldDrift 元数据」的并集。
  5. 是否有回归问题: master 窗口未碰 PR 源文件;唯一 kernel 改动是 projectUnit 锚点注释的模型可见文案(与 PR 门禁无交互,门禁只查 compressibleRanges.length>0)。无回归。
  6. 是否破坏缓存: 不涉及。
  7. 是否改了设计方向: 不涉及。
  8. 是否引入了新的配置: 不涉及。

结论: APPROVE / 可合——完整端到端审查与八问维持不变,无任何阻塞合并的问题。

…nder golden conflict

Master's batch11-wave11 (#6827) regenerated the storage-render goldens for new persisted fields; the PR's lastFoldDrift field also touches them. Regenerated from the merged code so the snapshots reflect both; golden suite 5/5, PR test 3/3, typecheck clean.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Merge-conflict resolved (2nd wake, attempt 1/6). Since my last run, master advanced again (3f0c1d2110 → a446a3c1c8, via batch11-wave11 #6827), which re-regenerated the same 4 storage-render golden files — so the PR hit the same conflict class a second time.

What I did this run:

  1. Verified live: my previous head 3ae51e56d8 was still the remote head (no concurrent advance); live master had moved to a446a3c1c8; test-merge of my head vs live master → exit 1, conflict in the same 4 tests/golden/storage-render/{anthropic,chat,google,responses}.json.
  2. Root cause (same as last time): the storage-render goldens are auto-generated fixtures. The PR's additive lastFoldDrift metadata field and master's new persisted fields ([PR] wave-11 batch: 7 community fixes (opencode provider, preflight epoch, output budget, +4) — #6797/#6818 excluded #6827) each independently regenerate the same 4 files → content conflict.
  3. The workspace had been reset (node_modules gone), so I re-ran npm ci + npm --prefix kernel run build (kernel 0.0.199, fresh dist), then git merge origin/master, then regenerated the 4 goldens from the merged code via scripts/update-storage-render-goldens.ts (so the snapshots carry both the PR's lastFoldDrift and master's persisted fields).
  4. Verified: golden suite 5/5, the PR's own test 3/3, npm run typecheck clean. Pushed the unmarked final head cd8f5f2361 (one full CI pass).
  5. Post-push: test-merge of cd8f5f2361 vs live master → exit 0 (clean); PR effective diff = 9 files, no kernel/ changes (kernel-guard safe); bili version 0.1.216 unchanged; working tree clean.

Status note (honest): the mirror check cache is stale — it still reports the previous head 3ae51e56d8 (fetched 2026-11-18), so I cannot report the new head cd8f5f2361's CI state yet; it is pending on this branch's one full CI pass.


八问(中文)

  1. 是什么问题:PR [PR] fix(preflight): continue the multi-round convergence walk past the doom bar when fold state exists (#4920) #4928 与 master 冲突(merge state dirty)——master 的 batch11-wave11([PR] wave-11 batch: 7 community fixes (opencode provider, preflight epoch, output budget, +4) — #6797/#6818 excluded #6827)重新生成了 4 个 storage-render golden 文件,本 PR 新增的 lastFoldDrift 元数据字段也改了这 4 个 golden,两边都动 → 内容冲突。
  2. 什么原因导致的:storage-render golden 是自动生成的测试夹具;任何改持久化字段/渲染契约的 PR 都会重新生成它。本 PR(lastFoldDrift)与 master([PR] wave-11 batch: 7 community fixes (opencode provider, preflight epoch, output budget, +4) — #6797/#6818 excluded #6827 的持久化字段)各自独立重新生成同一批文件,产生冲突。这是该 PR 第二次撞上同一类冲突(前一次是 master 的 lean-compress-receipt 修复 [PR] Remove head/tail tags from the compression success receipt (keep excerpts) + add collapse timestamps + annotate kernel a | 压缩成功回执去掉 head/tail 标签(保留摘录)+ 打折叠时间戳 + kernel 锚点引文标注来源(模型可见文本,4 处) #7105)。
  3. 影响范围与严重程度:仅测试夹具(4 个 golden JSON),不影响运行时行为;不修则 PR 无法合并(dirty 阻塞 merge)。
  4. 怎么修复的:git merge origin/master(a446a3c1c8)→ 重建 kernel dist → 用 scripts/update-storage-render-goldens.ts 从合并后代码重新生成 4 个 golden(同时包含 lastFoldDrift 与 master 的持久化字段)→ 定向验证(golden 5/5、本 PR 测试 3/3、typecheck 全绿)→ push 最终 head。
  5. 是否有回归问题:无。golden 是从合并后代码重新生成的,同时反映本 PR 与 master 的变更,不是取单边;golden 套件 5/5、本 PR 测试 3/3、typecheck 全绿。PR 有效 diff 无 kernel/ 变更、bili 版本 0.1.216 未动、工作树干净。
  6. 是否破坏缓存:不涉及(纯测试夹具重生成,无运行时缓存/重试/增量游标/去重键变更)。
  7. 是否改了设计方向:不涉及(仅解决测试夹具冲突,无架构/边界/数据流变更)。
  8. 是否引入了新的配置:不涉及(无新 env/config/默认值)。

判定:冲突已解,新 head cd8f5f2361 与 live master test-merge 干净、无 kernel 变更、版本未动,可进入 CI 全量跑与本 PR 的正式 review。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

No action needed this run — the conflict is already resolved; the mirror cache is stale.

I verified live in this run before touching anything:

  • git fetch origin: remote PR head = cd8f5f2361 (my previous run's merge), live master = a446a3c1c8 (has not advanced since my last merge).
  • git merge-tree --write-tree HEAD origin/master → exit 0 (clean) — the current head merges cleanly with live master. There is no conflict to resolve.

The system forward's "merge state: dirty" comes from the mirror check cache, which is frozen at the previous head 3ae51e56d8 (fetched 2026-11-18, before my last push) — that head did have the conflict, which I resolved by pushing cd8f5f2361. The mirror poller simply hasn't refreshed to the new head yet.

So this run is a no-op: no merge, no push (nothing to resolve; pushing a no-op merge would only add noise). The branch head cd8f5f2361 is the unmarked final head already carrying this branch's one full CI pass.

Status (honest): I can verify the merge state live (clean), but I cannot report the new head's CI state — the mirror cache is stale (still on 3ae51e56d8), so cd8f5f2361's CI is pending.


八问(中文)

  1. 是什么问题:系统转发报「PR 与 base 冲突(merge state dirty)」,但这是镜像缓存的过期状态——缓存仍停在上一 head 3ae51e56d8(fetched 2026-11-18),而该冲突已在上一轮解决并 push 了新 head cd8f5f2361。
  2. 什么原因导致的:镜像 poller 的 merge-state 缓存未刷新到新 head;GitHub 侧实际已无冲突(本地 test-merge 干净)。
  3. 影响范围与严重程度:无实际影响——当前 head cd8f5f2361 与 live master a446a3c1c8 test-merge 干净(exit 0),PR 可正常合并;仅镜像缓存显示滞后。
  4. 怎么修复的:本轮无需修复。已 live 验证:fetch 确认 remote head=cd8f5f2361、live master=a446a3c1c8(未再前进)、test-merge exit 0(干净);未做 merge/push(无冲突可解,不做无意义 no-op merge)。
  5. 是否有回归问题:不涉及(本轮零改动)。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:不涉及。

判定:本轮 no-op——冲突已在前一轮解决,镜像缓存滞后。无需进一步动作;等镜像 poller 刷新到 cd8f5f2361 后 merge-state 会转 clean,CI 全量跑在本 head 上。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

@ranxianglei ranxianglei left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

APPROVE — verified independently: core gate logic, visibility half, tests, and golden changes.

Core fix (server.ts:4095-4156): The gate re-prices the over-bar decision on fold-history + compressible-ranges rather than raw-bytes-terminal. When multiRoundInFlight (over-bar AND fold history exists AND compressible ranges present), the walk continues into the fold-first regime instead of refusing with a terminal 413. Fresh sessions (no fold state) keep the immediate 413. Control flow verified: multiRoundInFlight skips both the 413 and the forward-once paths, falling through to the fold-first regime; the post-fold doom check still guards the actual forward.

Visibility (fold-reconcile.ts / session.ts / acp-status.ts): The lastFoldDrift record is keyed on realUnmatched (truly-lost coverage), not plan.unmatched (which includes re-anchored claims and expected rebases that are not loss). Clean passes clear the record; drift passes note it. The acp_status rendering is additive-only.

Tests: The positive e2e test would fail pre-fix (terminal 413 instead of convergence) — it has teeth. The negative e2e test pins the fresh-session 413 (preserving #2490/#2847). The unit test covers the round-trip and malformed-shape rejection.

Goldens: Metadata-only (content-addressed digests for the additive lastFoldDrift field). State/blockContents/stats unchanged.

Behavior change (disclosed in PR body): Old: over-bar-by-bytes → terminal 413 for ALL estimate-baseline sessions. New: sessions WITH fold state continue the bounded convergence walk; fresh sessions unchanged.

已顺手修:tests/issue4920-multiround-doombar.test.ts:161 注释「~88K estimated tokens against a 20K window」与 WINDOW = 60_000(第 33 行)不符——过时的示意数字,纯外观,不影响断言。已改为「60K window」。+ commit 0cae5a0


8问(中文结构化结论)

  1. 是什么问题:provider 切换后宿主重渲染历史 → 内容 hash 覆盖断裂 → 已折叠内容以原始形式回到线上 → 502 重试承诺「下次从更小基线开始」,但下一轮 502 写回触发证据探测机制 → 道门按原始入站字节定价 → 终局 413 + 路由级本地拒绝,在折叠之前就发生 → 会话永久卡在 3-6M token。
  2. 什么原因导致的:道门(doom bar)按原始入站字节定价,不区分「有折叠状态可继续收敛」和「无折叠状态只能快速失败」。502 写回的估计基线让证据探测机制定价原始字节,而非折叠后的基线。
  3. 影响范围与严重程度:dsh-lane provider 切换场景(p1)。有折叠状态的会话被终局 413 卡死,无法恢复。无折叠状态的新会话不受影响(保持快速失败)。
  4. 怎么修复的:道门增加 multiRoundInFlight 条件——超过道门 AND 有折叠历史 AND 有可压缩范围时,不拒绝,而是落入折叠优先机制继续收敛。同时增加 lastFoldDrift 会话级可见性(acp_status 显示丢失的覆盖)。
  5. 是否有回归问题:审过以下既有行为——(a) 子道门单次转发:不受影响(multiRoundInFlight 仅在超过道门时触发);(b) #3846 本地拒绝:不受影响(localRefusalHere 仅在 !multiRoundInFlight 时可达);(c) #2490/#2847 新会话 413:不受影响(新会话无折叠状态,multiRoundInFlight 为 false);(d) [acp-drift] 警告行:字节级不变;(e) acp_status:仅追加;(f) 持久化:仅追加 lastFoldDrift 字段。
  6. 是否破坏缓存:不涉及。折叠决策不变,仅改变道门拒绝条件。
  7. 是否改了设计方向:不涉及。修复在既有道门机制内,不改变架构/边界/数据流。
  8. 是否引入了新的配置:不涉及。无新 env/config/默认值。

判定:可合并(APPROVE)。 核心修复正确,测试有牙,golden 仅元数据变更,行为变更已在 PR 正文披露。无 kernel/ 触碰,无 kernel-change 声明。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

PR #4928 review complete: APPROVE (posted as a COMMENT review since a self-PR can't self-approve on GitHub) + 1 on-spot comment fix (20K→60K window number in the #4920 seed comment, commit 0cae5a0). Core gate logic, visibility half, tests, and golden changes all verified independently; no kernel/ touch.

@ranxianglei ranxianglei left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review at head 0cae5a0 — the only delta from the previously-reviewed head cd8f5f2 is the on-spot comment fix I pushed in the prior pass (20K→60K window number in the #4920 seed comment, tests/issue4920-multiround-doombar.test.ts:161). Verified: cosmetic only, now matches WINDOW = 60_000 (line 33), no behavior change.

The full review (core gate logic, visibility half, tests, goldens) stands as posted at the previous head — APPROVE. No kernel/ touch, no kernel-change declaration.

已顺手修(前一轮,本轮仅确认):tests/issue4920-multiround-doombar.test.ts:161 注释「20K window」→「60K window」(与 WINDOW = 60_000 一致,纯外观)。+ commit 0cae5a0


8问(中文结构化结论)

  1. 是什么问题:(同前一轮)provider 切换后宿主重渲染历史 → 内容 hash 覆盖断裂 → 道门按原始入站字节定价 → 有折叠状态的会话被终局 413 卡死,无法恢复。
  2. 什么原因导致的:(同前一轮)道门不区分「有折叠状态可继续收敛」和「无折叠状态只能快速失败」;502 写回的估计基线让证据探测机制定价原始字节。
  3. 影响范围与严重程度:(同前一轮)dsh-lane provider 切换场景(p1)。有折叠状态的会话被卡死;新会话不受影响。
  4. 怎么修复的:(同前一轮)道门增加 multiRoundInFlight 条件 + lastFoldDrift 会话级可见性。本轮无新修复,仅确认前一轮的注释修正。
  5. 是否有回归问题:本轮 delta 仅一处注释(20K→60K),无行为变更。前一轮审过的既有行为(子道门单次转发、#3846 本地拒绝、#2490/#2847 新会话 413、[acp-drift] 警告行、acp_status 追加、持久化追加)结论不变。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:不涉及。

判定:可合并(APPROVE)。 本轮 delta 仅为前一轮的注释修正(纯外观),无行为变更。完整审核结论同前一轮。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

Re-review at head 0cae5a0 complete: only delta from the previously-reviewed head is my own on-spot comment fix (20K→60K, cosmetic) — full review stands, APPROVE (posted as COMMENT review; self-PR can't self-approve). No kernel/ touch.

…nder golden conflict

Master's hash-cleanup batches + kernel 0.0.200 bump (#7149/#7151/#7191/#7281) regenerated the storage-render goldens; the PR's lastFoldDrift field also touches them. Regenerated from the merged code so the snapshots reflect both; golden suite 5/5, PR test 3/3, typecheck clean. Built on the concurrent comment-fix commit 0cae5a0.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Merge-conflict resolved (4th wake, attempt 1/6). Master advanced again to 6453feee (hash-cleanup batches #7149/#7151/#7191 + kernel bump to 0.0.200), re-regenerating the same 4 storage-render goldens — the PR hit the same conflict class a third time.

What I did this run:

  1. Live check at wake: my local head was cd8f5f2361, but the remote PR branch had been advanced concurrently to 0cae5a0e (a comment-fix commit: "correct stale window number in the # [Bug][dsh] Fold coverage mismatch after provider switch 639/6313 → payload bounces back to 6.07M → preflight folds 32× | # [Bug][dsh] 切换 provider 后折叠覆盖失配 639/6313 → payload 弹回 6.07M → preflight 折叠 32 次仍压不回窗口 #4920 seed comment (20K → 60K)"). Live master = 6453feee. test-merge of my head vs live master → conflict in the same 4 tests/golden/storage-render/*.json.
  2. Per push discipline I reset my local to the remote head 0cae5a0e (preserving the concurrent commit), so the new merge builds on top of it.
  3. The workspace was reset again (node_modules gone), so I re-ran npm ci + npm --prefix kernel run build (kernel now 0.0.200), then git merge origin/master, then regenerated the 4 goldens from the merged code via scripts/update-storage-render-goldens.ts (carrying both lastFoldDrift and master's persisted-field changes).
  4. Verified: golden suite 5/5, the PR's own test 3/3, npm run typecheck clean. Confirmed the merged kernel is byte-identical to master's 0.0.200 (staged kernel/ diff vs master = empty). Pushed the unmarked final head d29d7c43ea5.
  5. Post-push: test-merge of d29d7c43ea5 vs live master → exit 0 (clean); PR effective diff = 9 files, no kernel/ changes (kernel-guard safe); bili version 0.1.216 unchanged; working tree clean.

Status note (honest): I can verify the merge state live (clean). The mirror check cache was stale in prior runs, so I'm not asserting the new head's CI state here — it is pending on this branch's one full CI pass.


八问(中文)

  1. 是什么问题:PR [PR] fix(preflight): continue the multi-round convergence walk past the doom bar when fold state exists (#4920) #4928 再次与 master 冲突(merge state dirty)——master 前进到 6453feee(hash-cleanup 批次 + kernel 0.0.200 版本 bump),重新生成了 4 个 storage-render golden;本 PR 的 lastFoldDrift 字段也改了这 4 个 golden → 内容冲突。
  2. 什么原因导致的:storage-render golden 是自动生成的测试夹具;master 的 hash-cleanup 批次(性能清理提案:同一份内容每请求被重复哈希 3-5 次 —— 盘点结论与分批清理方案 #7149/[PR] perf: batch-1 hash dedup — anonymous-lane v1 skip + incremental wire-hash pair (#7149) #7151/[PR] perf: Batch 2+3-1 consolidated — fingerprint change detection + ledger zero-hash inheritance + persona deprecation annot | perf: 批次二+三-1 合订 — 指纹变化探测 + 台账零哈希继承 + persona 退役标注 (#7149) #7191)改了持久化字段(systemFp/canonicalSysFp 等)重新生成 golden,与本 PR 的 lastFoldDrift 各自独立重新生成同一批文件 → 冲突。这是该 PR 第三次撞上同一类冲突。
  3. 影响范围与严重程度:仅测试夹具(4 个 golden JSON),不影响运行时行为;不修则 PR 无法合并。
  4. 怎么修复的:fetch 发现远端 PR head 已被并发推进到 0cae5a0e(一个注释修正 commit),reset 本地到该 head(保留并发提交)→ git merge origin/master(6453feee)→ 重建 kernel dist(0.0.200)→ 用 scripts/update-storage-render-goldens.ts 从合并后代码重新生成 4 个 golden → 定向验证(golden 5/5、本 PR 测试 3/3、typecheck 全绿)→ push 最终 head。
  5. 是否有回归问题:无。golden 从合并后代码重新生成,同时反映本 PR 与 master 的变更;golden 5/5、本 PR 测试 3/3、typecheck 全绿。PR 有效 diff 无 kernel/ 变更(合并后 kernel 与 master 的 0.0.200 完全一致,staged diff 为空)、bili 版本 0.1.216 未动、工作树干净。
  6. 是否破坏缓存:不涉及(纯测试夹具重生成,无运行时缓存/重试/增量游标/去重键变更)。
  7. 是否改了设计方向:不涉及(仅解决测试夹具冲突,无架构/边界/数据流变更)。
  8. 是否引入了新的配置:不涉及(无新 env/config/默认值)。

判定:冲突已解,新 head d29d7c43ea5 与 live master test-merge 干净、无 kernel 变更、版本未动,且已保留并发的注释修正 commit 0cae5a0e,可进入 CI 全量跑与本 PR 的正式 review。

@ranxianglei ranxianglei left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review at head d29d7c4 — the PR was rebased onto the latest master (6453fee), which now includes several merged PRs (notably a kernel change #7281, kernel v0.0.200).

Key verification: the PR's own diff against its base does NOT touch kernel/. The base is master 6453fee (which already carries the #7281 kernel change), so the kernel change is inherited from master, not part of this PR's diff. The 9 files in the PR diff (against base 6453fee) are exactly the previously-reviewed set:

  • src/acp-status.ts (+9 -1), src/fold-reconcile.ts (+13 -1), src/server.ts (+31 -3), src/session.ts (+25 -0)
  • tests/golden/storage-render/{anthropic,chat,google,responses}.json (+3 -3 each) — re-verified metadata-only after the rebase (only stateDigest/stateDigestAligned/sectionDigests.metadata change; state/blockContents/stats/stateKeyDigests unchanged)
  • tests/issue4920-multiround-doombar.test.ts (+286 -0)

The HARD RULE (kernel/ touch → findings-only + 🔶 需要决策) does NOT apply — no kernel/ file in the PR diff, no kernel-change declaration.

The full review (core gate logic, visibility half, tests, goldens) stands as posted at the previous heads — APPROVE. CI green on the new head.


8问(中文结构化结论)

  1. 是什么问题:(同前)provider 切换后宿主重渲染历史 → 内容 hash 覆盖断裂 → 道门按原始入站字节定价 → 有折叠状态的会话被终局 413 卡死,无法恢复。
  2. 什么原因导致的:(同前)道门不区分「有折叠状态可继续收敛」和「无折叠状态只能快速失败」;502 写回的估计基线让证据探测机制定价原始字节。
  3. 影响范围与严重程度:(同前)dsh-lane provider 切换场景(p1)。有折叠状态的会话被卡死;新会话不受影响。
  4. 怎么修复的:(同前)道门增加 multiRoundInFlight 条件 + lastFoldDrift 会话级可见性。本轮无新修复,仅确认 rebase 后 PR diff 不变。
  5. 是否有回归问题:本轮 delta 是 rebase 到最新 master(6453fee),PR 自身 diff 不变(9 文件,无 kernel/)。master 上的 kernel 变更(#7281)已在 base 中,不属于本 PR diff。CI 绿。前一轮审过的既有行为(子道门单次转发、#3846 本地拒绝、#2490/#2847 新会话 413、[acp-drift] 警告行、acp_status 追加、持久化追加)结论不变。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:不涉及。

判定:可合并(APPROVE)。 本轮 delta 仅为 rebase 到最新 master,PR 自身 diff 不变(无 kernel/ 触碰,无 kernel-change 声明)。完整审核结论同前。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

Re-review at head d29d7c4 (rebased onto master 6453fee) complete: PR's own diff is the same 9 files, zero in kernel/ — the #7281 kernel change is inherited from master (already in the base), not part of this PR's diff, so the kernel HARD RULE does not apply. Goldens re-verified metadata-only. Full review stands: APPROVE (COMMENT review; self-PR can't self-approve). CI green.

@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 ✓

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant