Repository navigation
fix(#459): stabilize fork-host live-tail refs - #466
Conversation
📦 Built Extension ArtifactBranch: Option A — Install from npm PR tag (recommended)pi install npm:billion-context-pi@pr-466Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pi-pr466.tgz
pi install ./packageThis comment is automatically updated on each push. |
[bot] 🏷 收到。正在拉取分支 |
be991f6 to
90147e1
Compare
[bot] 🏷 Review 完成,结论:可以合并(合并动作留给你)。 逐条核对(5/5 与代码一致)
本地验证(原 head be991f6)
我做了一个操作:rebase 到最新 master分支基于 457df15,落后 master 3 个提交(release v0.1.71 + #461/#462 proxy stand-down)。已在本地 rebase 并验证 patch 零漂移(range-diff 显示 非阻塞观察(记录在案,不要求改)
📌 中文摘要:修复了 fork host 下 live 尾部 ref 随宿主视图漂移导致 compress 死循环的问题(#459/#452 L1 根因),内容寻址 id + 尾锚定对齐 + merged 视图剪枝 + 工具/nudge 视图对齐四项加固均已逐条核对属实、本地全量验证通过;我已把分支 rebase 到最新 master(patch 零漂移,新 head 90147e1),CI 重跑中,可以合并。 |
|
继续 |
…fix alignment + orphan pruning + tool-view parity) - live-tail ids are now content-addressed (sha256-16 of message identity + duplicate rank) instead of array-index live-N: identical content keeps the same id across context fires while the host appends or evicts elsewhere. Rank uses the telescoping invariant seq(M)=count_P(X)+unmatched-X-before-M, so persisting tail messages never renumbers surviving duplicates. - findPositionalPrefixRun (sequence-match.ts): deterministic tail-anchored fallback when findUniqueLongestRun rejects an ambiguous match; persisted branches only grow at the tail, so tail alignment is unambiguous. - pruneOrphanRefs now also runs on the merged non-pi view, enforcing byRaw ⊆ current-view ids ∪ block ids (kills cross-generation stale refs). - Tool path now sees the same view as the context path: lastLiveBySession cache replays the last known live tail into stateFor() for tool calls on fork hosts (getBranch() lags the in-flight view; this asymmetry is why compress from nudge-cited refs always failed there). - FORK_HOST_WARNING_MESSAGE softened: hardening shipped, proxy still recommended for long sessions; admission log fields updated.
90147e1 to
dc923a8
Compare
Fixes #459
背景
#452「循环压缩」的 L1 根因:fork host(PI_ACP_FORK_HOST=1,无 buildContextEntries)路径上 live 尾部消息用数组下标
live-N当 id——宿主每轮 append/evict 都会让同一内容换 id,nudge 引用的 ref 下一轮就失效(does not exist in this session),compress 永远失败、emergency-inject 死循环。这正是 OMP 默认被拒的原因(src/index.ts 的 refusal 注释)。改动(4+1)
mergeLiveEntries):unmatched 尾部消息的 id =live-<sha256(identity + rank)[:16]>。identity 来自 messageIdentity(去时间戳/排序键/剥 ref 标签)。rank 用望远镜不变量seq(M) = count_P(X) + unmatched-X-before-M:尾部消息落盘时 U−1/P+1,存活重复项 rank 守恒 → 跨 fire 同内容同 id;新消息只追加在尾部,不影响前序 rank。findPositionalPrefixRun):findUniqueLongestRun因歧义拒绝时,按「persisted 只在尾部增长」的性质做尾锚定逐长度匹配,返回唯一确定解。行为变化:等长歧义 run(如 [e1,gap,e2] 对 live [e2])以前整段拒绝,现在对齐到最近一次出现——保持身份稳定,严格更优(integration.test.ts T2 已改名锁定该契约)。stateFor):merged 视图也跑pruneOrphanRefs,强制 byRaw ⊆ 当前视图 id ∪ block id,清掉 Cyclic compression | 循环压缩 #452 里跨代残留 ref(m00190.. vs m05395.. 并存那类)。lastLiveBySession):架构级发现——工具调用走stateFor(ctx)只看 getBranch()(滞后于 in-flight 视图),而 nudge 渲染的是 merged 视图。master 上 fork host 的 compress 结构性地解析不到 live 尾部 ref(本分支 A/B 探针验证)。现在 context fire 缓存最后已知 live 尾部,工具路径回放同一视图;pi host 与无缓存场景行为完全不变。验证
备注