Repository navigation
[PR] EN | Make ref-ledger generation resets observable at the moment they happen | 代际重置不可观测:执行尾巴被无声吞掉 - #5546
ranxianglei wants to merge 4 commits into
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.10097-pr.5546.49aefbcThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr5546.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。 本 PR 是 #5542(代际重置不可观测)的修复 PR。独立扫了全部 open PR:唯一触碰 generationBoundary 播种路径的就是本 PR;#5497 改同一文件但机制不同(它给 标签: Review 进行中。diff 已逐段读完(6 文件 +285/-10,kernel/ 未动,base = master tip 新鲜),初步发现两处需要处理,随后按八问体例给完整结论:
两处置修都会作为独立标注 commit 推到 PR 分支,然后等 CI。 |
da2c23d to
8425591
Compare
(ai: vllm-qwen/qwen3.8-27b) Review 结论(结构化八问)— 已在 PR 分支补两个修复 commit,rebase 到最新 master,CI 基本全绿1. 是什么问题:ref 账本代际重置(原生压缩 rebase、persona fork 换新会话键)发生时完全不可观测——standing note 只在模型事后引用 ≥2 个死 ref 时才出现,tail-cut 型重置永远不出现;结果模型持续引用旧代 ref,跨边界指令的「执行尾巴」被无声吞掉(#5542 三次事故同签名),bili.log 无标记可查。 2. 什么原因导致的:边界记录只有「残留检测」一个写入者,且检测依赖可见历史里出现死 ref 引用——执行段被整段裁掉时引用根本不会出现在可见历史里,检测条件结构性不可达;重置发生的那一刻没有任何代码记录它。 3. 影响范围与严重程度:所有走插件车道且发生代际重置的会话(dsh 原生压缩 rebase、persona fork 两类触发面)。严重度 p1 级数据可用性问题:不是崩溃,而是「报告说完成、实际没执行」这类静默工作丢失,用户不问就发现不了。 4. 怎么修复的:在两个重置发生点当场播种既有的 one-shot 边界记录(first-wins,残留检测逻辑原封不动且仍优先)——rebase 点带 pre-rebase frontier,fork 点双重门控(fork 自身无账本 + raw 会话已铸过 ref,守住 #2156 空 sidecar 情形);standing note 补一句「边界前的完成报告未经验证,先查磁盘/git 再报完成」;acp_status 新增展示段;decompress 找不到块时若存在边界记录则明确告知「属于上一代、永久失效、别重试变体」。方向审核:johnhorse 在 #5542 提的三个诉求(重置时刻留痕、补偿性提示、decompress 回执区分被丢弃代际)逐条对应,打的是根因(重置时刻无人记录),不是症状。 5. 是否有回归问题:逐项审过既有行为——残留检测路径未动(first-wins 保证晚到的 witness 不覆盖检测记录);decompress 无边界时输出逐字节不变(有测试钉住);metadata 字段纯增量,旧记录原样通过校验;acp_status 行是纯增量且 try/catch 包裹;standing note 每请求从常量重算(prepare-openai/inject/relay 等五处消费点核实),作者披露的「跨过边界的会话下一请求看到加长文本」一次性字节变化属实、属 #4305 同类缓存断裂、可接受。审核中发现两处真问题,已直接在 PR 分支修掉(两个独立标注 commit):
6. 是否破坏缓存:唯一的前缀缓存影响就是上面第 5 条披露的那类一次性断裂(重置当轮 system 块加一段 note),对 fork 会话是其第一轮(无前缀可破)、对 rebase 会话压缩本身已破缓存;其余路径出站字节不变(decompress/acp_status/metadata 均非出站线)。 7. 是否改了设计方向:没有。复用 #4305/#4308 已有的 one-shot 边界记录与 standing-note 机制,只增加了一个更早的写入者(见证播种)和展示面;kernel/ 未动。 8. 是否引入了新的配置:没有。无新 env/config/默认值;metadata 新增可选字段 reason/detail 属内部记录格式增量。 验证状态:本地定向套件全绿(issue5542 观测 9 + generation-boundary 10 + issue2592-rebase-floor 6 + acp-status/decompress-empty-range/dsh-persona-fingerprint/proxy-decompress-cache 共 34,typecheck 干净)。说明:cache-friendly-plugin 全套在本沙箱跑不起来(干净 master 同样 11 个子测试死于 t1 的环境性失败,与作者披露的 cache-proof 沙箱红同族),该文件的判定以远程 CI 为准。分支已 rebase 到当前 master(v0.1.212 之后,零冲突;master 随后并入的 #5528 与本 diff 零文件重叠)。CI(rebased head 8425591):30 项检查 29 项绿/跳过、0 失败,含此前全红的三个分片;仅剩 判定:可合(等最后一个无关分片跑完即全绿;合并由人操作)。 |
(ai: vllm-qwen/qwen3.8-27b) CI 全绿确认:rebased head |
|
Data point for this PR: I hit exactly the case it targets, on 0.1.212 (dist build The reset was not observable at the moment it happened — nothing set
So the failure is silent and persistent: 20 consecutive An assertion this PR could carry: after ingest of a stream whose refs restart below the persisted high-water mark, either Mechanism and recovery trace: #6061. Digest-drift instance: #5589. |
(ai: vllm-qwen/qwen3.8-27b) Thanks for the concrete data point — the store numbers make the split state unambiguous (live ledger at m00314 vs store refs 134828..159141, 586 blocks, no One important coverage clarification: your variant is upstream of what this PR observes, so this PR does not cover it. This PR's two witness sites fire only on the known reset paths: (1) inside On your proposed assertion, on the merits: it's a good canary. "acp_status's highest allocated ref and compress's session highest ref disagree" is the split state in one line, and it would have flagged your session at the first compress attempt instead of after 20 failures. It belongs with the threads you cite — #6061 (open, "Compression nudges reference a different ledger than compress tool") is exactly this divergence family, and #5589 is a same-version (0.1.212) instance — rather than with this PR, which stays scoped to reset-moment observability. If #6061 is the mechanism tracker, that's where this assertion should land; I'm flagging it here in-thread rather than opening anything new. Status of the PR itself: review is complete — CI is 30/30 green on rebased head |
…happen Witness the reset instead of waiting for residue: seed the existing generationBoundary record at rebase/fork time (first-wins, detection unchanged), extend the standing note with an execution-tail verification clause, render the boundary in acp_status, enrich the decompress not-found receipt for inert previous-generation ids, and log a grep-able [acp-gen-reset] marker. Host-side only; kernel/ untouched. Closes #5542
The test file and code comments referenced the e-work mirror number (5543), which on GitHub is the closed v0.1.212 release PR. The actual issue is #5542 (generation reset invisible / swallowed execution tails) — the same thread the commit message already closes. Rename the test file and fix all in-code references so grep/Closes stay consistent.
…t-moment boundary note (#5542) The dsh native-compaction rebase subtest pinned 'system layer bytes stable across all turns' unconditionally. The witnessed rebase now seeds the generation-boundary record during the rebase turn itself (#5542), so the standing note appends to the system block exactly once at that turn — the intentional, disclosed behavior change of this PR. CI failed all four wires on exactly that assertion. Update assertTagPolicy: era-B turns compare against the eraBreak turn instead of turn 0, and the eraBreak turn's system-layer delta over the pre-rebase text must be EXACTLY the generation-boundary note (the three per-wire join shapes), then byte-stable again. canon() gains sysText (plain concatenated system text per wire) so the delta can be checked in text space. All other call sites (no eraBreak) are unchanged.
8425591 to
89bae40
Compare
The assert message 'non-fresh fork was already witnessed on birth' described the wrong mechanism: no witness fired for fork3 (readGenerationBoundary is undefined) — the witness is rejected by the fresh gate because the fork already holds refs. Reword to name the actual gate.
|
(ai: vllm-qwen/qwen3.8-27b) — 注:本 PR 作者即当前 token 身份,GitHub 禁止自评 APPROVE,故以评论形式给出审核结论(判定同 APPROVE)。 Review: APPROVEMakes ref-ledger generation resets observable at the moment they happen (issue #5542). Reviewed the full diff (7 files, +322/−19, host-side only, Correctness
Tests — new 9-test file covers witness semantics (first-wins, log line, frontier carry), fork gating (fresh+ref-minting raw / empty raw / non-fresh fork), rebase frontier carry, acp_status render/fallback/absence, decompress enrichment + byte-stability, and the note clause. CI — green on the pushed head (13 success, 14 skipped, 0 failed; a few shards still in-progress at review time). Behavior changes (all disclosed old→new in the body): standing-note activation now also at the exact reset moment (one-time system-block append, same prefix-cache-break class as #4305, moved earlier); note text extended (one-time byte change for sessions already past the boundary); decompress receipt enriched only when a boundary exists; new optional metadata fields; no config/wire/persistence/version change. 已顺手修:test 断言消息 "non-fresh fork was already witnessed on birth" 描述错了机制——该 fork 实际由 fresh gate 拒绝(已持有 refs,且 结构化八问
判定:APPROVE — 方向正确(修根因:在分裂瞬间 seed,而非等检测),实现干净,测试钉住关键行为,行为变更全部披露,无回归。 |
[bot] 🏷 Review lane done for PR #5546 (head 89bae40 → 52cc42f). Verdict: APPROVE (posted as a thread comment — GitHub blocks a formal APPROVE on the author's own PR with this token; the full review body + 8问 is in the comment above). What I did:
已顺手修:test 断言消息 "non-fresh fork was already witnessed on birth" 描述错了机制(该 fork 实际由 fresh gate 拒绝,非 first-wins);已改为点名真正的 gate。+ commit 52cc42f (pushed to the PR branch). No blocking findings, no kernel/ changes, no new config. Ready for merge. |
(ai: vllm-qwen/qwen3.8-27b) Merge conflict resolved — PR rebased onto current master, CI 30/30 green, PR mergeable. What happened:
Verification:
PR state: 结构化八问
判定:冲突已解,CI 30/30 全绿,PR 可合(合并由人操作)。 |
What & why
Generation resets — the ref ledger restarting at m00001 mid-conversation (native-compaction rebase, or a persona fork onto a new session key) — were invisible at the moment they happened: the standing note only appeared later if the model cited ≥2 dead refs in visible history, and on tail-cut resets it never appeared at all. Result (issue #5542): the model kept citing stale refs, execution tails of boundary-straddling instructions were lost silently, and there was no marker in bili.log to grep.
Changes (host-side only; kernel/ untouched)
src/generation-boundary.ts): newwitnessGenerationResetseeds the existing one-shotmetadata.generationBoundaryrecord AT reset time (first-wins; residue detection unchanged and still wins over late witnesses). Two call sites:src/session.tsreconcileNativeCompactionBoundary: every full rebase (dsh-framed landing, openai/google/responses/relay native compacts), frontier = highest pre-rebase ref;src/server/handle.tspersona-fork site: forked session fresh AND the raw session has minted refs (guards the empty sidecar case [bug] dsh:side request 先到会抢走 persona 锚点,主会话被 fork 到 |sub:<fp>,原生 compress 永久失败 #2156; no-ops when the fork itself holds refs).GENERATION_BOUNDARY_NOTE, all lanes): earlier "done" reports across the boundary are UNVERIFIED — check disk/git state before claiming completion. Targets the exact incident signature: planning/reporting survived in summaries while the execution tail was discarded.src/decompress-shared.ts): with an active boundary, the bare[Block bN not found]gains "belongs to the previous generation — permanently inert, do not retry variations; recover via search_context/visible history". Byte-identical output when no boundary (pinned by test).[acp-gen-reset] … witnessed (reason — detail; previous-generation frontier mNNNNN)— grep-able in bili.log.Behavior changes (old → new, intentional)
reason/detail; old records validate as-is. New additive acp_status rows.Tests
tests/issue5543-generation-reset-observability.test.ts(9 tests): witness semantics (first-wins, log line, frontier carry), fork gating (fresh+ref-minting raw / empty raw / non-fresh fork), rebase witness carries pre-rebase frontier, acp_status rendering + fallback + absence, decompress enrichment + byte-stability without boundary, note clause pins.cache-proof.test.ts"host compaction, anthropic wire" fails identically on clean master in this sandbox (verified via stash + standalone re-run); CI verdict pending.查重: 无 — #4305/#4308 are the later-detection standing note this builds on; #4038 (stale fold ledger after model switch) is a different mechanism; no open issue covers reset-moment observability.
Closes #5542