Repository navigation
[PR] fix: wire the #2621 novelty gate on the anthropic and google dsh lanes - #2783
ranxianglei wants to merge 2 commits into
Conversation
…nes (#2775) #2658 shipped the dsh native-compaction detector on /v1/messages and generateContent but called carriesDshLocalCompactionSummary without the pre-turn ref map, although knownRefsBefore was already computed at both call sites — so only the carrier gate ran and any user-role plain-text message merely quoting the checkpoint framing (tag anywhere or preamble prefix), replayed byte-identical under ordinary fold drift, false-recorded a native-compaction conflict and wiped all live ACP state via resetSessionCompression (#2621's false-rebase profile, reborn on the two new wires). Pass knownRefsBefore at both call sites (same wiring + comment shape as the openai lane) so the framing match also demands novelty: a freshly-landed checkpoint is a NEW id, a quoted/replayed mention hits an OLD id. The contract comment in dsh-compaction-guard.ts ('every in-repo caller passes it') is true again. Tests: port the #2621 negative to both wires — a seeded user message quoting the framing, replayed byte-identical (old id) with a real fold gap (8/9 covered ids missing) must not rebase, must not record a native-compaction conflict, and the live fold must survive. Red without the wiring (6/8 pass, both negatives fail with a false rebase), green with it (8/8).
… a dsh native-compaction rebase (#2775) The #2658 port to the google wire shipped the detector without the dshRebased skip that openai/anthropic/responses carry around detectUnannouncedHistoryRewrite: when a genuine native compaction lands and the rebase has already recorded the 'native-compaction' conflict, the rewrite path could also record a second 'unannounced-rewrite' entry — presenting the substrate destruction as 'another compressor fighting you', the exact double-attribution the sibling lanes' guards exist to prevent. Capture reconcileNativeCompactionBoundary's return and skip the rewrite record when dshRebased, matching the sibling lanes; pin the no-double-record assertion on the google e2e positive in parity with the anthropic one.
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.3057-pr.2783.e07fc5bThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2783.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 Review complete — verdict: code is mergeable; CI currently blocked only by an unrelated Windows flake (evidence below). Failed jobs have been re-triggered via API; merge once they're green. Independent verification (not taken on faith)
Windows CI failure — unrelated to this PR (investigated, not assumed)Both Windows unit jobs fail on ONE test, identical on both runners: Duplicate handlingClosed PR #2775 as superseded (labeled Follow-up observations (left as comments per the source-chain rule — owner decides whether to file)
结构化八问
判定:代码可合并。 唯一阻塞是 Windows 单测 job 在一个与本 PR 无关的 #2771 storage 测试清理路径上撞 Windows 文件锁(flake 证据如上);失败 job 已触发重跑,转绿后即可合并。 |
[bot] 🏷 Follow-up: Windows rerun reproduced the failure — and I have a correction to make. Rerun result. The triggered rerun finished: both Ubuntu jobs green, both Windows jobs failed again on the exact same test — Correction to my previous reply. I stated the master baseline run (4387bcf) was "fully green including Windows" — that was wrong. Checking the runs: the master CI at 4387bcf (11:59Z) and at e7b94a2 (12:24Z, release-triggered) both had their Diagnosis (hypothesis, needs confirmation). All test assertions pass; only the cleanup dies. Implication. Until the #2771/#2772 storage proof battery is made Windows-stable, every full-matrix PR CI will stay red on Windows — this blocks merging any PR, #2783 included. Decision needed from you (per source-chain rules I don't file a new issue from this auto-triggered session):
中文小结:重跑确认 Windows 失败可复现(4/4),且是我上一条回复的基线判断有误——master 近期 CI 均跳过 test job,#2771 测试电池落地后从未在 Windows 上绿过;根因指向 |
|
最终用户侧独立复核(不看本 PR 的 diff,直接查已发布的 npm 0.1.194): 1)两条车道确实只跑了载体门。 从 0.1.194 的 function carriesDshLocalCompactionSummary(msgs,knownIds){ ... if(knownIds!==void 0&&typeof m2.id==="string"&&knownIds.has(m2.id))continue; ... }4 个调用点里只有 2 个传了集合(openai/responses 车道的 2)这个残余面在真实机器上已有可核对的历史伤害。 我这台 Windows 机器在 0.1.190 上曾因纯载体门误记一条 3)升级到含 #2628 的版本后,同类误报未再出现(本机 conflicts 台账至今仍是 (环境:Windows 11 中文版 10.0.26100,DSH 插件模式,bili 0.1.194;如需 0.1.194 的提取片段或 conflicts 台账原文可提供。) |
[bot] 🏷 Thanks for the independent cross-check — I verified each point against the published artifact and the source rather than taking it on trust: 1) Confirmed byte-for-byte. Pulled the actual 2) Log format confirmed; one precise nuance. The 3) Consistent with everything else. Matches the PR body, my source review, and now the shipped artifact. Your offered extracts aren't needed for review purposes — though if the owner wants the FP history documented alongside the tracking item, your conflicts ledger would be good evidence. Status unchanged: code verdict stands (mergeable); the outstanding decision is still the owner's — fix the unrelated #2771 storage-test Windows breakage first (it currently keeps every full-matrix PR CI red), or merge this PR with an explicit waiver of that red gate. 中文小结:已对 npm 上实际发布的 0.1.194 逐字节复核,三点全部成立;其历史误报属 #2628 已关闭的 assistant/tool 引用类,本 PR 收口的是正交的「user 纯文本逐字引用 + fold 漂移重放」残余面,定性准确。合并判定不变,仍等 owner 决定先修存储测试的 Windows 破坏或对本 PR 豁免红门。 |
Closes #2775
What
#2621added a novelty gate tocarriesDshLocalCompactionSummary(a freshly-landed checkpoint is a NEW id; a quoted/replayed mention hits an OLD id) and wired it on the openai and responses lanes.#2658then shipped the detector on the anthropic (src/server/prepare-anthropic.ts) and google (src/server/prepare-google.ts) lanes but called it without the second argument, althoughknownRefsBeforewas already computed at both call sites — so only carrier gate ① ran on these two wires, and any user-role plain-text message merely quoting the checkpoint framing, replayed byte-identical under ordinary fold drift, false-recorded anative-compactionconflict and wiped all live ACP state viaresetSessionCompression(#2621's false-rebase profile, reborn on the two new wires).Commits
fix: wire the #2621 novelty gate onto the anthropic and google dsh lanesknownRefsBeforeat both call sites (one line each, same wiring + comment shape as the openai lane).tests/issue2658-dsh-anthropic-google-compaction.test.ts: a seeded user message quoting the checkpoint framing, replayed byte-identical (old id) + a real fold gap (8/9 covered ids missing) must NOT rebase, must NOT record anative-compactionconflict, and the live fold must survive.dsh-compaction-guard.ts("every in-repo caller passes it") is true again.fix: stop the google lane double-recording unannounced-rewrite beside a dsh native-compaction rebase(found while auditing for commit 1)dshRebasedskip that openai/anthropic/responses carry arounddetectUnannouncedHistoryRewrite. CapturesreconcileNativeCompactionBoundary's return and skips the rewrite record when the rebase already classified the rewrite; pins the no-double-record assertion on the google e2e positive in parity with the anthropic one.Behavior changes (flagged per policy)
native-compaction, a secondunannounced-rewriteconflict entry can no longer be recorded (previously possible when the rewrite detector also fired — needs ≥20 known refs plus surviving blocks, i.e. mature sessions only). Semantics now identical to the three sibling lanes.Verification (targeted local runs; full suite left to CI)
nativeCompactionBoundaryset). Green with it: 8/8.issue2432-dsh-local-compaction11/11,issue2451-dsh-responses-compaction4/4,issue2709-dsh-native-compaction-attribution5/5,dsh-compaction-guard18/18,e2e-anthropic6/6.npm run typecheckclean.