Skip to content

[PR] fix: bound the failed-compress orphan sweep window at the commit-time ref frontier - #6142

Open
ranxianglei wants to merge 10 commits into
masterfrom
2026-11-10_sweep-window-upper-bound
Open

ranxianglei wants to merge 10 commits into
masterfrom
2026-11-10_sweep-window-upper-bound

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

kernel-change: issue #6116 requests exactly this behavior (owner-filed feature request; in-thread decision B confirmed — mechanism fix only, no prompt change).

What & why

The #3769 fold-gated orphan sweep removes failed compress calls at/after the pending fold's earliest start ref (pendingOrphanSweepMinRef) with no upper bound. A failure issued in the same assistant turn AFTER the successful compress call (mixed multi-tool turns — compress mixed with other tools, exactly the scenario raised in #6116) therefore gets wiped on the next pass too, destroying fresh error feedback the model needs to react correctly — the exact pathology #3769 exists to prevent ("failures must remain observable or a deterministic model re-issues the same no-op compress forever").

Fix: applyCompression now also records pendingOrphanSweepMaxRef = highestUsedIndex(state.messageRefs) at commit time. The successful call and any later same-turn calls only receive refs strictly above that frontier on the next assignRefs pass, so they stay out of the sweep window [minRef, maxRef]. Across multiple folds committing before one consuming turn the markers accumulate (running MIN / running MAX). The hide node consumes both one-shot; sync-blocks, cloneState and host hydration carry the new field.

Behavior change (old -> new)

  • Old: sweep removed every non-active compress failure with ref >= foldMinRef (unbounded upward), including failures created after the successful call.
  • New: sweep removes failures with foldMinRef <= ref <= foldMaxRef; failures at/above the success-call frontier stay visible until a later fold covers them.
  • Upgrade compat: states written before this change lack the max bound and keep the pre-fix unbounded behavior (a stray max without min is inert by construction). Pinned by test.

Cache impact: none — the sweep still runs in the same post-fold rewrite pass where the cached breakpoint already moved past foldMinRef.

Duplicate screening

查重: 不重复 — closest open work is #5607 (failed-compress recovery re-request shape), #5987 (failure accounting on rebase), #5336 (orphan-sweep CLI surface); all different mechanisms, none bounds the sweep window.

Tests

  • New kernel/tests/issue6116-sweep-window.test.ts (7 tests): inclusive window both ends + single-ref windows; legacy min-only -> unbounded (upgrade pin); max-without-min inert; real core.applyCompression writes both markers; THE issue scenario (same-turn failure after the success call survives); two folds accumulate the union window; full processTurn pipeline carries the bound through sync-blocks and consumes both one-shot.
  • Existing suites green: issue3769-orphan-sweep, hide-consumed-stub/mcp, orphan-fixes, storage-state-fields (round-trip extended with the new field), verif-subset-guard + verif-bug3769-orphan-window (guarded files changed per KDD release v0.1.4 #14).
  • typecheck + build clean on rebased master (58a8796).

Closes #6116

ci-check added 2 commits November 10, 2026 22:15
…ef frontier (#6116)

The #3769 fold-gated orphan sweep removed failed compress calls at/after the
pending fold's earliest start ref with no upper bound, so a failure issued in
the SAME assistant turn AFTER the successful compress call (mixed multi-tool
turns) was wiped on the next pass too — destroying fresh error feedback the
model needs to react correctly (the exact pathology #3769 exists to prevent).

applyCompression now also records pendingOrphanSweepMaxRef = highestUsedIndex
of the ref map at commit time: the successful call and any later same-turn
calls only get refs strictly above that frontier on the next assignRefs pass,
so they stay out of the sweep. Across folds committing before one consuming
turn the markers accumulate (running MIN / running MAX). The hide node
consumes both one-shot; sync-blocks, cloneState and hydration carry the new
field. States written before this change lack the max bound and keep the
pre-fix unbounded behavior (upgrade compat, pinned by test).

kernel-change: issue #6116 requests exactly this behavior; owner filed the
issue, in-thread decision B confirmed (mechanism fix only, no prompt change).
mergeState() is the single source of truth for persisted CompressionState
fields (#4192); add pendingOrphanSweepMaxRef to its literal so the transient
window bound survives the unified round-trip like its min counterpart, and
pin the round-trip in the storage field test.
@ranxianglei ranxianglei added enhancement New feature or request p2 scope/kernel labels Nov 10, 2026
@ranxianglei ranxianglei changed the title fix: bound the failed-compress orphan sweep window at the commit-time ref frontier [PR] fix: bound the failed-compress orphan sweep window at the commit-time ref frontier Nov 10, 2026
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-11-10_sweep-window-upper-bound (b06c45e)

Latest build — install this exact version

npm install -g billion-context@0.0.11187-pr.6142.2670bab

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
b06c45e billion-context@0.0.11187-pr.6142.2670bab build
1a73928 billion-context@0.0.10912-pr.6142.04ad19a build
4424c03 billion-context@0.0.9839-pr.6142.6c851ae build
797c5d8 billion-context@0.0.9309-pr.6142.72283f8 build
227d45e billion-context@0.0.9231-pr.6142.03dd2f8 build
4bcb78a billion-context@0.0.9175-pr.6142.550d4c1 build
61b7663 billion-context@0.0.8997-pr.6142.481b6a6 build
687c400 billion-context@0.0.8960-pr.6142.634cd1a build

Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr6142.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

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

Review pass started on this PR (independent of the author-side report above).

查重: 不重复 — searched open+closed issues/PRs for the sweep-window mechanism: closest items are #5607 (failed-compress recovery re-request shape), #5987 (failure accounting on rebase), #5336 (orphan-sweep CLI surface) and the closed orphan-ACK family #4293/#4307/#4310 — all different mechanisms, none bounds the sweep window. This is the only open PR targeting #6116; no parallel second fix PR exists.

标签: bug + scope/kernel + p2(内核清理窗口语义修正:特定条件——同轮混合工具调用中成功压缩后又出现新失败——下丢新鲜错误反馈,非不可用、非缓存泄露,p2)。

Live state verified just now: PR open, head 2026-11-10_sweep-window-upper-bound @ 687c400 on base master@58a87962 (= current master tip, no rebase needed). CI at the last mirror snapshot (15:49 UTC): 0 failed / 1 pending (mysql-contract queued) / 2 codex jobs cancelled by a re-run — I will confirm the final green before concluding.

Next: pulling the branch, reading the full diff against master, regression-walking the touched paths, and running the targeted kernel suites locally. Full structured conclusion (八问) to follow in a second comment.

@ranxianglei ranxianglei added the bug Something isn't working label Nov 10, 2026
ci-check added 3 commits November 11, 2026 04:09
kernel/package.json was bumped 0.0.192 -> 0.0.193 but its own
package-lock.json was left at 0.0.192, and the version line in both
lockfiles lost its indentation. npm install --package-lock-only
re-normalizes all of it, so git diff --exit-code went red.

- kernel/package-lock.json: 0.0.192 -> 0.0.193 (top-level + packages.""),
  matching the already-declared kernel bump in this PR.
- package-lock.json: restore canonical 6-space indent on the acp-kernel
  version line (content unchanged).
Resolve the kernel-version conflict introduced by master advancing
0.0.192 -> 0.0.195 while this PR carried its own 0.0.193 bump:

- kernel/package.json, root package-lock.json, kernel/package-lock.json:
  the merged tree now holds master's 0.0.195 kernel PLUS this PR's
  sweep-window change, so the version moves to 0.0.196 (one bump past
  master's tip) rather than reusing either side's stale number.
- Restores canonical indentation on the acp-kernel version line that the
  original sed-style bump had stripped (the root cause of the lock-sync
  red: npm install --package-lock-only re-normalizes it, so git diff
  --exit-code went non-zero).

Kernel source (compress.ts / sync.ts / types.ts / hide-consumed.ts)
auto-merged clean against master; only the version/lockfile lines
conflicted.
…und key

#6116 adds pendingOrphanSweepMaxRef to the persisted CompressionState
(kernel/src/compress.ts, sync.ts, types.ts; hydrated in
src/state-hydration.ts). The four storage-render goldens pre-date that key,
so the per-top-level-state-key digest pin (stateKeyDigests) now sees one new
entry. In the scripted golden scenario the value is undefined (the one-shot
window bound is consumed together with its fold marker), so the entry carries
the shared "null" digest 74234e98afe7498f and no other field changes —
stateDigest, section digests, per-turn wire digests and state shape are all
byte-identical. Net diff: one added line per wire.

Regen: node --import tsx scripts/update-storage-render-goldens.ts
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷

Re-verified live, root-caused, fixed, and pushed. The lock-sync red from the earlier wake is already resolved (green again on the new head). This wake's real blocker was three red test shards, all failing the same four golden tests.

What was red (live, head 4bcb78ab14): test (windows-latest,22,5), test (ubuntu-latest,24,3), test (ubuntu-latest,22,3) — each failing storage-render golden (chat|anthropic|responses|google). The CI assertion named exactly one divergent state key: pendingOrphanSweepMaxRef=74234e98afe7498f (golden undefined); foldAt/editedAt/stateDigest/all section digests matched.

Root cause: this PR (#6116) adds pendingOrphanSweepMaxRef to the persisted CompressionState (kernel compress.ts/sync.ts/types.ts, hydrated in src/state-hydration.ts). The four storage-render goldens pre-date that key and were never regenerated, so the per-top-level-state-key digest pin (stateKeyDigests) now sees one new entry → all four wire goldens red → the three shards that run this file red. The PR was simply incomplete on the golden side — not a behavioral regression.

Fix: regenerated the four goldens with the sanctioned script (node --import tsx scripts/update-storage-render-goldens.ts). The diff is exactly one added line per wire — "pendingOrphanSweepMaxRef": "74234e98afe7498f" — inserted right after pendingOrphanSweepMinRef. The value is undefined in the scripted scenario (the one-shot window bound is consumed together with its fold marker), so it carries the shared "null" digest and no other field changes: stateDigest, section digests, per-turn wire digests, and stateShape are all byte-identical to the old goldens.

Verification:

  • Local targeted run of tests/golden-storage-render.test.ts: 5/5 pass (all four wires + the orphaned-file guard).
  • Diff review: 4 files, +4 lines, nothing else.
  • Pushed 227d45eb8f to 2026-11-10_sweep-window-upper-bound (clean fast-forward, no force-push; remote head was an ancestor).

CI now (live, single GitHub API read — the mirror cache is stale, fetched_at stuck at 2026-11-11T17:03Z on the old head): on head 227d45eb8f, lock-sync, version-guard, kernel-guard, architecture-docs, and both static-gates are all green; the 10 test shards are still in progress (including the three that were red). Given the local 5/5 pass and the one-line-per-wire diff, these should turn green; I'll confirm on the next wake if any shard is still red.


八问(中文,供人工 reviewer):

  1. 是什么问题:PR 给持久化状态新增了一个字段 pendingOrphanSweepMaxRef,但没重新生成早已存在的 4 个 storage-render golden 快照,导致「逐状态键摘要」钉住多出一个键,4 条 wire 的 golden 全红,连带 3 个 test shard 红。
  2. 什么原因导致的:根因是 PR 不完整(漏了 golden 再生成),不是行为回归——新增键在脚本化场景里值恒为 undefined(一次性窗口上界随 fold 标记一起被消费),JSON.stringify 会省略它,所以 stateDigest/各 section 摘要/逐轮 wire 摘要全都不变,唯一差异就是 stateKeyDigests 里多了一行。
  3. 影响范围与严重程度:仅影响 CI 的 3 个 test shard(跑 golden 测试的那几个),不影响任何运行时行为、不影响用户;属「CI 红、产品无感」,严重度低(流程瑕疵)。
  4. 怎么修复的:用仓库自带的正规脚本 update-storage-render-goldens.ts 重新生成 4 个 golden,每条 wire 只加一行 pendingOrphanSweepMaxRef: 74234e98afe7498f(共享的 "null" 摘要),其余字节完全不动。
  5. 是否有回归问题:无。diff 只有 4 个 golden 文件各 +1 行,没碰任何 src/kernel 逻辑;stateDigest 与逐轮 wire 摘要逐字节未变,证明 wire 与持久化行为都没漂移。
  6. 是否破坏缓存:不涉及。这是测试快照再生成,不碰缓存/重试/游标/去重键。
  7. 是否改了设计方向:不涉及。纯测试快照对齐,无架构/边界/数据流变更。
  8. 是否引入了新的配置:不涉及。无新 env/config/默认值。

收工判定:修复已推送(227d45eb8f),本地 5/5 通过,diff 最小化(每 wire 一行);guard/lock-sync 已绿,test shard 在跑,预期转绿——若仍有 shard 红,下次唤醒我会继续跟进。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷

Re-verified live — everything is already green; no work needed this run.

This event reported lock-sync red on head 61b7663623, but that's an old, superseded head (the original 3-commit PR head, an ancestor of the current tip). The earlier wake already fixed both the lock-sync red and the three red test shards.

Live state on the current head 227d45eb8f (verified this run — fresh mirror cache + a single GitHub check-runs read):

  • lock-sync, kernel-guard, version-guard, architecture-docs, both static-gates: success
  • all 11 test shards: success (incl. the three that were red: windows 22/5, ubuntu 24/3, ubuntu 22/3)
  • tally: 38 success / 14 skipped / 0 failed / 0 pending

Nothing to fix. Stopping without further work.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷

Final confirmation — PR #6142 is green and ready for human merge.

Re-verified live this run on the current head 227d45eb8f: all checks pass (38 success / 14 skipped / 0 failed / 0 pending) — lock-sync, kernel-guard, version-guard, architecture-docs, both static-gates, and all 11 test shards. The lock-sync red this wake reported was on the old, superseded head 61b7663623.

No further work from the CI lane. Ready for you to merge: #6142

@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] 🏷

Merge conflict resolved and CI fully green — PR #6142 is ready for human merge.

The PR went dirty because master advanced past its base: PR #6326 ("durability-before-render") merged, moving master c26c31ace4 → 9674cfafbc. I merged the new master into the PR branch:

  • Zero conflicts — master's 7 files (src/incremental-lane.ts, src/persist.ts, src/server/prepare-{anthropic,google,openai,responses}.ts, tests/issue3397-…test.ts) don't overlap this PR's files (kernel + src/state-hydration.ts + goldens).
  • Pushed 797c5d8eb9 (clean fast-forward, no force-push).
  • Verified live: mergeable = True, base now at master tip 9674cfafbc.

CI on the new head 797c5d8eb9 (verified live): all green — 16 success / 14 skipped / 0 failed / 0 pending. All 8 gate checks (lock-sync, kernel-guard, version-guard, architecture-docs, both static-gates, config-surface-guard, lifecycle-ledger-guard) and all test shards pass.

八问(中文,供 reviewer):

  1. 是什么问题:PR [PR] fix: bound the failed-compress orphan sweep window at the commit-time ref frontier #6142 与 base 冲突(dirty)——master 在 PR 基线之后合入了 [PR] fix: persist ledger rows before the model call (durability-before-render) #6326,base 从 c26c31ace4 前进到 9674cfafbc,PR 落后被标 dirty。
  2. 什么原因导致的:非本 PR 代码冲突,而是 master 新增了 [PR] fix: persist ledger rows before the model call (durability-before-render) #6326 的 7 个文件、PR 分支落后于新 master;两边改动文件零重叠。
  3. 影响范围与严重程度:仅本 PR 暂时无法合并,不影响任何已发布行为;严重程度低(纯合并调度,非功能缺陷)。
  4. 怎么修复的:把新 master 9674cfafbc merge 进 PR 分支(用 merge 而非 rebase,避免 force-push);零冲突干净合并,kernel 0.0.196 / root 0.1.213 保持不变。
  5. 是否有回归问题:无。merge diff 相对上一绿头 227d45eb8f 恰好只是 master 的 7 个文件(+261 行),本 PR 的 kernel/lockfile/goldens 一律未动 → 上一轮已绿的各 gate 全部保持,新头 CI 全绿(16 成功/14 跳过/0 失败)。
  6. 是否破坏缓存:不涉及(纯 git 合并,无缓存/重试/游标逻辑改动)。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:不涉及。

判定:冲突已解决,PR 恢复可合并(mergeable=True),新头 797c5d8eb9 CI 全绿。可由人工合并:#6142

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Re-verified live — no new work this run; PR #6142 remains fully green and ready for human merge.

This run was an auto-retry after the daemon restart — no new event and no new commits since the conflict-resolution head 797c5d8eb9 reported in the previous run. Verified just now:

  • Mirror cache (snapshot 09:51Z): head 797c5d8eb9, 0 failed, but 2 test shards still in_progress (test windows 22/5, test ubuntu 24/2) — the snapshot was mid-run.
  • Single live GitHub check-runs read on head 797c5d8eb9: all 52 runs completed — 38 success / 14 skipped / 0 failed / 0 pending. Both of the still-running shards have since turned green.

State is unchanged since the last report: merge conflict resolved (master merged in, zero conflicts), all gates green. mergeable_state is blocked solely by branch protection — with every required check now satisfied, what remains is the human review/merge step. Nothing left for the CI lane.

Ready for human merge: #6142


八问(中文,供人工 reviewer):

  1. 是什么问题:本轮无新问题——这是 daemon 重启后的自动重试运行,PR 无新事件、无新提交。
  2. 什么原因导致的:不涉及(无缺陷)。
  3. 影响范围与严重程度:不涉及。
  4. 怎么修复的:本轮未做任何修改,仅复核状态——镜像缓存快照(09:51Z)显示 2 个 test shard 仍在跑,随后单次 GitHub check-runs 实读确认 52 项全部完成:38 成功 / 14 跳过 / 0 失败 / 0 待跑。
  5. 是否有回归问题:无。代码自上一绿头 797c5d8eb9 起无任何变动。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:不涉及。

判定:CI 全绿、无新增工作,等待人工合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

…lict at 0.0.198

Master advanced past the PR base (batch4 kernel fixes #6428/#6345/#5166 ->
kernel 0.0.197, storage-render chat golden digest refresh, pi-subagents 0.2.4,
305 files). Content hunks auto-merged (kernel/src/compress.ts,
tests/golden/storage-render/chat.json); the only conflicts were the three
kernel version lines, resolved at 0.0.198 = master's 0.0.197 + this PR's
kernel/src change, per the CI-enforced kernel version discipline.

Targeted local verification: tests/golden-storage-render.test.ts 5/5,
kernel issue6116/issue3769/hide-consumed suites 27/27.
…lict at 0.0.200

Master advanced past the PR base again (batch11 wave11 #6827, lean-compress
receipt #7105, wire-client-sidecars #7083, p1 batch b2/b3, #7087, #7101 ->
kernel 0.0.199, storage-render goldens regenerated for #6775 persisted
fields, 400 files). Content hunks auto-merged (kernel/src/compress.ts,
kernel/src/types.ts, all four storage-render goldens); the only conflicts
were the three kernel version lines, resolved at 0.0.200 = master's 0.0.199
+ this PR's kernel/src change, per the CI-enforced kernel version discipline.

Targeted local verification: tests/golden-storage-render.test.ts 5/5,
tests/storage-state-fields.test.ts 2/2, kernel issue6116/issue3769/
hide-consumed suites 27/27.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Merge conflict resolved, final head pushed, all gates green — test shards still running.

Verified live first (the mirror's git endpoint was 502-ing this run, so I fetched live heads directly from github.com): PR head 4424c03ea (unchanged since the last run — no concurrent pushes), master a446a3c1c, which had advanced 400 files past the PR base (batch11 wave11 #6827, lean-compress receipt #7105, wire-client-sidecars #7083, p1 batches — kernel 0.0.199, storage-render goldens regenerated for the #6775 persisted fields).

What I did this run:

  1. Merged upstream/master into the PR branch. Conflicts were ONLY the three kernel version lines (PR 0.0.198 vs master 0.0.199) — resolved at 0.0.200 = master's 0.0.199 + this PR's kernel/src change, per the CI-enforced kernel version discipline (the merged tree still carries this PR's kernel/src diff against the new master, so it needs its own bump). All content hunks auto-merged: kernel/src/compress.ts, kernel/src/types.ts, and all four storage-render goldens — verified both sides' changes are present in each.
  2. Local targeted verification on the merged tree (kernel rebuilt from merged source): tests/golden-storage-render.test.ts 5/5, tests/storage-state-fields.test.ts 2/2, kernel issue6116/issue3769/hide-consumed suites 27/27.
  3. Pushed final head 1a739281b6 — clean fast-forward, no force-push, unmarked per the CI-hold policy (this is the branch's one full CI pass).

CI on 1a739281b6 (mirror cache, live this run): all gate checks green — lock-sync, kernel-guard, version-guard, architecture-docs, both static-gates, config-surface-guard, lifecycle-ledger-guard and the rest (0 failed). 11 test shards still in progress at the last snapshot; 0 failures so far. Risk is low: the previous head 4424c03ea already passed every shard on this same PR code, and this merge adds only master's own CI-verified changes plus the mechanical version resolution. If any shard turns red I'll pick it up on the next wake (attempts 2/6, 3/6 remain).


八问(中文,供人工 reviewer):

  1. 是什么问题:PR [PR] fix: bound the failed-compress orphan sweep window at the commit-time ref frontier #6142 与 base 再次冲突(dirty)——master 在 PR 基线之后又合入了 batch11 wave11([PR] wave-11 batch: 7 community fixes (opencode provider, preflight epoch, output budget, +4) — #6797/#6818 excluded #6827)、[PR] Remove head/tail tags from the compression success receipt (keep excerpts) + add collapse timestamps + annotate kernel a | 压缩成功回执去掉 head/tail 标签(保留摘录)+ 打折叠时间戳 + kernel 锚点引文标注来源(模型可见文本,4 处) #7105、[PR] fix(lanes): demote the wire clients' auxiliary calls to the side lane (discussions/6884) #7083 等共 400 个文件的变更(kernel 0.0.199、[PR] fix(persist): keep k̂ model provenance and the emergency-shrink marker across restarts #6775 持久化字段的 golden 重生成)。
  2. 什么原因导致的:非本 PR 代码冲突,而是 master 持续前进、PR 分支落后;两边唯一重叠的冲突是 3 个 kernel 版本行(PR 0.0.198 vs master 0.0.199),内容 hunk(compress.ts / types.ts / 4 个 golden)全部自动合并成功。
  3. 影响范围与严重程度:仅本 PR 暂时无法合并,不影响任何已发布行为;严重程度低(纯合并调度,非功能缺陷)。
  4. 怎么修复的:把 master a446a3c1c merge 进 PR 分支(merge 而非 rebase,避免 force-push);版本冲突解为 0.0.200 = master 的 0.0.199 + 本 PR 的 kernel/src 变更(CI 版本纪律:合并树相对新 master 仍含 kernel 变更就必须再 bump);本地定向验证全绿后推送最终头 1a739281b6。
  5. 是否有回归问题:无。相对上一绿头 4424c03ea,本 merge 只带入 master 自身(已在 master CI 验证过的)400 文件变更 + 3 个版本行;本 PR 的 kernel/golden 逻辑一律未动。golden 测试 5/5 证明合并后的快照与合并树行为一致。
  6. 是否破坏缓存:不涉及(纯 git 合并 + 版本行,无缓存/重试/游标逻辑改动)。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:不涉及。

判定:冲突已解决并推送(1a739281b6),gate 全绿、test shard 在跑(0 失败)、本地定向验证全绿;若 shard 转红下次唤醒继续跟进,否则等待人工合并:#6142

@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] 🏷
(ai: vllm-qwen/qwen3.8-27b)

Review of PR #6142 (head 1a739281b) — findings only. NOT approving: touches kernel/ and carries a kernel-change: declaration → human-only review tier (Kernel Boundary rule 3).

① Direction (原 issue): Linked GitHub issue #6116 (owner-filed) asks to narrow the #3769 fold-gated orphan sweep from "everything at/after the earliest fold point" (lower bound only) to the window between this compression's earliest fold point and the successful call itself — so fresh same-turn failures issued after the success keep their error feedback. In-thread decision B was confirmed: mechanism fix only, no prompt change. The PR implements exactly that, at the root cause (the missing upper bound in the sweep predicate), not a symptom. Direction is correct.

What I verified independently (not from the author's report):

  • Pulled the branch. True diff vs current master (a446a3c1c) = 14 files, +390/−10, all on-purpose. Head is a clean merge of current master (merge-base = master tip); git merge-tree → no conflict.
  • Core mechanism: applyCompression (kernel/src/compress.ts:933) records pendingOrphanSweepMaxRef = highestUsedIndex(state.messageRefs) at commit time (running MAX across folds that commit before one consuming turn); the sweep (kernel/src/hide-consumed.ts:361) becomes the closed window num >= foldMinRef && (foldMaxRef === undefined || num <= foldMaxRef). The load-bearing claim — "the successful call and any later same-turn calls only get refs on the next assignRefs pass, strictly above the frontier" — holds on both lanes: proxy mode commits on the request history (ctx.compressMessages ?? ctx.messages, src/stream.ts:1363), which ends before the response's calls; plugin mode commits on the agent's own request history before the success call is appended.
  • Regression walk of the touched paths: quiet-turn no-sweep, sub-min visibility, persistent monotonic sweptOrphanCallIds, the quotesActiveBlock carrier exemption, and the pre-[Bug] MCP failed compression record rotation prematurely rewrites the history prefix, triggering expensive cache recompu | [Bug] MCP 失败压缩记录轮换提前改写历史前缀,触发大额缓存重算 #3769 hiddenOrphanRefs upgrade honor are all preserved — the window check is nested inside the existing foldMinRef !== undefined && !quotesActiveBlock branch, so it only narrows, never widens, the swept set. Legacy states without the max field degrade to the pre-fix unbounded sweep (upgrade compat). A stray max without min is inert. Both markers are consumed one-shot. The field is carried through sync-blocks (kernel/src/sync.ts:87), cloneState (kernel/src/compress.ts:2626), and host hydration (src/state-hydration.ts:67), and round-trips unified storage (tests/storage-state-fields.test.ts).
  • Tests: 7 new tests (kernel/tests/issue6116-sweep-window.test.ts) — both-endpoint inclusivity, legacy min-only → unbounded, max-without-min inert, real core.applyCompression writes both markers, THE issue scenario (same-turn failure after the success survives), two-fold running min+max union window, full processTurn pipeline carry + one-shot consume. All assert exact swept call-id lists (teeth, not counts). The four storage-render goldens each gain exactly one line (pendingOrphanSweepMaxRef: "74234e98afe7498f", the shared "null" digest — undefined in the scripted scenario); wire shas unchanged.
  • Version discipline + declaration: kernel 0.0.199 → 0.0.200 (the head's merge resolved the version conflict against master's 0.0.199); kernel-change: present in the PR body.
  • CI (mirror cache, fetched 2026-11-19T00:13Z for this head): 30 checks — 0 failed / 0 pending (all test shards, both static-gates, mysql-contract, gate, docs-coverage green; e2e lanes skipped by their gates).

Behavior change (intended, disclosed in PR body): old = sweep removed every non-active compress failure with ref ≥ foldMinRef (unbounded upward), including failures created after the success call; new = sweep removes only foldMinRef ≤ ref ≤ foldMaxRef; failures at/above the success-call frontier stay visible until a later fold covers them. Legacy (pre-#6116) states keep the old unbounded behavior for their one pending window.

Cache impact: none — the sweep still runs in the same post-fold rewrite pass where the cached breakpoint already moved past foldMinRef.

Findings: none blocking, none small enough to fix on the spot. Diff is clean (every line on-purpose), comments explain why and cite the issue, no dead code, no config surface touched.

八问(中文,供人工 reviewer):

  1. 是什么问题:[Bug] MCP failed compression record rotation prematurely rewrites the history prefix, triggering expensive cache recompu | [Bug] MCP 失败压缩记录轮换提前改写历史前缀,触发大额缓存重算 #3769 的失败清扫只有下界没有上界——成功压缩之后、同一轮里新产生的 compress 失败也会在下一轮被永久隐藏,模型刚拿到的错误反馈丢失,可能重复发出同样的无效压缩。
  2. 什么原因导致的:清扫条件只有 ref >= foldMinRef,缺上界;同一轮里成功调用之后的消息要到下一次 assignRefs 才铸 ref,全部落在 ≥ foldMinRef 区间,无法与「该清的旧失败」区分。
  3. 影响范围与严重程度:仅当模型在同一轮把 compress 与其他工具混用、且压缩成功后又出现新失败时触发;属特定条件下的体验问题(错误反馈丢失→注意力/重试效率下降),不影响主流程,p2。
  4. 怎么修复的:applyCompression 提交时记 pendingOrphanSweepMaxRef = highestUsedIndex(refMap)(成功调用及之后的消息 ref 严格大于它);清扫收敛为闭区间 [min, max];多折叠先于消费轮提交时 running MIN/MAX 累积;sync-blocks / cloneState / 宿主 hydration 三处搬运新字段。
  5. 是否有回归问题:无——[Bug] MCP failed compression record rotation prematurely rewrites the history prefix, triggering expensive cache recompu | [Bug] MCP 失败压缩记录轮换提前改写历史前缀,触发大额缓存重算 #3769 既有行为逐项保持(静默轮不清扫、下界以下不动、持久单调清扫集、载体豁免、pre-[Bug] MCP failed compression record rotation prematurely rewrites the history prefix, triggering expensive cache recompu | [Bug] MCP 失败压缩记录轮换提前改写历史前缀,触发大额缓存重算 #3769 hiddenOrphanRefs 升级兼容);窗口检查嵌套在既有分支内只收窄不放宽;旧状态无 max 字段退化为修复前无界行为(测试钉死);max 无 min 天然惰性(测试钉死)。
  6. 是否破坏缓存:不破坏——清扫仍在折叠后同一次出站改写里执行,缓存断点已随折叠移过下界。
  7. 是否改了设计方向:没有——[Bug] MCP failed compression record rotation prematurely rewrites the history prefix, triggering expensive cache recompu | [Bug] MCP 失败压缩记录轮换提前改写历史前缀,触发大额缓存重算 #3769 机制框架不变,只给窗口加上界。
  8. 是否引入了新的配置:没有——新增的是内核内部状态字段(随 kstate 序列化往返),无 env/config/CLI 面变化。

Verdict: correct, minimal, well-tested, behavior change properly disclosed, no findings. Merge is gated on the owner's sign-off (kernel human-only tier) — see the follow-up 需要决策 comment.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

🔶 需要决策
(ai: vllm-qwen/qwen3.8-27b)

PR #6142 (head 1a739281b) touches kernel/ and carries a kernel-change: declaration — it sits at the human-only review tier (Kernel Boundary rule 3) and cannot be agent-approved or auto-merged.

Gated diff (the kernel/ portion):

  • kernel/src/compress.ts — applyCompression records pendingOrphanSweepMaxRef at commit time (running MAX across folds); hideCompressCallsNode consumes it one-shot; cloneState carries it.
  • kernel/src/hide-consumed.ts — sweep predicate becomes the closed window [foldMinRef, foldMaxRef] with a legacy unbounded fallback when the max is absent.
  • kernel/src/sync.ts — sync-blocks carries the new field.
  • kernel/src/types.ts — pendingOrphanSweepMaxRef?: number on CompressionState.
  • kernel/package.json — version 0.0.199 → 0.0.200.
  • kernel/tests/issue6116-sweep-window.test.ts — 7 new regression tests.

My review (findings only, above): correct, minimal, well-tested, behavior change disclosed, no blocking or small findings. CI green (0 failed / 0 pending on this head).

Requesting the owner's authorization to merge.

  • Option A: approve + merge.
  • Option B: request changes (specify what).

…lict at 0.0.202

Master advanced 122 commits past the PR base (batch-seam double-claim fix
#7428 -> kernel 0.0.201, storage backup/repair #7156/#7431, ingest-band
default-off #7426, pf-tail-ids cap #7381, OpenAI reasoning alias #7432,
dsh-mneme scan #7430, and more). Content hunks auto-merged (kernel/src/
compress.ts, all four storage-render goldens); the only conflicts were the
three kernel version lines, resolved at 0.0.202 = master's 0.0.201 + this
PR's kernel/src change, per the CI-enforced kernel version discipline.

Targeted local verification: tests/golden-storage-render.test.ts +
tests/storage-state-fields.test.ts 7/7, kernel issue6116/issue3769/
hide-consumed suites 27/27.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Merge conflict resolved, final head pushed, all gates green — test shards still running.

Verified live first: PR head 1a739281b6 (unchanged since the last run — no concurrent pushes), master 98fa9575f108, which advanced 122 commits / 139 files past the PR base (batch-seam double-claim fix #7428 → kernel 0.0.201, storage backup/repair #7156/#7431, ingest-band default-off #7426, pf-tail-ids cap #7381, OpenAI reasoning alias #7432, dsh-mneme scan #7430, and more).

What I did this run:

  1. Merged upstream/master into the PR branch. Conflicts were ONLY the three kernel version lines (PR 0.0.200 vs master 0.0.201) — resolved at 0.0.202 = master's 0.0.201 + this PR's kernel/src change, per the CI-enforced kernel version discipline (the merged tree still carries this PR's kernel/src diff against the new master, so it needs its own bump). All content hunks auto-merged: kernel/src/compress.ts (verified both sides present — the PR's frontier/cloneState hunks and master's [PR] fix: two adjacent ranges in one compress batch both claimed the shared seam tool pair — first-come-first-served #7428 batch-seam coverage refresh + allCovered warning) and all four storage-render goldens (master's refreshed digests + the PR's one key line in each).
  2. Local targeted verification on the merged tree (kernel rebuilt from merged source): tests/golden-storage-render.test.ts + tests/storage-state-fields.test.ts 7/7, kernel issue6116/issue3769/hide-consumed suites 27/27.
  3. Pushed final head b06c45e1f4f — clean fast-forward, no force-push, unmarked per the CI-hold policy (this is the branch's one full CI pass).

CI on b06c45e1f4f: the mirror cache was stale for this head (last poll 2026-11-19, old sha — the mirror's git endpoint has been 502-ing, so the poller can't refresh), so I verified with a single non-polling GitHub check-runs read: 0 failed — 25 success + 13 skipped (all gate checks green: lock-sync, kernel-guard, version-guard, architecture-docs, static-gates, config-surface-guard, …), 13 test shards in progress/queued. Risk is low: the previous head 1a739281b6 completed fully green (30/30, 0 failed), and this merge adds only master's own CI-verified changes plus the mechanical version resolution. If any shard turns red I'll pick it up on the next wake (attempts 2/6, 3/6 remain).


八问(中文,供人工 reviewer):

  1. 是什么问题:PR [PR] fix: bound the failed-compress orphan sweep window at the commit-time ref frontier #6142 与 base 再次冲突(dirty)——master 在 PR 基线之后又合入了 122 个提交 / 139 个文件(batch-seam 双占修复 [PR] fix: two adjacent ranges in one compress batch both claimed the shared seam tool pair — first-come-first-served #7428 → kernel 0.0.201、storage backup/repair [Bug][storage] Takeover spawns before reclaim: old and new sidecars simultaneously hold index.db, causing corruption; em | [Bug][storage] 接管时先 spawn 后回收:新旧侧车同时持有 index.db 引发损坏;空 payload_json 又让历史会话静默变 0 #7156/[PR] feat(storage): index.db backup and corruption recovery commands bili storage backup / repair (#7156) | feat(storage): index.db 备份与损坏恢复命令 bili storage backup / repair(#7156) #7431、ingest-band 默认关闭 [Bug][opencode][ingest/0.1.216] Long sessions on the opencode lane are permanently 413'd by the 32 MiB ingest hard limit | [Bug][opencode][ingest/0.1.216] opencode 车道的长会话被 32 MiB ingest 硬闸永久 413(且 #6908/#6933 的修复只豁免 dsh 车道,opencode 仍在外) #7426、pf-tail-ids 上限 [PR] fix: cap x-bili-pf-tail-ids at 160 ids and decouple the pf-seq stamp from the fastpath gate (#7367) #7381、OpenAI reasoning 别名 [Bug][proxy/0.1.216] OpenAI adapter reads only delta.reasoning_content, so a provider that streams delta.reasoning loses its whole thinking block — client keeps exactly the first token | proxy 车道丢弃 delta.reasoning,思维链只剩第一个词 #7432 等)。
  2. 什么原因导致的:非本 PR 代码冲突,而是 master 持续前进、PR 分支落后;两边唯一重叠的冲突仍是 3 个 kernel 版本行(PR 0.0.200 vs master 0.0.201),内容 hunk(compress.ts / 4 个 golden)全部自动合并成功,且已逐一验证双方改动都在。
  3. 影响范围与严重程度:仅本 PR 暂时无法合并,不影响任何已发布行为;严重程度低(纯合并调度,非功能缺陷)。
  4. 怎么修复的:把 master 98fa9575f108 merge 进 PR 分支(merge 而非 rebase,避免 force-push);版本冲突解为 0.0.202 = master 的 0.0.201 + 本 PR 的 kernel/src 变更(CI 版本纪律:合并树相对新 master 仍含 kernel 变更就必须再 bump);本地定向验证全绿后推送最终头 b06c45e1f4f。
  5. 是否有回归问题:无。相对上一全绿头 1a739281b6,本 merge 只带入 master 自身(已在 master CI 验证过的)122 个提交的变更 + 3 个版本行;本 PR 的 kernel/golden 逻辑一律未动。golden 测试 7/7 证明合并后的快照与合并树行为一致。
  6. 是否破坏缓存:不涉及(纯 git 合并 + 版本行,无缓存/重试/游标逻辑改动)。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:不涉及。

判定:冲突已解决并推送(b06c45e1f4f),gate 全绿、test shard 在跑(0 失败)、本地定向验证全绿;若 shard 转红下次唤醒继续跟进,否则等待人工合并:#6142

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 enhancement New feature or request needs-decision p2 scope/kernel

Projects

None yet

1 participant