Repository navigation
fix: fork adoption carries the parent's CCR content-store entries (#1341) - #1349
ranxianglei wants to merge 1 commit into
Conversation
) applyForkAdoption seeded blocks + blockContents + messageRefs + token- Snapshot but not the content store — the forked session showed covered-ref spans (decompress/search worked off cloned views) while every acp_retrieve(adopted ref) missed: a half-adopted state that breaks v2's 'these refs are retrievable' promise. Adopt the parent's store entries for the plan's refs, copy-on-fork: - first write wins in the child (append-only store contract); - entries whose content blob is missing from the parent (corrupt envelope) are skipped — honest beats broken hits; - storedBytes follows contentStoreStats, contentStoreDirty set only when entries actually moved. Fixes #1341
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)npm install -g billion-context@pr-1349Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pr1349.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 Review of PR #1349 — verdict: superseded by #1361; closing this one. #1361 is ready for human merge. What I verified (pulled both heads onto current master
Findings on #1349 itself:
Duplicate situation (why I'm closing): two open PRs for one issue (#1341) trips the one-issue-one-PR loop guard, and these are the same root cause with overlapping code regions — merging both would conflict. #1361 implements exactly the agreed union seed (covered ∪ cited), adds restart-survival and parent-append-only tests, and strictly subsumes #1349's coverage. The one edge where #1349 differs — skipping payload-less entries outright instead of copying them — has no user-visible difference: kernel Actions:
中文摘要:#1349 机制正确但只种了「被采纳块覆盖的 ref」(part a),漏掉 #1341 定下的另一半(incoming 占位符消息引用的 ref),与后开的 #1361(完整并集、测试更全、代码区间包含前者)构成同一根因的重复 PR——已按重复规则关闭 #1349,#1361 本地+CI 全绿、回归审查无漂移,可交人工合并。 |
Fixes #1341
What & why
applyForkAdoption(src/fork-adoption.ts) seeded blocks +blockContents+messageRefs+ tokenSnapshot — but not the CCR content store. The forked session ended up half-adopted:decompressworked (cached views were cloned), covered-ref spans displayed correctly (v2 covered-ref surfacing), yet everyacp_retrieve(mNNNNN)on an adopted ref missed — breaking the implicit v2 promise that surfaced covered refs are retrievable.(The store is a separate per-session companion envelope,
*.content-store.json, lazily loaded — adoption simply never touched it.)Fix
In
applyForkAdoption: load the parent's store (contentStoreOf), and for every ref in the plan copy its entry + content blob into the child's store:byHash(corrupt envelope) are skipped, not copied as broken hits;stats.storedBytesfollowscontentStoreStats;contentStoreDirtyset only when entries actually moved (no-growth forks write nothing).No kernel change needed — the kernel store is pure data; this was purely the host adoption scope.
Complements #1340 (kernel, PR ranxianglei/acp-kernel#433): without both, the first fold after a fork stored placeholder bytes as originals (fake hits); with #1340 alone the refs would still miss (no entries); with this PR the real parent entries are present and retrievable.
Tests
tests/fork-adoption-content-store.test.ts(new, 3):Red on master (1 fail), green with fix. Existing
tests/fork-adoption.test.tse2e (2) unaffected.