Repository navigation
feat: pin acp-kernel 0.0.90 + wire refold-in-place into proxy decompress - #1316
Conversation
…ess (kernel #398/#403) Kernel 0.0.90 ships the refold-in-place stack (#398/#400/#402) but markBlockRestoredInline had no host caller — the capability was inert in bili's proxy lane: a decompress→recompress loop could never refold, and the kernel's blocked-refold guidance promised an inline-restore path that never materialized on this wire. Wiring: resolveDecompress flips restoredInline (and markDirty) on a successful FULL-BLOCK restore (default one-level view or full) — the tool result stays in the client's re-sent history, so the model holds the re-summarization material. Range restores (startId/endId) return partial content and must NOT flip the flag; inactive blocks are skipped. Tests (tests/refold-wiring.test.ts): flag flip + idempotence, full:true parity, range-restore exclusion, end-to-end proxy-shaped refold (empty view, in-place update, marker cleared, no second block), and a negative control pinning the honest already-compressed rejection. Downstream verification against the published 0.0.90: typecheck ✓, full suite 2559 pass / 0 fail, build ✓.
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)npm install -g billion-context@pr-1316Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pr1316.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 Review of #1316 — verified on branch What I did: pulled the branch (base == current master tip Verification: all green
① Direction (issue review): correct. The one-way ratchet is real — without this wiring, proxy-mode decompress→re-compress of the same span dies on "already compressed" despite kernel #398's refold path, and the kernel's blocked-refold guidance pointed at a nonexistent downstream route. Bundling pin+wiring in one PR is the right call (pinning alone would ship an inert feature). ② Regression review (existing behaviors touched):
③ Code review: the wiring is minimal and correctly placed — after the range early-return, guarded by ④ Test validity: the 5 tests have teeth. Test 4 is a genuine end-to-end refold through ⑤ Diff cleanliness: clean — 4 files, every line on-purpose. Findings needing owner attention: A. Overlap with open PR #1298 (biggest item). #1298 ("compress receipts carry per-block summary fingerprints; inline decompress ends with re-fold guidance", fixes #1294) wires the same B. "Plugin lanes are unaffected" is inaccurate. The plugin tool API routes agent decompress calls through Behavior-change disclosure (old → new): in bili proxy mode (and, per B, plugin mode), re-compressing a span already folded into an active block was rejected with "already compressed"; after a successful full-block decompress it now refolds in place (same blockId, replaced summary, marker cleared). This is the intended fix of the kernel #398 ratchet, not drift. Tool-result text is unchanged by this PR. Verdict: code is correct, minimal, well-tested, green on a fresh base; kernel artifact verified; no regression identified in the bundled kernel delta. From my side this is mergeable — but per §7.4 the acp-kernel pin bump is a cross-repo dependency change, so the merge stays human-gated, and finding A should be sequenced deliberately (this PR first). 中文摘要:PR #1316(pin acp-kernel 0.0.90 + 把 refold-in-place 接入 proxy 的 decompress)已核分支、跑通本地 typecheck/2559 测试全绿/build、验证了 npm 上 0.0.90 产物与锁文件一致,代码正确且最小化,可合并;但需先与同改 |
…eat restores keep the exact-refs hint Rebase of #1298 onto master-with-#1316 surfaced a semantic duplicate: both PRs flagged restoredInline in resolveDecompress, but #1316 marked BEFORE the toFile early-return (violating the frozen contract 'file mode behavior fully unchanged') while #1298 marked only on the inline path. This keeps the contract-correct inline-only marking and additionally: - repeat inline restores now re-derive the exact span (kernel result is idempotent) so the hint stays byte-identical across repeats — the legacy 'repeat decompress returns identical content' invariant holds unchanged - only the FIRST restore pays the state write + persist - new pin test: >10K spill does NOT flip restoredInline and carries no hint Fixes #1294 (P1 fingerprint lines + P2 re-fold guidance, P2 live via the 0.0.90 pin from #1316)
Pairs with acp-kernel 0.0.90 (PR ranxianglei/acp-kernel#420) — pin bump plus the host-side wiring that makes the kernel's refold-in-place capability real in bili's proxy lane.
Why bundle them
Kernel #403 shipped
markBlockRestoredInlinewith zero host callers — in bili proxy mode the flag could never flip, so:Pinning without the wiring would ship an inert feature + a dead-end instruction.
The wiring (
src/decompress-shared.ts)resolveDecompressflipsrestoredInline(viamarkBlockRestoredInline) +markDirtyon a successful full-block restore (default one-level view orfull:true) — the tool result stays in the client's re-sent history, so the model genuinely holds the re-summarization material. Guards:startId/endId) never flip — partial content is not refold materialPlugin lanes are unaffected: full-log hosts (pi) use the kernel's resolving route (#400) which needs no flag.
Tests (
tests/refold-wiring.test.ts, 5)full:trueparityCompressed … → 1 block(s), ~0 tokens saved)Verification
markBlockRestoredInline+ refold code present in the published tarball)