Repository navigation
[PR] fix(#5780): screen UNCOVERED HISTORY runs through the apply-side foldability judgment - #5785
ranxianglei wants to merge 5 commits into
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.9542-pr.5785.61ee164This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr5785.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。 Open [PR] 列表里唯一相关项是 #5311(静态 这是 [PR] 唤醒,不重做工作,进入验证:拉取 |
(ai: vllm-qwen/qwen3.8-27b) 审查完成。结论:可合并(待 CI 剩余 lane 跑绿;已完成 lane 全绿、无红)。方向、实现、测试均成立;顺手修了一处注释(见末节,独立 commit b1ae885 已推到 PR 分支)。 结构化八问:
测试有效性:7 个新 case 走真实生产 apply 路径(parseCompressInput + applyRanges)钉 advertise↔execute 一致性——被标记 span 逐字提交收到与标记预测相同的拒绝(P1/P2)、turn 对齐空洞保持无标记且干净折叠(N1)、sub-gate 段保持无标记(P4)、#2886 closure zone 得 zone 标记且提交为 soft no-op(P2b);正负向成对,断言有牙。本地定向运行:17/17 绿(新文件 7 + issue4331 回归对 10)。master 自 merge-base 以来未触碰 src/uncovered.ts、src/stream.ts、src/acp-status.ts——56 commits behind 与本改动域无语义冲突。 残余几何角(非阻塞): 与 #5311 协调核对:已取 #5311 head 验证——其静态 CI:head b0cd01e 上已完成 lane 全部 success(ubuntu 22×3、ubuntu 24×1、windows 22×2、static-gates windows 22),其余 in_progress,无红。注释修正 commit b1ae885 为纯注释变更,已推分支,新 CI run 会覆盖新 head。 顺手修(review fix,独立标注 commit b1ae885):修正 src/uncovered.ts 判定:可合并,待剩余 CI lane 绿即可由 owner 合并(agent 不代合)。 |
…eview)
The original header attributed the estimate's conservatism to entry-space
skipping ('UNDER-counts ... can only make us report more'). That mechanism
actually pushes the other way when covered/zero-token messages sit inside
the recent window: last-N entries span more than N messages, so the claim
reaches further back than the naive message-space zone and errs toward
silence in that band (bounded by the covered count in the window; degrades
to pre-#5780 behavior). State both biases explicitly: (1) #2886-family zone
extensions protect more than the count+anchor estimate, so it sits behind
the true zone start (doomed mass ahead of the zone is reported + screen-
labeled instead of vanishing); (2) the skip-in-window corner above errs
toward silence. Neither direction ever claims a span folds that apply
rejects. Comment-only; no code change.
…nt from the second repro P2c: with the latest user message left uncovered, the kernel's user-anchor rule (Rule 3, coupled to preserveRecentMessages>0) protects only that message; the audit's relaxed diff pass zeroes the knob and is blind to the anchor (and token) components. Pins both sides: foldable mass past the anchor stays plain and folds cleanly, while the anchor-claimed user msg and the zoned tail are never advertised as if older than the window; a fully-zoned current turn stays silent. P3: one session surfaces both verdict classes at once (a clean mid-history hole plus a doomed head glued to the zoned tail); sweeps EVERY reported run on isolated state copies asserting no unmarked+doomed combination exists.
…d window' when they sit inside its components The acp_status UNCOVERED HISTORY header asserted every listed run was older than the protected recent window, which contradicts the apply verdict for runs claimed by the zone's other components (token rule, user-anchor rule, #2886 closure) — the exact contradiction of the second repro ('the advertised text and the verdict are opposite conclusions'). Wording now states what is true: outside the offered ranges, either older than the window or inside one of its components. Module header documents the empirical diff's structural blind spot for those components.
aaacc5b to
4a55be3
Compare
…o-op An isolated protected-tool run (e.g. a mid-history compress exchange far from the recent window) hits the kernel's filter no-op — "all of its content is protected or filtered" — not the zone no-op. The screen keyed both soft no-ops to ZONE_NOTE, mislabeling the cause for the filter class. Split them: FILTERED_NOTE for the content-filter no-op, ZONE_NOTE for the zone no-op. P5 pins an isolated protected-tool run getting the filtered marker and its verbatim filter no-op receipt.
ranxianglei
left a comment
There was a problem hiding this comment.
(ai: vllm-qwen/qwen3.8-27b)
Review: APPROVE (posted as comment — GitHub blocks approving my own PR). Correct fix, strong tests, zero kernel diff.
APPROVE — correct fix, strong tests, zero kernel diff.
What it does: screens each UNCOVERED HISTORY run through the apply-side foldability judgment (core.applyCompression on a structuredClone(state)), so the audit only advertises runs that will actually fold. Structural refusal (split fatal / zone no-op / filter no-op) → a marker; transient refusal (sub-gate, already-covered) → unmarked; screen failure → unmarked (advisory degrades, never blocks).
Verified:
- Host-side only, public API — no kernel change.
- Every kernel error/warning wording the regexes match is confirmed verbatim in
kernel/src(unit-projection.ts:476/371/1071, compress.ts:1809/1893). protectedClaimStartbias directions all safe (report-more or silence — never a false "folds" claim).- Test file: 10 tests, positive+negative pairs, real apply path, pins advertise↔execute agreement.
Small finding fixed on the spot: the screen keyed both soft no-ops to ZONE_NOTE, so an isolated protected-tool run (a mid-history compress exchange far from the recent window) was mislabeled "entirely inside the protected zone" when the true cause is the content filter. Split into FILTERED_NOTE / ZONE_NOTE + a P5 test pinning the isolated protected-tool run. 已顺手修 + commit b94e68d.
Targeted tests: tests/issue5780-uncovered-foldability.test.ts 10/10, tests/issue4331-uncovered-history.test.ts 10/10. Full-suite verdict = CI on the new head.
[bot] (ai: vllm-qwen/qwen3.8-27b) PR #5785 review complete — APPROVE (posted as a comment review; GitHub blocks approving my own PR). Review: #5785 (review) What the PR does. The UNCOVERED HISTORY audit (the "these runs are foldable" advisory in the status/receipt) previously judged foldability by a cheap heuristic — span tokens ≥ 200 + not fully zone-claimed — which diverged from the kernel's real apply judgment. A run could pass the heuristic but be refused by the apply path (split a turn at the protected boundary, sit entirely inside the zone, or be entirely protected/filtered content), so a model following the hint hit a refusal/no-op and wasted a turn. The fix screens each run's EXACT span through Verified. Host-side only, zero kernel diff. Every kernel error/warning wording the regexes match is confirmed verbatim in 已顺手修:the screen keyed both soft no-ops to 八问
判定:可合并 —— 仅 host 侧、无 kernel 改动、定向测试绿。注:PR 落后 master 15 个 commit(243709bef2→99c22d283f,均为 notices/BILI_PLUGIN_BYPASS/docs),但无一触碰本 PR 文件(无语义冲突),trivial rebase 后即干净可合(或作 merge commit)。小发现(filter vs zone 标记)已当场修(commit b94e68d)。 |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) PR #5785 review complete — APPROVE / 可合并. (Full 8问 + verification detail on floor 11.)
判定:可合并 —— 仅 host 侧、无 kernel 改动、定向测试绿;小发现已当场修(commit b94e68d)。agent 不代合,待 owner 合并。 |
Closes #5780. Related: the split-guard item on #5185 (owner-tracked); coordinates with PR #5311 (see below).
What this is
UNCOVERED HISTORY (the #4331 audit surface) advertised runs that
compressstructurally cannot fold — in the incident log, m02080–m02088 was rejected with "Range would split 1 turn(s) at the protected-zone boundary", and the atomic batch rollback dragged the adjacent legitimate range down with it. The audit never ran the shared apply-side foldability judgment (#3236 doctrine: advertise and execute must share one projection) — that doctrine was wired into the Compressible-ranges offer and the acp_status uncompressed view, but not into the later-added uncovered-history audit.Fix (host-side only, zero kernel diff)
src/uncovered.ts:core.applyCompressionon astructuredCloneof the live state — byte-for-byte the path a real submission takes (public core API; no kernel re-export needed, so kernel authorization request: export the projectUnit screening entry so UNCOVERED HISTORY runs can carry verdict-backed foldability tags #5784 is not required for this fix). Structurally doomed runs carry a compact trailing marker:⚠ not foldable: would split a turn at the protected boundary(projectUnit split/integrity fatals),⚠ not foldable: entirely inside the protected zone(zone fatal, or its [PR] Compression always failing and requiring many retries? Changed collapsed/protected region intervals to successful no-op | 压缩总是失败要重试很多次?已折叠/保护区区间改为成功 no-op 收据,并刷新 armed-but-silent 窗口的 ref 指针 (#4521) #5253 soft no-op form "folded nothing … do not resend this range").Transient refusals (below the fold-size gate, already covered, unknown refs) stay unmarked — they self-teach via their own text, and the run folds once it ages out or is combined with adjacent mass.
The marker rides both render sites automatically (
acp_statussection + success-receipt verdict line) — no consumer edits.Behavior changes (intended, disclosed)
, ⚠ not foldable: …inside the parens for structurally-doomed runs only (old: bare span; new: span + marker). Plain-line grammar unchanged.Coordination with PR #5311
#5311 (part of #5186) adds a blanket STATIC
[not foldable]prefix to all uncovered runs plus a historical-refs note on success receipts. Different mechanism (static mask vs shared judgment): this PR's marker is per-run evidence from the actual apply path and names the cause; #5311's prefix flags without explaining why. Both touch the same parenthesized render hunk — whichever merges second carries a small rebase (this note appends inside the parens after any leading prefix, so they compose). I did not stack on #5311's branch because it fixes a different thread (#5780 vs #5186) — one issue = one scope.On ④ (pre-loop coverage snapshot)
Triage conclusion matches the tracking side's empirical probe: the stale
preExistingCoveragesnapshot inapplyRangescannot produce spurious split fatals in forward-order batches (INV1 needs a call earlier than its own group's reasoning — impossible; INV2 never references coverage; overlap-skip prevents sibling-span overlap). Residual impact is limited to reversed-order submissions and self-heals next round. No change here.Tests
New
tests/issue5780-uncovered-foldability.test.ts(7 tests, hermetic, real kernel apply path):⚠ …split…marker; consistency pin: verbatim submission fails identically with "would split" (advertise↔execute agreement).All 10 existing
tests/issue4331-uncovered-history.test.tstests pass unchanged. Local: targeted suites green, typecheck clean, build clean; full-suite verdict comes from CI. Perf sanity: ~27 ms audit on a 1800-message session with 3 reported runs (advisory surface, not the per-request hot path).