Skip to content

[PR] kernel: re-inject T1 after a partial fold to kill the compression ratchet (#6720) - #6760

Open
ranxianglei wants to merge 5 commits into
masterfrom
2026-11-14_partial-fold-reinject
Open

ranxianglei wants to merge 5 commits into
masterfrom
2026-11-14_partial-fold-reinject

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Fixes #6720

What this is

The post-fold floor ratchets up monotonically in long low-usage sessions (1M window, usage <= 24%): each tier-1 fold is PARTIAL (the weak model folds only part of the offered list, leaving 15-60K on the table), and the cadence gate (growthFloor, a full 50K growth wait) makes the next nudge come only after the remainder has already ridden along and grown another 10-20K. So the floor rises 114K -> 119K -> 132K -> 139K -> 212K and never recovers.

Root cause

The cadence gate (tokenCount - lastShownByTier < growthFloor -> "blocked: T1 (cadence)") has no partial-fold follow-up path. A partial fold's remainder waits a FULL growth interval before the next nudge, and by then the tail has grown. The gentle nudge wording ("Ranges the task still needs can wait") plus the done-shaped receipt (no mention of the unharvested remainder) let weak models treat a partial fold as complete.

Fix

One-shot partial-fold re-inject (kernel). A partial tier-1 fold (harvest < STALL_HARVEST_RATIO of the offered pending, i.e. < 50%) arms NudgeState.partialFoldReinjectArmed. The next processTurn re-offers T1 without waiting for the full growth floor — but only while the armed flag is set AND t1Eff >= 50% of the T1 threshold (so a tiny remainder doesn't spam). The branch is not gated on usage: a low-usage 1M-window session never crosses minContextLimitPct (45%), so the first-sight/backlog bypasses never fire and the remainder would otherwise stall for a full growth interval every round. The flag is cleared when the re-injected nudge is displayed (nudge-stamp node) or by a compliant full fold; an ignored re-offer keeps lastNudgeShownTokens set so the normal growth gate re-asserts — at most one re-inject per partial fold, no loop on an unresponsive session.

Receipt names the remainder (host). applyCompression now reports remainingPending (offered pending minus what folded, floored at 0) on a partial tier-1 fold; the compress receipt appends "N tokens of the offered ranges remain unfolded — include them in your next compress call" instead of reading as a clean "done".

Nudge log line lists the offered ranges (host). The nudge INJECT log line now includes ranges=[mXXXXX–mYYYYY(tokens), ...] (capped at 4 + "+N more") so "the model saw this list and didn't fold it all" is verifiable from the log (previously only pendingT1 was logged).

Behavior change (old -> new)

  • After a PARTIAL tier-1 fold, the next request re-injects T1 even at low usage (old: wait for the full growthFloor growth interval). This is the fix — the remainder drains on the next request instead of ratcheting the floor up. A compliant (full) fold is unaffected: it never arms the re-inject, and the normal cadence still applies.
  • The compress receipt now mentions the unharvested remainder on a partial tier-1 fold (old: a done-shaped receipt with no mention). Full folds and no-ops are unchanged.
  • The nudge inject log line now lists the offered ranges (old: only pendingT1). Additive, no behavior change.

Verification

  • Kernel: issue6720-partial-fold-reinject.test.ts (4 tests: partial fold arms + re-injects at low usage; not gated on usage; one-shot no loop; full fold never arms). 3 nudge.test.ts tests updated for the new re-inject behavior (they did a partial fold then a low-usage request, where the re-inject now fires — the intended change).
  • Host: issue6720-partial-fold-receipt.test.ts (4 tests: receipt names the remainder; full fold no note; log line lists ranges; log line omits when none).
  • Targeted: kernel 120 pass (issue6720 + issue5698 + nudge + compress + nudge-text); host 17 pass (receipt suites). Typecheck clean (kernel + host).

kernel-change

kernel-change: #6720 partial-fold ratchet — the cadence gate (growthFloor) let each partial fold's remainder ride along for a full growth interval; the re-inject branch bypasses that wait for ONE re-offer after a partial fold, then the normal growth gate re-asserts. New NudgeState field (partialFoldReinjectArmed) + ApplyCompressionResult field (remainingPending); no wire-format or id-logic change.

Kernel version bumped 0.0.197 -> 0.0.198.

Props 2/3/4/6 from the issue (escalate after N partial folds, per-stream metering, "already at minimum" wording, client-side 2-streams/51K-system) are separate mechanisms and deferred to their own issues.

…chet (#6720)

A partial tier-1 fold (harvest < STALL_HARVEST_RATIO of the offered pending)
arms a one-shot re-inject: the next processTurn re-offers T1 without waiting
for the full growth floor, so the unharvested remainder drains instead of
riding along and ratcheting the post-fold floor up monotonically (#6720).

- kernel: NudgeState.partialFoldReinjectArmed (one-shot, armed on a partial
  fold, cleared on display or a compliant full fold); applyCompression reports
  the unharvested remainder (remainingPending) on a partial tier-1 fold;
  decideNudge gains the re-inject branch (not gated on usage — a low-usage
  1M-window session never crosses minContextLimitPct, which is exactly the
  ratchet shape); the nudge-stamp node disarms on a displayed tier-1 nudge.
- host: the compress receipt names the remainder instead of reading as a clean
  "done"; the nudge inject log line lists the offered ranges (capped at 4).

kernel-change: #6720 partial-fold ratchet — the cadence gate (growthFloor)
let each partial fold's remainder ride along for a full growth interval; the
re-inject branch bypasses that wait for ONE re-offer after a partial fold,
then the normal growth gate re-asserts (no loop on an unresponsive session).
@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-11-14_partial-fold-reinject (80ca785)

Latest build — install this exact version

npm install -g billion-context@0.0.11160-pr.6760.e11a0dd

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
80ca785 billion-context@0.0.11160-pr.6760.e11a0dd build
62d9eea billion-context@0.0.10859-pr.6760.7e868b6 build
2d84c7d billion-context@0.0.10295-pr.6760.42df829 build
09f6fe5 billion-context@0.0.10030-pr.6760.a1bff1e build
3c8ad9d billion-context@0.0.10018-pr.6760.9044cf5 build

Download artifact

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

Install instructions are refreshed on each push.

@ranxianglei ranxianglei changed the title kernel: re-inject T1 after a partial fold to kill the compression ratchet (#6720) [PR] kernel: re-inject T1 after a partial fold to kill the compression ratchet (#6720) Nov 14, 2026
@ranxianglei ranxianglei added bug Something isn't working p2 scope/kernel labels Nov 14, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重: 不重复. Only PR #6760 targets #6720 (verified against the open [PR] list). Other open nudge/compress PRs (#6745 web chart, #6531 un-show rejected nudge, #5779 tier-merge screening, #6716/#6747/#6705 receipt/scan perf) are different mechanisms — no in-flight PR touches the cadence-gate / partial-fold follow-up.

标签: applied bug + pi + scope/kernel + p2 to the thread — kernel nudge-mechanism defect surfacing in a long pi proxy-mode session; usable but not fully drained, so p2 (not p1: context still shrinks each fold, no cache leak, no data loss). The PR's own GitHub labels (bug/p2/scope/kernel) already match its diff — no change needed there.

Review — read the full diff (8 files, +475/−11) at PR head 3c8ad9da7e on base 3858b6956a (= current master, no stale base) and re-derived the mechanism from the code independently of the PR description.

Mechanism walkthrough:

  • Arming (kernel/src/compress.ts:959-968): inside blocksCreated > 0, inside the existing firePending > 0 branch — partial = tokensCompressed < STALL_HARVEST_RATIO * firePending (same predicate as the existing t1HarvestStall, whose assignment is unchanged); sets partialFoldReinjectArmed = partial and remainingPending = max(0, firePending − tokensCompressed) only when partial. No-op folds (blocksCreated = 0) never arm.
  • Re-inject branch (kernel/src/compress.ts:2487-2495): placed after the pressure/growth if-else, fires iff injectedTier === null && !pressure && flag === true && t1Eff >= 0.5 * tierThresholds[1] — fills exactly the gap the old code left (pending in [50%, 100%) of the T1 threshold, growth floor unmet, no pressure). Skipped when a normal T1/T2/T3 fire already happened this turn.
  • One-shot / no loop: the flag is cleared on display of ANY T1 nudge (nudgeNode, kernel/src/compress.ts:1618-1620), on distill folds, and on a compliant full fold. Arming happens only inside applyCompression (which resets the nudge-shown counter), so the re-inject can never fire while another nudge is outstanding. An ignored re-offer → flag already cleared on display → the normal 50K growth gate re-asserts. At most one re-inject per partial fold.
  • Receipt (src/stream.ts:1620-1624): appends "N tokens of the offered ranges remain unfolded — include them in your next compress call." only when remainingPending !== undefined (partial T1 folds only); full-fold receipts are byte-identical.
  • Log line (src/server.ts, diagNudge): ranges=[mX–mY(tokens), …] capped at 4 + "+N more", from n.compressibleRanges — a real NudgeDecision field (kernel/src/types.ts:753, set at kernel/src/compress.ts:2589), not dead code.
  • Plugin mode: the same kernel code runs agent-side, so the agent's own loop gets the same re-inject; the proxy suppresses nudge injection in plugin mode (KDD feat: bili CLI + debug in config + README rewrite #7), so proxy-side flag state is inert there.

Verification (targeted local runs on the PR head; full-suite verdict = CI):

  • kernel: issue6720-partial-fold-reinject ×4, nudge + nudge-text ×77, issue5698 + compress ×39 → 120 pass (matches the PR's claim)
  • host: issue6720-partial-fold-receipt ×4 pass
  • verif-subset-guard ×2 pass (kernel/src/compress.ts is a verif-guarded file, KDD release v0.1.4 #14)
  • wire-contract ×24 pass (golden behavior surface unchanged)
  • typecheck clean (kernel + host)
  • CI (verified live at the time of this reply): 12 checks still pending (plan green, 0 failed) — full-suite verdict outstanding.

Non-blocking observations:

  1. The issue's acceptance criterion ("same-scale repro session, tail back within ±10% of the first fold tail ~114K") is a live long-session check — the unit tests pin the mechanism (re-inject fires, receipt names the remainder, one-shot, both directions per Test Blind Spot Retrospective: Reinforcing Negative Assertion Discipline, Tightening Fake Upstream Strictness, Thin Inst | 测试盲区复盘:补反向断言纪律、假上游严格化、薄安装冒烟、形态矩阵与生命周期覆盖 #3617) but not the end-to-end outcome. The new log line (prop 5) makes post-merge verification possible: per nudge, list total ≈ folded + unfolded.
  2. Deferred props 2/3/4/6 ("deferred to their own issues") — none of them are filed yet. Per the aggregation policy they'd be checklist items in Every compression only trims a little: the post-fold floor ratchets up and a 1M-window session ends at 212K without recovering | 每次压缩只降一点:压缩后的地板越压越高,1M 窗口会话涨到 212K 不回落 #6720 unless you want them tracked separately.
  3. The 0.5 literal in the re-inject gate is documented in its comment and consistent with the file's style (e.g. 2 * tierThresholds[1] in backlogDrainReady) — no action.

结构化八问(审核结论):

  1. 是什么问题:长会话低 usage(1M 窗口、usage ≤24%)时,每次 tier-1 折叠都是部分折叠(弱模型只折了清单的一部分),折叠后的地板单调上移(114K→119K→132K→139K→212K),永不回落。
  2. 什么原因导致的:节奏门(growthFloor——等满 50K 增长)对部分折叠没有跟进路径:剩余未折部分要等一个完整增长周期,期间尾巴又长 10–20K;温和的 nudge 措辞加上"像已完成"的 receipt,让弱模型把部分折叠当完成。
  3. 影响范围与严重程度:proxy 模式(plugin 模式经 agent 侧 kernel 同样生效);长会话 + 弱模型 + 大窗口 + 低 usage(≤ minContextLimitPct 45%)。会话仍可用、每轮仍回收 15–20%,只是折不干净。p2:明显问题,无不可用、无数据丢失、无缓存泄露。
  4. 怎么修复的:一次性重注入——部分 tier-1 折叠(回收 < 50% 送出的 pending)置位一个标志;下一请求不等满增长门就重发 T1,门槛为剩余量 ≥ T1 阈值的 50%;显示或合规全折即清除标志,每个部分折叠至多重注入一次,无响应会话回落到正常增长门。宿主侧:receipt 点名未回收的剩余量;nudge 日志行列出送出的区间(上限 4 条)。
  5. 是否有回归问题:无。逐路径核过既有行为:新 decideNudge 分支在标志未置位时不可达(所有既有会话/路径判决字节级不变);t1HarvestStall 赋值不变(同一谓词);全折/no-op 的 receipt 字节级不变;日志行是增量追加(无测试或解析器钉死旧格式);持久化是增量可选字段(旧会话状态可正常加载);golden wire contract 不变(24 pass)。nudge.test.ts 里 3 个被改的断言原来钉的是旧行为(部分折叠 → 低 usage → 沉默),现在钉新行为并显式匹配 reason——这是有意且已披露的行为变更。
  6. 是否破坏缓存:否。重注入只是让 nudge 提前一轮出现(注入位置/形状与普通 nudge 轮一致);receipt 注记是临时 tool result,从不进入缓存前缀;cache ledger/折叠归属未动。
  7. 是否改了设计方向:否。同一管线、同一节点,一个可选状态字段 + 一个决策分支。flat-50K 节奏(KDD feat: release CI (npm auto-publish on release branch) #8)仍是默认;重注入是一次性、事件驱动的合规跟进(与 fix: compress over unpruned view + acp-kernel 0.0.38 (billion-context-pi#195) #194/In 0.1.210, sessions with frequent interruptions barely trigger compression reminders — tokens accumulate to 330k before | 中断频繁的会话在 0.1.210 里压缩提醒几乎不触发,积到 33 万 token 才压一次 #5415 的 bypass 同类,但由部分折叠而非 usage 置位),触发后正常增长门重新生效。
  8. 是否引入了新的配置:无。无新 env、无新 config key、无新默认值。

Kernel boundary: PR body 声明 kernel-change ✓;版本 0.0.197→0.0.198 ✓(CI 强制);kernel: commit 前缀 ✓;零新增运行时依赖 ✓;两层测试(kernel 单测 + 宿主)✓。human-only review tier 适用——合并权在你。

Verdict: code review passes — no regressions found, tests pin the mechanism in both directions, kernel boundary compliant. Awaiting CI green on the pushed head (12 checks pending at the time of this reply). Merge is human-only (kernel change).

@ranxianglei ranxianglei added the pi label Nov 14, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Post-review fix pushed to the PR branch (small-fix policy — CI-failure class, fixed in place rather than filed):

The bump commit (3c8ad9da7e) updated kernel/package.json to 0.0.198 but left both lockfiles at 0.0.197 — the lock-sync CI job (.github/workflows/ci.yml:701) regenerates both lockfiles and fails on any drift, so this would have gone red.

Fixed with an additive commit 09f6fe5d31 (chore: sync lockfiles with kernel 0.0.198 bump (lock-sync)):

  • package-lock.json: kernel entry 0.0.197 → 0.0.198 (1 line)
  • kernel/package-lock.json: self version 0.0.197 → 0.0.198 (2 lines)

Verified idempotent with the exact CI recipe (npm install --package-lock-only --ignore-scripts at root and in kernel/, then git diff --exit-code) — no further drift. Matches the established pattern where the bump commit carries the lockfile sync (e.g. 1b15692af4 for 0.0.197).

CI re-runs on the new head; the review verdict above is unchanged.

…eceipt conflict

Single conflict: src/stream.ts success-receipt line, touched by both
sides since the branch base (3858b69):
- this branch (#6720): appends the partial-fold remainingPending note
- master (#6855, fe5c5f3): builds the headline from the effective
  (kernel-clamped) range via effectiveCompressedDetail

Resolution keeps BOTH intents: effectiveDetail for the headline,
remainingNote appended after the saved-tokens clause.

Kernel version: master independently bumped 0.0.197 -> 0.0.198
(399cd2b, #6709) for the same base this branch bumped for #6720 —
git auto-resolved the identical change to 0.0.198. The merged tree now
carries kernel changes from BOTH PRs, so the branch's diff vs master
shows kernel/src edits (compress.ts, types.ts) with no version change —
kernel-guard rule 2 would fail. Bumped to 0.0.199 and regenerated both
lockfiles with the exact lock-sync recipe
(npm install --package-lock-only --ignore-scripts; verified idempotent).

Verified: host typecheck clean; kernel suite 1644 pass; targeted host
tests issue6720-partial-fold-receipt + issue6855-compress-headline 7 pass.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Conflict resolved and pushed — 2d84c7da03 (merge of origin/master tip e0d63bf8c8, 167 commits, into the PR branch).

What I did this run

  1. Merged master into the branch (merge, not rebase — keeps the reviewed commits intact, no force-push). Exactly ONE conflict: src/stream.ts success-receipt line, touched by both sides since the branch base:
  2. Kernel version bump 0.0.198 → 0.0.199 (the one non-conflict judgment call). Master independently bumped 0.0.197 → 0.0.198 for Version 0.214: compression issues still persist. The problem of old blocks failing to compress remains unresolved. | 0.214版本,压缩依旧存在问题,旧块无法压缩问题依旧存在 #6709 (399cd2b8c0) from the same base this branch bumped for Every compression only trims a little: the post-fold floor ratchets up and a 1M-window session ends at 212K without recovering | 每次压缩只降一点:压缩后的地板越压越高,1M 窗口会话涨到 212K 不回落 #6720, so git auto-resolved the identical change to 0.0.198. But the merged tree now carries kernel changes from BOTH PRs, so the branch's diff vs master shows kernel/src edits (compress.ts, types.ts) with no version change — kernel-guard rule 2 would fail. Bumped to 0.0.199 and regenerated both lockfiles with the exact lock-sync recipe (npm install --package-lock-only --ignore-scripts, root + kernel/), verified idempotent.
  3. Verified (targeted local runs; full-suite verdict = CI on the pushed head): host typecheck clean; kernel unit suite 1644 pass (covers both Every compression only trims a little: the post-fold floor ratchets up and a 1M-window session ends at 212K without recovering | 每次压缩只降一点:压缩后的地板越压越高,1M 窗口会话涨到 212K 不回落 #6720's and Version 0.214: compression issues still persist. The problem of old blocks failing to compress remains unresolved. | 0.214版本,压缩依旧存在问题,旧块无法压缩问题依旧存在 #6709's tests); host targeted tests issue6720-partial-fold-receipt + issue6855-compress-headline 7 pass.
  4. Pushed 09f6fe5d31..2d84c7da03 (plain push; remote head was unchanged before the push, no concurrent work on the branch).

Live state (verified this run, not from memory): master tip is an ancestor of the branch head (deterministic local check), and a single read-only GitHub GET reports mergeable: true, mergeable_state: blocked on head 2d84c7da03 — the conflict is gone; "blocked" is the expected hold for a kernel PR (CI on the new head + human-only merge tier). Note: the mirror checks cache was stale for this PR (fetched_at 2026-11-14T20:06Z, old sha), so I used that one allowed single GET instead of guessing from the cache.

Behavior change flag (old → new): kernel version 0.0.198 → 0.0.199 on the branch head — mechanical consequence of the merge (both kernel changes now need one version), required by kernel-guard rule 2; no code behavior change beyond the two already-reviewed PRs. The receipt line now combines #6855's effective-range headline with #6720's remainder note — both pinned by their own tests, both previously reviewed in isolation.

结构化八问

  1. 是什么问题:PR 分支落后 master 167 个提交,与目标分支冲突(merge state dirty),无法合并。
  2. 什么原因导致的:master 侧独立合入了 Compress success receipt echoes the requested end ref instead of the clamped one, so the model's next call starts above the highest ref and is refused #6855(compress 成功 receipt 回显 kernel 钳位后的有效区间)和 Version 0.214: compression issues still persist. The problem of old blocks failing to compress remains unresolved. | 0.214版本,压缩依旧存在问题,旧块无法压缩问题依旧存在 #6709(kernel BLOCKED 修复,版本 0.0.197→0.0.198);本 PR 的 Every compression only trims a little: the post-fold floor ratchets up and a 1M-window session ends at 212K without recovering | 每次压缩只降一点:压缩后的地板越压越高,1M 窗口会话涨到 212K 不回落 #6720 改了同一行 receipt 文案、也从同一 base 把版本 bump 到 0.0.198——同一行、同一版本号被两侧同时改动。
  3. 影响范围与严重程度:仅影响本 PR 的可合并性;无用户可见影响。
  4. 怎么修复的:merge master 进分支;唯一冲突(src/stream.ts 成功 receipt 行)按两侧意图取并集——Compress success receipt echoes the requested end ref instead of the clamped one, so the model's next call starts above the highest ref and is refused #6855 的 effectiveDetail 做标题 + Every compression only trims a little: the post-fold floor ratchets up and a 1M-window session ends at 212K without recovering | 每次压缩只降一点:压缩后的地板越压越高,1M 窗口会话涨到 212K 不回落 #6720 的 remainingNote 追加在 saved-tokens 之后;kernel 版本 bump 到 0.0.199(合并树同时含两个 PR 的 kernel 变更,对 master 的 diff 必须带版本变更,否则 kernel-guard 规则 2 红);两份 lockfile 按 lock-sync 配方重生成并验证幂等。
  5. 是否有回归问题:无。冲突解是两次独立已审变更的纯并集;最终 stream.ts 对 master 的 diff 与 PR 原意图逐字节一致(仅版本行不同);kernel 全套 1644 pass(含 Version 0.214: compression issues still persist. The problem of old blocks failing to compress remains unresolved. | 0.214版本,压缩依旧存在问题,旧块无法压缩问题依旧存在 #6709 的 issue5919 测试);host 定向测试(issue6720 receipt + issue6855 headline)7 pass;typecheck 干净。CI 全量裁决以推送 head 上的远端 test lane 为准。
  6. 是否破坏缓存:否。未触碰缓存/重试/增量游标;receipt 文案是临时 tool result,从不进入缓存前缀。
  7. 是否改了设计方向:否。
  8. 是否引入了新的配置:无。

收工判定:冲突已解并推送(2d84c7da03),GitHub 实时状态 mergeable=true / blocked(等 CI + 人工合并——kernel 变更 human-only merge tier)。CI 将在新 head 上重跑;若红项再现,同一机器人继续处理。

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

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

Reviewed end-to-end: mechanism, tests, both compression modes, §7.3/§7.4. The fix is sound and well-tested. Findings below are non-blocking; this is a kernel/ change so it needs owner authorization before merge (see the follow-up 🔶 comment).

Mechanism — verified correct.

  • applyCompression (kernel/src/compress.ts:957-966): on a T1 fold that harvests < STALL_HARVEST_RATIO (0.5, compress.ts:194) of the offered lastT1FirePending, arms nudge.partialFoldReinjectArmed = true and sets remainingPending = max(0, firePending − tokensCompressed). A distill (any new block > tier 1) or a compliant full fold clears the flag (compress.ts:957).
  • decideNudge (compress.ts:2487-2495): new one-shot re-inject branch fires when injectedTier === null && !pressure && partialFoldReinjectArmed && t1Eff >= 0.5 * tierThresholds[1] — deliberately NOT gated on the growth floor or usage, so the remainder is re-offered without a full 50K growth wait. One-shot: the flag is disarmed when the re-injected T1 nudge is displayed (nudge-stamp node, compress.ts:1619) or by a compliant full fold; an ignored re-offer keeps lastNudgeShownTokens set so the normal growth gate re-asserts — no loop on an unresponsive session.
  • remainingPending math is correct: tokensCompressed is the ORIGINAL token count of the folded content (compress.ts:1937-1949), so firePending − tokensCompressed is the true unfolded remainder (0 on a full fold).
  • Host: the receipt names the remainder (src/stream.ts:1734-1735); diagNudge logs the offered ranges (src/server.ts:2821-2823).

Tests — valid, would catch regressions. Kernel issue6720-partial-fold-reinject.test.ts (4: partial arms + re-injects, not usage-gated, one-shot no loop, full fold never arms) all pass; nudge.test.ts 3 updated (49 pass). Host issue6720-partial-fold-receipt.test.ts (4: receipt names remainder, full fold omits note, log lists ranges, log omits when none) all pass. Typecheck clean (host + kernel). CI green on the rebased head.

Findings (non-blocking):

  1. §7.3 marker missing for the model-facing receipt. The new receipt text at src/stream.ts:1734-1735 ("N tokens of the offered ranges remain unfolded — include them in your next compress call.") is model-facing prompt surface. The PR body's "Behavior change" section describes it, but the mandatory ⚠️ MODEL-FACING TEXT CHANGE marker at the top of the PR body + commit message, and the explicit consumption-chain inference, are absent. The number is the accurate unfolded remainder (not a phantom), so the consumption risk is low — but per §7.3 the marker + a sentence of consumption-chain inference should be added before merge.
  2. Stale version prose. The PR body says "0.0.197 -> 0.0.198" and the lock-sync commit says "kernel 0.0.198 bump", but the actual bump is 0.0.198 → 0.0.199 (master moved). The version IS correctly bumped (CI version-discipline passes); only the prose is stale.

Modes (§6): re-inject + receipt are proxy-mode observable effects; the kernel changes (flag + remainingPending field) are additive/mode-agnostic and don't break plugin mode (the agent owns compression there, nudge suppressed). The issue is proxy-mode. ✓

Scoping: implements issue Props 1 (re-inject + receipt) + 5 (log line); Props 2/3/4/6 (escalation, per-stream metering, wording, client-side) are correctly deferred as separate mechanisms — not open debt.

Verdict: code is sound, tested, and CI-green. The only gate is owner authorization for the kernel/ change (HARD RULE — I do not approve kernel PRs). See the follow-up 🔶 需要决策 comment.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🔶 需要决策

This PR touches kernel/ and carries a kernel-change: declaration, so it needs owner authorization before merge (HARD RULE — kernel changes sit at the human-only review tier, and I do not approve kernel PRs).

Gated diff (PR #6760):

  • kernel/src/compress.ts — new one-shot partialFoldReinjectArmed flag (armed on a partial T1 fold at compress.ts:957-966, disarmed on display at compress.ts:1619 or by a compliant full fold) + the re-inject branch in decideNudge (compress.ts:2487-2495) + remainingPending on the apply result.
  • kernel/src/types.ts — NudgeState.partialFoldReinjectArmed?: boolean (types.ts:184) + ApplyCompressionResult.remainingPending?: number (types.ts:846).
  • kernel/package.json + lock — version bump 0.0.198 → 0.0.199.

The host-side changes (src/stream.ts receipt, src/server.ts diagNudge log) are additive and mode-safe; the kernel changes are the gated surface.

The findings-only review above verifies the mechanism is correct and well-tested; the two non-blocking findings are a §7.3 marker gap and stale version prose. Requesting owner authorization to proceed with the human-only kernel review tier.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b) Review complete — findings-only review posted above + 🔶 需要决策 + needs-decision label. Mechanism verified correct + tested; CI green; two non-blocking findings (both in PR body/commit, not code). This is a kernel/ change — I do not approve kernel PRs (HARD RULE); awaiting owner authorization for the human-only kernel tier.

8问(结构化审核结论)

  1. 是什么问题:Every compression only trims a little: the post-fold floor ratchets up and a 1M-window session ends at 212K without recovering | 每次压缩只降一点:压缩后的地板越压越高,1M 窗口会话涨到 212K 不回落 #6720——proxy 模式下弱模型对 T1 折叠只做部分收割(<50%),剩余 pending 随尾部累积,节奏门(growthFloor 50K)让下一次 nudge 要等整整一个增长间隔,导致折叠后的 floor 单调上爬(114K→212K)。
  2. 什么原因导致的:节奏门没有针对"部分折叠"的跟进机制——部分折叠后剩余量要等满 50K 增长才重新 nudge,弱模型每轮只收割一部分,floor 因此逐轮抬升。
  3. 影响范围与严重程度:proxy 模式、长会话(1M 窗口)、弱模型、低 usage(≤24%)下触发;表现为压缩 cadence 退化(floor 单调上爬),非数据丢失/不可用——"能用但体验退化"(p2)。
  4. 怎么修复的:内核加一次性 partialFoldReinjectArmed 标志:部分 T1 折叠置位,下一次 processTurn 绕过 growth floor 直接重发 T1 nudge(不依赖 usage);nudge 显示或合规全量折叠时清除,保证一次性、不循环。host 侧 receipt 点名剩余量、diag 日志列出可折叠区间。
  5. 是否有回归问题:审过既有行为——全量折叠路径不变(remainingPending 为 undefined 时 receipt 无变化)、plugin 模式不受影响(agent 自持压缩、nudge 抑制)、reason 字段仅日志用(不喂模型)、tokensCompressed 是被折叠内容的原始 token 数(非节省量)故 remainingPending 计算正确。无回归。
  6. 是否破坏缓存:不涉及——改动在 nudge 决策与 receipt 文案,不触碰缓存/重试/增量游标/去重键。
  7. 是否改了设计方向:不涉及——在既有 nudge 决策框架内加一个一次性分支,未改架构/边界/数据流。
  8. 是否引入了新的配置:不涉及——无新 env/config/默认值。

判定:代码正确、测试有效、CI 绿;唯一门槛是 kernel 变更需 owner 授权(HARD RULE——不批准 kernel PR)。等 owner 走人工 kernel 审核档。

…eceipt conflict (2nd pass)

Master advanced 178 commits since the 2026-11-16 merge (2d84c7d).
Single conflict again: src/stream.ts success-receipt line.

- this branch (#6720): remainingNote appended inside the brackets
- master (497efc7, 2026-11-18 owner change): 'folded at <timestamp>'
  stamp appended after the closing bracket (receipt temporal footing)

Resolution keeps BOTH: remainingNote inside the brackets, folded-at
stamp after them. formatTagTime already imported from acp-kernel.

Kernel version: master independently bumped 0.0.198 -> 0.0.199
(497efc7) from the same base this branch bumped for #6720 —
auto-merge landed on 0.0.199. The merged tree carries kernel changes
from BOTH sides, so the branch's diff vs master shows kernel/src edits
(compress.ts, types.ts) with no version change — kernel-guard rule 2
would fail. Bumped to 0.0.200; both lockfiles regenerated with the
exact lock-sync recipe (npm install --package-lock-only
--ignore-scripts), verified idempotent.

Verified: host typecheck clean; kernel suite 1644 pass; host targeted
tests issue6720-partial-fold-receipt + issue6855-compress-headline 7
pass; master-side receipt regressions (compress-fingerprint-refold,
issue5173-last-user-anchor, issue4313-fingerprint, text-safe) 49 pass.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Conflict resolved and pushed — 62d9eea873 (merge of origin/master tip a446a3c1c8, 178 commits beyond the 2026-11-16 merge, into the PR branch). This is the branch's final-head push (no [ework:ci-held] marker — work verified locally before pushing, per the CI-hold discipline).

What I did this run

  1. Merged master into the branch (merge, not rebase — keeps the reviewed commits intact, no force-push). Exactly ONE conflict again: src/stream.ts success-receipt line:
  2. Kernel version bump 0.0.199 → 0.0.200 (same mechanical judgment call as the 11-16 pass). Master independently bumped 0.0.198 → 0.0.199 for 497efc7e31 from the same base this branch bumped for Every compression only trims a little: the post-fold floor ratchets up and a 1M-window session ends at 212K without recovering | 每次压缩只降一点:压缩后的地板越压越高,1M 窗口会话涨到 212K 不回落 #6720, so the auto-merge landed on 0.0.199. The merged tree carries kernel changes from BOTH sides, so the branch's diff vs master shows kernel/src edits (compress.ts, types.ts) with no version change — kernel-guard rule 2 would fail. Bumped to 0.0.200; both lockfiles regenerated with the exact lock-sync recipe (npm install --package-lock-only --ignore-scripts, root + kernel/), verified idempotent.
  3. Verified (targeted local runs; full-suite verdict = CI on the pushed head): host typecheck clean; kernel unit suite 1644 pass; host targeted tests issue6720-partial-fold-receipt + issue6855-compress-headline 7 pass; master-side receipt regressions (compress-fingerprint-refold, issue5173-last-user-anchor, issue4313-fingerprint, text-safe) 49 pass.
  4. Pushed 2d84c7da03..62d9eea873 (plain push; remote head was unchanged before the push — no concurrent work on the branch).

Live state (verified this run, not from memory): master tip is an ancestor of the branch head (deterministic local check), and a single read-only GitHub GET reports mergeable: true, mergeable_state: blocked on head 62d9eea8 — the conflict is gone; "blocked" is the expected hold for a kernel PR (CI on the new head + human-only merge tier). Note: the mirror checks cache was stale for this PR (fetched_at 2026-11-16T07:27Z, old sha), so I used that one allowed single GET instead of guessing from the cache.

Behavior change flag (old → new): kernel version 0.0.199 → 0.0.200 on the branch head — mechanical consequence of the merge (both sides' kernel changes now need one version), required by kernel-guard rule 2; no code behavior change beyond the two already-reviewed PRs. The receipt line now combines #6720's remainder note (inside the brackets) with the 2026-11-18 owner's folded at stamp (after the brackets) — each pinned by its own tests, both previously reviewed in isolation.

结构化八问

  1. 是什么问题:PR 分支再次落后 master(178 个提交,11-16 那次合并之后 master 又前进了),与目标分支冲突(merge state dirty),无法合并。
  2. 什么原因导致的:master 侧 2026-11-18 合入了 owner 的 receipt 时间戳改动(497efc7e31:成功回执追加 folded at <时间戳>,kernel 版本 0.0.198→0.0.199),与本 PR 的 Every compression only trims a little: the post-fold floor ratchets up and a 1M-window session ends at 212K without recovering | 每次压缩只降一点:压缩后的地板越压越高,1M 窗口会话涨到 212K 不回落 #6720 又改了同一行 receipt 文案、且两侧从同一 base 各自 bump 了版本号——同一行、同一版本号被两侧同时改动(与 11-16 那次同型)。
  3. 影响范围与严重程度:仅影响本 PR 的可合并性;无用户可见影响。
  4. 怎么修复的:merge master 进分支;唯一冲突(src/stream.ts 成功 receipt 行)按两侧意图取并集——Every compression only trims a little: the post-fold floor ratchets up and a 1M-window session ends at 212K without recovering | 每次压缩只降一点:压缩后的地板越压越高,1M 窗口会话涨到 212K 不回落 #6720 的 remainingNote 留在方括号内、owner 的 folded-at 时间戳追加在方括号后;kernel 版本 bump 到 0.0.200(合并树同时含两侧 kernel 变更,对 master 的 diff 必须带版本变更,否则 kernel-guard 规则 2 红);两份 lockfile 按 lock-sync 配方重生成并验证幂等。
  5. 是否有回归问题:无。冲突解是两侧独立已审变更的纯并集;最终 stream.ts 对 master 的 diff 与 PR 原意图逐字节一致(仅版本行不同);kernel 全套 1644 pass;host 定向测试(issue6720 receipt + issue6855 headline)7 pass + master 侧 receipt 回归(compress-fingerprint-refold / issue5173 / issue4313 / text-safe)49 pass;typecheck 干净。CI 全量裁决以推送 head 上的远端 test lane 为准。
  6. 是否破坏缓存:否。未触碰缓存/重试/增量游标;receipt 文案(含新时间戳)是临时 tail 消息,从不进入缓存前缀区域(owner 改动注释已明确这一点)。
  7. 是否改了设计方向:否。
  8. 是否引入了新的配置:无。

收工判定:冲突已解并推送(62d9eea873),GitHub 实时状态 mergeable=true / blocked(等 CI + 人工合并——kernel 变更 human-only merge tier)。CI 将在新 head 上跑这一轮全量;若红项再现,同一机器人继续处理。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

CI-engineer run complete — conflict resolved, pushed. Full 八问 summary is in the comment above (floor 16); short confirmation here:

  • Merged origin/master tip a446a3c1c8 (178 commits ahead) into 2026-11-14_partial-fold-reinject; the single conflict (src/stream.ts success-receipt line) resolved as the union of both intents — Every compression only trims a little: the post-fold floor ratchets up and a 1M-window session ends at 212K without recovering | 每次压缩只降一点:压缩后的地板越压越高,1M 窗口会话涨到 212K 不回落 #6720's remainingNote inside the brackets + the 2026-11-18 owner's folded at timestamp stamp after them.
  • Kernel version 0.0.199 → 0.0.200 (merged tree carries both sides' kernel changes; kernel-guard rule 2 requires the version diff vs master); both lockfiles regenerated with the lock-sync recipe, idempotency verified.
  • Verified locally: typecheck clean; kernel suite 1644 pass; host targeted tests 7 pass (issue6720-partial-fold-receipt, issue6855-compress-headline); master-side receipt regressions 49 pass.
  • Pushed final head 62d9eea873 (no [ework:ci-held] marker — final push after local verification).
  • Live state (verified this run): mergeable: true, mergeable_state: blocked on head 62d9eea8 — conflict gone; blocked = expected hold (CI on the new head + human-only merge tier for kernel changes).

Nothing further pending from this lane; if CI turns red on the new head, the same bot will pick it up.

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

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

Re-review of the new head (62d9eea). The PR contribution is byte-identical to the previous head (2d84c7d) — the only change is the merge of the newer master (a446a3c), which pulled in PR #7105 (compress-receipt rework) and moved the kernel version to 0.0.199.

Conflict resolution verified. The compress-receipt conflict (src/stream.ts:1746-1750) is resolved correctly: the #6760 remainingNote (from r.remainingPending) is appended to the receipt alongside the #7105 changes (effectiveDetail, the "folded at" timestamp) — they coexist without clobbering each other. The mechanism, tests, and mode analysis from the previous review all still hold.

Kernel version now 0.0.199 → 0.0.200 (master moved). CI green (0 failed on the new head).

Findings (unchanged from the previous review, still open — both in the PR body, not the code):

  1. §7.3 marker missing for the model-facing receipt text (src/stream.ts:1748-1749). The PR body's "Behavior change" section describes it, but the mandatory ⚠️ MODEL-FACING TEXT CHANGE marker at the top + the explicit consumption-chain inference are absent.
  2. Stale version prose. The PR body says "0.0.197 -> 0.0.198" but the actual bump is now 0.0.199 → 0.0.200.

Verdict: code is sound, tested, and CI-green (unchanged from the previous review). The only gate is owner authorization for the kernel/ change (HARD RULE — I do not approve kernel PRs). See the 🔶 需要决策 comment.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Re-review done (head moved 2d84c7d → 62d9eea).

The author merged a newer master (a446a3c, incl. PR #7105 compress-receipt rework); the PR's own contribution is byte-identical to the prior head (same 10 files, +478/-14) — no new code. Re-verified on the new head:

Re-review posted (COMMENT, findings-only — kernel PRs can't be approved). 🔶 需要决策 + needs-decision label already in place. Two findings still open (both PR-body-only, not spot-fixable): (1) §7.3 ⚠️ MODEL-FACING TEXT CHANGE marker missing for the receipt text; (2) stale version prose (body says 0.0.197→0.0.198, actual 0.0.199→0.0.200).

8问(结构化审核结论)

  1. 是什么问题:Every compression only trims a little: the post-fold floor ratchets up and a 1M-window session ends at 212K without recovering | 每次压缩只降一点:压缩后的地板越压越高,1M 窗口会话涨到 212K 不回落 #6720——proxy 弱模型对 T1 折叠只做部分收割(<50%),剩余 pending 随尾部累积,节奏门(growthFloor 50K)让下一次 nudge 等满一个增长间隔,floor 单调上爬(114K→212K)。
  2. 什么原因:节奏门没有部分折叠的跟进路径——剩余量要等满 50K 增长才重新 nudge,弱模型每轮只收割一部分,floor 逐轮抬升。
  3. 影响范围与严重程度:proxy 模式、长会话(1M 窗口)、弱模型、低 usage(≤24%)触发;压缩 cadence 退化(非数据丢失/不可用)——p2。
  4. 怎么修复:内核一次性 partialFoldReinjectArmed 标志:部分 T1 折叠置位,下一次 processTurn 绕过 growth floor 重发 T1 nudge(不依赖 usage);nudge 显示或合规全量折叠时清除,一次性不循环。host receipt 点名剩余量、diag 日志列区间。
  5. 是否有回归:全量折叠路径不变、plugin 模式不受影响、reason 仅日志用、tokensCompressed 是被折叠内容原始 token 数(非节省量)故 remainingPending 正确;receipt 冲突与 [PR] Remove head/tail tags from the compression success receipt (keep excerpts) + add collapse timestamps + annotate kernel a | 压缩成功回执去掉 head/tail 标签(保留摘录)+ 打折叠时间戳 + kernel 锚点引文标注来源(模型可见文本,4 处) #7105 正确共存。无回归。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及——既有 nudge 框架内加一次性分支。
  8. 是否引入新配置:不涉及。

判定:代码正确、测试有效、CI 绿;唯一门槛是 kernel 变更需 owner 授权(HARD RULE——不批准 kernel PR)。等 owner 走人工 kernel 审核档。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

1 similar comment
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

…sion conflict

master advanced kernel 0.0.199 -> 0.0.201 (batch-seam double-claim fix + #7252 collision bump) while the PR carried its own 0.0.200. The merged tree has the PR's partial-fold re-inject kernel change ON TOP of master's 0.0.201, so the version resolves to 0.0.202 in kernel/package.json, kernel/package-lock.json, and the root package-lock.json. Source files (compress.ts, stream.ts, server.ts, types.ts) auto-merged cleanly; targeted kernel tests (issue6720 + nudge, 49) pass on the merged tree.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Merge conflict resolved and pushed — PR #6760 is no longer dirty; GitHub now reports mergeable: true.

What I did this run:

  1. Confirmed the blocker. PR head 2026-11-14_partial-fold-reinject (62d9eea) was dirty against master (ba2e8198). All 30 prior checks were already green (0 failed) — the merge conflict was the only blocker.
  2. Merged origin/master into the PR head. The only conflicts were kernel version bumps in 3 lockfiles; every source file (kernel/src/compress.ts, kernel/src/types.ts, src/server.ts, src/stream.ts) auto-merged cleanly.
  3. Resolved the version collision. master had advanced the kernel 0.0.199 → 0.0.201 (batch-seam double-claim fix + the [PR] compress.reasoning.tail: drop reasoning of any closed round in the protected window (#7144 follow-up) #7252 collision bump) while the PR carried its own 0.0.200. The merged tree has the PR's partial-fold re-inject kernel change sitting on top of master's 0.0.201, so I resolved all three files (kernel/package.json, kernel/package-lock.json, root package-lock.json) to 0.0.202.
  4. Verified locally. No leftover conflict markers; the PR's targeted kernel tests (issue6720-partial-fold-reinject + nudge, 49 tests) pass on the merged tree.
  5. Pushed the merge (clean fast-forward 62d9eea → 80ca785, no force-push). New head 80ca785.

Notes:

  • No kernel-change: body edit — the PR body already carries the declaration, so the kernel-guard is satisfied. I did not touch the body.
  • No design decision needed — pure mechanical version-bump resolution.
  • Status freshness: the new sha's CI is still running; the mirror cache still shows the prior green sha (62d9eea) and will refresh as the poller picks up 80ca785. I am not asserting the new sha is green — only that the conflict is cleared and the prior sha was green.

八问

  1. 是什么问题:PR [PR] kernel: re-inject T1 after a partial fold to kill the compression ratchet (#6720) #6760 与 master 基线冲突(merge state: dirty),无法合并。
  2. 什么原因导致的:master 在此期间把 kernel 版本从 0.0.199 推进到 0.0.201(batch-seam double-claim 修复 + [PR] compress.reasoning.tail: drop reasoning of any closed round in the protected window (#7144 follow-up) #7252 撞版本号),而 PR 分支自己带着 0.0.200,两边 kernel 版本号在三个 lockfile 里撞车。
  3. 影响范围与严重程度:仅影响该 PR 的可合并性,不影响任何已发布行为;冲突未解决前 PR 无法合并(阻塞)。
  4. 怎么修复的:把 origin/master 合并进 PR 分支,源码文件自动合并干净;三个 lockfile 的 kernel 版本统一解析为 0.0.202(master 的 0.0.201 之上叠加 PR 的 partial-fold re-inject kernel 改动)。
  5. 是否有回归问题:无。源码未手改逻辑(自动合并);PR 定向 kernel 测试(issue6720 + nudge,49 项)在合并树上全绿。
  6. 是否破坏缓存:不涉及——纯版本/lockfile 冲突解析,未触碰缓存、重试、游标、去重键。
  7. 是否改了设计方向:不涉及——纯机械冲突解析,无架构/边界/数据流变化。
  8. 是否引入了新的配置:不涉及——无新 env/config/默认值。

判定:冲突已解决并推送,PR 现可合并(mergeable: true),等待新 sha(80ca785)的 CI 全绿 + 审批。

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

(ai: vllm-qwen/qwen3.8-27b) Re-review (head moved 62d9eea → 80ca785).

What changed: the only new commit is a master merge (80ca785ce merges ba2e8198203), which pulled in a large batch of unrelated master work (batch-seam double-claim fix, dsh-mneme scan, storage-integrity, web fixes, etc.). The PR's own contribution is byte-identical to the prior head — I diffed the PR's contribution on top of master (ba2e8198203..80ca785ce): the partial-fold re-inject kernel change (compress.ts arm/clear/re-inject + remainingPending), the host receipt (stream.ts), and the diagNudge ranges (server.ts) are all unchanged. The merge resolved the kernel version conflict correctly: master had advanced to 0.0.201, so the PR's change now lands on top as 0.0.202 (kernel/package.json + kernel/package-lock.json both 0.0.202, consistent). CI green: 30/30, 0 failed.

Re-verified on the new head:

  • Kernel mechanism intact: partialFoldReinjectArmed arms on a partial T1 fold (compress.ts:974), clears on a compliant full fold (compress.ts:967) and on a displayed T1 nudge (compress.ts:1609); the decideNudge re-inject branch (compress.ts:2491) fires when injectedTier===null && !pressure && partialFoldReinjectArmed===true && t1Eff >= 0.5*tierThresholds[1] — not usage-gated, one-shot, no loop. remainingPending = Math.max(0, firePending - tokensCompressed) (compress.ts:976) is the correct unfolded remainder (0 on a full fold).
  • Host receipt (stream.ts:1790-1794) + diagNudge ranges (server.ts:2838, 2852-2854) intact.
  • Master's batch-seam double-claim fix to compress.ts is in a separate region and does not touch the partial-fold logic.
  • Targeted kernel tests (issue6720 + nudge) present and passing on the merged tree (per the merge commit; CI green confirms).

Findings (both non-blocking, PR-body-only, NOT spot-fixable — the only permitted PR-body edit is the kernel-change: line, which is already present):

  1. §7.3 ⚠️ MODEL-FACING TEXT CHANGE marker still missing at the top of the PR body + commit message for the receipt text ("N tokens of the offered ranges remain unfold…"). The body has a "Behavior change" section but no marker and no explicit consumption-chain inference (what the model does with the number, where it anchors, adversarial pass). This is a model-facing string the model reads and may copy into its next compress call.
  2. Stale version prose: body says "Kernel version bumped 0.0.197 -> 0.0.198"; the actual bump on the current master is 0.0.201 → 0.0.202.

Verdict: findings-only (COMMENT) — this PR touches kernel/ and carries a kernel-change: declaration, so per the authorization boundary it cannot be approved by the review lane; the merge waits on the human-only kernel review tier. The 🔶 需要决策 comment + needs-decision label are already in place. Code is correct, tests valid, CI green; the only gate is owner authorization for the kernel change.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Re-review #3 done (head moved 62d9eea → 80ca785).

The only new commit is a master merge (80ca785ce merges ba2e8198203) pulling in a large batch of unrelated master work. The PR's own contribution is byte-identical to the prior head — I diffed the PR's contribution on top of master: the partial-fold re-inject kernel change (compress.ts arm/clear/re-inject + remainingPending), the host receipt (stream.ts), and the diagNudge ranges (server.ts) are all unchanged. The merge resolved the kernel version conflict correctly: master had advanced to 0.0.201, so the PR's change now lands as 0.0.202 (kernel/package.json + kernel/package-lock.json consistent). CI green: 30/30, 0 failed.

Re-review posted (COMMENT, findings-only — kernel PRs can't be approved). 🔶 需要决策 + needs-decision label already in place. Two findings still open (both PR-body-only, not spot-fixable): (1) §7.3 ⚠️ MODEL-FACING TEXT CHANGE marker missing for the receipt text; (2) stale version prose (body says 0.0.197→0.0.198, actual 0.0.201→0.0.202).

8问(结构化审核结论)

  1. 是什么问题:Every compression only trims a little: the post-fold floor ratchets up and a 1M-window session ends at 212K without recovering | 每次压缩只降一点:压缩后的地板越压越高,1M 窗口会话涨到 212K 不回落 #6720——proxy 弱模型对 T1 折叠只做部分收割(<50%),剩余 pending 随尾部累积,节奏门(growthFloor 50K)让下一次 nudge 等满一个增长间隔,floor 单调上爬(114K→212K)。
  2. 什么原因:节奏门没有部分折叠的跟进路径——剩余量要等满 50K 增长才重新 nudge,弱模型每轮只收割一部分,floor 逐轮抬升。
  3. 影响范围与严重程度:proxy 模式、长会话(1M 窗口)、弱模型、低 usage(≤24%)触发;压缩 cadence 退化(非数据丢失/不可用)——p2。
  4. 怎么修复:内核一次性 partialFoldReinjectArmed 标志:部分 T1 折叠置位,下一次 processTurn 绕过 growth floor 重发 T1 nudge(不依赖 usage);nudge 显示或合规全量折叠时清除,一次性不循环。host receipt 点名剩余量、diag 日志列区间。
  5. 是否有回归:全量折叠路径不变、plugin 模式不受影响、reason 仅日志用、tokensCompressed 是被折叠内容原始 token 数(非节省量)故 remainingPending 正确;master 的 batch-seam 修复在 compress.ts 另一区域,不触碰部分折叠逻辑。无回归。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及——既有 nudge 框架内加一次性分支。
  8. 是否引入新配置:不涉及。

判定:代码正确、测试有效、CI 绿;唯一门槛是 kernel 变更需 owner 授权(HARD RULE——不批准 kernel PR)。等 owner 走人工 kernel 审核档。

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

Projects

None yet

1 participant