Repository navigation
[PR] fix(pi): charge policy-gate refusals to the compress failure ledger - #6753
Conversation
Policy-gate REFUSED receipts (compress.requireNudge / compress.requireRecommendation) returned before any ledger call, so a model re-submitting a range bili will never fold got byte-identical receipts forever and the circuit breaker never armed. Charge both gate branches like every other reject path (recordCompressFailure + noteCompressLoopFailure), collapse repeat gate refusals to a one-liner from the 2nd identical call, and use terminal wording when no compressible ranges remain at all instead of pointing at acp_status. Fixes ranxianglei#6728
…cy-gate branches Review nit from ranxianglei#6753: in both gate branches the repeatGuard value was always empty at its only use site — the repeat-collapse (occurrences >= 2, trackLoop is true whenever the gate is defined) returns before the full receipt could render it, and the gate branches are unreachable from the untracked lane where the parse path's guard does render. Keep the ledger charge (the point of the fix); drop the dead variable and the never-rendered custom advice string. Behavior byte-identical; 8/8 issue6728 suite + 48 neighbor tests green, typecheck clean.
(ai: vllm-qwen/qwen3.8-27b) Review of #6753 (fixes #6728) — verified independently, one small cleanup pushed to the branch, verdict: mergeable. 查重 (dedup): 不重复 — #6753 is the only open PR targeting #6728. Related open issue #6520 (requireNudge 1-round vs 20-round credit semantics) is the same gate family but a different mechanism — not the ledger-charging defect fixed here. No parallel mirror [PR] row for this thread. What I verified (evidence, not trust):
Behavior changes (old → new, all intended):
Small fix pushed to the PR branch (independently labeled commit 八问:
Verdict: mergeable — single-module scoped fix, regression test reproduces the bug (red→green verified locally), clean diff, references #6728, no kernel/config change; the only wire-visible delta is the model-facing receipt text disclosed above. CI is the final gate (0 failures so far; guard lanes still running on the new head after the cleanup commit). |
|
Closes pair #6728 was auto-closed by the batch merge. Superseded by #6765 (merged to master as a2cf2f0). Your commit 412bb63 is in master verbatim — same content, same authorship, only the object ID changed (the batch used a real Thanks for the fix — it is live in master from a2cf2f0 onward. |
What broke
The two
compress.requireNudge/compress.requireRecommendationpolicy gates inapplyRangesreturned their REFUSED receipt before any ledger call, unlike every other reject path. A model re-submitting a range bili will never fold got byte-identical receipts forever and the circuit breaker never armed — 9 consecutive verbatim refusals in 125 s in the reported pi session, ~176K uncached input burned, ended only by the human typing "stop calling compress".What changed
recordCompressFailure+noteCompressLoopFailure), so the breaker arms by the 3rd consecutive refusal and the receipt escalates to the stop wording.acp_status, which is a dead end in that state.loopTracking:falseand never reaches the gates, so bili’s own overflow backstop is unaffected.How verified
tests/issue6728-policy-gate-ledger.test.ts: 8/8 green (red before the fix, green after), covering breaker arming on both gates, disarm on success, repeat-collapse, terminal wording + its negative direction, and the preflight exemption.issue5683gate suite (22), ledger/loop/breaker suites and other compress suites (70 + 46 + 19 tests).Fixes #6728