Repository navigation
fix: bound CCR content-store envelope with byte cap + oldest-ref eviction (#1282) - #1288
ranxianglei wants to merge 2 commits into
Conversation
…tion (#1282) Since #1207 every compress fold persists covered originals into the session's .content-store.json on top of arrival-time oversized-result storing, so a heavy session's disk envelope approaches the full transcript and never shrinks while the session lives. Add a host-side per-session byte cap (kernel delegates retention downstream): compress.ccr.maxStoreBytes (absent=32MiB default, 0=unbounded, >0=cap bytes) enforced at both choke points (load + adoption-growth) with oldest-ref-first (mNNNNN ascending) dedup-aware eviction, per-ref [ccr] evict warn logs, honest retrieve misses for evicted refs, and acp_status surfacing of stored-of-cap utilization.
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)npm install -g billion-context@pr-1288Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pr1288.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 Review of PR #1288 complete (per [PR] protocol: verified, not redone). Verdict: mergeable — one small fix was found in review and committed directly to the PR branch ( ① Direction (original issue #1282) — checked against the issue: it documents that since #1207 every fold persists covered originals into ② Regression inventory (existing behaviors on touched paths, each judged):
③ Code review: ④ Test validity: the 7 new tests have teeth — real assertions on eviction counts/survivors/retrieve hit-vs-miss, dedup semantics, unbounded mode, the default constant, adopt-growth enforcement, plus a load-path e2e that persists an oversized file then reloads it under a tight cap and asserts both memory and file converge. No tautologies; each would catch its regression. ⑤ Diff cleanliness: 4 files, +244/−8, every line in scope; no lockfile/generated churn; single linear commit rebased onto current master (behind=0). CI was 9/9 green on Fix committed in review ( 一句话中文:修复了 CCR content-store 无上限增长、磁盘信封≈全量会话记录的问题(#1282)——新增 32 MiB 默认字节上限(可配,0=不限)+ 按最旧 ref 逐出并记日志;review 中另补了一个"重启后 storedBytes 统计过期导致显示超 100%"的顺手小修(已单独标注提交),本地 typecheck/全量测试/build 全绿,CI 绿后可合并。 |
Closing — the cap/eviction design was explicitly rejected by the owner (#1282, closed not_planned): lossless is an absolute commitment. "Not retrieved so far" is not "never needed"; evicting an unretrieved ref is delayed loss, which is the exact failure mode CCR exists to eliminate. The store is supposed to be as large as the conversation it serves, shares the session lifecycle (#1189 companion GC), and its growth is already observable via
acp_status(stored bytes / wire saved / retrieve rate). No byte cap, no eviction, ever.Opened after the #1282 closure landed — see the decision record there for the full rationale.