Repository navigation
[PR] feat: compress-block retirement (acp_retire/acp_restore) + external summary rewrite (acp_rewrite) + export ledger - #5774
Conversation
Add three state operations on CompressionBlock, all roll-backable and storage-format-neutral (optional fields ride the payload_json blob): - retireBlocks / restoreBlocks: retired blocks keep active status and full coverage bookkeeping, but prune() stops injecting their summary anchor into the resident view (syncBlocks keeps them alive instead of deactivating the intentionally-absent content); usage metering, distillation pending tiers, and tier hints skip them; apply-side rejects whole batches whose ranges would consume a retired block so retirement can never be silently destroyed by re-compression. - rewriteBlockSummary: replaces a stored summary with caller-supplied text (single or batch), keeping previousSummary one step deep for rollback; compressedTokens untouched (it records original input). - acp_status overview gains a RETIRED BLOCKS section when non-empty; the compressed drilldown marks retired rows. - New model tools acp_retire / acp_restore / acp_rewrite declared for all four wire dialects, classified mutating (session lock + same-turn re-request); prompt prose updated four -> seven tools with fixtures regenerated. kernel-change: owner-requested capability #5765 — long single-session context management needs per-block opt-out of the resident view and post-hoc summary replacement that neither the compression pipeline nor the existing generation-time external-summary config can express.
…#5765) Host wiring for the kernel block operations: - executeProxyTool dispatch + executor module (arg parsing, receipts with freed-char counts, markDirty persistence); tools classified mutating so the shrink lands in the same turn via re-request. - Adapter PROXY_TOOL_SETs and pi-subagent allowlist extended for the three names; acp_cache added to both adapter sets in passing (same drift: it was missing, which would raw-replay its chunks as 'real' calls on mixed rounds). MCP dialect note lists the new tools. - snapshot-render (D lane): retired blocks contribute no synthetic summary anchor while their covered rows stay suppressed. - bili export: per-block ledger line (messages range from kernel-assigned startRef/endRef or messageRefs fallback, original/summary char counts, active|retired|consumed status) in both markdown paths; JSONL block rows gain conditional retired/rewrittenAt/originalChars/summaryChars fields. Markdown listing stays active-filtered per the pinned #845 contract (retired blocks remain active, so they stay listed; consumed excluded). Closes #5765
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。 本 PR 是 GitHub #5765(owner 能力请求:块退役 + 摘要外部重写 + 导出账本)的唯一实现在途;当前所有 open [PR] 行里无第二个 PR 触碰同一主题。该需求另有一张同文不同词的重复请求单(镜像侧),上游主票即 #5765,PR 的 标签: 拟打 审核进行中:已拉取分支(wt-5767-ework-daemon,2 commits,+1063/−24,22 文件),正在通读 diff + 核 CI。结论按八问体例随后补上。 |
# Conflicts: # kernel/package.json
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.9050-pr.5774.016e94bThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr5774.tgz
npm install -g packageInstall instructions are refreshed on each push. |
The tool-set partition deepEquals in compress-tools.test.ts still expected the pre-#5765 five-tool surface; acp_retire/acp_restore/acp_rewrite are mutating session-state tools and belong in ACP_MUTATING_TOOLS alongside compress/decompress.
…ditions Intended change only: the three new tool schemas now appear in the pinned tool arrays/surfaces. Pure insertions (+1308/-0), no pinned entry removed, ledger not shrunk. Prompt text is not pinned by these goldens (the four->seven prompt-section change is fixture-pinned in kernel/tests/fixtures).
…nvention The #5765 field additions landed at 3-space indent and re-indented the adjacent restoredInline/durationMs lines with them; the interface uses 2 spaces throughout.
Repo convention names regression files after the GitHub issue (issue2915-/issue3236-/...); GitHub #5767 is an unrelated banner issue, so the mirror number in these filenames pointed at the wrong thread.
…IdArg The ad-hoc id normalization kept original case and skipped zero-pad forms, so B5/005-style ids undercounted the freed-chars receipt; parseBlockIdArg is the kernel's canonical normalizer and unknown ids are skipped honestly instead of matched against a mangled key.
acp_retire/acp_restore/acp_rewrite fell through toolChipCls to the unstyled default; they sit in the same fold-family chip class as compress/acp_status/acp_cache.
(ai: vllm-qwen/qwen3.8-27b) Review 结论:#5765 block retirement / external rewrite / export ledger(PR #5774)方向正确、实现完整、测试有牙;但首遍有两处 CI 级遗漏(已在本分支直接修掉并推送)。逐问如下。 1. 是什么问题:这是功能 PR 审核,不是 bug。#5765 要三个能力——压缩块退役(acp_retire/acp_restore)、摘要外部改写(acp_rewrite)、导出账本。PR 把三者都实现了:kernel 侧状态机(block-ops.ts)+ 四条 wire 方言的工具面 + 宿主执行器 + 导出元数据。 2. 什么原因导致的(CI 红):两处首遍遗漏,均非设计问题——
3. 影响范围与严重程度:合入后所有 function/hybrid 工具车道多 3 个工具 schema(function 车道约 +0.3K tokens,正文已披露;text 车道不加触发器、不变)。无用户可见缺陷;全部新字段可选,旧持久化状态向后兼容(缺省读作未退役)。 4. 怎么修复的(我推了 6 个标注 commit,head 现在是 83cacf5):
5. 是否有回归问题:审过的既有行为逐项过——
6. 是否破坏缓存:retire/rewrite 都是用户显式操作,各造成一次前缀变化(一次性破缓存,符合预期);不碰消息身份通道(msgid/顺序/hash 三层)与增量水位快路径,去重键与增量游标不受影响。 7. 是否改了设计方向:没有。纯增量能力面,kernel 版本纪律遵守(0.0.180→0.0.181 已在分支上,我的 whitespace 修复搭同一 bump,kernel-guard 绿)。 8. 是否引入了新的配置:没有——与 acp_cache 同款 always-on,无 env/config/CLI 新增,与 PR 正文声明一致。 测试有效性:两个新测试文件都读了原文——kernel 侧 9 例、宿主侧 7 例,正负向成对(#3617 纪律达标),宿主侧走真实 executeProxyTool 分发而非只测执行器,幂等/拒绝矩阵/状态不被失败翻转/一步深回滚链都有断言,不是摆设。 现状:新 head 83cacf5 的 CI——ubuntu static-gates ✅(原先红的就是它)、kernel-guard/version-guard/lane-guard/lock-sync/docs 等全绿,windows static-gates 与 test 分片在跑;本地定向验证全绿(kernel 1599/1599、wire-contract golden 5/5、wire 合约 263 例、export 35 例、pi-subagents/build/thin-install)。CI 结论已在 #4599 留了一行。 判定:ready——等 83cacf5 的分片全绿即可合(合并由你操作)。小提醒:PR 正文里引用的测试文件名还是旧的 issue5767-*,我不动你的正文,你顺手改一下即可。标签想打 scope/kernel + p3,但镜像 shim 没实现 label 端点(首条回复已说明)。 |
(ai: vllm-qwen/qwen3.8-27b) 收工摘要(前一条八问 review 结论不变,这里补 CI 状态更正与最终盘点): 做了什么:通读全部 22 文件 diff + kernel/宿主两侧新测试原文;master 对照工作区实测定位出两处首遍遗漏(static-gates 红 = kernel 工具分类分区测试没更新;wire-contract golden 4/5 必红 = 没跑再生成脚本,PR 正文「golden unchanged」与事实不符);在本分支直接修掉并推送 6 个标注 commit(head 现为 CI 现状更正(我此前一条补述未能落库,以本条为准):新 head 待你操作:① UI 重跑 test 分片,全绿后即可合(合并只能你来);② PR 正文里引用的测试文件名还是旧的 issue5767-*,顺手改一下即可(正文我不代改)。判定维持:代码侧 ready,等分片绿。 |
🔶 需要决策 (ai: vllm-qwen/qwen3.8-27b) 先纠正上一轮(floor 8)的「环境/runner」判断——这轮有决定性反证。 floor 8 依据「PR 分片红 + 同期 master 分片绿」判为环境问题。观察本身没错,但 CI 颜色相关性区分不了「PR diff」还是「分片抖动」。决定性的是同条件本地 A/B:我把纯 master( 16 个失败文件 = 15 个「master 过 / PR 挂」的 PR 引入回归 + 1 个(msgid-lane-flow)因分支落后 master 而红、已被我这轮的 merge 修好。 同一台机、同一 node、同一时刻,唯一变量是代码 ⇒ 不是环境。(若真是 runner 问题,master 在同样的本地环境里也会挂——它没有。) 本轮做了什么
根因(高置信):PR 把 3 个新工具
需要你拍板——这 3 个工具怎么暴露?(PR 正文「Config surface: None added… always-on like acp_cache」说明作者是有意选 always-on;但 always-on 的真实半径是上面 15 个文件,作者可能只预期到 wire-contract / prompt fixtures 那组 golden。)
推荐 B(尊重作者已定的 always-on 方向,acp_cache 本就 always-on),前提是你明确接受「function 车道每请求永久 +~0.3K tokens」这个已披露的行为变化,并授权跨 15 文件的测试重校 + golden 再生;若要零爆炸半径则退 A(需你为新增配置项背书)。 结构化结论(八问)
置信边界:always-on 工具面作为主因高置信(#1843 确定性数值 + manifest 族精确清单两类硬证据);其余 e2e 已逐一证明 PR 引入(A/B),但未把每条追到具体某行——选定 A/B 后即可据此收敛。 判定:hold,等你对 A/B/C 拍板(合并只能你来)。 |
acp_retire counted freed summary chars over the whole input list before the flip — already-retired (noop) and rejected ids inflated the receipt. Count outcome.applied after the flip instead (summary text survives the flag change). acp_rewrite silently dropped malformed items[] entries — the model could not tell which item did not land; report a skip count. Drop the dead failedCount counter.
…cks (#5765 review) Math.min(...nums)/Math.max(...nums) over effectiveMessageIds can exceed V8's argument-spread limit for tier-3 blocks of very long sessions; compute min/max with a loop. Reuse the already-computed active list in renderHandoff instead of re-filtering s.state.blocks.
The PR's snapshot-render change (retired blocks contribute no synthetic anchor while covered rows stay suppressed) had no test anywhere; legacy prune and D-lane behave identically for this shape, so add a hermetic D-on test with assertDActive to prove the lane rendered.
ranxianglei
left a comment
There was a problem hiding this comment.
(ai: vllm-qwen/qwen3.8-27b)
Findings-only review — kernel gate. This PR touches kernel/** (new kernel/src/block-ops.ts; edits to compress-tools.ts/compress.ts/prune.ts/report.ts/sync.ts/types.ts/index.ts; kernel tests; kernel/package.json 0.0.182→0.0.183) and carries the kernel-change: declaration, so per the Kernel Boundary (human-only review tier) I am not approving — see the 🔶 需要决策 comment for the authorization request. Everything below is my independent assessment of the work itself.
① Direction check (original issue #5765). Owner-requested capability; all three acceptance criteria are met and pinned:
- retire/restore:
acp_statusRETIRED section ✓, resident-view total drops by the summary size ✓ (assertedcharsAfter < charsBefore), decompress/recap keep working ✓ —kernel/tests/issue5765-retire-rewrite.test.ts. - rewrite: summary becomes the supplied text, char counts reported, originals untouched,
compressedTokens(input accounting) preserved, one-steppreviousSummaryrollback ✓. - export ledger: covered range
mNNNNN–mNNNNN(startRef/endRef with messageRefs fallback), original chars, summary chars, lifecycle status ✓ (tests/issue5765-acp-block-ops.test.tspins the exact line).
The load-bearing mechanism choices are correct, verified against the surrounding code: retired blocks stay active:true with an early-continue in syncBlocks (kernel/src/sync.ts:154) — without it the still-present check would deactivate the block once the stale rendered copy leaves history and orphan GC would destroy decompressability; the test includes a control proving the guard is what keeps it alive. The apply-side guard (kernel/src/compress.ts:1753) throws into the existing batch fail-fast contract (compress.ts:827 "Batch rejected before folding any range") — a sibling range does NOT land, tested. D-lane: seeds carry the flag, assembleView skips the anchor while covered rows stay suppressed (src/server/snapshot-render.ts:279). Storage-neutral: the optional fields round-trip verbatim through payload_json (src/storage/ingest.ts:429/651), so rollback state survives restart.
② Regression inventory (existing behavior on touched paths).
- prune: anchor skip is strictly flag-gated;
knownSummaryIdsstill built from ALL blocks so stale rendered copies of retired blocks are dropped, not leaked (kernel/src/prune.ts:216). - syncBlocks: new branch only fires when
retired === true; the consumed/expanded branches above it are untouched. - compress apply/recommend: new throw only when a range consumes a retired block; tier hints and
pendingByTierexclude retired, and retired messages stay COVERED (coverage intentionally includes them), soacp_statusranges cannot span them — no advertise→reject loop. Verified, not just asserted. - report.ts: every metering/section change gated on
block.retired; a session with nothing retired renders byte-identically. - export: markdown listing stays active-filtered (#845 contract pinned by the new test);
- wire-contract goldens: I structurally diffed all four (bili/kernel/manifest-default/manifest-optin) — the ONLY delta is the three added tools in each dialect array; zero unrelated drift.
- Tool-surface completeness: every model-facing lane derives its tools from the proxy manifest / kernel arrays (opencode-native iterates
ACP_TOOLS_OPENAI; dsh/pi/omp register the fetched manifest; MCPtools/listserves the proxy manifest), so the explicit name lists are exactly the ones updated (both adapterPROXY_TOOL_SETs,BILI_INJECTABLE_TOOL_NAMES, web chips, MCP dialect note). The in-passingacp_cacheaddition to the two adapter sets is a genuine pre-existing drift fix (chunks could raw-replay as "real" calls) and is disclosed. - All disclosed behavior changes hold up; I found no undisclosed semantic drift.
Findings — all four fixed on the spot (host-side only, three commits on this branch):
src/acp-block-ops.tsexecuteAcpRetire: freed-chars counted over the WHOLE input list pre-flip — already-retired (noop) and rejected (unknown/inactive/malformed) ids inflated the receipt ("~N chars leave the view" when none did). Now countsoutcome.appliedpost-flip (summary text survives the flag change, so measurement stays exact).7d7f8fa0a- Same file,
executeAcpRewrite: malformeditems[]entries were silently dropped — the model couldn't tell which item never landed. Receipt now reports a skip count; also removed the deadfailedCountcounter.7d7f8fa0a src/export.ts:Math.min(...nums)/Math.max(...nums)spread overeffectiveMessageIdscan exceed V8's argument-spread limit for tier-3 blocks of very long sessions → loop;renderHandoffre-filtereds.state.blockswhereactivewas already computed → reuse.208936146- Missing pin: the D-lane retired-anchor behavior had no test anywhere, and legacy prune and D-lane produce the SAME shape here, so a silent legacy fallback would have read green. Added a hermetic D-on test with
assertDActive(tests/snapshot-render.test.ts).3de75ff16
Non-blocking observation, left untouched (kernel-side, trivial): renderOverview re-sorts retiredBlocks although the source list is already sorted (kernel/src/report.ts:371 area).
Verification: targeted local runs green — tests/issue5765-acp-block-ops.test.ts 7/7, export/handoff suites 40/40 (incl. pre-existing format pins, confirming the ledger additions don't break them), new snapshot-render test 1/1, tsc --noEmit clean. Full-suite verdict = remote CI on the pushed head 3de75ff16. Kernel version bump satisfies the CI-enforced discipline; verif subset-guard is part of CI (green on prior head, rerunning on this one).
八问
- 是什么问题: owner 请求的两个能力(压缩块退役、摘要外部重写)+ 导出账本——旧块每轮全量注入占上下文,无法移除也無法精简。
- 什么原因导致的: 不是缺陷,是能力缺口——块一旦 fold,其摘要就永久常驻视图,没有用户可控的退出机制。
- 影响范围与严重程度: 纯增量能力;不使用者零影响。对使用者:长会话(如 113 块/32 万 token 视图)可显著降低常驻摘要体量。
- 怎么修复的: 视图层标志位方案——retired 块保持 active(防孤儿 GC 回收原文),仅跳过 prune 锚点注入与 D-lane 合成锚点;rewrite 原地换文本+一步回滚位;apply 侧整批拒绝消费 retired 块的压缩范围。
- 是否有回归问题: 逐项核过 prune/sync/compress/report/snapshot-render/export/golden——所有变更均按 retired 标志门控,无 retired 块的会话行为逐字节不变;golden 结构化 diff 确认纯增量。无回归。
- 是否破坏缓存: retire/rewrite 会使其锚点之后的前缀失效——PR 已披露且属预期(摘要字节变了,缓存本来就该断);未操作时缓存路径不变。
- 是否改了设计方向: 否。复用既有 fail-fast 批处理契约、payload_json 存储通道、manifest 派生的工具面;未引入新配置面。
- 是否引入了新的配置: 无(always-on,同 acp_cache 先例)。
判定: 代码质量本身达到可合并水准(发现项已全部顺手修掉并推送,head 3de75ff16);因触及 kernel/,按边界规则不予批准,等待 owner 授权(见 🔶 评论)。
|
🔶 需要决策 PR #5774 触及 我的独立审查结论(完整内容见上方 review):方向正确(#5765 三项验收全部满足且有测试钉住)、回归清点逐项通过(所有行为变更均按 retired 标志门控,无 retired 块的会话逐字节不变)、golden 结构化 diff 纯增量、工具面各车道覆盖完整。发现的 4 个小问题已全部在分支上顺手修掉并推送(host 侧,未动 kernel):head 选项:
被卡 diff 一览: |
(ai: vllm-qwen/qwen3.8-27b) PR #5774 review 完成:findings-only 审查已发到 GitHub(kernel 门禁——PR 触及 已顺手修:4 个发现全部在分支上直接修掉(host 侧,未动 kernel)——①acp_retire 回执字数只统计实际翻转的块(原先把已退役/被拒 id 也算进去,虚报释放量)②acp_rewrite 批量里的坏 items 不再静默丢弃,回执报告跳过数(顺带删死变量 failedCount)③export 账本 range 回退的 Math.min/max spread 改循环(超大块防 V8 参数上限崩溃)+ renderHandoff 冗余 filter 复用既有 active 列表 ④补 D-lane retired-anchor 行为测试(原 PR 该行为零测试钉住,legacy 与 D 车道此形状相同、静默降级会读成绿)。commits 收工一行:review 已交付(GitHub review id 5795587798 + 🔶 评论 6676569504),等 owner 授权合并或要求修改。 |
🔶 需要决策(续接 floor 11 —— 同一 A/B/C,无新增选项;本轮为核账,非重新立题) (ai: vllm-qwen/qwen3.8-27b) 一句话:dev/review-worker 在我上轮合并后又推了 3 个纯 host 侧 commit(head 现为 本轮做了什么
为什么没推代码:这批失败文件(manifest 精确清单族 / 尺寸敏感 e2e 族 / storage golden 漂移)的正确修法由 A 或 B 决定——A(门控默认关)= 现有套件零改动即绿;B(always-on)= 需跨多个文件重校 + 再生成 golden。无拍板即改 = 猜方向,故停。 给 owner 的关键提醒(两个 🔶 别混):你现在面前有两个独立待决——①我 floor 11 的工具面暴露策略(A/B/C,决定代码怎么改);②review-worker floor 13 的 kernel 合并授权(A 授权 / B 要求修改,决定能否合入,因 PR 触及 八问
判定:hold,等你对 floor 11 的 A/B/C 拍板(合并只能你来;kernel 合并授权另见 floor 13)。 |
kernel version: 0.0.183 (PR) vs 0.0.192 (master) -> 0.0.193
…urface
The acp_retire/acp_restore/acp_rewrite schemas are always-on in every
plugin manifest, so the pinned manifest/fork/launcher tool lists, the
insertion-order lists, and the codex-official prompt regex ('four' ->
'seven' context-management tools) all needed the three new names.
Fixes the 9 stale-assertion failures across plugin-protocol, plugin-fork,
launcher-plugin-mode and codex-official (deterministic on PR head, green
on master).
The four committed storage-render snapshots are byte digests of the forwarded wire bodies; the always-on retire/restore/rewrite tool schemas change every body (+2685B on the chat wire per turn), so the digest/bytes fields were refreshed via scripts/update-storage-render-goldens.ts. Structural fields (turns, summary placement) are unchanged. Fixes golden-storage-render + storage-engine-proofs (8 tests, 4 wires).
The always-on retire/restore/rewrite tool schemas add ~0.66-0.7k est-tokens (~2.6KB) to every forwarded body. Several e2e scenarios are deliberately calibrated a few hundred tokens under their trigger boundaries (the repo's established pattern when the wire surface shifts: #2750 wording change, #3298 fold-boundary retune, #1933 bill-rate retune), and the constant body growth pushed them over: - e2e-relay-5xx-selfheal: tool_result 12000 -> 11700 chars keeps the payload at the intended ~97% of the 32k window. - issue1933 F2: 1.4x/15x4000 -> 1.5x/14x4000 keeps the billed total at exactly 21000 (the scenario's +1k-above-target) while the estimate lands ~1.5k under the 20k trigger. - #663: repeat(235) -> repeat(220) keeps the post-fold forward at 4 messages (the mock only misclassifies exactly-1-message bodies). - e2e-google-compress: clamp the mock's fold endId to refIds[max(len-6,4)] — with the +2.6KB body the 24KB demand gate now opens at 12 refs, and the len-10 tail then degenerates to a single-message range (463 chars < minCompressRange, hard refusal). The len-6 clamp also fixes a steady-state ratchet each fold out-earned by ~500B, so the upstream bodies stay bounded (client 65.7KB vs peak 31.5KB, ratio 2.09, assertion requires >2). - #280: repeat(235) -> repeat(155) — the overflow-relaxed preflight fold now eats 3 more messages before the hard protection floor; 155 (the measured pass window is 100..215) keeps MARKER_8..11 in the forward. - #1843: mock bill 8000/6617 -> 8657/7274 (a real encoder bills the +657-tok schema text too) so the learned per-image cost lands at 1813.5, inside the (1500, 5000) sanity bound. - preflight-hold #568: repeat(235) -> repeat(220) (same family as #663). - issue2672: idx8 2562 -> 207 chars (it is BLOCKED — no compressible slot — so its size never touches the walk geometry) and tail 358 -> 294 chars (74 tok each keeps the 1000-tok recent-zone walk stopped at idx9 exactly as on master: 5x74+5+675 = 1050 >= 1000). Restores the pre-#5765 post-fold payload (~7.6k tok vs the 8k window). - cache-proof host-compaction: seed FILLER 6 -> 5.5KB/turn — the +2.6KB schemas pushed the second-phase seed body one body earlier past the 64KB demand threshold (66.9KB vs 65.5KB at body #11), landing the seed fold one turn ahead of the #2695 geometry the zombie-settle bound (9) and the rearm-shrink pin were measured against; 5.5KB restores the master-aligned fold turns (verified via PROOF_DUMP: seed folds at 8->9 and 12->13 on both, rearm at 21->22). All 15 affected files green (156/156), matching the 27 deterministic CI failures 1:1; the identical suite is 155/0 on master.
ranxianglei
left a comment
There was a problem hiding this comment.
Reviewed 3de75ff16 in depth (code + local repro of every CI failure + master control run), then pushed the review fixes below.
Code: the three tools (acp_retire / acp_restore / acp_rewrite), the kernel block-ops, the apply-side batch guard, the export ledger, and the D-lane snapshot handling all read clean — no logic bugs found, and the PR body's design notes match the implementation (retired-stays-active + sync deactivation control, one-step-deep previousSummary, whole-batch reject, optional payload_json fields, D-lane anchor suppression are all exactly as described).
Why CI was red, and what I did about it: all 11 test shards failed on 27 deterministic test-pin failures — reproduced 1:1 locally on the PR head, while the identical suite is 155/0 green on master. One root cause: the new always-on tool schemas add ~2.6KB (≈0.7k est-tokens) to every forwarded body, which (a) broke 17 pinned tool-list / prompt / golden assertions the PR didn't update, and (b) pushed 10 payload-calibrated e2e scenarios (tests deliberately sitting a few hundred tokens under their trigger boundaries) over their pins. Retuning those pins when the wire surface shifts is the repo's established pattern (#2750 wording change, #3298 fold-boundary retune, #1933 bill-rate retune). Fixed in the commits below.
Review-fix commits (pushed to wt-5767-ework-daemon):
552b62a03— merge master in. The only conflicts were the 3 version files (kernel 0.0.183 vs 0.0.192 → 0.0.193); no semantic overlap with master's recent work (#5991, #6068 egress pipeline auto-merges cleanly and the commandcode-style rewrap ordering before egress transforms is correct).8a94375f6— pinned tool lists + prompt regex gain the three new names (plugin-protocol ×5 tests, plugin-fork, launcher-plugin-mode ×2, codex-official "four"→"seven").454a71b8e— regenerate the 4 storage-render goldens viascripts/update-storage-render-goldens.ts(digest/bytes fields only, no structural change — one regen fixes all 8 golden-storage-render + storage-engine-proofs tests).ce9ba5562— retune the 10 payload-calibrated e2e pins, each with an inline comment showing the arithmetic: relay-5xx 12000→11700 chars, #1933 F2 1.4×15×4000→1.5×14×4000 (billed total stays exactly 21000), #663 repeat 235→220, google-compress mock endId clamprefIds[max(len-6,4)](also kills a steady-state +236B/cycle ratchet that bounded upstream bodies at 34.7KB instead of the asserted ratio), #280 repeat 235→155, #1843 mock bill 8000/6617→8657/7274, preflight-hold 235→220, #2672 idx8 2562→207 chars + tail 358→294, cache-proof host-compaction seed FILLER 6→5.5KB/turn (verified via PROOF_DUMP that the fold turns realign to master's: seed folds at 8→9 and 12→13, rearm at 21→22 on both).
Verified on ce9ba5562: 156/156 across all 15 affected test files, npm run typecheck + npm run build green, PR now MERGEABLE. Awaiting the CI run on the new head.
Two things for the owner to confirm (not blockers from my side):
- Always-on surface cost: the PR body says "prompt growth ~0.3K tokens on function lanes", but the measured per-request body growth on the anthropic/responses wires is ~2.6KB ≈ 0.66k est-tokens (visible in the golden deltas and in exactly how far the 10 e2e pins drifted) — and it applies to every session and every request, including ones that never call the new tools. I kept the tools always-on per the PR's own Configuration Surface Discipline argument; flagging only because it is a permanent tax on all conversations and worth re-confirming as intentional.
- PR body vs goldens: the Tests section says "wire-contract suite 23/23 standalone with golden unchanged", but commit
2887f5457regenerated the four wire-contract goldens (+1308 lines — purely additive: the 3 schemas + manifest names). A one-line body fix.
Cosmetic: the body references issue5767-retire-rewrite.test.ts / issue5767-acp-block-ops.test.ts; the actual files are issue5765-* (the issue is #5765).
) The #5924 architecture-docs guard (landed on master via the branch sync) requires every tracked src/ file in reference/architecture.md; the new block-ops host executor module was added by this PR without its map row, so the guard failed on the merged head. One-line registration next to the acp-* cluster; guard passes locally (320 src files covered, no ghosts).
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 收工汇报(接续此前未落库的轮次):head 1) architecture-docs 红(已修,commit
2) test (ubuntu-latest, 24, 2) 红(判定:负载饥饿时序 flake,非回归,零代码改动)
3) 工具面暴露策略(floor 11/20 的 A/B/C)已按 B 方向落地——需要你知悉并确认 结构化八问
判定:代码侧 ready。待两件事在你这边:①新 head |
…default off)
Owner ruling (review of this PR): acp_retire / acp_restore / acp_rewrite
must sit behind ONE switch, default OFF, injected only when ON — the
always-on surface costs ~0.7k estimated tokens per request on every
session of an enabled proxy.
Follows the absorb opt-in pattern end to end:
- kernel: definitions + name consts stay exported, but the 3 tools leave
the default arrays (ACP_TOOLS_{OPENAI,ANTHROPIC,RESPONSES,GOOGLE},
ACP_READONLY_TOOLS_RESPONSES, ACP_TOOL_NAMES); they stay in
ACP_MUTATING_TOOLS (dispatch must drive the compress loop when enabled).
New BLOCK_OP_TOOL_NAMES set + buildBlockOpsSystemPrompt(lane) section
builder; the default prompts are back to "four context-management
tools". New Config.blockOps { enabled } (off by default); absorb/ccr
tool-name predicates include the block ops.
- host: compress.blockOps config (3-level merge like absorb);
blockOpsEnabled / effectiveBlockOpsConfig / storeEffectiveBlockOps
(per-session, plugin tool API parity); isProxyToolFor, the proxy-lane
inject* extras, the responses hybrid lane, the round-2 cache seam, the
plugin manifest + tool API, the MCP dialect note and the system prompt
all inject/advertise the 3 only while enabled; the MCP note, prompt
and per-session metadata stay byte-identical to pre-#5765 while off
(zero footprint: no metadata key written while off — the storage-render
goldens match master byte-for-byte).
- dispatch: enabled calls run the kernel ops exactly as before; a stray
call while disabled gets a model-facing "not enabled on this bili proxy
(compress.blockOps.enabled is not true)" receipt and never touches state.
- wire-contract goldens revert to the master shapes (the default surface
is unchanged), and this commit supersedes the three earlier fix commits
on this branch (test-pin updates + storage-render regen + payload
retunes): with the default surface back to the master shape, those
test files return to the master versions and the 27 red CI tests are
green again without any calibration changes.
- docs: compress.blockOps in configuration.md/.zh-CN.md + website seed;
kernel 0.0.194.
Verified: kernel 1656/1656; host targeted 201/201 (the 15 previously
red CI files + block-ops/snapshot/wire-contract), 348/348 + 63/63
surface/config invariant files; typecheck + build green.
Conflicts: kernel version files (master 0.0.193 from the #6132 fold-point removal + this branch's 0.0.194 -> 0.0.195) and one relay.ts import line (master dropped relocateCompressCarriers; this branch adds buildBlockOpsSystemPrompt — the resolved import carries only the latter; no fold-point call sites survive in the merged relay). Re-verified on the merged tree: kernel 1631/1631, host targeted 201/201 + surface/config 374/374, typecheck + build green.
ranxianglei
left a comment
There was a problem hiding this comment.
Opt-in gate landed per owner ruling (default off, one switch). New head: efa3df785.
Design (follows the compress.absorb opt-in pattern end to end):
- Config:
compress.blockOps.enabled(boolean, defaultfalse, 3-level merge likeabsorb). Documented indocs/configuration.md+.zh-CN.mdvia thegen-config-docsseed (i18n + coverage green). - Kernel (
6b33fd21a, acp-kernel 0.0.194→0.0.195 after the master merge): the 3 tools leave the default arrays (ACP_TOOLS_*,ACP_READONLY_TOOLS_RESPONSES,ACP_TOOL_NAMES) and the default prompts go back to "four context-management tools"; definitions/name consts stay exported; they stay inACP_MUTATING_TOOLS(dispatch must drive the compress loop when enabled). NewBLOCK_OP_TOOL_NAMESset +buildBlockOpsSystemPrompt(lane)appended-section builder; absorb/ccr tool-name predicates include the block ops. - Host: injection (proxy lanes + responses hybrid lane + round-2 cache seam), the plugin manifest + tool API, the MCP dialect note and the system prompt all ride the flag; a per-session effective flag (
storeEffectiveBlockOps) keeps the plugin tool API on the same value the wire got. While disabled a stray call gets a model-facingnot enabled on this bili proxy (compress.blockOps.enabled is not true)receipt — never an error, never a state mutation. - Zero footprint while off: no session-metadata key is written while off, so persisted state, storage-render goldens and the wire-contract goldens are byte-identical to master (the previous always-on goldens are reverted; the PR's own test-pin updates and the payload retunes from the intermediate fix commits are superseded — those test files are back on the master versions, which is why the original 27 CI failures are gone by construction).
Verified locally (merged tree efa3df785): kernel 1631/1631 · host targeted 201/201 (the 15 previously-red CI files + block-ops/snapshot/wire-contract) · surface+config invariants 374/374 · typecheck + build green. CI verdict on the new head is authoritative.
… split unused-exports guard: MCP_DIALECT_NOTE_BLOCK_OPS and mcpDialectNoteText are consumed only inside compress-tool.ts (withMcpDialectNote) — make them module-local.
- lock-sync: the second master merge auto-merged the root package-lock with the pre-merge kernel version (0.0.193); regenerate it for 0.0.195 (npm install --package-lock-only). - lane-guard: src/server/side-request.ts (BILI_TOOL_NAMES += the kernel- fixed block-op names) is side-lane logic — pin it in the dedicated side-lane suite: tests/side-request-isolation.test.ts now asserts the bili-owned set covers ACP_TOOL_NAMES + block ops + absorb/rule/retrieve.
ranxianglei
left a comment
There was a problem hiding this comment.
CI status at head 1d5f9114b: all green.
- All 11 test shards pass (ubuntu 22/24 ×3, windows 22 ×5), full matrix + every guard job (gate, docs-sync, docs-coverage, config-surface-guard, kernel-guard, lane-guard, lock-sync, unused-exports, static-gates, build-artifact, …).
- The single earlier red was
test (windows-latest, 22, 2):tests/issue5152-owner-beat-survives-host-stall.test.ts("stop() must silence the fallback together with the entry — 3 !== 2") — a timing assertion in the owner-heartbeat fallback loop on a loaded Windows runner. Unrelated to this PR (the diff touches no owner-beat/worker code; the file passes 6/6 locally and on all other shards) — the re-run of the failed job is green.
|
CI status at head
|
(ai: vllm-qwen/qwen3.8-27b) 进度汇报(进程曾因卡住 33 分钟被重启,上一轮成果不受影响):已完成 findings-only 审查 + 4 个顺手修(commit |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.1173-master.dc041dd # this exact build
npm install -g billion-context@master # always the newest merged build
|
… round 9) Master advanced 33104b1 -> c26c31a (ranxianglei#6260, ranxianglei#5441, ranxianglei#6186, ranxianglei#5774, ranxianglei#6166 et al.). Clean auto-merge, no conflicts: the new window's blockOps work (ranxianglei#5765/ranxianglei#6166) and this PR's decide-lane keys land in different regions of every shared file. Also completes the round-8 docs regeneration that was left unstaged: the committed head carried the decide-lane keys in the compress.yaml seed but not in the generated output. Re-ran node tools/gen-config-docs.mjs generate on the merged seed (341 entries; i18n ok: 256 keys, EN/ZH equal) — generated output now matches the seed in docs/configuration[.zh-CN].md, website/main.js and website/docs/index.html (blockOps + decide-lane keys, both languages). Verified: tsc --noEmit clean; unused-exports gate clean; targeted suites green (nudge-decide + issue3004 selfheal + config-surface-guard + nudge-model-decided e2e). Full-suite verdict = remote CI.
Closes #5765
kernel-change: owner-requested capability #5765 — long single-session context management needs per-block opt-out of the resident view and post-hoc summary replacement that neither the compression pipeline nor the existing generation-time external-summary config can express.
What
Three new model-callable tools, all roll-backable, storage-format-neutral (new optional fields ride the existing payload_json blob):
Design notes
Behavior changes (disclosed)
bili export丢失 active block summaries(snapshot 尾部被 BILI_PERSIST_TAIL_TOKENS 截断时) #845 contract (retired blocks are active, so they stay listed; consumed excluded).Config surface
compress.blockOps.enabled(boolean, default false, 3-level merge likecompress.absorb) — one switch for all three tools. Enabled: tools injected (proxy lanes) / advertised (plugin manifest) + per-lane prompt section + per-session effective flag for the plugin tool API. Disabled: nothing injected, zero per-request cost. Documented in docs/configuration.md + .zh-CN.md (gen-config-docs seed, i18n + coverage green).Tests
Review history
First push shipped the tools always-on (acp_cache precedent); the owner reviewed and ruled: one switch, default off, injected only when on. This also made the 27 CI failures of the first push (17 stale pinned tool-list/prompt assertions + 10 payload-calibrated e2e tests tipped over by the always-on schema growth) disappear by construction — the intermediate test-fix/retune commits on this branch are superseded by the gate commit and the affected test files are back on the master versions.