Repository navigation
fix: compress receipts carry per-block summary fingerprints; inline decompress ends with re-fold guidance (#1294) - #1298
Conversation
[bot] 🏷 Review complete (fixes #1294). Verdict: not mergeable as-is — it's blocked on unshipped acp-kernel#398, and merging now would break master's entire test suite. I recommend splitting P1 out to ship now. Evidence below (replicated locally, not just read off the body). What I verified
Per-gate findings
Recommendation (my pick; final call is yours)
This is a packaging/workflow decision, so the call is yours. I won't merge either way (agents can't). Say the word and I'll execute the split — a fresh P1-only branch+PR referencing #1294, and move P2 onto a #398-gated branch. 中文摘要:PR #1298 现在不能合——它依赖尚未发布的 acp-kernel#398( |
…ecompress ends with re-fold guidance (#1294)
…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)
533eba5 to
b2382f3
Compare
|
Rebased + deduped onto master-with-#1316 (head
Gates on the rebased head: typecheck ✓ · 2581 tests / 2571 pass / 0 fail (10 e2e-gated skips) · build ✓. Fixes #1294. Cross-link set (refold feature): acp-kernel#398 · acp-kernel#403 (shipped in kernel 0.0.90) · billion-context-pi#535 → PR #536 (pin-bump + #540 riding there) · #1316 (wiring, merged). |
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)npm install -g billion-context@pr-1298Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pr1298.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 Re-reviewed the rebased head Why my blocker cleared
Independent verification on
Dedup correctness (read
Coverage — 14 new tests, all with teeth
Regression scope (existing behaviors touched)
One non-blocking nit (flagging, not fixing unprompted): Merge gate: per §7.4 this stays human-merge (message-shape + session-state + cross-repo dependency); I won't merge. Base is fresh; the only watch item at merge is any concurrent PR touching On the 中文摘要:已对 rebase 后的头 |
The inline whole-block path is intentionally stateful since #1298 (restoredInline flag + one markDirty persist); the old test name and assertion messages still asserted the pre-refold invariant verbatim. Rename and reword to the new contract, pointing at tests/refold-wiring.test.ts where the flag flip is pinned.
Fixes #1294
What & where
P1 — per-block summary fingerprint on compress receipts. Built in
applyRanges()(src/stream.ts:336), via new helpersummaryFingerprintLine()atsrc/stream.ts:189. After a successful kernel apply, each newly-created or summary-updated block appends one line to the tool result only (prefix cache untouched):Head = first 30 chars, tail = last 100 chars of the STORED (kernel round-tripped) summary,
\r?\nflattened to spaces. This is the opencode/plugin-side equivalent of the pi-side receipt enhancement — the receipt text here comes fromsrc/stream.ts, not a shared TUI module.P2 — re-fold guidance on inline decompress. Built in
resolveDecompress()(src/decompress-shared.ts:136-154). Inline mode now calls the kernel'smarkBlockRestoredInline()(flagsrestoredInlineon the block so a latercompressrefolds it in place — same id, new summary) and ends the result with the frozen hint:Refs come from the kernel's new return fields
{restored, blockId, restoredStartRef, restoredEndRef}(field names frozen by/home/dog/tmp/refold/spec.mdK2); when the span is not derivable the hint degrades to the generic form without exact refs. ThetoFilespill path is byte-identical to before — no hint, no flag.Files
src/stream.ts— P1 (fingerprint helper + append loop)src/decompress-shared.ts— P2 (mark + frozen hint, inline path only)tests/compress-fingerprint-refold.test.ts— 8 new deterministic testsTests
Coverage: fingerprint line for long/short/CJK-mixed/newline summaries; one line per block in multi-range calls; no fingerprint on FAILED receipts; P2 exact-refs hint text; degraded generic hint when the span is undecidable; toFile path carries no hint. Prefix-cache stability: P1/P2 mutate only the current round's tool result string — request prefix bytes are unchanged, existing e2e anchor/cache suites pass.
Cross-repo dependency
P2 consumes acp-kernel
markBlockRestoredInline()and the inline-decompress result fields from the refold-in-place work. Local verification was done against that branch's build overlaid intonode_modules/acp-kernel(the repo's documented overlay flow for pre-release kernel features); the acp-kernel pin and lockfile are deliberately untouched here. Until the kernel ships, typecheck/build and the P2 main-path tests on a bare checkout are expected red — the pin-bump commit follows the kernel release.requires acp-kernel(pending refold-in-place, ranxianglei/acp-kernel#398)