Repository navigation
[PR] fix: judge recognizes plugin-lane compress pairs as summary carriers (#4401) - #4410
ranxianglei wants to merge 8 commits into
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.9712-pr.4410.665f12fThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr4410.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。 本 PR 是 #4401「invariant judge 不认识 plugin-lane carrier 制度」机制的唯一在途修复;检索 open+closed issue/PR 无同机制并行修复(相关的 #3991/#3992 为不同机制——stale cache 渗漏 vs judge 误报,不并入)。 标签: bug, dsh, scope/kernel, p2(advisory 层误报风暴,无真实字节丢失;与原 issue #4401 定级一致) 审核进行中,先报初步发现:
|
1cd1134 to
9d442eb
Compare
…dialect compress pairs (#4401) Review follow-up on #4410 (two sub-defects of the same carrier-recognition mechanism): 1. The exemption-overflow cap (maxExempt, default 128) counted every riding compress pair as 2 carrier messages. A steady-state plugin session with N active blocks carries 2N such messages, so the cap tripped at N=65 even though every pair is legitimate host state — the very sessions this PR exists to silence (86 active blocks in the reporter's logs) would have converted the mid-history-drop storm into an exemption-overflow storm. Pair volume is now bounded by 2 x |coveredIds| (one pair per active block, each covering >=1 message); excess over that ceiling still counts toward the cap, and without host state the full pair volume counts (safe direction: over-warn, never under-warn). The overflow detail string gains an additive pairExcess= field. 2. isCompressToolMsg matched only the bare "compress" tool name; the MCP dialect form "mcp__bili__compress" (#2970/#3222, zcode lane) was not recognized by the regime logic. It now uses the same dual-name predicate as the I3 pairing pass and hideConsumedCompressCalls. Tests: +4 unit tests (86-pair steady state green at carrier=172; fake-carrier excess still trips overflow with host state present; dialect pair marks the regime; refused dialect receipt does not).
|
(ai: vllm-qwen/qwen3.8-27b) Premise flag from #5866 triage (plugin-lane array-form folds end with zero full summaries on the wire): The normalization premise "No bytes were ever lost: the full summary text rides in the re-sent call arguments" does NOT hold for native-array-form plugin folds. Two consequences for this PR:
Related: #5866 |
…invariant judge summary carrier (KDD#7/#1567): while the pair rides, stripKernelSummaries removes the kernel anchor, so a steady-state folded plugin session carries zero acp_summary markers on the wire. The armed-default judge (#3938) then declares folded=false and flags every covered inbound message as mid-history-drop — one warn per request (1104/day in the reporter's long-lived IM-bridge sessions). No bytes were ever lost: the full summary text rides in the re-sent call arguments. Teach the judge the regime: a successful compress receipt (tool-result, toolName=compress, text starting with "[Compressed ") is a summary carrier of the same rank as the anchor; refused/failed receipts fold nothing and do not mark the regime. Entry cells covered by ACTIVE blocks (host state via new activeBlockCoveredIds, wired at the relay seam) are expected absences, counted as "covered K" in the verdict — honored only when the exit actually carries fold evidence, so the zero-carrier anomaly (no anchor AND no pair) stays red.
Unit: steady-state shape green with covered count; negative control without coveredIds red; uncovered-drop teeth fire; zero-carrier anomaly stays red; refused receipts do not mark the regime; multi-fold behind the first fold point is free I2 territory; activeBlockCoveredIds unions ACTIVE blocks only. Live e2e: real server + real /__bili/plugin/tool fold, full-history resend with the riding pair judges clean (covered=3 — turns 1-3 excused, pinned first user message rides as matched twin per kernel/src/prune.ts), then an uncovered cell vanishing from the outbound still fires.
…dialect compress pairs (#4401) Review follow-up on #4410 (two sub-defects of the same carrier-recognition mechanism): 1. The exemption-overflow cap (maxExempt, default 128) counted every riding compress pair as 2 carrier messages. A steady-state plugin session with N active blocks carries 2N such messages, so the cap tripped at N=65 even though every pair is legitimate host state — the very sessions this PR exists to silence (86 active blocks in the reporter's logs) would have converted the mid-history-drop storm into an exemption-overflow storm. Pair volume is now bounded by 2 x |coveredIds| (one pair per active block, each covering >=1 message); excess over that ceiling still counts toward the cap, and without host state the full pair volume counts (safe direction: over-warn, never under-warn). The overflow detail string gains an additive pairExcess= field. 2. isCompressToolMsg matched only the bare "compress" tool name; the MCP dialect form "mcp__bili__compress" (#2970/#3222, zcode lane) was not recognized by the regime logic. It now uses the same dual-name predicate as the I3 pairing pass and hideConsumedCompressCalls. Tests: +4 unit tests (86-pair steady state green at carrier=172; fake-carrier excess still trips overflow with host state present; dialect pair marks the regime; refused dialect receipt does not).
…dge (#4401) The PR's normalization premise — full summary text rides in the re-sent call arguments — does not hold on the outbound wire for native-array-form plugin folds: hideConsumedCompressCalls stubs kept-call summaries over 200 chars and stripKernelSummaries strips the acp_summary anchor on existence+range match only, so a fold whose summary exceeds the stub threshold left both halves of the re-sent pair differing byte-for-byte (call half stubbed) while the anchor was gone. The judge read that as mid-history-rewrite/mid-history-drop — #4401's storm persisted for exactly the long-summary population, which the short-summary fixtures never exercised. stableEqual now accepts a directional sanctioned-compress-twin proof: same raw prefix, same non-content fields, and the exit content list an order-preserving subsequence of the entry list where each surviving entry matches by exact range key (startId/endId, messageId fallback) and verbatim-or-exact-stub summary (199-char prefix + U+2026, surrogate-safe). Mirrors kernel/src/hide-consumed.ts lockstep (not imported — judge stays a leaf); unparseable args fail safe to plain byte compare. The range-filter facet (dead-range entries dropped outbound) is covered by the subsequence match. Tests: unit POS (>200-char stub, multi-range drop) + NEG teeth (non-exact clip, rewritten summary, planted range all stay red) + e2e live path asserting the forwarded call half really is the stubbed form upstream while the armed judge reads the steady-state request as a clean fold. Related: #5866 (option A would keep the anchor for this shape; complementary, merge-order independent).
9d442eb to
ffcb8a1
Compare
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复——你的 flag 与 #4401 同属一个机制家族(judge 不认 plugin-lane compress pair),按「一个机制一个 PR」纪律直接在本 PR 内修掉,不另立 issue。 前提确认:你说得对,已实证代码级 + 线上双确认:稳态下 >200 字符摘要的 plugin fold 出站线上零份全文——kernel 修法:judge 侧识别 kernel 授权的 call-半截投影(commit 1f0f0c2)不动 host 侧 strip(那是 #5866 option A 的领地,owner 未拍板,本 PR 零触碰)。在 judge 的 行为变更披露(旧→新):旧:>200 字符摘要的 plugin fold 稳态判红(mid-history-rewrite on stubbed half;裸 master 上还有 mid-history-drop×N)→ 新:判绿,pair 计入 covered carrier。仅 advisory 层(warn 日志/面板),零流量变更;#4401 风暴对长摘要人群止住。≤200 字符路径逐字节不变。 与 #5866 option A 的关系:互补,合入顺序互不锁死A 落地后锚点留在线上 ⇒ 八问
CI(head ffcb8a1,已 rebase 到 master 5af5f9f + merge ci-fixes)11 条 e2e/gate 车道全绿;核心矩阵 6/12 shard 红 = 全部为 #5860 F3 继承签名(silent-backend-nudge ×3 + fork-nudge-trigger ×2 + issue4241 render-baseline,逐条比对日志与 #4599 floor 1103 清单吻合,#728B 通过),等 #5867 owner A/B/C 拍板,全舰队分支同红,已在 #4599 留一行。本 PR 自身测试在对应 shard 内全绿,零 PR 专属失败。本地定向验证:invariant-judge 族 64/64 + companion 24/24,typecheck/build 干净。 判定:ready for review/merge;残余红为继承性、已登记,不阻塞本 PR 的审查结论。 |
(ai: vllm-qwen/qwen3.8-27b) 本轮结论:6 个红分片全部是 master 继承红(#5860 波次的 nudge 行为测试钉),与本 PR 代码无关;master 侧的裁定修复(#5882)已并入本分支并推送,等 CI 重跑。 本轮做了什么(判断,非流水账)
结构化八问
备注:floor 11 的 >200 字符 stub 不对称前提标记仍在 #5866 跟踪(待 owner 拍板),不阻塞本 PR 的 CI。 收工判定:CI 重跑转绿后 ready-to-merge(合并由人执行)。 |
The suite baseline preload (preload-storage-baseline.mjs) pins BILI_STORAGE_UNIFIED="legacy" for the broad corpus. After #6480 flipped the storage default to pure-sqlite, the notice-registry suite's visibleNotices assertions expect the pure-sqlite default notice, which is gated on unifiedSelectionIsSqlite (unified "sqlite" or absent) — the preload's "legacy" made the notice silent, so the suite was born-red on master. Pin the selection explicitly (#4011 lesson: a test that depends on the production default passes locally but fails in CI).
# Conflicts: # src/invariant-judge.ts # src/server/relay.ts # tests/invariant-judge.test.ts
(ai: vllm-qwen/qwen3.8-27b) Merge conflict resolved — branch is back at current master, pushed as What happened: master advanced ~40 commits past this branch's base (kernel 0.0.195, #6003 egress-chokepoint relay refactor, #5478 invariant-provenance / #564/#2627 separator provenance, #4862 compress-pairing, pure-SQLite default, announcement policy, …) and the PR was flagged dirty. What I did — merged
No semantic change to either side: the merged tree is exactly Verification on the merged head: 中文八问
收工判定:冲突已解、分支已对齐当前 master 并推送( |
Closes #4401
What this changes
The invariant judge (#3842, armed default-on since #3938) did not know the plugin-lane carrier regime (KDD#7/#1567): in plugin lanes the client's own re-sent
compresspair IS the wire summary carrier — while the pair rides,stripKernelSummariesremoves the kernel anchor, so a steady-state folded plugin session carries zeroacp_summarymarkers on the wire. The judge then declaredfolded=falseand flagged every covered inbound message asmid-history-drop— one warn per request. That is exactly the reporter's 1104/dayI1 mid-history-dropstorm in long-lived IM-bridge sessions. No bytes were ever lost: the full summary text rides in the re-sent call arguments; the warnings were false positives.Fix (advisory layer only, zero traffic change):
tool-result,toolName=compress, text starting[Compressed) is now a summary carrier of the same rank as the anchor. Refused/failed receipts fold nothing and deliberately do NOT mark the regime.activeBlockCoveredIds, wired at the relay seam) are expected absences: counted ascovered Kin the verdict/log instead of violations. Honored only when the exit actually carries fold evidence — the zero-carrier anomaly (no anchor AND no pair) stays red.Behavior change disclosure (old → new)
I1 violation: mid-history-drop … (N finding(s), matched≈0, exempt carrier=0)WARN… matched X/Y, covered KTests (local targeted; full suite = CI on pushed head)
tests/invariant-judge.test.ts34/34 — 8 new: steady-state green w/ covered count; negative control withoutcoveredIds; uncovered-drop teeth; zero-carrier stays red; refused receipts non-regime; multi-fold behind first fold point free;activeBlockCoveredIdsunions ACTIVE blocks only.tests/invariant-judge-e2e.test.ts6/6 — new live path: real server + real/__bili/plugin/toolfold, full-history resend with riding pair judges clean (covered=3: turns 1–3 excused, pinned first user message rides as matched twin per kernel/src/prune.ts §8.1), then an uncovered cell vanishing from the outbound still fires.Open items handed back to the issue thread
sess=session-268a4f93(grep[plugin] tool compress executed via plugin) to confirm lane attribution in their deployment.Review updates (rebased + follow-up fixes)
Rebased onto master 44067a5 — the original base was ~1151 commits stale; conflicts with the I3 egress-pairing pass (#4862) and the render-lane reconcile (#4241) resolved as union of intent. Test counts above reflect the pre-rebase head.
Review found two sub-defects of the same carrier-recognition mechanism, fixed on this branch:
exemption-overflowstorm. Pair volume is now bounded by2 x |coveredIds|(one pair per active block, each covering >=1 message); excess over that ceiling still counts toward the cap, and without host state the full pair volume counts (over-warn direction only). The overflow detail string gains an additivepairExcess=field.exemption-overflowwarn once riding pairs exceed 64; new: clean unless carrier volume beyond the bound trips the cap. Non-plugin sessions and state-less judge seams: unchanged.mcp__bili__compress, zcode lane, [Bug] MCP compress 历史调用未被清理,长会话累积大量旧摘要与回执 #2970/[Bug] MCP compress 未接入 reasoning 清理及未完成调用保护 #3222) now mark the regime like barecompress(previously unrecognized by the new logic); refused/failed receipts still do not mark it.Post-rebase verification: invariant-judge unit 52/52 (+4 new), e2e 6/6, companions (unified-acp-invariants / side-lane-invariants / cache-friendly-plugin) 33/33, typecheck + build clean. Full suite = CI on pushed head.