Repository navigation
order-centric reconciliation: Pass 0 resync + tool-id twin claiming (#2915, #2821) - #2939
Conversation
#2821 replay: a mid-session model switch re-minted every tool-call id on re-projection (content byte-identical). Both Pass 0 flank scans died at their FIRST cell (changed preamble at the head, appended turn at the tail): byPos=0, 3289 covered ids missing, three drift passes -> "substrate destroyed" -> total unfold -> ~4MB raw out -> doomed-probe 502. The order was intact the whole time; only its evidence was id-gated. Owner rule (2026-10-12): 顺序为中心, hash 为辅助 — order is the carrier, content the per-cell gate, the id a fast path; no single dimension's miss may cascade into total unfold. - Pass 0 resync: a fingerprint mismatch is a gap, not a wall — scans resync at the next run of MIN_RESYNC_RUN consecutive same-index agreements (gaps bounded by MAX_RESYNC_GAPS) and keep claiming verified spans behind the break; order breaks are observable ("N order break(s) resynced" in the drift line). - Pass 1.5 (#2396 detection promoted to claiming): re-minted tool-call ids with byte-identical normalized content are claimed k-th-to-k-th with the byNorm length guard — the fallback when no stored positional copy exists. After one churn pass the self-saved {ids, canon} copy upgrades recovery back to the positional path. - Escalation semantics: "substrate destroyed" only counts gaps that survived resync AND the content passes. - unchanged: "never fuzzy similarity" — the hash stays a HARD per-cell gate (mis-attribution discipline); genuinely edited cells stay honestly unmatched and re-enter the wire. AGENTS.md §2 gains the order-centric principle as design decision #11. Tests: tests/issue2915-order-centric-reconcile.test.ts (2821 replay, mid-island resync, insertion offset, twin claiming incl. rerun-twin rejection + k-th families, three-generation escalation lifecycle).
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.3316-pr.2939.f453022This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2939.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 收到,开始按 PR 审查规范审 #2939(对应 issue #2915,重放 #2821 事故)。 初始状态:单 commit( 正在做:① 原 issue 方向核对 → ② 既有行为回归清点 → ③ fold-reconcile 逐段精读 → ④ 测试有效性 → ⑤ diff 整洁度。结论稍后按结构化八问给出。 |
…twin-claim pass Review supplement for #2939: the comment claimed 'both claim passes key on the toolCallId itself', which stopped being true once Pass 1.5 (#2915) promoted content-identical twins from detection to claiming. Reworded to state what the counter actually reports now: suspects that survived EVERY claim pass (length-guard rejects, exhausted duplicate families, real edits) — detection evidence only, never a repair target.
|
Proof-angle + logic review (independent verification in a clean worktree; nothing pushed) Verified green on this branch: issue2915 (8/8) + fold-reconcile + positional + issue2202 = 98/98; cross-invariant cluster cache-proof (incl. HOSTCOMPACT) + identity-proof = 24/24; cache-friendly-plugin + session-continuity + fork-adoption-wires + mode-upgrade + compaction-archive = 22/22; typecheck clean. A/B teeth: new suite on base master → 7/8 red ( Logic correctness — checked and clean:
Proof gaps (none blocking, in priority order):
One compatibility note (accept-level): Pass 1.5 requires Happy to contribute the wire-level phase (1) as an additive commit if wanted. |
[bot] 🏷 PR #2939 Review 结论 审查路径:①原 issue 方向 → ②既有行为回归清点 → ③代码逐行精读(含 resync 循环边界算术、OOB、最坏复杂度)→ ④测试有效性 → ⑤diff 整洁度。原 head 结构化八问
测试有效性:新 suite 有牙——plan 级断言在 master 上必然失败(byPos 0→11、byTwin undefined→3、unmatched 12→1);integration case 钉死「三次连续 re-mint → 无 destroy verdict、无 reap、coverage 骑在 g3 ids 上」的死循环闭合。一处诚实注记:escalation describe 块里「never escalates」单条断言在该 fixture 下 master 也能过(byte-stable prose 经 byNorm 保住多数,unmatched<10),但整个 suite 靠 unit 级断言在 master 失败,作为回归套件成立。insertion case 是对既有 flank 行为的守卫(master 亦过),与 PR body 定位一致,非虚报新功能。 顺手小修(独立标注 commit): 跟踪观察(非阻塞,owner 拍板):PR #2928 与本 PR 都写了 "Closes #2915",但覆盖该 issue 四项 checklist 里不同的机制(本 PR = defect 1–2 reconcile 机制;#2928 = defect 3 doomed-probe/preflight;defect 4 → #2399/#2469)。先合的那个会 auto-close #2915,可能让另一机制的工作失去跟踪 issue。建议:#2915 保持 open 直到两个 PR 都合入,或把 defect 3 拆出独立 issue。 判定:可合。 方向打到根因(非治标),misattribution 纪律与模块边界守住,测试钉住行为,CI 全绿。合并请人工操作:#2939 |
…2915 review gaps 2+3) Review feedback addressed with two additive cases in the #2915 suite: - pre-latched escalation: a session that latched foldDriftEscalated under an OLDER build (where re-mint churn could not recover) persists exactly that triple across the upgrade; the first recovered pass must clear latch + streak + since, or every LATER episode stays silently latched (#2297 contract). Production sessions crossing this upgrade are exactly this shape. - mid-list deletion: net-negative offset absorbed by the dual flanks, the deleted cell is the only honest loss, the cell after the gap re-anchors past it (insertion was covered; deletion was only exercised via the older suites — it is the compaction-adjacent direction).
Review feedback (accept-level compatibility note): Pass 1.5 requires anchor.m; anchors persisted before the #2396 era lack it and skip the twin pass. Realistically an empty set today (backfilled while present verbatim), but documented now so the skip reads as intentional, not accidental.
[bot] 🏷 Review gaps 处置 独立验证结果与我的审查结论一致——A/B teeth(7/8 red)与我此前的判断吻合:escalation describe 块在 master 上是先死在 Gaps 2+3 + 兼容注记已落地(两个标注 commit,已推 PR 分支):
本地定向验证:三个 fold-reconcile suite 96/96 绿(原 94 + 新 2)。最终 head Gap 1(wire-level phase):要,请贡献。 这正是 unit-green ≠ incident-closed 的那一层:incident 链的末端是管线语义(~4MB raw out、doomed probe、 CI 绿后我会补一条确认;在此之前判定维持:可合(gap 1 作为后续 additive commit 不阻塞合并——它加强证据,不改变行为)。 |
[bot] 🏷 CI 确认:head 当前状态:PR 分支 4 commits(原 1 + review 补充 3),判定维持可合;gap 1(wire-level #2821 replay phase)等你或我后续 additive commit,不阻塞合并。合并请人工操作:#2939 |
Owner rule 2026-10-12 — tiered fallback for Pass-0 gap cells: any exact channel → simhash corroboration (≤8 bits, measured margins) → order bracket (same index strictly between VERIFIED claims asserts the SLOT — owner-sanctioned delete+insert tradeoff); deletion stays honest loss (flanks absorb the shift, no bracket claim for the deleted id); zero corroboration stays honest drift. - FoldAnchor.sh simhash sketch (absent on pre-field anchors → graceful) - bySim/byOrder counters plumbed through plan/result/DBG/drift logs - gapPairs + claimedIdx recorded by the Pass-0 scans - unmatched loop moved AFTER gap resolution (ordering bug: claims were computed after unmatched had already frozen) - review gap ②: latch-recovery test — 3 total-loss passes latch once (#2297 single error line), healthy resend clears the latch, escalation reaps the substrate (#2695), lane continues clean - review gap ③: mid-column deletion test — flanks absorb, honest loss - simhash-tier unit: one-word re-render of a long line corroborates; negation/drop/reorder measured OUTSIDE the gate - AGENTS.md #11: gap-resolution tiering appended Closes review items on #2939; refs #2821
|
本轮新增(66a3371,叠在 ework 的三个补充 commit 之上,rebase 干净,101/101 绿 + typecheck 干净): 缺口修复
缺口分层裁决(owner 原则落地)
AGENTS.md #11 已补 gap-resolution 段落。 |
…view) The comment described a near-JSON key-reorder payload (measured ~8 bits) that this case no longer uses; the code tests a prose sentence with one word varied (~6 bits), which the following comment block already states. Comment-only fix, no behavior change.
[bot] 🏷 第三轮 review 结论(66a3371):一个阻塞发现,判定拦下 —— gap tiers 吞掉了真实用户编辑,打破既有 identity-proof 契约(CI 四平台全红)。本 commit 其余部分全部验证成立。 阻塞发现:simhash tier 误认领编辑过的 cell(MISATTRIBUTION)
修复建议(明确推荐,等你拍板):tier 块加一道事件级门——仅当 本 commit 其余部分验证成立:②③ 测试有牙(latch 生命周期覆盖置位一次/reap/clean slate;删除用例断言槽位被尾翼消费、不给 bracket);sh 不回填 = 文档化的 graceful degrade;bySim/byOrder 全链路贯通、日志行纯增量(零计数不改变既有断言);缓存/持久化无影响(sh 为增量可选字段);无新配置面(GAP_SIMHASH_MAX_HAMMING 是模块常量);typecheck 干净;本地 101/101 + 消费方套件绿。simhash 边界我用仓库自己的 simhashHex+canonicalTextOf probe 过:reorder/edit 5–8 内、否定翻转 11 / rerun 21–34 / JSON-vs-prose 30 出——门限分类正确但余量薄且载荷相关(你测的删词 ≈13 在我的载荷上测得 7,贴边)——这也是应该用事件级门限住它作用面的理由之一。 顺手小修已推: 八问:
判定:拦下 —— tier 门限定案(推荐 byTwin>0)+ CI 转绿后即可合。第二轮遗留项(wire-level startServer replay 测试)仍等你的贡献,不阻塞本项。 |
…anxianglei#2944) Skeleton = neutralTurns(messages).map(kind) — the ranxianglei#2791 projection that ranxianglei#2939 already runs on, instead of a third raw-field classifier: - content-blind by construction (kind sequence only) - google parts / responses function_call first-class - leading system run, client marker turns, image placeholders stripped by the projection — host machinery cannot misalign the skeleton - consecutive-assistant merge + multi-block tool_result split keep renderers that disagree on packing aligned Claim rules per the ranxianglei#2944 owner rule: unambiguous id + main shape + head-or-tail order match → raw (claim/continue/reanchor); shallow blob → |sub:aux (ranxianglei#1916 race structurally dead); deep stranger → |sub:task; failing-provenance ids stay on the anonymous ladder. id provenance table documented in the module docstring (anthropic/openai header, responses header|session_id|metadata.session_id, google header; content-fingerprint ids never qualify). Parallel implementation: persona-anchor.ts untouched, server not switched. Differential corpus pins the old ladder first (S1-S6), then the same scenarios through the new resolver with old→new rows, plus P6 (one conversation, four wires, one skeleton — impossible for the raw-field draft) and P7 (system add/remove + marker injection leave the skeleton unchanged).
What
Closes #2915 (replays the #2821 incident).
Order-centric fold reconciliation — owner rule 2026-10-12: 顺序为中心,hash 为辅助. Order is the carrier of message identity across resent histories; content hashes are per-cell verification; tool-call ids are a fast path. No single dimension's miss may cascade into total unfold.
The #2821 failure chain (why this PR exists)
Mid-session model switch on dsh → re-projection re-minted every tool-call id (content byte-identical, ids different). Old Pass 0:
canon[0] !== stored[0]→ break at index 0→ byPos=0,
3289 covered id(s) missing, three drift passes →compression substrate appears destroyed→ ALL folds dropped → ~4MB raw out → doomed-probe 502 (preflight_compress_failed). The order was intact the whole time; only its evidence was id-gated.Changes (
src/fold-reconcile.ts)MIN_RESYNC_RUN(=3) consecutive same-index fingerprint agreements, then resume claiming from thereMAX_RESYNC_GAPS(=8) per scan; gap cells fall through honestlyN order break(s) resyncedappended to the drift log lineanchor.m,normalizedIdentityNoToolCallId) are claimed k-th to k-th with the byNorm length guard (Math.max(256, b>>2)); runs after byTool, before byNorm. Rerun twins (different content) are still NEVER claimed — "never fuzzy similarity" unchanged.byTwin/resyncscounters; header doc updated; AGENTS.md §2 gains the order-centric principle as design decision feat: self-update (auto + manual) #11.Self-healing property: after one churn pass without a stored copy, the self-saved
{ids, canon}positional copy upgrades recovery back to the positional path (tested).Tests
tests/issue2915-order-centric-reconcile.test.ts(new, 8 cases):tests/fold-reconcile.test.ts[Bug][Prime/Responses] provider switch rewrites composite tool IDs and reintroduces compressed history #2396 section updated (detection → claiming)Local:
npm run typecheckclean; fold-reconcile suites 94/94 green (new suite 8/8). Full matrix on CI.