Repository navigation
[PR] fix: reject corrupt positional affinity snapshot carriers - #6047
ranxianglei merged 4 commits into
Conversation
…anxianglei#6037) Same defect class as the sketches/userFilters fix in this PR: the old filter-based validation dropped a malformed middle slot and shifted every later fragment onto the wrong source message, so the append-continuation rung compared stored vs incoming fragments positionally out of sync (worst case: a true continuation misses and mints a fresh session id). Whole-carrier validation now matches the other two carriers; exact-hash resolution is untouched either way. Regression coverage: a corrupted middle tail fragment degrades the whole carrier while exact replay still reattaches via 'prefix'; a valid tailFrags list round-trips byte-identical. Both fail/pass correctly against the pre-fix code.
…ianglei#6037) The local lists hold the raw persisted slots BEFORE validation, so 'valid'/'validU' misnamed them. Renamed to slots/flags to match the frags naming in the tailFrags block. No behavior change.
(ai: vllm-qwen/qwen3.8-27b) Reviewed PR #6047 (closes #6037, external contributor). Verdict: mergeable — human merge. The fix is correct, minimal, and well-tested; I verified it end-to-end in an isolated checkout rather than trusting "should work." What I checked (evidence)
【结构化八问】
Additional finding (same mechanism, out of this issue's literal scope): Not auto-merge eligible: it touches anonymous session-resolution logic (human-gated per §7.4). Otherwise clean, single-file, pure |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.1141-master.9895b69 # this exact build
npm install -g billion-context@master # always the newest merged build
|
Problem
Filtering malformed middle slots from persisted sketch/role arrays shifts later similarity evidence onto the wrong message.
Changes
Validate positional carriers as a whole and discard malformed similarity evidence while keeping exact hashes.
Regression coverage
Invalid middle sketches, sparse array holes and role flags degrade their complete positional carrier; exact replay and valid round-trip remain intact.
Validation
Passed against exact fork commit
caf14bb702346eae823ede9b46d501952b3cca4din an isolated GitHub Actions checkout: validation job. The targeted regression and related suites,npm run typecheck, andnpm run buildall passed on Node 22. This is targeted verification, not the full upstream CI matrix.Related work
Original feature #2266; malformed carrier handling is the new case.
Closes #6037.