Skip to content

[PR] fix: cold load after provider switch recovers the session fold ledger across routes (#3399) - #3765

Merged
ranxianglei merged 2 commits into
masterfrom
2026-10-19_issue-3399-cross-route-ledger-load
Oct 19, 2026
Merged

ranxianglei merged 2 commits into
masterfrom
2026-10-19_issue-3399-cross-route-ledger-load

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Problem

A mid-conversation provider switch leaves the fold ledger under its OLD route filename (<protocol>/<oldHost>_<sha24>.json). After a daemon restart (or LRU eviction), the cold load for the same native conversation id probes only the NEW route → empty session (requests=0, blocks=0) → the client re-sends the full unfolded history → refold from scratch, or a local 413 at the doomed-probe gate when the core text exceeds max(2MB, limit*7.5). Production evidence in #3399: a 3697-request ledger orphaned under the old host while a degraded 2-request twin accumulated under the new one, then a 413 on the refold attempt.

Root cause

SessionStore.loadEnvelope's candidate filters require an exact (id, protocol, upstreamOrigin) filename match whenever the request carries protocol meta — but the host prefix is display metadata derived from the request origin, not identity (#280/#286 contract: the conversation id IS the identity). The old-host file therefore never matches; bounded boot fills diskFiles but never the kernel discovered map, so all four probe stages miss and the session comes back empty. In-memory keying is id-only, which is why LIVE switches work but cold loads do not. Full-mode users are protected by the R2 unified index (row keyed (agent, conv_id), #2960); the legacy/shadow file-walk modes (the default) were not.

Fix (src/persist.ts only)

  1. Namespaced candidate pool. When the request carries protocol meta, loadEnvelope first resolves every same-protocol file naming this id: the computed exact-route name (covers files created after boot) ∪ walked siblings sharing the id's sha suffix (.fb.json spills reconciled to their canonical copy by savedAt, kernel loadAll convention). Each candidate is re-verified for body id and protocol (cross-protocol isolation); corrupt members quarantine per [bug] 会话状态写入缺 fsync:内核崩溃后留下 size 正常但 VDL=0 的全零状态文件,loadSync 永久抛错 → 502 acp-proxy failure 且不自愈(含 7 处 tmp+rename 写路径盘点) #3157. Winner by fold progress: requests → nextBlockId (the staleDiskPayload clobber-guard discipline) → exact-route preference → savedAt. Never probe order or savedAt alone — a fresh-but-empty current-route twin loses to the richer old-route ledger, and a successfully continued branch is never rolled back by a stale one (arbitration per the revised plan A agreed in-thread).
  2. Route adoption. A session restored from an off-route file adopts the requesting upstream origin — getSession's fill-if-absent merge cannot override a stale-but-present one — so the next save converges under the live route instead of re-forking forever. Label/title stay put (identity, not route). The pool sets sourceFiles, so CCR sidecar resolution follows the restored source unchanged.

No-meta callers keep byte-identical probe behavior: the pool only engages with protocol meta, and on pool miss the original four probe stages run unchanged.

Behavior changes (disclosed)

Surface Old New Why
Cold load after route switch (legacy/shadow) empty session → full-history resend → refold or local 413 richer ledger restored; next save converges to the new route the fix itself
Two diverged twins both present requested-route twin served even when degraded fold-progress winner served prevents rollback of a continued branch and recovery of a lost one at once
Restored session meta stale origin kept until the next save re-forked under the old host adopts the requesting origin immediately otherwise restoration never converges
Logs — two info lines: [persist] restored … from another upstream route (…), [persist] adopted route … observability of the new path

No config surface added. No persistence format/version change. No kernel/ change. No wire/message-shape change.

Tests

  • New tests/issue3399-cross-route-load.test.ts — 11 legs: both-twin arbitration (richer-old wins; continued-branch wins), convergence (save lands under the requested route with full content), pure miss, same-route control, corrupt-sibling quarantine + degraded fallback ([bug] 会话状态写入缺 fsync:内核崩溃后留下 size 正常但 VDL=0 的全零状态文件,loadSync 永久抛错 → 502 acp-proxy failure 且不自愈(含 7 处 tmp+rename 写路径盘点) #3157), all-corrupt → honest null, counter tie → requested route, cross-protocol isolation, CCR sidecar follow, explicit legacy lane. 11/11 green.
  • Targeted suites green locally (storage/persist area): bounded-storage, bounded-storage-scale, multi-instance-persist, persist-guard-ownership, persist-rollback-guard, persist-stats-roundtrip, issue3157-persist-durability, storage-ccr, golden-storage-render, persist-tail, persist-encryption, persist-eperm, persist-active-pack, fix-401-storage, storage-unified, storage-replicas — 0 failures. npm run typecheck clean, npm run build OK. Full-suite verdict = CI on this head.

Related: #2671 defect-1 (write-side filename coupling — separate facet of the same disease), #2960 (root-disease roadmap; R2 index already protects full mode).

Closes #3399

@ranxianglei ranxianglei changed the title fix: cold load after provider switch recovers the session fold ledger across routes (#3399) [PR] fix: cold load after provider switch recovers the session fold ledger across routes (#3399) Oct 19, 2026
…ider switch (#3399)

A provider switch mid-conversation leaves the fold ledger under its old
route name (<protocol>/<oldHost>_<sha>.json); the cold load after restart
probed only the requested route, so the session came back empty
(requests=0, blocks=0) and the client re-sent the full unfolded history -
refolded from scratch or rejected with a local 413 at the doomed-probe gate.

- loadEnvelope resolves same-protocol namespaced files for a conversation id
  as ONE candidate pool when the request carries protocol meta: the computed
  exact-route name plus walked siblings sharing the id's sha suffix
  (.fb.json spills reconciled to their canonical copy by savedAt), each
  re-verified for body id and protocol (cross-protocol isolation), corrupt
  members quarantined per #3157. Winner by fold progress - requests, then
  nextBlockId (staleDiskPayload discipline), exact route on ties - never by
  probe order or savedAt, so a fresh-but-empty current-route twin loses to
  the richer old-route ledger and a successfully continued branch is never
  rolled back by a stale one.
- A session restored from an off-route file adopts the requesting upstream
  origin (getSession fill-if-absent cannot override a stale-but-present
  one), so the next save converges under the live route instead of
  re-forking. Label/title are identity and stay put; no-meta callers keep
  byte-identical probe behavior.

Tests: tests/issue3399-cross-route-load.test.ts (11 legs incl. both-twin
arbitration, convergence, no-rollback, pure miss, corrupt fail-closed,
tie-break, cross-protocol isolation, CCR sidecar, legacy lane).

Closes #3399
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

查重: 不重复。 检索了 open+closed 的 issue 和 PR(按失败机制匹配,不只标题):只有本 PR 触碰「冷启动跨路由恢复折叠账本」这个机制;#3399 是它的跟踪 issue(本 PR Closes);#2671 defect-1 是写侧文件名耦合的独立面,本 PR 已正确把范围限定在读侧;#2804(fetch 驱逐)、#3452(wire lane)无关。

进入完整 review。先报两个硬状态:

  1. 分支落后 master 277 个提交,且与 master 冲突(mergeStateStatus=dirty)。 master 在 v0.1.198 升级后老会话丢失压缩状态:197 折叠过的会话以 117 万 token 原文重放,预压缩超过客户端耐心,老会话看起来「炸了」 #3573 重写了冷加载诊断区(logColdLoad / savedTok / compression count),和本 PR 的落点撞在一起。冲突本身很小、纯机械——两处都是「同一位置各加一行」:master 加 logColdLoad(...),本 PR 加 adoptRequestedRoute(...),正确解法是两行都留。我会把分支 rebase 到当前 master、解掉这两处、本地过 typecheck+定向测试后 push,最终以 CI 为准。
  2. CI 还没在这个 head 上出结果(check runs 目前为空)。

代码方向先给初步判断:根因定位准确——loadEnvelope 的候选筛选在请求带 protocol meta 时要求 (id, protocol, upstreamOrigin) 精确文件名匹配,而 host 前缀只是从请求来源派生的展示元数据、不是身份(#280/#286);bounded boot 只填 diskFiles、不填 kernel discovered map,于是四个探测阶段全 miss,会话返回空态。修法(同协议候选池 + fold-progress 仲裁 + 路由采纳)读下来逻辑自洽。正在逐项核回归面和测试有效性,稍后给结构化八问结论。

@ranxianglei
ranxianglei force-pushed the 2026-10-19_issue-3399-cross-route-ledger-load branch from 5d139d1 to 7b825c8 Compare October 19, 2026 03:13
@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-19_issue-3399-cross-route-ledger-load (c92da53)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.4486-pr.3765.cb79e65

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Option B — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr3765.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

冲突已解决并推送。 PR #3765(head 分支 2026-10-19_issue-3399-cross-route-ledger-load)已 rebase 到当前 master(a8853feee)并 force-push。GitHub 侧 mergeable_state 已由 dirty → blocked,即冲突已清除,现在只是等必需的检查/评审(正常待合状态),不再是合并阻塞。

过程:master 自该 PR 分叉点(ce9bc90a3)起前进了 323 个提交;其中在 src/persist.ts 的 loadSync 里独立加了冷加载诊断调用 this.logColdLoad(...)(#3573 等),恰好落在本 PR 插入 this.adoptRequestedRoute(id, session, meta) 的同两个锚点上 → rebase 时产生两处文本冲突。按「取并集」解掉:两处都保留 master 的 logColdLoad(诊断日志)与本 PR 的 adoptRequestedRoute(跨路由账本恢复),顺序为 logColdLoad 在前、adoptRequestedRoute 在后(紧贴 return session 前,即 PR 原位置)。其余 hunk(loadEnvelope 候选池逻辑、新增 loadNamespacedPool / adoptRequestedRoute 两方法、新测试文件)均自动干净应用,未手工改动。diff 形态与原 PR 一致(2 files,+391/-3)。

验证:typecheck 全绿(kernel + pi-subagents 构建 + tsc --noEmit);定向测试 tests/issue3399-cross-route-load.test.ts(本 PR 11 腿)+ tests/issue3573-cold-load-diagnostics.test.ts(master 冷加载诊断)共 14/14 通过。全量回归交给 push 后的 CI 把关(本地不跑全量)。

结构化八问:

  1. 是什么问题:PR [PR] fix: cold load after provider switch recovers the session fold ledger across routes (#3399) #3765 与 base(master)冲突(dirty)、无法合并——不是代码缺陷,是分支落后 323 个提交后的文本冲突。
  2. 什么原因导致:master 在同一锚点加了 logColdLoad,本 PR 在同处加了 adoptRequestedRoute,rebase 时两边各占一行 → 冲突。
  3. 影响范围与严重程度:仅阻塞该 PR 自身合并;rebase 本身不改任何用户可见行为。属调度层面(PR 卡住),非产品缺陷。
  4. 怎么修复的:单提交 PR rebase 到最新 master,两处冲突取并集(两行都留),typecheck + 定向测试通过后 force-with-lease 推回 PR head。
  5. 是否有回归:解法不引入回归——logColdLoad 只读计数器(refs/blocks/compressions/savedAt),adoptRequestedRoute 只改 route meta 并可能 scheduleSave,二者无数据依赖,先后顺序不影响日志内容;并集完整保留两边既有行为。全量由 CI 兜底。
  6. 是否破坏缓存:不涉及——未触碰任何缓存/重试/增量游标/去重键逻辑。
  7. 是否改了设计方向:不涉及——纯 rebase,无架构/边界/数据流转向。
  8. 是否引入新配置:不涉及——无新增 env/config/默认值。

判定:冲突已清除,PR 恢复可合并状态(当前 blocked 仅等待必需检查),可交 CI + 人工合并。我不会自行合并(规则禁止 agent 合并 PR)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

PR #3765 review(#3399 跨路由冷加载折叠台账恢复)— 结论:代码可合;当前 CI 红与本次改动无关

先给判定:代码审查通过。根因修复、逻辑自洽、测试有牙、diff 收敛到两个文件(src/persist.ts + tests/issue3399-cross-route-load.test.ts)。当前 CI 红是 base 级问题,不是这个 PR 引入的。按八问答:

  1. 是什么问题:会话中途切换 provider 后,折叠台账仍写在旧路由文件名 <protocol>/<旧host>_<sha24>.json 下;daemon 重启或 LRU 淘汰后的冷加载只探测新路由,读不到台账 → 空会话(req=0/blocks=0)→ 客户端把整段未折叠历史重发 → 要么从零重折,要么在 doomed-probe 门槛(coreTextBytes > max(2MB, limit×7.5))本地 413。生产证据:旧 host 下 3697 请求的台账被孤儿化,新 host 下只剩 2 请求/91 block 的退化孪生,随后对 2,949,521 字节正文 413。

  2. 什么原因导致的:SessionStore.loadEnvelope(src/persist.ts)在请求带 protocol meta 时,候选过滤要求 (id, protocol, upstreamOrigin) 文件名精确匹配;但 host 前缀只是展示元数据、不是身份(Codex 长会话在 macOS 休眠唤醒后 Bili 未触发压缩,导致上下文窗口超限 #280/会话身份不稳定:credential/upstream 维度导致长会话状态孤儿化(sessions 缺失) #286)。有界 boot 填了 diskFiles 却没填 kernel discovered map,四个探测阶段全部落空。内存态按 id 单键,所以在线切换没事、冷加载就丢。全量模式被 R2 统一索引(Identity pipeline: key sessions by (agent, conversation id) in the unified store — decouple fold ledgers from protocol/host origin (#2938 / #2847 / #2671 defect-1) #2960)保护,legacy/shadow 文件走查(默认)没有——PR 正是修在这个根因层(读侧候选池),不是治标。

  3. 影响范围与严重程度:影响所有走 legacy/shadow 文件走查模式(默认)且会中途切 provider 的客户端;触发条件=「切 provider + 之后发生一次冷加载」。严重度 p1 级体验:不是完全不能用,而是折叠承诺失效+可能 413/从零重折,用户能感知上下文「重置」和成本回涨。全量模式用户不受影响。

  4. 怎么修复的:三处协同,都在读侧/加载侧,不动写侧根因(写侧孤儿归 Storage layer: four concrete defects (filename coupling, multi-writer heuristic, non-atomic content-store write, immortal compressed sessions) #2671):

  5. 是否有回归问题:逐项过既有行为——无 meta 调用方逐字节不变(回落原路径);同路由场景不变;纯 miss 仍 miss;损坏件 fail-closed(degraded/all-corrupt→null)保持;跨协议隔离;采纳每路由变更最多一次。高危模式(语义漂移 / fail-fast 变吞错 / 阈值·时序·输出格式漂移)均无。一处残留(非新引入):收敛后旧路由文件仍在盘上(压缩态→GC 免疫),属 Storage layer: four concrete defects (filename coupling, multi-writer heuristic, non-atomic content-store write, immortal compressed sessions) #2671 既有写侧孤儿面,不在本 PR 范围。一个小 nit(不拦):fallthrough 路径(pool-miss→legacy 探测命中 _unknown/跨协议文件)也会触发 adoptRequestedRoute,此时无 protocol 只采纳 origin 对命名近乎无害;可选加固是加 session.meta.protocol===meta.protocol 守卫,属理论边缘、非独立缺陷,不单独立项。

  6. 是否破坏缓存:不涉及缓存失效策略。CCR sidecar 安全已单独验证:readContentStoreRels(src/persist.ts:508)候选里含由 sourceFiles.get(id) 派生的 .content-store.json,pool 设置 sourceFiles 后即使 adopt 改了 meta,content-store 探针仍指向恢复出的旧路由 sidecar,无 CCR 丢失。pck 路由用 live 请求 origin(src/server/prepare-responses.ts:540),不受 adopt 影响。

  7. 是否改了设计方向:不改架构/边界/数据流。仍是「读侧把同 id 多路由候选纳入探测池 + 一次性采纳现行路由」;写侧身份模型、unified/legacy 双模、R2 索引都不动。

  8. 是否引入了新的配置:不涉及。无新 env/config/默认值。

CI 状态(诚实说明):head 7b825c800。所有 guard/静态门禁绿(kernel-guard、config-surface-guard、docs-sync、build-artifact、lane-guard、gate 系列等)。测试分片:ubuntu22/2 成功;失败分片全是与本 PR 不相交的子系统——ubuntu22/3 与 windows22/2 各挂同样 3 个 D on: 用例(steady-state anchor-rendered-once / prefix-byte-stable、identity-seed upgrade outbound-prefix-byte-identical、client-drops covered-region server-authoritative),位于 tests/snapshot-render.test.ts,该文件在我本地 master(6f2b113bd) 中不存在、是 base 上 snapshot-render(#3759)post-v0.1.201 才加入的;另有 ubuntu22/1 的 #3044 port-zone lane 用例。两者都与本 PR 只动 persist 冷加载无关。本 PR 自己的 #3399 用例没出现在任何已完成/失败分片里,跑在仍在运行的分片(ubuntu24/1 或 windows22/1),结果待定。建议:重跑失败分片,确认 snapshot-render 的 D-on 是 base 真回归还是 byte-stability 定时 flaky;若复现,这条红应单独跟踪(症状与机制都与 #3399 不同)。

判定:代码可合,无需返工。唯一挡路的是 red base(snapshot-render.test.ts D-on + #3044 zone),与 #3399 无关;base 转绿即可合入。待运行分片落地后我可再确认 #3399 用例结果。

@darkness-A

Copy link
Copy Markdown
Contributor

感谢这个修复方向。补充一个独立的 OpenCode + billion-context@0.1.199 / shadow 案例:参考本 PR 7b825c800198764b6b17c0c709535c07c8ea7048 做了固定版本局部回移,生产冷加载已恢复 156 块 / 85 活跃块,摘要、引用、shadow 视图和旧源 SHA256 通过复验。脱敏证据、完整本地方法/指纹应用器、合成回归源码及验证边界已补充在:

#3399 (comment)

建议合并前额外覆盖 source-side CCR 采纳,而不只测试块数恢复:

  • 当前 head 的 adoptRequestedRoute 改 session.meta.upstreamOrigin 后 scheduleSave;而 loadContentStore/readContentStoreRels 将当前 meta 路径排在 sourceFiles 前。若新路由有退化 twin 的有效但不完整 CCR,按这条源码顺序,它可能遮蔽胜出旧账本的原件。
  • 本地回移在修改 origin 前先加载胜出源侧原件,置 contentStoreDirty,沿官方原件优先保存链写到新路由,再写账本;不把两套 messageRefs 和原件拼接。
  • 源文件是 *.fb.json 时,应读取 canonical 的 *.content-store.json,而不是 *.fb.content-store.json。
  • 源侧原件缺失但新路由另有一份 CCR 时,本地选择 fail closed;不能静默把新路由原件当作胜出账本的原件。具体缺失场景是否应由 snapshot substrate 接管,可结合最新主干策略讨论。

本地新增并通过的合成腿:

  1. A:requests=20、完整 CCR;B:requests=1、有效但不完整 CCR。零预热 cold reader 选择 A 后采纳 B,原件仍等于 A;官方保存后 B 的 sidecar 等于 A,再 fresh reader 重载仍一致,shadow 同步,无 DIGEST DRIFT。
  2. 胜出 A 只有 spill 账本、原件在 canonical CCR;B 有退化 CCR。仍读 A 的 canonical 原件。
  3. A 的原件缺失、B 另有 CCR,拒绝自动采纳,避免静默混账。

这些是本地 0.1.199 局部回移的测试和源码顺序审阅,没有把它表述为整份本 PR 或最新 master 的端到端实测。最新主干 snapshot 方案尚未评估;也没有主动对真实目标会话发送模型请求,故“真实上游成功 / 413 已消失”仍未验证。无私有账本、对话、配置或真实 ID 上传。

…3765 review)

readContentStoreRels probed the request's current-route sidecar before the winning ledger's own content-store. adoptRequestedRoute rewrites session.meta.upstreamOrigin to the requesting route during loadSync, so that current-route path targeted a degraded twin whose valid-but-incomplete CCR shadowed the richer recovered ledger's originals (missing refs -> DIGEST DRIFT) on the legacy lane.

Probe the sourceFiles-derived CCR first so originals always follow the same file the fold ledger was loaded from; derive its canonical <base>.content-store.json name for .fb.json fallback sources (CCRs are never .fb-named).

Adds two regression legs (shadowing; .fb.json->canonical) to tests/issue3399-cross-route-load.test.ts; both fail on the pre-fix code. Pre-merge coverage from the #3765 review.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

@darkness-A 感谢这份源码顺序审阅。我独立在当前 rebase 后的 head(7b825c800,而非你的 0.1.199 回移)上逐条复核了断言。

已确认并修复(无决策依赖的部分)

  1. CCR 遮蔽胜出账本原件 —— 属实,已修。 链路:adoptRequestedRoute(src/persist.ts:1230)在 loadSync 里把 session.meta.upstreamOrigin 改写成请求路由,早于任何 CCR 加载;CCR 是懒加载的(store.ts:126 → readContentStoreRels,src/persist.ts:508),候选顺序原本是 [请求路由 CCR, _unknown, sourceFiles CCR, disk-walk]。改写后 rels[0] 指向新/退化路由的 sidecar——只要它存在且可解析(version/byHash/byRef 齐备、哪怕不完整),就先于胜出旧账本的 sourceFiles sidecar 命中,遮蔽原件 → 缺 ref → DIGEST DRIFT。默认 legacy 车道(snapshot rollout 0%,D 车道未放量)全中。
    修法:把胜出源(sourceFiles)的 CCR 提到最前探测,让原件始终跟随账本实际加载的那个文件。同一路由下 source CCR == meta CCR(Set 去重),行为不变;仅跨路由分歧时纠正。

  2. .fb.json 源应读 canonical CCR —— 属实,同一处修掉。 原 source.replace(/\.json$/, ".content-store.json") 对 .fb.json 源会推出并不存在的 *.fb.content-store.json;现归一化为 <base>.content-store.json(CCR 从不带 .fb 名)。

新增两条回归腿到 tests/issue3399-cross-route-load.test.ts(对应你给的腿 1、2):退化新路由 sidecar 不得遮蔽胜出原件;.fb.json 回落源解析 canonical CCR。已验证这两条在修复前代码上确实失败(pre-fix 跑:11 pass / 2 fail),非恒真测试。typecheck 绿、定向 13/13 通过。已作追加提交推上 PR 分支:c92da53cd(fast-forward,未 force)。

需 owner 拍板(有决策依赖的部分,暂未实现)

你给的腿 3 / 第 4 点:胜出源根本没有 CCR、但另一路由有一份时怎么办。reorder 后的现状是 fall-through 到另一路由的 CCR = 静默混账(A 的 ref 配 B 的原件)。这是数据丢失语义的产品决策,不是机械 bug,我不擅自定:

倾向 A/C,请 owner 定夺后再补腿 3 与实现。

结构化八问

  1. 是什么问题:跨路由冷加载恢复了正确的账本,却可能加载错误的原件库——退化新路由的不完整 CCR 遮蔽了胜出旧账本的完整 CCR。
  2. 什么原因导致:adoption 在懒加载 CCR 之前改写了 meta 路由,使 CCR 探测把(已被改写的)请求路由 sidecar 排在胜出源 sidecar 之前;叠加 .fb.json 源推出错误 CCR 名。
  3. 影响范围与严重程度:默认 legacy 车道;触发=会话中途换 provider + 重启/LRU 淘汰 + 新路由存在退化 twin 且自带(不完整)CCR。严重度:数据完整性受损(部分折叠 ref 缺原件 → 降级回放/DIGEST DRIFT/可能重折),非完全不可用(账本本身完好)。
  4. 怎么修复的:让原件跟随账本来源文件(胜出源 CCR 优先探测)+ .fb.json 归一到 canonical CCR 名;最小改动,不动其它行为。
  5. 是否有回归:单路由路径不变(source==meta,去重);跨路由改为正确取进度最大账本的 CCR。typecheck + 定向 13/13 绿,且证明两条新腿 pre-fix 必挂。无 wire/消息形态变更,CCR 文件格式不变;全量交 CI。
  6. 是否破坏缓存:不涉及——只改「选哪个已存在 sidecar 文件先读」,不触碰缓存/重试/游标/去重键。
  7. 是否改了设计方向:否——反而补回 adoption 意外破坏的既有不变量(Feature: content-addressed message store — ID-referenced tool results + acp_retrieve (built-in CCR) #1097/Identity pipeline: key sessions by (agent, conversation id) in the unified store — decouple fold ledgers from protocol/host origin (#2938 / #2847 / #2671 defect-1) #2960「CCR 随账本走」)。
  8. 是否引入新配置:否。

范围说明:单元级验证(定向测试);全量回归交 push 后 CI。与你一致的边界——我也未对真实上游会话发模型请求,「真实上游成功 / 413 消失」仍未实测;无私有账本/对话/配置/真实 ID 上传。

判定:核心遮蔽缺陷已在本 PR 内修复并加锁(腿 1/2);腿 3 的 fail-closed 语义作为决策项提请 owner 拍板。我不会自行合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

这个要看看新存储是否解决了这个问题?看起来是遗漏问题

@ranxianglei
ranxianglei merged commit 48d45e7 into master Oct 19, 2026
146 of 147 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.624-master.48d45e7 (rolling master tag).

npm install -g billion-context@0.0.624-master.48d45e7  # this exact build
npm install -g billion-context@master  # always the newest merged build

npm view billion-context@master prints the current version at any time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

2 participants