Repository navigation
test: add model-switch phase to the identity proof matrix (#2636) - #2692
Merged
Merged
Conversation
The #2480 proof matrix only proved same-shape churn (id prefix swap, tool-arg key reordering/whitespace): every synthetic assistant was pure text with no reasoning, every user message had no images. #2636 showed the real failure class is cross-model re-serialization that CHANGES the shape of the same content — reasoning moved from a structured field into inline text (pair of cores -> one merged core), images replaced by a placeholder line — and none of the existing passes could re-anchor it. Extend tests/identity-proof.test.ts with a model-switch phase on the chat wire: reasoning-bearing assistant turns (scratch-N-final markers) plus image-bearing user turns, then the history is replayed with the pi-style transformation (reasoning_content joined seamlessly into content, image parts replaced by the placeholder). Assertions: - positive: coverage survives the shape churn; the covered thinking and covered tool result never re-enter the wire; judged on the FIRST post-churn body — a fresh server-side compress may re-fold a failed replay, and the healed round-2 must never stand in for the retention proof (the old bodies[length-1] assertion was masking exactly that). - control (reconcile=off): the churn re-bills the unfolded history (round-1 carries scratch-2-final, 112041B vs 95219B unfolded ref) before a self-healed re-fold — scanned across all post-churn bodies. Docs: MESSAGE-IDENTITY(.zh-CN).md matrix section extended in sync.
Contributor
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.2902-pr.2692.6c0af8bThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2692.tgz
npm install -g packageInstall instructions are refreshed on each push. |
Owner
Author
[bot] 🏷 收到,开始处理这个 [PR] issue:定位对应 PR、核对代码与 CI 状态,按 review 规范给出八问结论。稍后更新。 |
Contributor
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.230-master.44d5ac9 # this exact build
npm install -g billion-context@master # always the newest merged build
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #2644 (fix, merged) — extends the identity proof matrix that #2480 introduced, per the post-mortem question "之前的证明形同虚设?" (no issue needed, per owner instruction in #2636).
Why the old proof missed #2636
tests/identity-proof.test.ts's churn operators only ever proved same-shape, new-shell churn: id prefix swap (alt_), tool-arg key reordering and whitespace jitter. Every synthetic assistant message was pure text (no reasoning), every user message text-only (no images). #2636's failure class is same-content, new-shape churn from cross-model re-serialization (pi'stransformMessages): reasoning moves from a structuredreasoning_contentfield into inline text (a pair of cores becomes one merged core, seamless""join), and images on text-only targets become a placeholder line. No existing pass could re-anchor that — 211/211 covered ids went unmatched in the live incident.What this adds
A model-switch phase on the chat wire: reasoning-bearing assistant turns (
scratch-{t}-finalmarkers) + image-bearing user turns, folded, then the history is replayed with the pi-style transformation (churnModelSwitch:reasoning_contentmerged intocontent,image_urlparts replaced by the placeholder). Pure shape churn — ids/params untouched.scratch-2-final, vs 95219B unfolded ref); the control scans all post-churn bodies because the healed round-2 alone looks clean.Proof-strength fix found on the way
The matrix previously judged
bodies[length-1]after the churn turn. That is exactly the body a fresh server-side compress re-folds: a broken reconcile can replay unfolded on round-1 and still show a folded last body. Both the positive phase and the new control now judge the first post-churn body (positive: true round-1 = 76516B, previously the healed round-2 = 53598B stood in for it).Evidence
node --import tsx --test tests/identity-proof.test.ts— 8/8 (4 wires + old control + cross-wire swap + new positive + new control)npm run typecheckclean,npm run buildokRefs #2636 (fix shipped in #2644).