Repository navigation
docs: MESSAGE-IDENTITY — content hashes as the cross-turn join key (#1496) - #1509
ranxianglei wants to merge 2 commits into
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.1448-pr.1509.b086b46This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr1509.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 收到。这是带 |
[bot] 🏷 Review of PR #1509 ( ① Issue direction (#1496)The doc settles #1496's real question correctly: the mNNNNN ref ledger already is a session-scoped never-reused auto-increment id (kernel contract, AGENTS.md §2), so the open question was never "where do ids come from" but "what re-pins the ledger onto the host's freshly re-serialized array at turn N+1?" Answering that with content bytes as the join key is the right layering — and the failure-mode asymmetry argument (position join fails → silent misattribution, cf. #1307; hash join fails → non-recognition, self-healing) is the decisive one. Direction: sound. ② Regression reviewDocs-only PR: ③ Claim verification (doc vs. code, checked against master)All code-level claims verified accurate:
One factual error found and fixed: both docs stated The PR is now two linear commits (docs + this labeled review fix); diff stays 4 files, no whitespace churn. ④ Tests / ⑤ Diff cleanlinessNo test surface touched; CI was fully green on the previous head (full matrix: ubuntu/windows test suites, all real-client e2e lanes, hermetic registry, version-guard) and re-runs on the new head — a markdown-only delta cannot affect it. Diff is clean: every line serves the PR's purpose. Note: the earlier sibling PR #1506 (same title, superseded) is referenced by Verdict: mergeable once CI goes green on head 中文摘要:审查了 MESSAGE-IDENTITY 文档 PR(#1509),逐条核对了文档中的代码级论断(全部属实),发现并直接在分支上修正了一处事实错误—— |
来自 #2375(修 #2374)review 的一条文档协同提示:该 PR 合入后,本 PR 里「be confined to bili's own |
[bot] 🏷 Conflict wake-up handled — verdict: superseded, nothing pushed (do not rescue). The system flagged PR #1509 dirty vs base. Verified via API: Root cause — the PR's content already landed on master as a revised edition. A rewritten version of this exact design record was committed straight to master between my review (master was then
Same document, same conclusion for #1496 (identity stays content-derived; the real question is the cross-turn join key) — but the master edition is tighter and its anchors match the post-#2092 in-repo-kernel reality better than the PR's. I also checked the one defect I'd fixed in the PR ( Why I did not rebase+push: replaying Recommendation: close PR #1509 without merging (superseded by the direct-to-master landing). Issue #1496 is already closed (2026-09-27T13:39Z). No other open PR races on these files. Close/merge stays yours. 七问:
收工判定:无需合并——建议直接关闭 PR #1509(superseded);我没有、也不应代劳关闭。 |
Closes #1506 · Closes #1496 (documentation direction)
What & why
Settles #1496's design-review question — can message identity be an explicit ingress-assigned auto-increment id instead of a content-derived hash? — as a dedicated architecture doc, the message-granularity sibling of SESSION-IDENTITY.md. Recorded conclusion: message identity stays content-derived; the question was really about the join key, not the id.
New files:
MESSAGE-IDENTITY.md— design record (EN)MESSAGE-IDENTITY.zh-CN.md— design record (ZH)Recorded points:
byRaw: hash → ref) is the per-turn join that re-pins the ledger onto the host's freshly re-serialized array — content bytes are the only key stable across the five surveyed hosts (codex, claude-code, pi, omp, hermes) × four lanes (anthropic chat, openai chat, responses, google).input[].idis provider-namespaced ([Bug] Responses ACP round 2 生成 66 字符 message id,导致 Codex 后续请求持续 400 #242: 66-char minted id > 64-char cap → Codex Desktop rollout replay → upstream 400 every turn; fix: scope Responses ingress id healing to Bili's msg-proxy namespace #1475: renamingrs_*/fc_*opaque ids → Copilot 400, reasoning id ↔ encrypted_content replay pairing; healing confined tomsg-proxy-*bysanitizeResponsesInputIds). Field present ≠ writable.remembered快照,长会话里 plugin 路径的compress全败(Requested range(s) cannot be anchored) #1307 side requests). Failure-mode asymmetry: position-join failure = misattribution (silent corruption — [bug] #388 的侧请求隔离只认「输出预算 ≤ 200」,1 条消息的审查请求冲掉remembered快照,长会话里 plugin 路径的compress全败(Requested range(s) cannot be anchored) #1307's 163/163, whose original ≤2 count guard was a pure positional heuristic); hash-join failure = non-recognition (self-healing perf loss).lastPassIdsecho discrimination; and the colliding message was a USER message — exactly the class that cannot carry a persistent ingress-assigned id.Plus one cross-reference line each in
README.md/README.zh-CN.md, next to the existing SESSION-IDENTITY pointer.Behavior changes
None — docs only.
Tests
None (docs only). No code touched — typecheck/test/build structurally unaffected (CI runs them regardless). Every code-level claim in the doc was verified against current master before writing:
session.state.messageRefs.byRawconsumers (src/server.ts, src/fork-adoption.ts, src/preflight.ts, src/decompress-shared.ts, src/image-compress.ts), drift detection (src/session.ts: foldCoverage / detectUnannouncedHistoryRewrite / REWRITE_MIN_INCOMING_TOTAL), tag-echo-filter header (#206/#673/#1039 invariant block), src/util.ts systemToUser, src/strict-echo.ts, src/loop/adapter-responses.ts sanitizeResponsesInputIds + RESPONSES_ITEM_ID_MAX=64, devlog/2026-08-25_responses-id-length (#242).Config surface
None.
Rebased onto current master (516f987). Single commit; diff = 4 files, +346/−0, every line related to this doc.