Repository navigation
fix(affinity): append-continuation rung + hv2 ladder preference (#2807 regressions) - #2812
Merged
Merged
Conversation
Contributor
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.3113-pr.2812.72cae7cThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2812.tgz
npm install -g packageInstall instructions are refreshed on each push. |
ranxianglei
force-pushed
the
fix/2807-append-continuation
branch
from
October 11, 2026 15:25
5a942e8 to
2853ae5
Compare
…regressions) #2807 made the anonymous/identified identity chains hash the wire-NEUTRAL projection. That exposed three regressions (all three failing legs on the v0.1.193 release PR #2767): 1. The neutral projection MERGES a run of consecutive same-role messages into one turn (required for cross-wire equality — the anthropic render joins the run). A client that APPENDS another assistant message after an assistant tail (agent harnesses replaying model replies, fork follow-ups) re-renders the stored tail turn, so its item hash changes and the exact ladder fails by ONE item → fresh pfa-* mint → the fold ledger and the usage anchor are orphaned (spurious fork-of-fork children in fork-adoption-wires, 58701-vs-5000 sizing in issue2033-anonymous-anchor). Fix: per-source-message tail FRAGMENTS (fragmentHash) are now carried on every NeutralTurn, persisted on the chain (ChainEntry.tailFrags, snapshot round-trip included) and forwarded through note() from all resolve() paths. New rung 1.4 (append-continuation): a stored hv2 chain whose first K-1 items are byte-equal AND whose stored tail fragments are a strict PREFIX of the incoming turn-at-K-1 fragments is the same conversation extended in place → match instead of mint. 2. The v1 (pre-#2791 raw-wire) fallback rung could OUT-VOTE a matching hv2 chain by raw depth (raw counts MESSAGES, neutral counts TURNS — 16 vs 13 for the same history) and steal the request to a stale pre-upgrade duplicate session. Any user upgrading 0.1.192 → 0.1.193 hits this seam on their first post-upgrade request. Fix: within the ladder, hv2 candidates now take precedence over hv1; hv1 still resolves untouched when no neutral chain matches (legacy bridge). 3. Image placeholder text blocks were joined with "" into the neutral text, so the USER_IMAGE_PLACEHOLDER line filter could not strip them (issue2601 filter-branch replay). Placeholder blocks/parts are now dropped during neutral-text collection. Local: full targeted affinity sweep (27 suites) green; failing trio green.
ranxianglei
force-pushed
the
fix/2807-append-continuation
branch
from
October 11, 2026 15:26
2853ae5 to
1b7e380
Compare
Contributor
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.288-master.9fb9164 # 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.
What
Fixes the three test regressions introduced by #2807 (surfaced on the v0.1.193 release PR #2767 CI):
fork-adoption-wiresdisabled-adoption asserttailFrags) persisted on the chain; stored frags strict-prefix of incoming turn-at-K-1 frags + byte-equal first K-1 items ⇒ same conversation extended in place, match instead of mintissue2033-anonymous-anchor58701 !== 5000issue2601placeholder filter branch""defeat theUSER_IMAGE_PLACEHOLDERline filterhv2 ladder preference (upgrade seam, affects real users)
The v1 (pre-#2791 raw-wire) fallback rung could out-vote a matching hv2 chain by raw depth — but raw counts messages while neutral counts turns (16 vs 13 for the same history), so a stale pre-upgrade duplicate chain stole the request away from the live neutral session holding the fold ledger and usage anchor. Any 0.1.192 → 0.1.193 user hits this on their first post-upgrade request. Now hv2 candidates take precedence; hv1 still resolves untouched when no neutral chain matches (legacy bridge unchanged).
Verified locally
issue2033-anonymous-anchor✓issue2601-persona-fork-lineage✓fork-adoption-wires✓prefix-affinity,prefix-affinity-simhash,prefix-affinity-orphan,e2e-session-identity,affinity-crosswire-fold,conflict-remediation)tsc --noEmitcleanFull local suite running in parallel; CI is authoritative.