Skip to content

[PR] EN | Make ref-ledger generation resets observable at the moment they happen | 代际重置不可观测:执行尾巴被无声吞掉 - #5546

Open
ranxianglei wants to merge 6 commits into
masterfrom
2026-11-02_generation-reset-observability
Open

ranxianglei wants to merge 6 commits into
masterfrom
2026-11-02_generation-reset-observability

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

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)

  1. Witnessed seeding (src/generation-boundary.ts): new witnessGenerationReset seeds the existing one-shot metadata.generationBoundary record AT reset time (first-wins; residue detection unchanged and still wins over late witnesses). Two call sites:
  2. Standing-note compensation clause (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.
  3. acp_status section: renders the witnessed boundary (reason, timestamp, frontier, permanently-inert warning, verify-completion nudge); detection-shaped fallback wording when the record is detection-seeded; absent otherwise. Display-only, try/catch-wrapped like its neighbors.
  4. Decompress receipt (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).
  5. Log marker: [acp-gen-reset] … witnessed (reason — detail; previous-generation frontier mNNNNN) — grep-able in bili.log.

Behavior changes (old → new, intentional)

Tests

  • New 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.
  • Green locally (targeted): generation-boundary (10), issue2592-rebase-floor (6), decompress-empty-range, acp-status, dsh-persona-fingerprint, proxy-decompress-cache; typecheck clean.
  • Known LOCAL-ENV failure, not from this diff: 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

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-11-02_generation-reset-observability (a8ae309)

Latest build — install this exact version

npm install -g billion-context@0.0.12010-pr.5546.6ea40c2

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Recent builds (commit → version)

commit version build
a8ae309 billion-context@0.0.12010-pr.5546.6ea40c2 build
19230a1 billion-context@0.0.11614-pr.5546.337b14e build
8239690 billion-context@0.0.11503-pr.5546.982ff2f build
52cc42f billion-context@0.0.10097-pr.5546.49aefbc build
89bae40 billion-context@0.0.10090-pr.5546.45996c4 build
8425591 billion-context@0.0.7900-pr.5546.97981ca build
da2c23d billion-context@0.0.7895-pr.5546.afde0ac build
5c7451e billion-context@0.0.7889-pr.5546.7867555 build

Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr5546.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei ranxianglei changed the title EN | Make ref-ledger generation resets observable at the moment they happen | 代际重置不可观测:执行尾巴被无声吞掉 [PR] EN | Make ref-ledger generation resets observable at the moment they happen | 代际重置不可观测:执行尾巴被无声吞掉 Nov 2, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

查重: 不重复。 本 PR 是 #5542(代际重置不可观测)的修复 PR。独立扫了全部 open PR:唯一触碰 generationBoundary 播种路径的就是本 PR;#5497 改同一文件但机制不同(它给 detectGenerationBoundary 的误报加守卫——system-role 扫描/中段 mNNNNN 假阳性,属检测面;本 PR 是时刻见证播种 + 观测面),二者互补不重叠,仅 src/generation-boundary.ts 存在热文件相邻,合入顺序无依赖。#4305/#4308 是本 PR 构建其上的事后检测 standing note,#4038 是模型切换后旧账本残留的 compress 误报,机制均不同。

标签: bug claude-code scope/kernel p1(事故签名 = 执行尾巴静默丢失 + 旧代 decompress 永久失败,owner 2026-10-19 判例的数据/工作丢失类)。

Review 进行中。diff 已逐段读完(6 文件 +285/-10,kernel/ 未动,base = master tip 新鲜),初步发现两处需要处理,随后按八问体例给完整结论:

  1. CI 三红定位:三个失败 shard(ubuntu-24/2、ubuntu-22/2、windows-22/2)挂的是同一组测试——tests/cache-friendly-plugin.test.ts 的 dsh native-compaction rebase 矩阵(四车道各 1 项),断言 "system layer bytes changed at t5"。这不是作者披露的 cache-proof 本地环境红,而是本 diff 的有意行为变更撞上了既有回归钉:DSH desktop 0.2.0-rc.2,偶现缓存命中失效,浪费大量token #2596/[bug] dsh 原生压缩单轮 rebase 兜底缺失于 anthropic 线路(#2432 修复未覆盖):checkpoint 落地后 ACP 状态永久失效 #2658 矩阵钉死「rebase 前后 system 层逐字节不变」,而本 PR 让 rebase 当轮在 system 块追加 generation-boundary note。修法方向:更新该钉以编码新契约(delta 必须恰好等于 note 本体、之后恢复稳定),不是回退功能。
  2. issue 编号错位:PR body 的 Closes #5542 正确(GitHub Generation reset (ref ledger restart) is invisible — swallowed execution tails caused silent work loss | 代际重置不可观测:执行尾巴被无声吞掉 #5542 = 本 issue),但测试文件名与代码注释引用的是 [PR] release v0.1.212 #5543(GitHub [PR] release v0.1.212 #5543 是一个已关闭的 release PR)——疑似把 e-work 镜像编号当成了 GitHub 编号。仓库惯例是 GitHub 编号,顺手修正。

两处置修都会作为独立标注 commit 推到 PR 分支,然后等 CI。

@ranxianglei
ranxianglei force-pushed the 2026-11-02_generation-reset-observability branch from da2c23d to 8425591 Compare November 2, 2026 16:05
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(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 失败,含此前全红的三个分片;仅剩 test (ubuntu-latest, 22, 1) 在跑——按分片划分它不含本 PR 改动的两个测试文件(分别在 shard 2/3,均已绿),且同一 shard 内容在另外三个 os/node 组合上已绿。

判定:可合(等最后一个无关分片跑完即全绿;合并由人操作)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

CI 全绿确认:rebased head 842559162 上 30/30 检查完成、0 失败(含最后那个 test (ubuntu-latest, 22, 1) 分片)。此前全红的三个分片在修复 commit 842559162(钉更新)+ 014b3eab4(编号订正)之后转绿。PR 已具备合并条件,等人工合并。

@sorasoras

Copy link
Copy Markdown
Contributor

Data point for this PR: I hit exactly the case it targets, on 0.1.212 (dist build daa082ea), ZCode desktop client.

The reset was not observable at the moment it happened — nothing set nativeCompactionBoundary, so reconcileNativeCompactionBoundary() stayed on its early return and the session sat in a split state indefinitely:

  • acp_status → live ledger, highest allocated ref m00314;
  • compress → session highest allocated ref=m159141 … session history=586 compression(s), 586 block(s), rejecting every live ref as unknown to this session [cause: stale-ref];
  • store: refs 2,994 rows spanning ref_num 134828..159141, blocks 586 (78 active) in the same namespace, messages 23,031 rows over seq 134550..159223, metadata_json 52 keys with no nativeCompactionBoundary.

So the failure is silent and persistent: 20 consecutive compress failures with the circuit breaker re-arming, and the nudge re-offering ranges the tool refuses.

An assertion this PR could carry: after ingest of a stream whose refs restart below the persisted high-water mark, either metadata_json.nativeCompactionBoundary.pendingRebase is set, or the next compress must not report a "highest allocated ref" that exceeds what acp_status advertises for the same session_id. Those two numbers disagreeing is the whole bug in one line.

Mechanism and recovery trace: #6061. Digest-drift instance: #5589.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(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 nativeCompactionBoundary in metadata).

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 reconcileNativeCompactionBoundary, which early-returns unless metadata.nativeCompactionBoundary.pendingRebase is already set (src/session.ts:1797-1799), and (2) the persona-fork site in handle.ts. In your trace the boundary marker was never set at all — the marking gate (dual-signal: client-recognizable compaction framing — dsh checkpoint framing / codex summary template / bili-authored snapshot — plus a decimated fold gap, checked at each wire's prepare path) never fired for the ZCode compacted resend, so no rebase ever ran and there was nothing for the witness to record. This PR makes resets observable at the moment they happen on the known mark+rebase paths; it deliberately adds no new detector for unmarked resets. Your case — marker never set, session stuck in a split state indefinitely — is a different mechanism (detection miss, not observability gap).

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 842559162 (two review-found issues fixed on the branch: a stale system-layer pin that collided with the sanctioned note injection, and mirror-number mislabels), verdict mergeable, awaiting human merge.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)

收工汇总(本会话全部工作已完成,无遗留项):

  1. PR [PR] EN | Make ref-ledger generation resets observable at the moment they happen | 代际重置不可观测:执行尾巴被无声吞掉 #5546 审核完成,判定可合——八问结论见上方楼;审核中发现的两处真问题已作为独立标注 commit 修在 PR 分支:014b3eab4(issue 编号错位:测试文件名/注释误引镜像号 [PR] release v0.1.212 #5543,订正为 Generation reset (ref ledger restart) is invisible — swallowed execution tails caused silent work loss | 代际重置不可观测:执行尾巴被无声吞掉 #5542)、842559162(tests/cache-friendly-plugin.test.ts 的 DSH desktop 0.2.0-rc.2,偶现缓存命中失效,浪费大量token #2596/[bug] dsh 原生压缩单轮 rebase 兜底缺失于 anthropic 线路(#2432 修复未覆盖):checkpoint 落地后 ACP 状态永久失效 #2658 系统层字节钉与本 PR 有意披露的 note 注入冲突,已改为编码新契约:eraBreak 轮增量必须恰好等于边界 note、其余轮次重新逐字节稳定)。
  2. CI 30/30 全绿(rebased head 842559162,0 失败,含此前全红的三个分片);分支已 rebase 到当前 master(零冲突,后续并入的 [PR] fix: read Responses additional_tools preamble in tool reachability observation #5528 与本 diff 零文件重叠),origin 分支与本地一致,工作树干净。
  3. @sorasoras 的现场数据点已回复(见上上楼):其 ZCode 案例(nativeCompactionBoundary 从未被置位 → reconcile 提前返回 → 永久分裂态)属检测面漏报,在本 PR 两个见证点的上游,本 PR 不覆盖;其提议的 acp_status/compress 高水位一致性断言已评估为 Compression nudges reference a different ledger than compress tool #6061/Codex Desktop: snapshot-shadow lost-tail and unified shadow state.messageRefs DIGEST DRIFT on 0.1.212 #5589 家族的合适探针,在帖内指出归属,未另开 issue。
  4. 合并由人操作:[PR] EN | Make ref-ledger generation resets observable at the moment they happen | 代际重置不可观测:执行尾巴被无声吞掉 #5546

@ranxianglei
ranxianglei force-pushed the 2026-11-02_generation-reset-observability branch from 8425591 to 89bae40 Compare November 15, 2026 05:04
@ranxianglei

Copy link
Copy Markdown
Owner Author

(ai: vllm-qwen/qwen3.8-27b) — 注:本 PR 作者即当前 token 身份,GitHub 禁止自评 APPROVE,故以评论形式给出审核结论(判定同 APPROVE)。

Review: APPROVE

Makes ref-ledger generation resets observable at the moment they happen (issue #5542). Reviewed the full diff (7 files, +322/−19, host-side only, kernel/ untouched) and verified:

Correctness

  • witnessGenerationReset (src/generation-boundary.ts) seeds the existing one-shot metadata.generationBoundary record at reset time, first-wins (an already-recorded boundary — witnessed or detected — is never overwritten); residue detection is unchanged and still wins over late witnesses.
  • Call sites fire at the right moments: reconcileNativeCompactionBoundary (src/session.ts) fires once per rebase (returns early unless pendingRebase), carrying the pre-rebase high-water mark (highestBefore) captured before the reset wipes the map; the persona-fork site (src/server/handle.ts) fires on the fork's first empty turn (the fresh gate blocks.length>0 || highestMappedIndex>0 rejects non-fresh forks) and only when the raw session has minted refs (guards the [bug] dsh:side request 先到会抢走 persona 锚点,主会话被 fork 到 |sub:<fp>,原生 compress 永久失败 #2156 empty sidecar).
  • Backward compat: readGenerationBoundary now requires only at+frontier; old records (with maxStaleRef) validate as-is; new optional reason/detail are additive.
  • Decompress enrichment is safe (context added only when a boundary is active; the bare not-found is byte-identical otherwise, pinned by test). The acp_status section is display-only, try/catch-wrapped, with a detection-shaped fallback.
  • derivedFromSessionId (the decompress read-time parent fallback) is only set for plugin-reported parents, not dsh persona forks — so the enrichment applies to the fork case the PR targets.

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. cache-friendly-plugin.test.ts correctly relaxes the system-layer byte-stability pin to allow exactly ONE sanctioned delta at the rebase turn, and pins that the delta is exactly the note and the pre-rebase text remains an exact prefix.

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,且 readGenerationBoundary 为 undefined 证明没有 witness 发生过);改为点名真正的 gate。+ commit 52cc42f


结构化八问

  1. 是什么问题:代际重置(ref 账本中途归零)在发生瞬间不可观测——执行尾巴被无声吞掉,模型继续引用失效 ref,bili.log 无可 grep 标记。
  2. 什么原因导致的:原 standing note 仅在"可见历史引用 ≥2 个失效 ref"时激活(residue detection);最坏情况(重置切断执行尾巴、引用文本一并被丢)永不触发检测,note 从不出现、日志无标记。
  3. 影响范围与严重程度:所有经历代际重置(native-compaction rebase / persona fork)的会话;严重——执行尾巴被无声吞掉导致工作丢失(Generation reset (ref ledger restart) is invisible — swallowed execution tails caused silent work loss | 代际重置不可观测:执行尾巴被无声吞掉 #5542 三起事故),用户完全不可见。
  4. 怎么修复的:在两个 host-side 分裂点"发生瞬间"调用 witnessGenerationReset,一次性 seed 已有 metadata.generationBoundary 记录(first-wins);standing note 加补偿条款;acp_status 渲染 GENERATION BOUNDARY 段;decompress not-found 有边界时明示"属上一代";打 [acp-gen-reset] 日志标记。
  5. 是否有回归问题:无。residue detection 未变且仍优先于晚到 witness;旧记录照常验证;decompress not-found 无边界时字节不变(测试钉死);acp_status 段纯新增;note 文本扩展是已披露的一次性字节变化。
  6. 是否破坏缓存:standing note 是一次性 system-block 追加(与 Switching model mid-conversation restarts the ref ledger, but the rendered transcript still shows the old refs — the model keeps aiming compress at dead ranges until the circuit breaker fires | 切模型后消息编号整体换账本,但渲染历史仍显示旧编号,模型对着死区间反复压缩直至熔断 #4305 同类,提前到 reset 瞬间),追加后字节稳定、prefix-cache 安全;note 文本扩展对已越界会话是一次性字节变化(已披露)。
  7. 是否改了设计方向:否。host-side only,kernel/ 未动;复用已有 generationBoundary 记录与 standing note 机制,仅把 seed 时机从"检测时"提前到"分裂瞬间"。
  8. 是否引入了新的配置:否。无新 env/config/默认值;新增可选 metadata 字段 reason/detail(旧记录照常验证),无持久化格式变化,无版本 bump。

判定:APPROVE — 方向正确(修根因:在分裂瞬间 seed,而非等检测),实现干净,测试钉住关键行为,行为变更全部披露,无回归。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[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:

  • Read the full diff (7 files, +322/−19, host-side only, kernel/ untouched) and the linked issue Generation reset (ref ledger restart) is invisible — swallowed execution tails caused silent work loss | 代际重置不可观测:执行尾巴被无声吞掉 #5542 end-to-end.
  • Verified correctness: first-wins seeding, the two call sites fire exactly once (rebase via pendingRebase; fork via the fresh gate + first-wins), backward compat (readGenerationBoundary now requires only at+frontier; old records validate as-is), decompress enrichment is byte-identical without a boundary, acp_status section is display-only/try-catch-wrapped.
  • Confirmed CI green on the pushed head (13 success, 14 skipped, 0 failed).
  • All behavior changes (note activation moved to the reset moment, note text extended, decompress receipt enriched, new optional metadata fields) are disclosed old→new in the PR body.

已顺手修: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.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

Merge conflict resolved — PR rebased onto current master, CI 30/30 green, PR mergeable.

What happened:

Verification:

  • typecheck clean; targeted suites 61/61 green (issue5542 observability 9, generation-boundary 10, issue2592-rebase-floor 6, acp-status + decompress-empty-range + dsh-persona-fingerprint + proxy-decompress-cache 34).
  • tests/cache-friendly-plugin.test.ts fails 11/11 at t1 in this sandbox — confirmed environmental: a clean-master worktree fails identically (t1 head-tag harness issue, before any rebase logic runs). The CI verdict for that file is green.
  • CI on the rebased head: 30/30 completed, 0 failures (15 success + 15 skipped).
  • Note: at 13:42 a concurrent agent pushed 52cc42fe (a test-assertion comment fix) on top of my rebase; the final CI head 52cc42fe2 includes it and is fully green.

PR state: mergeable: true (no conflicts); mergeable_state: blocked is branch protection only (merge is human-only). Ready for human merge: #5546

结构化八问

  1. 是什么问题:PR 分支落后 master 1178 个提交,与基分支冲突(merge state dirty),无法合并。
  2. 什么原因导致的:PR 创建(2026-11-02)后的 13 天里,master 并入了 Compression nudges reference a different ledger than compress tool #6061/Codex Desktop: snapshot-shadow lost-tail and unified shadow state.messageRefs DIGEST DRIFT on 0.1.212 #5589 的修复(检测判定同时武装 rebase),重写了 src/generation-boundary.ts 的模块头注释与 import 行——与本 PR 见证播种 commit 重写的是同一区域,产生文本冲突。
  3. 影响范围与严重程度:仅本 PR 的可合并性,无用户行为影响;严重度低(合并阻塞,非功能缺陷)。
  4. 怎么修复的:3 个 commit rebase 到最新 master;唯一冲突按并集解决——master 的「检测武装 rebase」段与 PR 的「见证播种」段都保留(二者互补:检测负责武装 rebase,rebase 时刻负责见证),import 取并集;功能代码零改动,最终 diff 与原 PR 意图一致(7 文件 +322/−19)。
  5. 是否有回归问题:无。四处自动合并的调用点逐一核实(session.ts rebase 见证、handle.ts fork 见证、decompress 回执、acp_status 段);typecheck 干净;定向测试 61/61 绿;CI 30/30 绿。cache-friendly-plugin 本地 11/11 红已证实为沙箱环境性(干净 master 同样死于 t1),CI 对应分片绿。
  6. 是否破坏缓存:不涉及——本次只做 rebase 与冲突解决,运行时行为零变化;PR 自身的缓存行为(重置当轮 system 块一次性追加 note)已在原审核中披露。
  7. 是否改了设计方向:没有。
  8. 是否引入了新的配置:没有。

判定:冲突已解,CI 30/30 全绿,PR 可合(合并由人操作)。

ci-check added 4 commits November 23, 2026 05:46
…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.
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.
@ranxianglei
ranxianglei force-pushed the 2026-11-02_generation-reset-observability branch from 52cc42f to 8239690 Compare November 22, 2026 21:52
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

All 3 red shards are one inherited master-level failure — not this PR's code. No branch-side fix made (policy: master-level fixes converge on ci-fixes/#7558, not on PR branches).

What I did this run:

  1. Re-verified live state: head 82396905fe9 (the rebased head from the previous run) has exactly 3 failing checks — test (windows-latest, 22, 1), test (ubuntu-latest, 22, 1), test (ubuntu-latest, 24, 1); all other checks green/skipped.
  2. Fetched all 3 job logs: every one fails the SAME single test — e2e #6069: history replaced under the same session id, then grown past the window: the turn is folded and forwarded at tests/issue6069-epoch-pause-over-window.test.ts:231, assertion preflight summarized the new history (expected true, got false). Each shard has exactly one failure, no hidden others.
  3. Established it is inherited, not PR-caused:
  4. Took the policy-prescribed action: checked origin/ci-fixes — it is already an ancestor of this head (merge would be a no-op; the Context limit exceeded. | 上下文超了 #6069 fix is not on ci-fixes yet). Posted the one-line status on CI Control Center: Centralized CI Failure Handling & Status Sync (Comment all CI issues here; do not open new issues) | CI 总控: CI 失败集中处理与状态同步(所有 CI 问题在此评论, 勿开新 issue) #4599. Did NOT duplicate the master-level fix on this branch (forbidden by the CI coordination policy).

Current state: the fix is in flight on PR #7558 (open, reviewed, CI green, awaiting owner merge). Once #7558 lands on master, re-merging master into this branch turns the 3 shards green — no branch-side change needed. I left the head untouched (82396905fe9).

结构化八问

  1. 是什么问题:rebase 后的 head 上 3 个 test 分片(ubuntu-22/1、ubuntu-24/1、windows-22/1)红,其余 27 项全绿/跳过。
  2. 什么原因导致的:三个分片挂的是同一个 master 级测试 e2e #6069(tests/issue6069-epoch-pause-over-window.test.ts:231,断言 preflight summarized the new history)。根因是 [PR] Add a one-time gate to preflight collapse-before-forwarding: only triggers on first use for new conversations / old sess | preflight 转发前折叠加一次性门槛:只对新对话/未用过 bili 的老会话首次触发,掐断死循环从机制上不可能 (#7545) #7546(preflight one-shot gate)落 master 后对 Context limit exceeded. | 上下文超了 #6069 epoch-pause 契约的回归——gate 只读 compressionCount>0、不读 Snapshot as session reconstruction: identity claim order takes priority, message hash demoted to reference signal (root- | 快照即会话重构:身份认领顺序优先,消息哈希降级为参考信号(根治 #3588/#3640 一类误判) #3641 的 epoch-confirm latch。与本 PR 改动无关:本 PR 不触碰 preflight/fold-reconcile/epoch-confirm 任何路径。
  3. 影响范围与严重程度:master 面上所有 PR 的 shard-1 测试车道(继承性红,CI Control Center: Centralized CI Failure Handling & Status Sync (Comment all CI issues here; do not open new issues) | CI 总控: CI 失败集中处理与状态同步(所有 CI 问题在此评论, 勿开新 issue) #4599 已列 7+ 个同签名 PR);用户行为无影响;对本 PR = 合并阻塞(等 master 修复)。
  4. 怎么修复的:本分支不做修复(政策:master 级失败禁止在 PR 分支重复修,修复收敛到 ci-fixes/哨兵)。已核实 ci-fixes 是 head 祖先(merge no-op);修复载体 PR [PR] fix: preflight one-shot gate must not block a replaced epoch's first fold (#7545) #7558 在途(CI 全绿,待 owner 合并);已在 CI Control Center: Centralized CI Failure Handling & Status Sync (Comment all CI issues here; do not open new issues) | CI 总控: CI 失败集中处理与状态同步(所有 CI 问题在此评论, 勿开新 issue) #4599 留一行状态。[PR] fix: preflight one-shot gate must not block a replaced epoch's first fold (#7545) #7558 合入后 re-merge master 即绿。
  5. 是否有回归问题:无——本次未改任何代码。证据链:①3 个 job 日志逐一核实,各仅 1 个失败且同签名;②干净 master 9ad612e 本地复现同一失败(pass 2 / fail 1,断言行逐字一致,非 flake);③本 PR diff 与失败路径零交集。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:没有。
  8. 是否引入了新的配置:没有。

判定:3 红 = 继承性 master 级失败(#7546 回归 #6069 契约),非本 PR 问题,本分支无需改动;等 #7558 合入 master 后 re-merge 即绿。

The 3 red shards (ubuntu-22/1, ubuntu-24/1, windows-22/1) all fail the
same inherited master-level test (e2e #6069, tests/issue6069-epoch-pause-
over-window.test.ts:231) — the #7546 one-shot-gate regression of the #6069
contract. That fix landed on master via PR #7558 (73844f5). Re-merging
master brings it in; no branch-side code change.

Verified locally: #6069 suite 3/3 green, PR's own suites 27/27 green,
typecheck clean.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

3 red shards resolved — re-merged master to pick up the #7558 fix; final head pushed (unmarked, one full CI pass).

What I did this run:

  1. Re-verified live state first: head 82396905fe9 had exactly 3 failing checks — test (ubuntu-latest, 22, 1), test (ubuntu-latest, 24, 1), test (windows-latest, 22, 1); all other checks green/skipped. Not already green, so work was needed.
  2. Confirmed the root cause is now fixed on master: all 3 shards fail the same inherited master-level test — e2e Context limit exceeded. | 上下文超了 #6069 (tests/issue6069-epoch-pause-over-window.test.ts:231, assertion preflight summarized the new history) — the [PR] Add a one-time gate to preflight collapse-before-forwarding: only triggers on first use for new conversations / old sess | preflight 转发前折叠加一次性门槛:只对新对话/未用过 bili 的老会话首次触发,掐断死循环从机制上不可能 (#7545) #7546 one-shot-gate regression of the Context limit exceeded. | 上下文超了 #6069 epoch-pause contract. That fix shipped on master via PR [PR] fix: preflight one-shot gate must not block a replaced epoch's first fold (#7545) #7558 (merge 73844f567ef, gate fix 434bf68843b), which the previous run had flagged as in-flight.
  3. Re-merged origin/master into the PR branch — clean auto-merge, zero conflicts, zero branch-side code change. Note: I merged origin/master, not origin/ci-fixes — the [PR] fix: preflight one-shot gate must not block a replaced epoch's first fold (#7545) #7558 fix landed directly on master and is NOT on ci-fixes (ci-fixes is a pure ancestor of master, 0 commits ahead), so merging ci-fixes would have been a no-op that leaves the red.
  4. Verified locally: the Context limit exceeded. | 上下文超了 #6069 suite now passes 3/3 (the previously-failing test is green), the PR's own suites pass 27/27 (issue5542 observability + generation-boundary + issue2592-rebase-floor), typecheck clean.
  5. Pushed the final head 19230a10bf0 without the ci-held marker — this is the branch's one full CI pass. (The intermediate marked commit was amended off before pushing; no intermediate push went out.)

结构化八问

  1. 是什么问题:rebase 后的 head 上 3 个 test 分片(ubuntu-22/1、ubuntu-24/1、windows-22/1)红,其余 27 项全绿/跳过。
  2. 什么原因导致的:三个分片挂的是同一个 master 级测试 e2e Context limit exceeded. | 上下文超了 #6069(tests/issue6069-epoch-pause-over-window.test.ts:231,断言 preflight summarized the new history)。根因是 [PR] Add a one-time gate to preflight collapse-before-forwarding: only triggers on first use for new conversations / old sess | preflight 转发前折叠加一次性门槛:只对新对话/未用过 bili 的老会话首次触发,掐断死循环从机制上不可能 (#7545) #7546(preflight one-shot gate)落 master 后对 Context limit exceeded. | 上下文超了 #6069 epoch-pause 契约的回归——gate 只读 compressionCount>0、不读 Snapshot as session reconstruction: identity claim order takes priority, message hash demoted to reference signal (root- | 快照即会话重构:身份认领顺序优先,消息哈希降级为参考信号(根治 #3588/#3640 一类误判) #3641 的 epoch-confirm latch。与本 PR 改动无关(本 PR 不触碰 preflight/fold-reconcile/epoch-confirm 任何路径)。
  3. 影响范围与严重程度:master 面上所有 PR 的 shard-1 测试车道(继承性红);用户行为无影响;对本 PR = 合并阻塞(等 master 修复)。
  4. 怎么修复的:修复载体 PR [PR] fix: preflight one-shot gate must not block a replaced epoch's first fold (#7545) #7558 已合入 master(73844f567ef)。把 origin/master re-merge 进 PR 分支带进该修复;分支侧零代码改动。注:合的是 master 而非 ci-fixes——[PR] fix: preflight one-shot gate must not block a replaced epoch's first fold (#7545) #7558 直接落 master、不在 ci-fixes 上(ci-fixes 是 master 纯祖先、领先 0 提交),合 ci-fixes 会是 no-op。
  5. 是否有回归问题:无。clean auto-merge 零冲突;本地验证 Context limit exceeded. | 上下文超了 #6069 套件 3/3 绿(原失败测试转绿)、本 PR 自有套件 27/27 绿、typecheck 干净。
  6. 是否破坏缓存:不涉及——本次只做 master re-merge,运行时行为零变化。
  7. 是否改了设计方向:没有。
  8. 是否引入了新的配置:没有。

判定:3 红 = 继承性 master 级失败(#7546 回归 #6069 契约),修复 #7558 已落 master,re-merge 后原失败测试本地转绿;final head 19230a10bf0 已推送(无 ci-held 标记,触发一次完整 CI),等 CI 重跑即绿。合并由人操作:#5546

Master added blockContentSnapshot to the session.js import; this PR added
the readGenerationBoundary import from generation-boundary.js. Resolved as
union — both imports kept (both are used in the file). The other two
overlapping files (src/server/handle.ts, src/session.ts) auto-merged clean;
verified the PR's witness call sites (witnessForkedGeneration in handle.ts,
witnessGenerationReset in session.ts) and the decompress boundary enrichment
all survived the merge.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

Merge conflict resolved — merged upstream/master into the PR branch, resolved the single import conflict, pushed. CI will re-run on the new head.

What I did this run:

  1. Verified live state: the PR head was 19230a10bf0 (my previous run's master-merge, unmarked); master had moved 186 commits ahead of the PR's merge-base (328fdebdb41 → ced22b1d2b0), which is what made the PR dirty. (Note: the local mirror origin was returning 502 for git operations this run, so I fetched/pushed via the real GitHub upstream remote — same target, the push landed on the PR branch.)
  2. Merged upstream/master into the PR branch. One real conflict, in src/decompress-shared.ts import lines: master added blockContentSnapshot to the ./session.js import while this PR added a new readGenerationBoundary import from ./generation-boundary.js. Resolved as a union — both imports kept (both are used in the file). The other two overlapping files (src/server/handle.ts, src/session.ts) auto-merged clean.
  3. Verified the PR's work survived the merge: witnessForkedGeneration (handle.ts:2021), witnessGenerationReset (session.ts:1956), both witness functions defined in generation-boundary.ts, and the decompress boundary-enrichment receipt (decompress-shared.ts:606–609) are all intact.
  4. Verified locally: typecheck clean; targeted suites 30/30 green (issue5542 observability + generation-boundary + issue2592-rebase-floor + the Context limit exceeded. | 上下文超了 #6069 test from the previous fix).
  5. Pushed the conflict-resolution merge a8ae309182e to the PR branch (a merge, so a plain push — no force-push).

结构化八问

  1. 是什么问题:PR 分支与基分支 master 冲突(merge state dirty)——master 在 PR 上次 rebase 之后又前进了 186 个提交,无法合并。
  2. 什么原因导致的:PR 分支基于旧 master(merge-base 328fdebdb41),master 已推进到 ced22b1d2b0;双方都改了 src/decompress-shared.ts 的 import 区(master 加 blockContentSnapshot、本 PR 加 readGenerationBoundary),产生文本冲突。
  3. 影响范围与严重程度:仅本 PR 的可合并性,无用户行为影响;严重度低(合并阻塞,非功能缺陷)。
  4. 怎么修复的:把 upstream/master merge 进 PR 分支;唯一冲突按并集解决——两条 import 都保留(文件里都在用);另两个重叠文件(handle.ts、session.ts)自动合并干净;功能代码零改动。
  5. 是否有回归问题:无。逐一核实 PR 的见证调用点(handle.ts fork witness、session.ts rebase witness)、generation-boundary 两个 witness 函数、decompress 边界回执全部存活;typecheck 干净;定向测试 30/30 绿(含上一轮修的 Context limit exceeded. | 上下文超了 #6069 测试)。
  6. 是否破坏缓存:不涉及——本次只做 master merge 与 import 冲突解决,运行时行为零变化。
  7. 是否改了设计方向:没有。
  8. 是否引入了新的配置:没有。

判定:冲突已解(唯一冲突 = decompress-shared.ts 的 import 并集),本地验证通过,merge a8ae309182e 已推送到 PR 分支,等 CI 在 new head 上重跑。注:本轮本地镜像 git 端点 502,改走 GitHub upstream 远端完成 fetch/push,目标分支不变。合并由人操作:#5546

@ranxianglei

Copy link
Copy Markdown
Owner Author

(ai: vllm-qwen/qwen3.8-27b) — 本 PR 作者即当前 token 身份,GitHub 禁止自评 APPROVE,故以评论形式给出审核结论(判定同 APPROVE)。

Review (re-review of new head a8ae30918): APPROVE

This trigger is a merge of upstream/master into the PR branch (a8ae30918 "Merge upstream/master: resolve conflict in decompress-shared.ts imports"). The feature work itself was already reviewed and approved at 89bae40eb (with my one-line comment fix 52cc42fe2e). The branch was rebased onto a newer master, so every feature commit carries a new hash — but the work is byte-for-byte intact.

What the new delta actually is: 274 files / +20409 −1573 — the bulk of master (already reviewed & merged upstream). The only PR-authored code in this merge commit is the decompress-shared.ts import conflict resolution.

Verified on the new head:

  • Conflict resolution correct — src/decompress-shared.ts:25 ./session.js import now carries master's blockContentSnapshot (used at :222, :595) and keeps the PR's readGenerationBoundary (used at :606, :609). No dead import, no dropped feature code.
  • Feature intact — all five files present; call sites confirmed: src/session.ts:1956 (rebase witness, reason native-compaction-rebase), src/server/handle.ts:2021 (fork witness), src/acp-status.ts:407/414 (GENERATION BOUNDARY section), src/decompress-shared.ts:606/609 (decompress not-found enrichment), src/generation-boundary.ts witness fns + extended execution-tail note.
  • Cross-file deps resolve — generation-boundary.ts uses local helpers highestMappedIndex(:92) / indexToRef(:101) plus imported peekSession/getStore/markDirty; all valid at the new head.
  • Merge did not touch feature lines — git diff P1..merged on session.ts/handle.ts shows zero feature-line changes (only master's unrelated edits: +55/−5 and +26/−7).
  • My prior comment fix survived the rebase — tests/issue5542-generation-reset-observability.test.ts:90 still reads "non-fresh fork (already holds refs) — the witness only fires on the fork's first empty turn".

CI: running on a8ae30918 — 0 failed, 14 pending, 10 skipped, 6 success (the full-suite verdict is the CI test lanes).

No new findings, no kernel/ changes, no new config, no behavior drift beyond what the original PR already disclosed.

结构化八问

  1. 是什么问题:本触发是 PR 分支合并上游 master 以解决 decompress-shared.ts 导入冲突;特性本体(代际重置可观测)此前已在 89bae40eb 审过。
  2. 什么原因导致的:分支落后 master,作者 rebase/merge 上游以对齐;唯一新增代码是导入冲突的合并结果。
  3. 影响范围与严重程度:仅影响本 PR 分支的构建/合并状态;特性对外行为无变化。
  4. 怎么修复的:导入冲突取 master 的 blockContentSnapshot 并保留 PR 的 readGenerationBoundary,两者均被实际使用,无死导入、无遗漏特性代码。
  5. 是否有回归问题:无——特性 5 文件、全部调用点、我此前的注释修复均原样保留;merge 未改动任何特性行;跨文件依赖全部可解析。
  6. 是否破坏缓存:不涉及——未触碰前缀缓存/重试/游标逻辑;GENERATION_BOUNDARY_NOTE 仍为静态文本。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:不涉及。

判定:APPROVE(特性本体已审过;本次 master 合并的冲突解决正确、特性无损、CI 无失败)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 Re-review done for PR #5546 new head a8ae30918 (the "Merge upstream/master" commit that resolved the decompress-shared.ts import conflict).

Verdict: APPROVE (posted as a thread comment — GitHub still blocks a formal self-APPROVE on the author's own PR; full review + 8问 is in the comment).

The new delta is purely the master merge (274 files / +20409). Verified on the new head:

  • Import conflict resolution correct — src/decompress-shared.ts:25 keeps the PR's readGenerationBoundary (used :606/:609) AND picks up master's blockContentSnapshot (used :222/:595); no dead import, no dropped feature code.
  • Feature byte-for-byte intact — all 5 files, all call sites (session.ts:1956, handle.ts:2021, acp-status.ts:407/414, decompress-shared.ts:606/609, generation-boundary.ts), and my prior comment fix (test:90) all survived the rebase.
  • Merge touched zero feature lines in session.ts/handle.ts (only master's unrelated edits).
  • CI on a8ae30918: 0 failed, 14 pending, 10 skipped, 6 success.

No new findings, no kernel/ changes, no new config, no behavior drift. Ready for merge.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 Status: PR #5546 re-review is complete. The forward just now was an echo of my own review comment (upstream-sync), not new input — so there was nothing new to act on.

Current state of the thread:

  • Review of new head a8ae30918 (the "Merge upstream/master" conflict-resolution commit) is posted as a thread comment — verdict APPROVE.
  • Feature is byte-for-byte intact; the decompress-shared.ts import conflict resolution is correct (kept the PR's readGenerationBoundary, picked up master's blockContentSnapshot, both used); CI on a8ae30918 shows 0 failed (14 still pending).
  • No new findings, no kernel/ changes, no new config, no behavior drift.

Nothing further needed from me unless a genuine new comment lands. Ready for merge.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

2 participants