Skip to content

order-centric reconciliation: Pass 0 resync + tool-id twin claiming (#2915, #2821) - #2939

Merged
ranxianglei merged 6 commits into
masterfrom
2026-10-12_order-centric-reconcile
Oct 13, 2026
Merged

ranxianglei merged 6 commits into
masterfrom
2026-10-12_order-centric-reconcile

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

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:

  • head scan: first cell = changed preamble → canon[0] !== stored[0] → break at index 0
  • tail scan: first cell = appended user turn → break at j=1
  • byTool/byNorm: keys include the rewritten toolCallId → dead by design

→ 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)

  1. Pass 0 resync — a fingerprint mismatch is a gap, not a wall:
    • on mismatch, scan forward/backward for the next run of MIN_RESYNC_RUN (=3) consecutive same-index fingerprint agreements, then resume claiming from there
    • bounded by MAX_RESYNC_GAPS (=8) per scan; gap cells fall through honestly
    • observable: N order break(s) resynced appended to the drift log line
  2. Pass 1.5 — [Bug][Prime/Responses] provider switch rewrites composite tool IDs and reintroduces compressed history #2396 twins promoted from detection to claiming — re-minted toolCallIds with byte-identical normalized content (anchor.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.
  3. Escalation — "substrate destroyed" only counts gaps that survived resync AND the content passes; the 公告:release v0.1.193 修复dsh 切模型导致上下文暴涨问题,修复fork问题,修复claude codex dsh等自动压缩导致会话破坏问题 . 另外修复几十个bug. 我本地场景有限,未必都测全,麻烦大家小场景先测试下是否有问题.任何问题及时反馈. #2821 re-mint scenario now lands at unmatched=1 (the honestly-changed preamble), far below the threshold.
  4. Plan/result objects gain byTwin / resyncs counters; 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

Local: npm run typecheck clean; fold-reconcile suites 94/94 green (new suite 8/8). Full matrix on CI.

#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).
@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-12_order-centric-reconcile (d351816)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.3316-pr.2939.f453022

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-pr2939.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei ranxianglei added the p1 label Oct 12, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 收到,开始按 PR 审查规范审 #2939(对应 issue #2915,重放 #2821 事故)。

初始状态:单 commit(2d2080d6e),与 master 无 behind;4 文件 +379/-36(src/fold-reconcile.ts、新测试套件、tests/fold-reconcile.test.ts、AGENTS.md §2 设计决策 #11)。CI:static-gates/kernel-guard/version-guard/config-surface-guard 等全绿,test 矩阵(ubuntu/windows × 22/24)仍在跑。

正在做:① 原 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.
@ranxianglei

Copy link
Copy Markdown
Owner Author

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 (byPos: 0 vs 11, byTwin: undefined vs 3, escalate/reap assertions), only the never-claim control passes. Real teeth.

Logic correctness — checked and clean:

  • resync scans are monotonic and bounded (r > i, r ≥ j+1; ≤ MAX_RESYNC_GAPS per flank; at most one long forward scan per break) — no loops, no blowup;
  • duplicate-content mispairing under resync can only pair byte-identical fingerprints at the same index (role+toolName+text all hash factors) — harmless by the content doctrine, same property Pass 0 always had;
  • Pass 1.5 is safe against double-claims: candidates are pre-filtered (covered.has(id) → continue) and limited to the churn region [prefix, len−suffix), claimedCandidates guards across passes; k-th discipline + the 4x/256 length guard match Pass 2;
  • permanent shifts (insertion/deletion) do NOT resync (same-index fingerprints keep disagreeing) — flanks absorb, exactly as the insertion test asserts;
  • escalation math: resync/twin claims make totalDrift false on the first repair pass, and resetFoldDriftState at the !totalDrift branch clears a previously-latched foldDriftEscalated — recovery un-latches.

Proof gaps (none blocking, in priority order):

  1. The 公告:release v0.1.193 修复dsh 切模型导致上下文暴涨问题,修复fork问题,修复claude codex dsh等自动压缩导致会话破坏问题 . 另外修复几十个bug. 我本地场景有限,未必都测全,麻烦大家小场景先测试下是否有问题.任何问题及时反馈. #2821 incident is only replayed at unit level. The incident chain ended in pipeline terms: ~4MB raw out, doomed probe, preflight_compress_failed 502, folds dropped. A wire-level phase (dsh-shaped re-projection turn — every toolCallId re-minted + changed preamble + appended turn — through a real startServer) asserting fold coverage survives, no raw replay, no doomed-probe, would pin the conjunctive outcome the way identity-proof/cache-proof pin theirs. Unit-green ≠ incident closed (same lesson as the fix(sessions): wire-neutral affinity hashing for cross-protocol continuity (#2791) #2807/Inbound markers: one declarative strip engine for all four wires (#2789, #2798, #2811 plan B) #2815 review gaps).
  2. Pre-latched recovery is untested: a session that latched foldDriftEscalated=true under the old build, then upgrades and repairs — the clearing path (prevStreak !== 0 → resetFoldDriftState) deserves one case, since production sessions crossing this upgrade are exactly that shape.
  3. No explicit mid-list deletion case in the new suite (insertion + replacement-island are covered; deletion only via the older suites). Cheap to add given deletion is the compaction-adjacent direction.

One compatibility note (accept-level): Pass 1.5 requires anchor.m; anchors persisted before the #2396 era lack it and skip the twin pass — realistically empty set today, but worth one line in the header comment if you want it documented.

Happy to contribute the wire-level phase (1) as an additive commit if wanted.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 PR #2939 Review 结论

审查路径:①原 issue 方向 → ②既有行为回归清点 → ③代码逐行精读(含 resync 循环边界算术、OOB、最坏复杂度)→ ④测试有效性 → ⑤diff 整洁度。原 head 2d2080d6e 全矩阵 CI 绿;我补了一个 comment-only 小修(见下),最终 head 2322e022a 18/18 checks 全绿(ubuntu/windows × node 22/24 全部 test job + 全部 gates)。

结构化八问

  1. 是什么问题:dsh plugin-lane 会话中途切模型,re-projection 把每个 tool-call id 重新铸造(内容字节级不变),fold reconciliation 没有任何路径把覆盖重新锚定到改写后的 id——四个匹配维度同时失明(positional 扫描在第一个指纹 mismatch 处死亡,byTool/byNorm 恰好 key 在被改写的字段上)→ 数千 covered id 判 missing → 三个 drift pass 后判 "substrate destroyed" → 全部 fold 丢弃 → ~4MB raw → doomed-probe non-retryable 502,会话死亡(公告:release v0.1.193 修复dsh 切模型导致上下文暴涨问题,修复fork问题,修复claude codex dsh等自动压缩导致会话破坏问题 . 另外修复几十个bug. 我本地场景有限,未必都测全,麻烦大家小场景先测试下是否有问题.任何问题及时反馈. #2821 事故,fix(dsh): model switch drops all folds — fold-reconcile #2396 detect-only cannot re-anchor rewritten tool-call ids → doom-probe 502 session death #2915 根因分析)。

  2. 什么原因导致的:单一证据维度对邻居持有全局否决权。positional 扫描把「cell i 指纹不一致」当成「坐标系从此失效」(实际只有 cell i 变了);content 路径又把身份 key 在 host 恰好改写的字段上。顺序本身全程完好——只是没被用作载体。层次:表面=502 死亡;中间=mass missing + destroy verdict;根因=per-cell 证据与全局判决的耦合。

  3. 影响范围与严重程度:触发条件 = dsh plugin lane + 中途换模型 + 已有 folds + 历史规模足以触发 escalation(≥10 个非 reasoning unmatched × 连续 3 pass)。严重程度 = 永久、不可恢复的会话死亡(全部 fold 状态丢失,502 不可重试)。任何在 dsh 里对已压缩上下文中途切换模型的用户都会踩中。

  4. 怎么修复的:落实 owner rule「顺序为中心,hash 为辅助」。(a) Pass 0 把 mismatch 变成 gap 而非墙——在下一个 3 连 same-index 指纹一致 run 处 resync(每方向 ≤8 次),验证过的 span 继续 claim,gap cells 诚实落入 content passes;(b) [Bug][Prime/Responses] provider switch rewrites composite tool IDs and reintroduces compressed history #2396 detection-only twins 升级为 claiming pass(Pass 1.5):改写 toolCallId 下的精确 normalized-content 相等,k-th-to-k-th 顺序纪律 + length guard,rerun twins(内容不同)仍永不 claim——never-fuzzy 不变;(c) escalation 语义是涌现的:任何成功 recovery 都重置 drift streak,公告:release v0.1.193 修复dsh 切模型导致上下文暴涨问题,修复fork问题,修复claude codex dsh等自动压缩导致会话破坏问题 . 另外修复几十个bug. 我本地场景有限,未必都测全,麻烦大家小场景先测试下是否有问题.任何问题及时反馈. #2821 形状落在 unmatched=1(真正变化的 preamble),远低于阈值——没有改一个阈值常量。自愈:{ids, canon} 每 pass 保存,一次 churn pass 后 recovery 升级回 positional 路径。

  5. 是否有回归问题:未发现无意回归。既有行为逐项清点:steady-state early-return 路径未动(perf: 长会话每次请求重复计算并丢弃超上限的压缩锚点 #2334 zero-normalization 契约保持,metadata byte-stability 快照测试绿);编码旧 wall 语义的既有断言(fold-reconcile-positional.test.ts:mid-history edit / compaction+codec switch / upgrade mid-drift / legacy migration)逐个 trace,resync 语义下断言结果相同且 CI 绿;日志行变更是 additive-conditional(N order break(s) resynced / N by toolCallId twin 仅在 >0 时出现),regex 断言兼容;escalation/reap 阈值(PASSES=3、MIN_UNMATCHED=10、[Bug][proxy] unframed host-side history deletion leaves zombie fold blocks rendering carriers forever — one carrier flaps in/out every turn (persistent prefix-cache churn) #2695 majority-loss)未触碰;每个新 claim 都有 full normalized-content equality + length guard 门控,misattribution 纪律不变;result object 仅增 byTwin/resyncs(additive),全仓唯一 full-shape deepEqual 断言已同步更新,grep 确认无其他消费者。有意行为变更(披露):可恢复的 id-rewrite drift 不再累积 destroy streak / zombie reap streak——这正是修复目标。

  6. 是否破坏缓存:不破坏。prefix-cache 相关字节(head system、wire shape)未动;变更纯在 bili 内部 fold-state bookkeeping(metadata anchors/order/positions + block id lists)。FoldBlockCoverage p/r/t/e/z 语义不变——claimed ids 照旧计为 reclaimed(r),更多 id 被正确计为 reclaimed 而非 lost,ledger 条件 accrual 只会更准。

  7. 是否改了设计方向:是——有意将 owner rule 2026-10-12 固化为 AGENTS.md §2 design decision feat: self-update (auto + manual) #11(order-centric 教条:order=载体,content hash=per-cell 硬门,id=fast path,无单一维度持全局否决)。模块边界/管线位置/wire fidelity 不变;diff 不触碰 kernel/(kernel-guard 绿佐证)。

  8. 是否引入新配置:无。无新 env/config/CLI。MIN_RESYNC_RUN=3、MAX_RESYNC_GAPS=8 为模块内常量(不可配),符合 env-discipline policy。

测试有效性:新 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):2322e022a docs(fold-reconcile)——#2396 suspect-pass 注释仍写 "Both claim passes key on the toolCallId itself",Pass 1.5 落地后不再成立;改为说明该计数器现在报告的是幸存所有 claim pass 之后的 suspect(length-guard 拒绝、重复族耗尽、真实编辑)。comment-only,零行为变更,最终 head CI 全绿。

跟踪观察(非阻塞,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

ework-agent added 2 commits October 12, 2026 23:39
…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.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 Review gaps 处置

独立验证结果与我的审查结论一致——A/B teeth(7/8 red)与我此前的判断吻合:escalation describe 块在 master 上是先死在 byPos: 0 vs 11 断言上、还没执行到 escalate/reap 断言,所以整测红;"never-claim control"(rerun twin rejection)按设计在 master 也过。逻辑正确性各项(monotone bounded resync、double-claim 防护、permanent shift 不 resync 由 flanks 吸收、un-latch 路径)我也独立 trace 过,结论相同。

Gaps 2+3 + 兼容注记已落地(两个标注 commit,已推 PR 分支):

本地定向验证:三个 fold-reconcile suite 96/96 绿(原 94 + 新 2)。最终 head 0e83e4883,CI 运行中(tests/comments-only 变更)。

Gap 1(wire-level phase):要,请贡献。 这正是 unit-green ≠ incident-closed 的那一层:incident 链的末端是管线语义(~4MB raw out、doomed probe、preflight_compress_failed 502、folds dropped),unit suite 钉不住这个合取结果。建议断言:dsh 形 re-projection turn(全部 toolCallId re-mint + preamble 变化 + 追加 turn)携已有 folds 过真实 startServer → fold coverage 存活(block ids 骑新代 id)、无 raw replay、无 doomed-probe 502。放哪套 proof/e2e infra 你比我熟(cache-proof/identity-proof 那簇),additive commit 即可,不需要动本 PR 已有内容。若你这边排不上,我可以接手做。

CI 绿后我会补一条确认;在此之前判定维持:可合(gap 1 作为后续 additive commit 不阻塞合并——它加强证据,不改变行为)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 CI 确认:head 0e83e4883(含 cdba11eeb 两个新 test case + 0e83e4883 Pass 1.5 兼容注记)18/18 checks 全绿(ubuntu/windows × node 22/24 全部 test job + 全部 gates)。本地定向验证同为 96/96(三个 fold-reconcile suite)。

当前状态: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
@ranxianglei

Copy link
Copy Markdown
Owner Author

本轮新增(66a3371,叠在 ework 的三个补充 commit 之上,rebase 干净,101/101 绿 + typecheck 干净):

缺口修复

缺口分层裁决(owner 原则落地)

  • gap cell 三级:①任一精确通道 → 认领;②simhash 佐证 ≤8 bit(实测边界:改一词 ≈6-8 进,否定翻转 ≈11 / 删词 ≈13 / 键重排 ≈21 出);③order bracket——同一索引严格夹在已验证认领之间 → 断言槽位(owner 批准的 delete+insert 取舍:coverage 骑槽,不认旧字节);零佐证零围栏 = 诚实漂移。
  • FoldAnchor.sh(锚定期 simhash 草图,旧锚点无此字段自动降级)+ bySim/byOrder 计数全链路(计划/结果/DBG/两行 drift 日志)。
  • 顺手修了一个顺序 bug:unmatched 列表在 gap-resolution 之前冻结,新认领不反映——已把循环移到其后。

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.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 第三轮 review 结论(66a3371):一个阻塞发现,判定拦下 —— gap tiers 吞掉了真实用户编辑,打破既有 identity-proof 契约(CI 四平台全红)。本 commit 其余部分全部验证成立。

阻塞发现:simhash tier 误认领编辑过的 cell(MISATTRIBUTION)

修复建议(明确推荐,等你拍板):tier 块加一道事件级门——仅当 plan.byTwin > 0 时运行(Pass 1.5 在 tier 之前执行,决策点取值已定)。理由:新 id + 字节相同内容就是 re-projection 本身的签名,与会话规模无关。语料走查:#2821 no-copy 变体 byTwin=3 → 开 ✓;stored-copy 变体 byPos=11 接管、preamble 保持诚实 unmatched(该测试本就断言 unmatched=["pre"])✓;deletion / island / slot-claim / simhash-positive 全是全量 remint → byTwin>0 开,断言不变 ✓;latch-lifecycle 用 scramble 全改写 byTwin=0 → 关,行为等同 master(该测试断言升级发生,一致)✓;identity-proof 编辑 pass byTwin=0 → 关 → 诚实重入 ✓。备选项及否决理由:missing 数量下限(小会话切模型会丢恢复能力)、gapPairs≥2(可行但比 byTwin 间接)。诚实残余风险:用户编辑与大规模 re-projection 落在同一请求时,编辑会被吞(bounded,下一次 drift 自愈)——AGENTS.md 需补一句。无论哪个方向拍板,AGENTS.md #11 的文字都要与代码对齐。

本 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,贴边)——这也是应该用事件级门限住它作用面的理由之一。

顺手小修已推:d35181679 —— 删除 simhash 测试用例顶部 4 行过期注释(near-JSON/key-reorder ≈8 bits;代码实际测 prose sing→chirp ≈6 bits,下方注释已准确描述)。comment-only、零行为变化,该套件仍全绿。

八问:

  1. 是什么问题:新 gap tiers(simhash≤8 / order-bracket)认领 gap cell 时不区分事件类型,把用户对折叠消息的真实编辑当作"同一条消息的重渲染"认领了,coverage 骑槽、编辑永不重入 wire——打破 never-fuzzy 教条与既有 identity-proof 契约。
  2. 什么原因导致的:同索引 fingerprint break 的两个来源(host re-projection vs 用户编辑/再生)局部不可区分;tier 为前者设计,缺事件级判别器,越界到后者。
  3. 影响范围与严重程度:proxy-mode 会话中"用户编辑已折叠消息 且 编辑的 simhash 距离 ≤8 bits"(长消息上的短编辑,最常见形态)——编辑静默消失于 wire,模型持续看到旧文本摘要。数据完整性类(silent misattribution),非可用性故障;当前 CI 四平台红,不可合并。
  4. 怎么修复的:建议 tier 块以 plan.byTwin>0(re-projection 签名)为门,走查见上;最终由你拍板,拍板后我补测试验证。
  5. 是否有回归问题:除本发现外,既有行为未破坏——消费方全覆盖(coverage accrual / turn-sep / compaction-archive / receipt / breaker / [性能回归] 0.1.193 长会话本地耗时从 1.3s 升至 3.2s:无用 SimHash 计算与重复历史转换 #2824 sketch 计数 / fold-drift 家族)本地全绿;bracket 对 mid-history-edit 的语义翻转(honest unmatched → slot claim)在 byTwin>0 门下只在大规模 re-projection 可达,即你批准的取舍本身。
  6. 是否破坏缓存:否。sh 为增量可选锚点字段,positions/order/coverage 存储形状不变,result 对象新增 bySim/byOrder(内部计数器,唯一 deepEqual 已同步)。
  7. 是否改了设计方向:是,且正是要你拍板的点——"never fuzzy similarity" 从绝对禁令扩展为"re-projection 事件内允许模糊佐证";采纳门限方案后 AGENTS.md feat: self-update (auto + manual) #11 需补门条件与残余风险一句。
  8. 是否引入新配置:否(GAP_SIMHASH_MAX_HAMMING 为模块常量,非 env/config)。

判定:拦下 —— tier 门限定案(推荐 byTwin>0)+ CI 转绿后即可合。第二轮遗留项(wire-level startServer replay 测试)仍等你的贡献,不阻塞本项。

ranxianglei added a commit that referenced this pull request Oct 13, 2026
Verification stack: #2939 order-centric reconcile merged over the #2815 dev line (#2915 #2821)
@ranxianglei
ranxianglei merged commit 17178d6 into master Oct 13, 2026
14 of 18 checks passed
YunzhouLi-hub pushed a commit to YunzhouLi-hub/billion-context that referenced this pull request Oct 13, 2026
…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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(dsh): model switch drops all folds — fold-reconcile #2396 detect-only cannot re-anchor rewritten tool-call ids → doom-probe 502 session death

1 participant