Skip to content

[PR] fix(kernel): reject range folds that would merge blocks beyond the requested ref window - #5835

Open
ranxianglei wants to merge 10 commits into
masterfrom
2026-11-07_compress-window-coverage-guard
Open

ranxianglei wants to merge 10 commits into
masterfrom
2026-11-07_compress-window-coverage-guard

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Closes #5830

kernel-change: add a hard gate in projectUnit so a plain message-ref range can never merge an active block whose coverage extends beyond the requested ref window — the missing check behind #5830's silent summary-coverage loss. The judgment lives entirely in the kernel's shared projection; the host side cannot fix this.

What was wrong

A plain mNNNNN..mMMMMM range carries one summary describing exactly that ref window. But projectUnit decided which existing blocks to consume by asking only whether each block's visible representation (its rendered summary, or earliest surviving raw) falls inside the resolved span. After a folded historical ref resolves via activeOwnerAnchor to its inheriting block's anchor position (an unbounded jump in view-index space), the resolved span can be far larger than the requested window — every same-tier block swept along gets merged, its effectiveMessageIds unioned into the new block while the new block carries only the last range's summary. The prior summaries are silently replaced; the receipt reports success. #5830 observed this as one block covering 1566 messages from conversation start carrying a single 2456-char summary.

Fix

One decision-point gate in projectUnit (kernel/src/unit-projection.ts), shared by apply / recommend / acp_status per the #3236 single-projection discipline:

  • A plain range that would consume any active block whose coverage lies outside [startRef..endRef] is now fatal (kind: "window"): the whole batch rejects atomically, zero commits, and the error names the offending blocks with their coverage extent plus how to proceed (reference block ids directly for deliberate merges, or narrow the range).
  • Unmappable coverage fails closed (containment unprovable → reject).
  • Exemptions: block-boundary distillation (bN..bM) absorbs boundary coverage by design; no-op resubmits create no block, so nothing is replaced.
  • kernel/src/report.ts flags the new fatal kind so acp_status rows stay consistent with the apply verdict.

Behavior change (disclosed)

OLD: such folds landed successfully, silently replacing the consumed blocks' summaries (active-summary coverage loss; originals recoverable via decompress through directBlockIds).
NEW: they are hard-rejected with an actionable error; the rest of the batch is untouched (atomic rollback).
WHY: the supplied summary cannot cover the merged content — landing it is data-quality corruption dressed as success. Legitimate merges (coverage inside the window), distillation, and idempotent resubmits are unchanged.

Tests

New kernel/tests/issue5830-merge-window-guard.test.ts (4 tests, all-real API calls):

  1. repro: stale-inherited start ref + pruned view → pre-fix silent mega-merge (verified red on the unfixed code), post-fix atomic reject naming the out-of-window block;
  2. control: legit in-window merge still lands;
  3. control: subset resubmit unchanged (no block created, no coverage change);
  4. control: bN..bM distillation unaffected.

Targeted suites green on rebased head (local): issue5830 (4), issue5751-tool-pair-widening (6), tool-pairs (14), issue3236 (5), regression-bugfixes (12), issue4484 (4), dead-ref-split (5), dead-refs (6), refold (20), carrier-advertise-validate (5), issue3371 (3), compress (32), decompress-report (16), panel (12), parse-compress-input (98), checkpoint-carrier (4), issue4289 (14), pipeline (15), verif-subset-guard (2). Full-suite verdict = CI.

Kernel version: 0.0.182 → 0.0.183. No config surface changes. No new env vars.

…ed ref window (#5830)

A plain m-ref range carries one summary describing exactly [startRef..endRef], but projectUnit consumed any same-tier active block whose visible representation fell inside the RESOLVED span. After a folded historical ref snaps to its inheriting block's anchor (unbounded view-index jump), the span can sweep blocks whose coverage lies outside the window, silently replacing their summaries with one that does not cover their span (#5830).

Hard gate in projectUnit (shared by apply/recommend/acp_status per #3236): a plain range consuming an active block with out-of-window coverage is fatal (kind 'window') — whole batch rejects atomically, zero commits, error names offenders + remedy. Unmappable coverage fails closed. Exempt: block-boundary distillation, no-op resubmits. report.ts flags the new kind for acp_status consistency.

Regression: kernel/tests/issue5830-merge-window-guard.test.ts (repro verified red pre-fix + 3 controls). Kernel 0.0.182 -> 0.0.183.
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-11-07_compress-window-coverage-guard (a3abdd7)

Latest build — install this exact version

npm install -g billion-context@0.0.11148-pr.5835.6f32606

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
a3abdd7 billion-context@0.0.11148-pr.5835.6f32606 build
aa4175f billion-context@0.0.10881-pr.5835.a4a2b4a build
fa82e64 billion-context@0.0.10068-pr.5835.29322b1 build
108681d billion-context@0.0.9157-pr.5835.cb33cd6 build
d4b2749 billion-context@0.0.8417-pr.5835.3e54ab2 build
ce6f877 billion-context@0.0.8415-pr.5835.aac4af3 build
02ed9c9 billion-context@0.0.8414-pr.5835.694ff61 build
3c4f8d5 billion-context@0.0.8411-pr.5835.f96baa5 build
041fa98 billion-context@0.0.8409-pr.5835.e070157 build

Download artifact

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

Install instructions are refreshed on each push.

@ranxianglei ranxianglei changed the title fix(kernel): reject range folds that would merge blocks beyond the requested ref window [PR] fix(kernel): reject range folds that would merge blocks beyond the requested ref window Nov 6, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

CI 红灯已修:lock-sync(attempt 1/3,一次修完)。修复已推到 PR 分支,新 head 3c4f8d5ea,等 CI 重跑。

七问摘要:

  1. 是什么问题:PR 按 Kernel Boundary 要求把 kernel 版本从 0.0.182 提到 0.0.183(改了 kernel/src/** 必须 bump),但没重新生成两个 lockfile——CI 的 lock-sync 门禁(package-lock.json version metadata lags package.json (bili 0.1.190 vs 0.1.191, kernel 0.0.112 vs 0.0.114) #2704 漂移守卫)检测到版本记录落后,判红。严重程度:仅本 PR 的 CI 门禁,不影响任何用户与运行时行为。
  2. 什么原因导致的:改 package.json 不会自动改写 package-lock.json,只有 npm install 才会重新生成——作者的提交只含源码改动,漏了 lockfile 再生这一步(该机制在 package-lock.json version metadata lags package.json (bili 0.1.190 vs 0.1.191, kernel 0.0.112 vs 0.0.114) #2704 有完整说明)。
  3. 怎么修复的:在 PR head 上原样执行 lock-sync job 的两条命令(npm install --package-lock-only --ignore-scripts,根目录 + kernel/ 各一次)重新生成,提交只含 3 行版本号:根 package-lock.json 的 kernel 条目 0.0.182→0.0.183、kernel/package-lock.json 自身两处同改。本地验证了幂等性(再跑一遍零变化),与 CI 日志里期望的 diff hunk 逐字一致。提交信息沿用了先例 5705f1d 的同款格式。
  4. 是否有回归问题:无。diff 仅 3 行 lockfile 元数据,不触碰任何代码/行为/配置;高危模式(语义漂移、吞错、阈值时序变化)逐项不涉及。
  5. 是否破坏缓存:不涉及(纯 lockfile 版本记录,与运行时缓存/重试/增量游标无关)。
  6. 是否改了设计方向:不涉及。
  7. 是否引入了新的配置:不涉及。

判定:待新 head 上 CI 重跑转绿;此前因 lock-sync 失败被跳过的 test/static-gates 等车道会随之全量运行,若仍有红由后续 attempt 处理。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重:不重复。 open/closed issue 与 PR(近 7 天为主,按失败签名匹配)中无其他条目针对 #5830 的「plain range 合并越窗块、旧摘要被静默替换」机制;与 #5789(tier 蒸馏绕过 mid-turn 块)同属折叠资格判定家族但症状与机制均不同,不构成重复。无并行在途 PR 修同一线程。

标签:bug + scope/kernel + p1(理由:静默摘要覆盖丢失属数据质量/数据丢失类,按 owner 2026-10-19 修订一律 p1;修复面纯内核,不打客户端车道标签)。保留系统 pr 标签。

审核进行中,先报已钉死的部分(完整八问结论随后补发):

  1. 方向审核通过:根因定位正确——projectUnit 只问「块的可见表示是否落在 resolved span 内」,而 stale inherited ref 经 activeOwnerAnchor 跳变后 resolved span 远超请求窗口,越窗块被整体吞并、摘要被单尾段摘要替换。判定放进共享投影(apply/recommend/acp_status 单一定义,[Bug] recommend/apply 对同一区间的 turn-integrity 判定永久不一致:acp_status 反复推荐的区间被 apply 侧整段拒绝(0.1.196,Range would split N turn(s) at the protected-zone boundary) #3236 纪律)、整批原子拒绝、fail-closed 不可映射覆盖——方案打到根因,不是症状层拦截。核对了 apply 侧原子性(compress.ts preLoopState 回滚,零提交)与 recommend 侧降级(screenRecommendedUnits 对任意 fatal 降 gap,不会 advertise→reject 循环)。
  2. CI 红已定位:lock-sync 红(版本号未同步 lockfile)你已自行修掉(3c4f8d5,与我独立重算的 diff 逐字节一致);static-gates 红 = 全量 kernel 套件本地复现 1591/1594,两个既有 pinned 套件被新 gate 误伤:
  3. 处置:两处都已在分支上直接修(gate 精化:端点解析未跳变时按加宽后 span 判含,跳变时仍钉死请求窗口;fixture 改为继承式账本并补 fail-closed 负向钉),kernel 版本随改 bump,本地定向+全量 kernel 套件跑绿后推送,CI 转绿再发完整八问结论。

@ranxianglei ranxianglei added bug Something isn't working p1 scope/kernel labels Nov 6, 2026
ci-check added 3 commits November 7, 2026 03:49
…points resolve in place

The literal-window containment check rejected legitimate folds whose span
was extended by pair/reasoning boundary widening (#5531 stranded-pair
recovery path): widened cells ride under the same summary by design, so
when BOTH endpoints resolved in place (the requested message itself still
occupies its slot), containment is now judged against the widened span
computed over the range message refs.

The #5830 producer stays fatal: an endpoint that resolved ELSEWHERE
(stale inherited ref snapping to a distant inheriting-block anchor) holds
the line at the requested window, as before. Unmappable coverage still
fails closed either way.

kernel 0.0.183 -> 0.0.184 (+ lockfile sync).
…age rejection

The subtest-3 fixture numbered the pruned view fresh from nextIndex=1,
which cannot model production: covered-but-pruned messages keep their
original refs (ids are never re-minted), so their numbers sit inside the
requested window even though the messages are gone. Seed an inherited
ledger with the original numbering instead — the merge lands again.

Add the companion negative pin (gate discipline #3617): the same shape
with fresh numbering leaves b1's coverage unmappable in byRaw, so the
fold must reject atomically with the [unmapped coverage] offender named.
The fail-closed rule treated ANY unmappable coverage id as an offender.
Turn separators (#2627) are synthetic outbound-only markers that legacy
polluted views registered into block coverage WITHOUT a ref entry; a
later plain-range fold consuming such a block was rejected although its
real-history coverage sat entirely inside the window. Real history ids
always keep their byRaw entry (ids are never re-minted; only
applyCompactionArchive prunes at native-compaction boundaries), so an
unmapped id carries no client-side content a replaced summary could
lose — skip it. A block whose ENTIRE coverage is unmappable still fails
closed (containment unprovable); the pi#199 negative pin holds.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

PR review 完成。判定:可合,等人工合并(kernel 层永不自动合并;PR 正文已带 kernel-change 声明)。审核中发现原 head 引入的 3 处回归已直接在分支上修掉(独立标注 commit),最终 head ce6f87738。

八问

  1. 是什么问题:普通 message-ref 区间折叠会静默合并覆盖范围超出请求窗口的活跃块——新块只带最后一个区间的 summary,被吞块的 summary 被无声替换(生产事故:b27 用一条 2456 字符的尾部 summary 罩住从会话开头起的 1566 条消息)。
  2. 什么原因导致的:projectUnit 判定消费哪些块时只看「块的可见表示是否落在解析后的 span 内」;陈旧继承 ref 经 activeOwnerAnchor 解析到继承块锚点位置(视图索引空间的无界跳变),解析 span 远大于请求窗口 → 沿途同层块全被卷入合并。[Bug] recommend/apply 对同一区间的 turn-integrity 判定永久不一致:acp_status 反复推荐的区间被 apply 侧整段拒绝(0.1.196,Range would split N turn(s) at the protected-zone boundary) #3236 单一投影保证了 apply/recommend/acp_status 共用同一判定,所以门必须加在 kernel 的 projectUnit 里,host 侧修不到。
  3. 影响范围与严重程度:p1 数据质量类(活跃 summary 覆盖丢失;原件可经 decompress/directBlockIds 找回,但面板/reconcile 看到的是大跨度薄 summary)。触发面:任何解析 span 扫到窗口外同层活跃块的普通 mNNNNN..mMMMMM 折叠(裁剪视图/compaction 后的陈旧继承 ref 是典型路径)。
  4. 怎么修复的:在 projectUnit 单一决策点加硬门(fatal kind window,整批原子拒绝、零提交、错误点名越界块并给出 bN..bM/收窄区间两条出路);不可映射覆盖 fail-closed;豁免 bN..bM distill、纯 resubmit、混合 bN..mM 端点。审核中我推了 3 个精修 commit:
  5. 是否有回归问题:既有行为逐项审过——recommend 对 fatal 单元降级为 gap(recommend.ts:705 通用 fatal 检查,无 advertise→reject 循环)、apply 整批回滚(preLoopState)、report.ts ⚠ 行一致、豁免面不变。原 head 引入的 3 处回归全部发现并在分支上修复(issue5531 搁浅对复活、regression-empty-rewrap Welcome to billion-context Discussions! #199 s3、issue2627 父块折叠被误拒)。本地:kernel 全套 1595/1595 绿,受影响 host 套件绿。CI 最终 head:guards + static-gates + 11 条 test leg 中 10 条绿;唯一红腿 test(ubuntu-22/2)是继承性 master 红,与本 PR diff 无关——tests/verif-snapshot-render.test.ts J3 judge 报 if condition degraded @319(buildView 符号化翻译降级一个 if 条件),在干净 master(c3dfbe6)检出上逐字节复现,且只在 SMT solver 被配置到时暴露(haveSolver() 门使暴露按 leg 抖动,上一 head 同腿就是绿的);当前 ci-fixes(0470bec)只含 dsh pin 对齐且已被 master 现状超越(六个文件在本 head 实测全绿),故未 merge ci-fixes;已在 CI Control Center: Centralized CI Failure Handling & Status Sync (Comment all CI issues here; do not open new issues) | CI 总控: CI 失败集中处理与状态同步(所有 CI 问题在此评论, 勿开新 issue) #4599 留结论评论,查重无存量 issue,按平台规则不另开单、在此停放待 master 车道处置(verif 翻译器覆盖面或 snapshot-render 源码,走 verif/README.md 纪律)。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及——留在 projectUnit 共享投影内,[Bug] recommend/apply 对同一区间的 turn-integrity 判定永久不一致:acp_status 反复推荐的区间被 apply 侧整段拒绝(0.1.196,Range would split N turn(s) at the protected-zone boundary) #3236 纪律不变。
  8. 是否引入了新的配置:无 env/config/默认值变更。行为变更披露 OLD→NEW:此类折叠旧行为=静默落盘(summary 被替换,decompress 可找回)→ 新行为=原子硬拒+可操作错误;有界残留披露:post-native-compaction(applyCompactionArchive 剪 byRaw)后整块不可映射的覆盖,普通区间折叠被拒(出路 bN..bM);映射部分在窗内的混合覆盖恢复落盘(合成标记不代表客户端侧内容,与 PR 前行为一致,非回归)。kernel 版本:0.0.182 → 0.0.185(跨整个 PR 一次到位)。

diff 面:7 文件 +344/−9(unit-projection 门 93 行含注释、report 2 行、两个测试文件、版本+双 lockfile)。收工判定:PR 内容本身可合;合并前请知悉上述唯一红腿为继承性 master 红(证据见上),由你决定是否容忍该腿或先走 master 车道修复。

CI shard flake on this PR (test ubuntu-22 s2, run 42288017742): 'receiver
port must be a number, got 0'. The fixture published its port with
appendFileSync — open(O_CREAT) and write are separate syscalls, so under
runner load the parent's existsSync poll can observe the file while it is
still empty, and Number('') === 0 trips the assertion. Reproduced locally by
splitting the publication (probe: exact same failure text); kernel-only PR
diff cannot touch this path.

Two facets of the same race, both test-side only:
- fixture publishes tmp + rename (atomic: existence now implies complete content)
- startReceiver waits until the content parses to a valid port > 0 instead of
  trusting mere existence (keeps the 15s deadline and both failure modes)
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

CI 修复完成(第二轮唤醒):唯一红腿 test (ubuntu-latest, 22, 2) 已修,新 head d4b2749d1 全矩阵绿(26 success + 1 skipped)。

七问

  1. 是什么问题:PR head ce6f877 上唯一失败的 check 是 test 矩阵 ubuntu-22 分片 2,3082 个用例中挂 1 个:#5152 one worker per origin: repeated attach paths share, refcounted stop,断言 receiver port must be a number, got 0。
  2. 什么原因导致的:与 PR diff 无关的既有测试竞态(kernel-only diff 不触此路径,master c3dfbe6 同矩阵绿,非继承)。机制:tests/fixtures/issue5152-beat-receiver.mjs 用 appendFileSync 发布端口文件——open(O_CREAT) 与 write 是两个系统调用,runner 高负载下子进程恰在两者之间被调度走时,父进程 startReceiver 的 existsSync 轮询看到「文件已存在但为空」提前退出等待,Number("") === 0 触发该断言。本地对抗探针把发布拆成 create→延迟 400ms→write,复现出与 CI 逐字节相同的报错文本;修复逻辑在同一探针下通过。
  3. 怎么修复的:同一机制两个 facet,均纯测试侧、独立标注 commit d4b2749d1:① 源头——fixture 改 tmp+rename 原子发布(rename 原子性保证「文件存在」即「内容完整」);② 消费端——startReceiver 改为轮询到内容解析为合法端口(正整数 >0)才接受,不再信任单纯的文件存在;15s deadline 与两种超时失败模式原样保留。
  4. 是否有回归问题:无。零 src/ 改动、零产品行为面;只动 tests/issue5152-owner-beat-survives-host-stall.test.ts 与上述 fixture 两个文件。审过既有行为:fixture 的 beat 记录语义(appendFileSync beats.txt)未动;各子测试的 warm-up/速率断言未动;接收器起不来时仍按原文案响亮失败。定向 3×6/6 绿 + typecheck 绿;CI 全矩阵 26 success(含此前失败分片)+ red-signal 按设计 skip。
  5. 是否破坏缓存:不涉及。
  6. 是否改了设计方向:没有。
  7. 是否引入新配置:没有。

另外两件事:① 本轮之前作者在我上一轮的 lock-sync commit 之上推了 3 个 kernel 提交(cd2a934/02ed9c926/ce6f87738)并自行同步了 lockfile,lock-sync 已绿;此前 verif-snapshot-render 那条红已在 #4599 floor 1070 单独归账(master 侧 SMT 求解器覆盖问题,与本 PR 无关)。② 顺带发现 tests/codex-mcp-shell.test.ts:124-125 有同型 existsSync→read 模式(entry-report.txt),暂无 flake 证据,本自动车道不动它,留此记录。已按协调政策在 #4599 留一行结论。

判定:PR #5835 全部 check 绿(mergeable_state 仅剩人工合并环节),可合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Progress update (merge-conflict lane, attempt 1/3): my session was force-restarted after a 31-minute stall — a git/network call hung, and I am resuming with hard timeouts on every step.

Live state verified this run before the stall:

  • Head d4b2749d1: all 30 checks green (mirror cache: 0 failed, 0 pending).
  • Merge state: dirty — the PR now conflicts with an advanced master (recorded base c3dfbe6b2 is stale).

Next: rebase the PR branch onto current master, resolve all conflicts (expecting kernel version + lockfiles, possibly test-side files), run targeted local verification, then force-push (explicitly permitted for this conflict rebase) and report back with the 七问 summary.

…dirty merge state, #5835)

# Conflicts:
#	kernel/package-lock.json
#	kernel/package.json
#	package-lock.json
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Merge conflict resolved. The PR was dirty because master advanced 228 commits past its recorded base (c3dfbe6b2); the integration is pushed as merge commit 108681d45 (regular fast-forward push, no force-push, author commits untouched) and the full CI matrix is green on it (verified directly: main CI run 43040615294 = 27 success + 1 skipped-by-design, all other workflows on the head also success). Live merge state is now behind (master moved again after my fetch — not a blocker, mergeable: true).

七问

  1. 是什么问题:PR 与目标分支冲突(dirty)——分支基于 c3dfbe6b2,而 master 在其后合入了 228 个提交(含 kernel Reaching out to the author — a plugin bug is throwing errors and causing the context to balloon rapidly. | 求助作者,插件bug报错导致上下文急速增加 #5789/New error in v0.213, following up on the previous bug where old blocks can't be compressed and tokens double. | 0.213版本新报错,接着上次的旧块无法压缩token翻倍bug #5919/Request two capabilities: compressed block "retirement" and summary "external rewrite". | 请求两个能力:压缩块「退役」与摘要「外部重写」 #5765、docs 重组等)。
  2. 什么原因导致的:常规的分支陈旧。冲突面只有三处:kernel/package.json(版本行)、package-lock.json、kernel/package-lock.json;两个源码文件(unit-projection.ts/report.ts)git 三方合并自动成功——双方改动区域不相交(PR 加 window 守卫,master 改 Reaching out to the author — a plugin bug is throwing errors and causing the context to balloon rapidly. | 求助作者,插件bug报错导致上下文急速增加 #5789 恢复梯与 Request two capabilities: compressed block "retirement" and summary "external rewrite". | 请求两个能力:压缩块「退役」与摘要「外部重写」 #5765 retired 区块)。
  3. 怎么修复的:选 merge 而非 rebase+force-push(不重写作者提交、符合 push 纪律的「能不强推就不强推」)。冲突解决:kernel 版本取 0.0.196(master 的 0.0.195 + 1,因 PR 仍含 kernel/src/** 改动,Kernel Boundary 版本纪律要求相对新 base 再 bump);两个 lockfile 用 lock-sync 门禁的原命令重新生成(npm install --package-lock-only --ignore-scripts --no-fund --no-audit,root + kernel/)。自动合并结果逐点核验:PR 的 compress merges disjoint ranges into earlier coverage but retains only the last summary #5830 守卫与 master 的 Reaching out to the author — a plugin bug is throwing errors and causing the context to balloon rapidly. | 求助作者,插件bug报错导致上下文急速增加 #5789/New error in v0.213, following up on the previous bug where old blocks can't be compressed and tokens double. | 0.213版本新报错,接着上次的旧块无法压缩token翻倍bug #5919 改动同时在场,新增 import(parseBoundary/indexToRef/refToIndex)在合并后的文件里全部有对应导出。
  4. 是否有回归问题:无。合并后对 master 的净 diff 恰好是原 PR 的 9 个文件,无夹带;typecheck 全树干净;定向测试 29/29(PR 的 2 个 kernel 测试 + master 同区 4 个:5789/5919/4484/5765)+ issue5152 测试 3×6/6;CI 全矩阵绿(27 success + 1 skip)。语义交互核对:PR 的 window 守卫在 projectUnit 中位于 master 恢复梯之前执行,且对递归排除重试同样生效(每次调用按实际 consumed blocks 判定),两者不互斥。
  5. 是否破坏缓存:不涉及。
  6. 是否改了设计方向:没有。
  7. 是否引入新配置:没有。

备注:mirror cache 本轮又滞后(长时间显示 5 个 test 分片 in_progress),真值以单次 GitHub API 拉取的主 CI run jobs 为准。已按协调政策在 #4599 留一行结论。

判定:冲突已解、全部 check 绿,可合并(合并动作由人工执行)。

…rge state, #5835)

- kernel version: master 0.0.197 + this PR's merge-window guard -> 0.0.198
  (kernel/src changes present in the merge, so a bump above master is required)
- #5152 port-handoff race: keep the PR's atomic-publish receiver fixture +
  valid-port polling as a coherent pair; master's parent-polling fix is subsumed
- lockfiles regenerated to kernel 0.0.198 (root + kernel, lock-sync clean)
- build + typecheck + targeted kernel (issue5830-merge-window-guard,
  regression-empty-rewrap) and #5152 tests all green
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Merge conflict resolved and pushed — PR is now mergeable.

The PR (GitHub #5835) was in dirty merge state: its branch 2026-11-07_compress-window-coverage-guard was 495 commits behind master and conflicted on 4 files. A prior merge attempt (108681d45) had integrated an older master (dc041dd1), but master advanced further and the conflicts re-surfaced.

I merged current master into the branch and resolved all 4 conflicts:

Verified before pushing: npm run build + typecheck green; targeted tests green — kernel issue5830-merge-window-guard (8 pass), regression-empty-rewrap, and issue5152-owner-beat (6 pass). Pushed as a fast-forward (fetched first; remote head was an ancestor, so no force-push). I did not edit the PR body — the kernel-change: declaration was already present for the PR's own kernel work, and my version bump is its consequence, not a new kernel change.

Current state: mergeable: true (was false/dirty); mergeable_state: blocked by CI/reviews, not by conflict. CI is running on the new head fa82e6417 — 18 checks completed (all green), 14 queued, 1 in progress, 0 failures so far. If a lane goes red, that's the red-CI half of this bot's job for the next attempt.


七问:

  1. 是什么问题:PR [PR] fix(kernel): reject range folds that would merge blocks beyond the requested ref window #5835 处于 dirty 合并态——分支落后 master 495 个提交、4 个文件冲突,无法合并。
  2. 什么原因导致的:分支从旧 master 切出后未跟进;之前的合并尝试(108681d45)只合入了更旧的 master(dc041dd1),master 继续前进后冲突重现。
  3. 影响范围与严重程度:仅影响该 PR 的可合并性,无用户侧影响;冲突局限于 kernel 版本号(3 个文件)与 [Bug] Watchdog takes its stale-heartbeat reading on its own event loop, so a synchronous stall kills a live proxy (parent-gone → uncompressed 400) #5152 端口握手测试(1 个文件)。
  4. 怎么修复的:把当前 master 合入分支并解决 4 处冲突——kernel 版本取 master 0.0.197 之上 +1 = 0.0.198(合并含 kernel/src 变更,必须高于 master),两个 lockfile 重新生成;[Bug] Watchdog takes its stale-heartbeat reading on its own event loop, so a synchronous stall kills a live proxy (parent-gone → uncompressed 400) #5152 测试保留 PR 侧(与原子发布 receiver 配套),master 侧父进程轮询修复被吸收;fast-forward 推送(推送前已 fetch,远端头是祖先,未 force-push)。
  5. 是否有回归问题:无。build + typecheck 绿;定向测试绿(kernel issue5830-merge-window-guard 8 过、regression-empty-rewrap、[Bug] Watchdog takes its stale-heartbeat reading on its own event loop, so a synchronous stall kills a live proxy (parent-gone → uncompressed 400) #5152 owner-beat 6 过)。合并只带入 master 既有变更 + 解决版本/测试冲突,未改动 PR 的 kernel 守卫行为。
  6. 是否破坏缓存:不涉及。未触碰任何缓存/重试/游标/去重逻辑。
  7. 是否改了设计方向 / 引入新配置:无设计转向,无新配置。kernel 版本 0.0.197→0.0.198 是 PR kernel/src 变更的版本纪律后果,不是新旋钮。

@ranxianglei ranxianglei left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Independent review of head fa82e6417 (branch contains all of current master faf0af61a). Findings only — this PR touches kernel/ and carries a kernel-change: declaration, so merge authorization stays with the owner (see the follow-up comment). No blocking findings; the fix is correct and precisely scoped.

1. Gate predicate matches the apply-side block-creation condition exactly. The gate (kernel/src/unit-projection.ts:270-357) fires on !isBlockBoundary && consumedBlockIds.length > 0 && filteredIds.length > 0. Checked against kernel/src/compress.ts: the filteredIds===0 && consumedBlockIds>0 plain-range shape is handled as an in-place refold or a no-op at compress.ts:1849-1894 before any block is created, and compress.ts:1898 no-ops only when both are empty. So the gate's "pure resubmits don't create a block" exemption is accurate — the predicate is neither over-broad (it would not reject refolds/no-ops) nor under-broad (it would not let a coverage-losing merge through).

2. Containment judgment is sound. Per-id containment of each consumed block's mappable coverage in the requested window; the span is widened by pair/reasoning only when BOTH endpoints resolve in place (preserving the #5531 stranded-pair recovery path), while a snapped endpoint — the #5830 producer via activeOwnerAnchor (boundaries.ts:271) — is judged on the literal window. Unmappable coverage fails closed. Reversed ranges are handled (min/max window + order-independent endpoint check).

3. Exemptions are principled. Block-boundary ranges (incl. mixed bN..mM) are explicit block merges: the model names a block and sees the consumed blocks' rendered summaries, so its distillation covers the merged content. The #5830 pathology is specific to plain ranges, where block consumption is a hidden side effect the model never asked for. The gate closes exactly that hole.

4. Atomicity and single-projection discipline (#3236) hold. fatal kind window is thrown at compress.ts:1818 with preLoopState rollback (zero commits — pinned by test 1's blocksCreated===0 + coverage deep-equal); recommend demotes fatal units to gaps (no advertise→reject loop); report.ts:514-515 flags the kind so acp_status rows match the apply verdict. The gate consumes consumedBlockIds after the #5789 recovery-ladder exclusion is applied, so recursive exclusion retries re-judge on the actual consumed set.

5. Tests pin both directions (#3617). kernel/tests/issue5830-merge-window-guard.test.ts: repro (stale-inherited start + pruned view → atomic reject naming b4, zero commits, no coverage loss) + 3 controls (legit in-window merge lands; covered resubmit no-op; bN..bM distillation untouched). kernel/tests/regression-empty-rewrap.test.ts: #199 fixture repaired to a production-shaped inherited ledger + a new fail-closed pin (unmappable coverage → reject). Ran both files locally: 8/8 pass. Real applyCompression API, realistic full-resend-host fixture.

6. House conventions. kernel-change: declaration present; kernel version 0.0.197→0.0.198 with both lockfiles in sync; unit-projection.ts is not a verif-guarded file (no verif work required; verif-subset-guard green on CI); no config surface, no new env vars; behavior change disclosed OLD→NEW in the PR body. The #5152 test-side race fix (atomic tmp+rename publish + valid-port polling) is test-only, clearly labeled, and correct.

CI on fa82e6417: 30 checks, 0 failed, 0 pending (14 skipped by design).

@ranxianglei

Copy link
Copy Markdown
Owner Author

🔶 需要决策

本 PR 触碰 kernel/ 且正文已带 kernel-change: 声明——按 Kernel Boundary 规则 3,kernel 变更属人工评审档,review 侧不批准合并,需 owner 授权。

请 owner 授权合并或指示处置。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重: 不重复——本线程 floor 6 已给过查重结论(open/closed issue 与 PR 无其他条目针对 #5830 的机制);本轮是 review lane 对同一 PR 的独立复审,非新立项。
标签: 保留 bug + scope/kernel + p1;新增 needs-decision(kernel 变更属人工评审档,待 owner 授权)。

本轮为 review lane 独立复审(head fa82e6417,分支已含当前 master faf0af61a 全部提交)。未照抄前轮(floor 7)结论——重新通读了 diff、apply/recommend/report 三条路径、边界解析机制与测试,并本地定向跑了两个 kernel 测试文件(8/8 绿)。已在 PR 上提交 findings-only review 与 🔶 需要决策 评论,并打上 needs-decision 标签。

八问

  1. 是什么问题:普通 message-ref 区间折叠(mNNNNN..mMMMMM)会静默合并掉那些覆盖范围超出请求窗口的活跃块——新块只带最后一个区间的摘要,被吞块的摘要被悄悄替换(生产事故:一个块罩住从会话开始的 1566 条消息,只带一条 2456 字符的尾段摘要)。
  2. 什么原因导致的:projectUnit 判定要吞哪些块时,只看「块的可见表示(渲染摘要或最早存活的 raw)是否落在解析后的 span 内」;而一个 stale inherited ref 经 activeOwnerAnchor 会解析到继承块的锚点位置(view-index 空间里的无界跳跃),使解析 span 远超请求窗口 → 沿途所有同层块被拖进合并。修复必须落在 kernel 的共享投影里([Bug] recommend/apply 对同一区间的 turn-integrity 判定永久不一致:acp_status 反复推荐的区间被 apply 侧整段拒绝(0.1.196,Range would split N turn(s) at the protected-zone boundary) #3236 单一投影纪律),host 侧修不了。
  3. 影响范围与严重程度:p1 数据质量类(活跃摘要覆盖丢失;原件可经 decompress/directBlockIds 找回,但面板/reconcile 看到的是大跨度薄摘要)。触发面:任何解析 span 会扫到窗外同层活跃块的普通 m..m 折叠(pruned view/compaction 后的 stale inherited ref 是典型路径)。
  4. 怎么修复的:在 projectUnit 单一决策点加一道硬门(fatal kind window):普通区间若会吞掉一个覆盖超出窗口的活跃块,整批原子拒绝(零提交),错误点名越界块并给两条出路(bN..bM 或收窄区间);包含判定按 mappable coverage id 逐格进行,两端都 in-place 解析时按 pair/reasoning 扩边后的实际 span 判(保住 Context compression leak — rose to 350k | 上下文压缩泄露 涨到 35w #5531 恢复路径),不可映射覆盖 fail-closed;块边界蒸馏与纯 resubmit 豁免。
  5. 是否有回归问题:逐项核过既有行为——① gate 谓词 !isBlockBoundary && consumedBlockIds>0 && filteredIds>0 与 apply 侧建块条件一一对应(compress.ts:1849-1894 在 filteredIds===0 形状建块前已按 refold/no-op 处理,1898 仅在两者皆空时 no-op),既不过拒也不漏放;② recommend 把 fatal 单元降级为 gap(无 advertise→reject 循环);③ report.ts 的 ⚠ 行与 apply 判决一致;④ gate 位于 Reaching out to the author — a plugin bug is throwing errors and causing the context to balloon rapidly. | 求助作者,插件bug报错导致上下文急速增加 #5789 恢复梯排除之后,递归排除重试按实际 consumed 集重判;⑤ 豁免面(bN..bM、混合 bN..mM、纯 resubmit)有原则依据(块边界操作是显式合并,模型看得到被吞块摘要)且不变;⑥ [Bug] Watchdog takes its stale-heartbeat reading on its own event loop, so a synchronous stall kills a live proxy (parent-gone → uncompressed 400) #5152 测试竞态修复是纯测试侧(原子发布 + 有效端口轮询),零产品行为面。高危模式(语义漂移、fail-fast 变吞错、阈值/时序/输出格式漂移)逐项过:均不涉及。唯一行为变更就是本修复本身(见披露)。
  6. 是否破坏缓存:不涉及(未触碰任何缓存/重试/增量游标/去重键)。
  7. 是否改了设计方向:不涉及——gate 留在 projectUnit 共享投影内,[Bug] recommend/apply 对同一区间的 turn-integrity 判定永久不一致:acp_status 反复推荐的区间被 apply 侧整段拒绝(0.1.196,Range would split N turn(s) at the protected-zone boundary) #3236 纪律不变。
  8. 是否引入了新的配置:无 env/config/默认值变更。行为变更披露(OLD→NEW):越窗的普通区间折叠,旧行为 = 静默落盘(被吞块摘要被替换,可经 decompress 找回)→ 新行为 = 整批原子硬拒 + 点名越界块的可操作错误;窗内合法合并、蒸馏、幂等 resubmit 均不变。kernel 版本 0.0.197→0.0.198(版本纪律后果,双 lockfile 同步)。

判定:PR 内容本身可合——修复正确、范围精准、测试双向钉死、CI 全绿(30 checks,0 failed)。因触碰 kernel/,按 Kernel Boundary 属人工评审档:已提交 findings-only review 与 🔶 需要决策 评论、打 needs-decision 标签,合并待 owner 授权。

… (dirty merge state, #5835)

Master advanced 271 commits (kernel 0.0.197 -> 0.0.199) since the last merge. Resolved 3 version conflicts: kernel version -> 0.0.200 (master's 0.0.199 + 1 for the PR's merge-window guard kernel/src changes), lockfiles regenerated to 0.0.200. Verified: build + typecheck green, issue5830-merge-window-guard 4 pass, regression-empty-rewrap 4 pass.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Run summary — re-resolved the dirty merge state (attempt 1/6)

The PR had become dirty again since the last run: master advanced 271 commits (kernel 0.0.197 → 0.0.199) past the merge-base the previous merge had integrated (faf0af61a), so the PR head (fa82e6417) conflicted with the new master (a446a3c1c).

What I did:

  1. Checked out the PR branch at its remote head (fa82e6417), merged current master (a446a3c1c).
  2. Resolved 3 version conflicts (the PR's kernel change — the merge-window guard in kernel/src/unit-projection.ts + kernel/src/report.ts — auto-merged cleanly; master didn't touch those files):
    • kernel/package.json: 0.0.198 (PR) vs 0.0.199 (master) → 0.0.200 (master's 0.0.199 + 1 for the PR's merge-window-guard kernel/src changes).
    • kernel/package-lock.json: took master's side, regenerated to 0.0.200.
    • package-lock.json (root): took master's side, regenerated to 0.0.200.
  3. Verified locally before pushing (CI-hold discipline — this push is the final head, no [ework:ci-held] marker):
    • npm run build — green
    • npm run typecheck — green
    • kernel/tests/issue5830-merge-window-guard.test.ts — 4 pass / 0 fail
    • kernel/tests/regression-empty-rewrap.test.ts — 4 pass / 0 fail
  4. Pushed aa4175ffaf as a fast-forward (fetched first; remote head was an ancestor, so no force-push).

Live state after push (verified this run):

  • mergeable: True, mergeable_state: blocked — the merge conflict is resolved; the PR is now blocked only by CI (starting up) and reviews, not by a conflict.
  • Mirror cache at last poll: new CI run starting (0 checks yet). The previous head's kernel-guard / lock-sync / version-guard / architecture-docs were all green; the new head re-runs the full suite.

八问

  1. 是什么问题: PR [PR] fix(kernel): reject range folds that would merge blocks beyond the requested ref window #5835 与 master 再次冲突(dirty)——上次合并后 master 又前进了 271 个提交(kernel 0.0.197 → 0.0.199),PR 分支落后导致重新冲突。
  2. 什么原因导致的: master 持续前进,PR 分支(上次合并到 faf0af6)落后 271 个提交;冲突集中在 kernel 版本号(0.0.198 vs 0.0.199)和两个 lockfile 的版本字段。
  3. 影响范围与严重程度: 仅影响 PR 的合并状态(无法合并),不影响任何已发布行为;严重度 = 阻塞合并,无运行时/用户影响。
  4. 怎么修复的: 将当前 master(a446a3c)合并进 PR 分支,解决 3 个版本冲突(kernel 版本 → 0.0.200,两个 lockfile 重新生成到 0.0.200);PR 的 kernel 改动(merge-window guard)自动合并无冲突,保持原样。
  5. 是否有回归问题: 无——本次只是合并 master + 版本号对齐,未改动任何逻辑;PR 的 kernel 改动(merge-window guard)保持原样,本地 build/typecheck/定向测试全绿。
  6. 是否破坏缓存: 不涉及——未触碰缓存/重试/游标/去重键相关代码。
  7. 是否改了设计方向: 不涉及——纯机械合并 + 版本对齐,无架构/边界/数据流变化。
  8. 是否引入了新的配置: 不涉及——未新增任何 env/config/默认值。

判定: 冲突已解决,PR 现为 mergeable(blocked by CI/reviews,非冲突)。等待 CI 全量跑完 + review 后可合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

CI 红腿处置完成:test (windows-latest, 22, 2) = 已知 #5631 负载 flake,非本 PR diff 引入。已触发重跑,等结果。

(补发上一轮 CI 失败处置的结论——上一轮结束前未发出,此处补齐;已在 #4599 留一行状态。)

八问

  1. 是什么问题:head aa4175ffaf 上 CI 全矩阵唯一红腿是 test (windows-latest, 22, 2),唯一失败用例是 restart survival: fold + prefix cache across repeated agent-host restarts (#5631) 的 dsh lane(openai chat shape),cycle1/sigkill/post-restart 0: status 413 preflight_compress_failed(context ~12581 tokens 超 model window 12288,「futile round」)。
  2. 什么原因导致的:已知 post-restart 冷加载竞态(load-flake 家族)——重启后首个请求可能在 proxy 从磁盘重载折叠态之前到达,preflight 窗口检查失败。该家族在 CI Control Center: Centralized CI Failure Handling & Status Sync (Comment all CI issues here; do not open new issues) | CI 总控: CI 失败集中处理与状态同步(所有 CI 问题在此评论, 勿开新 issue) #4599 记录 3+ 次;关键证据:master merge 548e396(不含本 PR 任何改动)的 test 车道也在同一测试上红(CI Control Center: Centralized CI Failure Handling & Status Sync (Comment all CI issues here; do not open new issues) | CI 总控: CI 失败集中处理与状态同步(所有 CI 问题在此评论, 勿开新 issue) #4599 floor 1576)——master 级运行都不含本 PR 的 window guard,故本 PR 不可能是成因。负载敏感(仅 CI 出现),本地定向跑恒绿。
  3. 影响范围与严重程度:仅影响本 PR 的可合并性(一条 CI 腿红),无用户侧/运行时影响。严重度 = CI 信号噪音。
  4. 怎么处置的:判定非本 PR 回归——证据:① 同一测试在 master merge 548e396(不含本 PR 改动)上同样红,排除本 PR 成因;② 失败签名是文档化的冷加载竞态(重启后 413 preflight_compress_failed「futile round」),不是 window guard 的拒绝签名(后者会点名越窗块);③ 本 PR diff 是 kernel projectUnit 的 window guard,与 preflight/restart 路径零交集。处置:触发 rerun-failed-jobs(run 44384445331,HTTP 201),只重跑红腿;根治在 PR [PR] fix(tests): bound-retry the #5631 post-restart cold-load race (known load-flake family) #7164(冷加载竞态 bounded retry,在途,未合入故未 cherry-pick 进本分支)。
  5. 是否有回归问题:无。本 PR diff 未动;本轮纯 CI 状态判定 + 重跑触发,零代码改动。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:不涉及。

判定:PR 内容本身可合(kernel 变更属人工评审档,待 owner 授权,见 floor 26/28);唯一红腿是已知负载 flake,已触发重跑,转绿后全矩阵即绿。若重跑再红,等 #7164 合入后重触发。

@ranxianglei ranxianglei left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review at new head aa4175ffa (master merge) — findings only (kernel PR, not approved).

What changed since my last review (fa82e64): a single merge commit integrating master (a446a3c1c). The PR's own contribution — the window gate in projectUnit — is byte-identical to what I reviewed and verified correct (predicate at kernel/src/unit-projection.ts:295, fatal kind at :347, error message at :351 — none touched).

The master merge is clean. Two master-side changes landed in unit-projection.ts, both in regions orthogonal to the gate:

  • The last-user-anchor note now self-labels as a "historical quote, NOT a new user message" (:470) — a model-facing text change from the ti_an incident, already merged on master.
  • #6709's content-free BLOCKED partner un-doom logic (:665-739) — lets a content-free BLOCKED partner flow to rung 2 instead of dooming the #5919 merge; already merged on master.

Execution order keeps them from interacting: the window gate throws at :295, before the #5919 recovery ladder at :665+ runs. A window-guard fatal never reaches the #6709 path, and the #6709 change only alters which stranded partners doom a merge — it does not change which blocks are consumed, so it cannot feed a new case into the gate.

Version: the PR's 0.0.198 bump collided with master's 0.0.199 (lock-sync #3782); the merge resolved it to 0.0.200, consistent across kernel/package.json + root package-lock.json + kernel/package-lock.json (version-guard green).

Verification at the new head:

  • Local targeted: 16/16 pass (issue5830-merge-window-guard 4 + issue5919-shredded-merge #6709-lockstep + regression-empty-rewrap #199).
  • CI on aa4175ffa: 30 checks, 0 failed (26 success / 1 in-progress / 3 skipped-by-design); kernel-guard, version-guard, lane-guard, architecture-docs all green.
  • master a446a3c1c fully contained; prior PR head fa82e6417 is an ancestor.

Verdict: no new blocking findings, no small findings to fix. The gate remains correct and precisely scoped; the merge is clean. This PR touches kernel/ and carries a kernel-change: declaration, so per Kernel Boundary rule 3 it stays at the human-only review tier — not approved here. See the follow-up 需要决策 comment for the authorization request.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🔶 需要决策

本 PR 触碰 kernel/ 且正文已带 kernel-change: 声明——按 Kernel Boundary 规则 3,kernel 变更属人工评审档,review 侧不批准合并,需 owner 授权。

本轮为 head 更新后的复审(fa82e6417 → aa4175ffa,新增一个 master 合并提交 aa4175ffaf):

门禁 diff(相对 master a446a3c1c):kernel/src/unit-projection.ts(window 守卫 +93)、kernel/src/report.ts(acp_status 标记 +2)、kernel 版本 0.0.199→0.0.200 + 双 lockfile、kernel/tests/ 两个测试文件(issue5830 守卫 4 例 + #199 fixture 修复与 fail-closed 负向钉);另有纯测试侧的 #5152 竞态修复(2 个测试文件,零产品行为面)。

独立审核结论:修复正确且精准,无阻塞发现,无小发现需修。详见上方 findings-only review。

行为变更(PR 正文已披露 OLD→NEW,未变):越窗的普通 message-ref 区间折叠,旧行为 = 静默落盘(被吞块摘要被单尾段摘要替换,#5830 生产事故:一块罩 1566 条消息只带 2456 字符尾摘要)→ 新行为 = 整批原子硬拒 + 点名越界块与两条出路(bN..bM / 收窄区间)的可操作错误;窗内合法合并、蒸馏、幂等 resubmit 均不变。

请 owner 授权合并或指示处置。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重: 不重复——本线程 floor 6 已给过查重结论;本轮是 review lane 对同一 PR 新 head(aa4175ffa,master 合并后)的独立复审,非新立项。
标签: 保留 bug + scope/kernel + p1 + needs-decision(kernel 变更属人工评审档,待 owner 授权)。

本轮为 head 更新后的独立复审(fa82e6417 → aa4175ffa)。未照抄上轮结论——重新核对了新 head 的 diff、master 合并的语义交互、版本解析,并本地定向跑了三个 kernel 测试文件(16/16 绿)。已在 PR 上提交 findings-only review 与更新版 🔶 需要决策 评论,needs-decision 标签已确认。

八问

  1. 是什么问题:普通 message-ref 区间折叠(mNNNNN..mMMMMM)会静默合并掉那些覆盖范围超出请求窗口的活跃块——新块只带最后一个区间的摘要,被吞块的摘要被悄悄替换(生产事故:一个块罩住从会话开始的 1566 条消息,只带一条 2456 字符的尾段摘要)。
  2. 什么原因导致的:projectUnit 判定要吞哪些块时,只看「块的可见表示(渲染摘要或最早存活的 raw)是否落在解析后的 span 内」;而一个 stale inherited ref 经 activeOwnerAnchor 会解析到继承块的锚点位置(view-index 空间里的无界跳跃),使解析 span 远超请求窗口 → 沿途所有同层块被拖进合并。修复必须落在 kernel 的共享投影里([Bug] recommend/apply 对同一区间的 turn-integrity 判定永久不一致:acp_status 反复推荐的区间被 apply 侧整段拒绝(0.1.196,Range would split N turn(s) at the protected-zone boundary) #3236 单一投影纪律),host 侧修不了。
  3. 影响范围与严重程度:p1 数据质量类(活跃摘要覆盖丢失;原件可经 decompress/directBlockIds 找回,但面板/reconcile 看到的是大跨度薄摘要)。触发面:任何解析 span 会扫到窗外同层活跃块的普通 m..m 折叠(pruned view/compaction 后的 stale inherited ref 是典型路径)。
  4. 怎么修复的:在 projectUnit 单一决策点加一道硬门(fatal kind window):普通区间若会吞掉一个覆盖超出窗口的活跃块,整批原子拒绝(零提交),错误点名越界块并给两条出路(bN..bM 或收窄区间);包含判定按 mappable coverage id 逐格进行,两端都 in-place 解析时按 pair/reasoning 扩边后的实际 span 判(保住 Context compression leak — rose to 350k | 上下文压缩泄露 涨到 35w #5531 恢复路径),不可映射覆盖 fail-closed;块边界蒸馏与纯 resubmit 豁免。
  5. 是否有回归问题:新 head 复核——① PR 自身的 window 守卫逐字节未变(谓词 unit-projection.ts:295、fatal kind :347、错误信息 :351),上轮已验证正确;② master 合并落进 unit-projection.ts 的两处改动(anchor 注记 :470、Version 0.214: compression issues still persist. The problem of old blocks failing to compress remains unresolved. | 0.214版本,压缩依旧存在问题,旧块无法压缩问题依旧存在 #6709 content-free BLOCKED 解除 doom :665-739)与守卫正交,且守卫在 :295 抛出、早于 :665+ 的 New error in v0.213, following up on the previous bug where old blocks can't be compressed and tokens double. | 0.213版本新报错,接着上次的旧块无法压缩token翻倍bug #5919 恢复梯,执行顺序保证不交互——Version 0.214: compression issues still persist. The problem of old blocks failing to compress remains unresolved. | 0.214版本,压缩依旧存在问题,旧块无法压缩问题依旧存在 #6709 只改「哪些 stranded partner doom 合并」,不改「消费哪些块」,无法给守卫喂入新 case;③ 版本 0.0.198(PR)vs 0.0.199(master)冲突解析为 0.0.200,双 lockfile 一致(version-guard 绿);④ 高危模式(语义漂移、fail-fast 变吞错、阈值/时序/输出格式漂移)逐项过:均不涉及。唯一行为变更就是本修复本身(见披露)。
  6. 是否破坏缓存:不涉及(未触碰任何缓存/重试/增量游标/去重键)。
  7. 是否改了设计方向:不涉及——gate 留在 projectUnit 共享投影内,[Bug] recommend/apply 对同一区间的 turn-integrity 判定永久不一致:acp_status 反复推荐的区间被 apply 侧整段拒绝(0.1.196,Range would split N turn(s) at the protected-zone boundary) #3236 纪律不变。
  8. 是否引入了新的配置:无 env/config/默认值变更。行为变更披露(OLD→NEW,未变):越窗的普通区间折叠,旧行为 = 静默落盘(被吞块摘要被替换,可经 decompress 找回)→ 新行为 = 整批原子硬拒 + 点名越界块的可操作错误;窗内合法合并、蒸馏、幂等 resubmit 均不变。kernel 版本(相对 master)0.0.199→0.0.200(版本纪律后果,双 lockfile 同步)。

判定:PR 内容本身可合——修复正确、范围精准、测试双向钉死(本地定向 16/16)、CI 全绿(30 checks,0 failed)、master 合并干净。因触碰 kernel/,按 Kernel Boundary 属人工评审档:已提交 findings-only review 与更新版 🔶 需要决策 评论、needs-decision 标签已确认,合并待 owner 授权。

… (dirty merge state, #5835)

Master advanced 99 commits (kernel 0.0.200 -> 0.0.201) since the last merge. Resolved 3 version conflicts: kernel version -> 0.0.202 (master's 0.0.201 + 1 for this PR's merge-window guard kernel/src changes), lockfiles regenerated to 0.0.202. Verified: build + typecheck green, issue5830-merge-window-guard 4 pass, regression-empty-rewrap 4 pass, issue5152-owner-beat 6 pass.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

冲突已解决并推送:merge commit a3abdd7c203(无 [ework:ci-held] 标记,CI 全量跑)。合并状态应转 clean。

七问

  1. 是什么问题:PR 与 base 分支冲突(merge state: dirty)——master 自上次合入(a446a3c1c)后又前进了 99 个 commit(到 ba2e8198203),kernel/package.json、kernel/package-lock.json、package-lock.json 三个文件冲突,PR 无法合并。
  2. 什么原因导致的:本 PR 改 kernel/src/**(merge-window guard),按版本纪律 kernel 版本必须高于 master;master 侧 kernel 已到 0.0.201,PR head 是 0.0.200,version 行三方冲突。与前两轮(108681d、fa82e6417、aa4175ffaf)完全同一模式——PR 在途期间 master 持续前进的常规版本冲突,非代码逻辑冲突。
  3. 影响范围与严重程度:仅阻塞本 PR 可合并性,无运行时/用户侧影响。
  4. 怎么修复的:git merge origin/master(ba2e819)进 PR 分支;三处冲突解法——kernel 版本 → 0.0.202(master 的 0.0.201 + 1,因本 PR 含 kernel/src 变更,必须高于 master);两份 lockfile 取 master 侧后按 lock-sync 门命令重新生成到 0.0.202。本地验证:build ✅、typecheck ✅、定向测试全绿——issue5830-merge-window-guard 4 pass、regression-empty-rewrap 4 pass、issue5152-owner-beat 6 pass。合并后相对 master 的净 diff 恰为 PR 原有 9 个文件(unit-projection.ts +93、report.ts +2、两个 kernel 测试、version+lockfiles、[Bug] Watchdog takes its stale-heartbeat reading on its own event loop, so a synchronous stall kills a live proxy (parent-gone → uncompressed 400) #5152 测试两文件),零多余改动。
  5. 是否有回归问题:无。本轮只解 version/lockfile 冲突,PR diff 本身未动(净 diff 已核对);master 侧 99 个 commit 的变更随 merge 原样带入,未做任何取舍。
  6. 是否破坏了缓存:不涉及。
  7. 是否改了设计方向 / 引入了新配置:均不涉及。

状态:最终 head a3abdd7c203 已推送(先 fetch 确认远端 head 未动,fast-forward 推送,无 force-push)。CI 将对该 head 全量跑一次;另注:镜像缓存显示上一 head aa4175ffaf 的 30 项 check 已全绿(上轮触发的 windows-22-2 #5631 flake 重跑已转绿)。PR 内容侧仍待 owner kernel 档授权(floor 26/28,needs-decision 标签在)。

@ranxianglei ranxianglei left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review at head a3abdd7c203 (third head; progression fa82e6417 → aa4175ffa → a3abdd7c203).

What changed since the last head (aa4175ffa): one master-merge commit integrating master ba2e8198203. The PR's own contribution is byte-identical — kernel/src/unit-projection.ts (the window guard) and kernel/src/report.ts are untouched by the merge (git diff aa4175ffa a3abdd7c203 -- kernel/src/unit-projection.ts kernel/src/report.ts is empty).

Master-merge cleanliness: the merge pulled in the #7428 batch-seam double-claim fix in kernel/src/compress.ts (refreshes preExistingCoverage at the top of the apply loop so each sibling range claims against earlier siblings in the same batch; refines the no-op warning wording). I traced the call flow: projectUnit (the guard) runs at compress.ts:1780 inside applySingleRange, which runs after the preExistingCoverage refresh at :817. The guard reads consumedBlockIds + block.effectiveMessageIds + messageRefs — it does not read preExistingCoverage, so the batch-seam fix does not change the guard's judgment for a given range. The only interaction is the intended one: earlier siblings now create active blocks in the shared state, so a later sibling's consumedBlockIds reflects them — which is exactly the cross-window merge the guard exists to reject. No regression.

Version: master 0.0.201 → PR head 0.0.202 (version-discipline consequence of the in-repo kernel change; consistent across kernel/package.json + both lockfiles).

Verification at the new head: local targeted 19/19 pass (window guard 4 + #7428 batch-seam + #6709 shredded-merge + #199 empty-rewrap); CI 30 checks, 0 failed, 0 pending; master ba2e8198203 fully contained, prior head aa4175ffa is an ancestor.

Gated diff (vs master ba2e8198203): kernel/src/unit-projection.ts (+93, the window guard), kernel/src/report.ts (+2, acp_status flag), kernel version 0.0.201→0.0.202 + both lockfiles, kernel/tests/issue5830-merge-window-guard.test.ts (+174, 4 tests), kernel/tests/regression-empty-rewrap.test.ts (+76/-1, #199 fixture repair + fail-closed pin); plus test-only #5152 race fix (2 files, zero product behavior).

Independent verdict: the fix is correct and precisely scoped; the master merge is clean; no blocking findings, no small findings to fix.

Authorization boundary: this PR touches kernel/ and carries a kernel-change: declaration — per Kernel Boundary rule 3, kernel changes sit at the human-only review tier. I am not approving. See the follow-up 🔶 需要决策 comment for the owner-authorization request.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🔶 需要决策

本 PR 触碰 kernel/ 且正文已带 kernel-change: 声明——按 Kernel Boundary 规则 3,kernel 变更属人工评审档,review 侧不批准合并,需 owner 授权。

本轮为 head 更新后的第三轮复审(aa4175ffa → a3abdd7c203,新增一个 master 合并提交,集成 master ba2e8198203):

门禁 diff(相对 master ba2e8198203):kernel/src/unit-projection.ts(window 守卫 +93)、kernel/src/report.ts(acp_status 标记 +2)、kernel 版本 0.0.201→0.0.202 + 双 lockfile、kernel/tests/issue5830-merge-window-guard.test.ts(+174,4 例)、kernel/tests/regression-empty-rewrap.test.ts(+76/-1,#199 fixture 修复 + fail-closed 负向钉);另有纯测试侧的 #5152 竞态修复(2 个测试文件,零产品行为面)。

独立审核结论:修复正确且精准,master 合并干净,无阻塞发现,无小发现需修。详见上方 findings-only review。

行为变更(PR 正文已披露 OLD→NEW,未变):越窗的普通 message-ref 区间折叠,旧行为 = 静默落盘(被吞块摘要被单尾段摘要替换,#5830 生产事故:一块罩 1566 条消息只带 2456 字符尾摘要)→ 新行为 = 整批原子硬拒 + 点名越界块与两条出路(bN..bM / 收窄区间)的可操作错误;窗内合法合并、蒸馏、幂等 resubmit 均不变。

请 owner 授权合并或指示处置。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重: 不重复——本线程 floor 6 已给过查重结论;本轮是 review lane 对同一 PR 第三轮 head(a3abdd7c203,master 合并后)的独立复审,非新立项。
标签: 保留 bug + scope/kernel + p1 + needs-decision(kernel 变更属人工评审档,待 owner 授权)。

本轮为 head 更新后的第三轮独立复审(aa4175ffa → a3abdd7c203)。未照抄前两轮结论——重新核对了新 head 的 diff、master 合并带入的 #7428 batch-seam 修复与守卫的交互、版本解析,并本地定向跑了四个 kernel 测试文件(19/19 绿)。已在 PR 上提交 findings-only review 与更新版 🔶 需要决策 评论,needs-decision 标签已确认。

八问

  1. 是什么问题:普通 message-ref 区间折叠(mNNNNN..mMMMMM)会静默合并掉那些覆盖范围超出请求窗口的活跃块——新块只带最后一个区间的摘要,被吞块的摘要被悄悄替换(生产事故:一个块罩住从会话开始的 1566 条消息,只带一条 2456 字符的尾段摘要)。
  2. 什么原因导致的:projectUnit 判定要吞哪些块时,只看「块的可见表示是否落在解析后的 span 内」;而一个 stale inherited ref 经 activeOwnerAnchor 会解析到继承块的锚点位置(view-index 空间里的无界跳跃),使解析 span 远超请求窗口 → 沿途所有同层块被拖进合并。修复必须落在 kernel 的共享投影里([Bug] recommend/apply 对同一区间的 turn-integrity 判定永久不一致:acp_status 反复推荐的区间被 apply 侧整段拒绝(0.1.196,Range would split N turn(s) at the protected-zone boundary) #3236 单一投影纪律),host 侧修不了。
  3. 影响范围与严重程度:p1 数据质量类(活跃摘要覆盖丢失;原件可经 decompress/directBlockIds 找回,但面板/reconcile 看到的是大跨度薄摘要)。触发面:任何解析 span 会扫到窗外同层活跃块的普通 m..m 折叠(pruned view/compaction 后的 stale inherited ref 是典型路径)。
  4. 怎么修复的:在 projectUnit 单一决策点加一道硬门(fatal kind window):普通区间若会吞掉一个覆盖超出窗口的活跃块,整批原子拒绝(零提交),错误点名越界块并给两条出路(bN..bM 或收窄区间);包含判定按 mappable coverage id 逐格进行,两端都 in-place 解析时按 pair/reasoning 扩边后的实际 span 判(保住 Context compression leak — rose to 350k | 上下文压缩泄露 涨到 35w #5531 恢复路径),不可映射覆盖 fail-closed;块边界蒸馏与纯 resubmit 豁免。
  5. 是否有回归问题:新 head 复核——① PR 自身的 window 守卫逐字节未变(unit-projection.ts、report.ts 均未被合并触碰),前两轮已验证正确;② 本次 master 合并带入 [PR] fix: two adjacent ranges in one compress batch both claimed the shared seam tool pair — first-come-first-served #7428 batch-seam 双重认领修复(compress.ts apply 阶段刷新 preExistingCoverage),追调用链确认:守卫在 compress.ts:1780 的 applySingleRange 内运行、晚于 :817 的刷新,且守卫只读 consumedBlockIds+block.effectiveMessageIds+messageRefs、不读 preExistingCoverage,故不改变守卫对任一区间的判决;唯一交互是预期内的(更早 sibling 在共享状态建出活跃块,使更晚 sibling 的 consumedBlockIds 反映它们——正是守卫要拦的越窗合并),无回归;③ 版本 master 0.0.201 → PR head 0.0.202,双 lockfile 一致(version-guard 绿);④ 高危模式(语义漂移、fail-fast 变吞错、阈值/时序/输出格式漂移)逐项过:均不涉及。唯一行为变更就是本修复本身(见披露)。
  6. 是否破坏缓存:不涉及(未触碰任何缓存/重试/增量游标/去重键)。
  7. 是否改了设计方向:不涉及——gate 留在 projectUnit 共享投影内,[Bug] recommend/apply 对同一区间的 turn-integrity 判定永久不一致:acp_status 反复推荐的区间被 apply 侧整段拒绝(0.1.196,Range would split N turn(s) at the protected-zone boundary) #3236 纪律不变。
  8. 是否引入了新的配置:无 env/config/默认值变更。行为变更披露(OLD→NEW,未变):越窗的普通区间折叠,旧行为 = 静默落盘(被吞块摘要被替换,可经 decompress 找回)→ 新行为 = 整批原子硬拒 + 点名越界块的可操作错误;窗内合法合并、蒸馏、幂等 resubmit 均不变。kernel 版本(相对 master)0.0.201→0.0.202(版本纪律后果,双 lockfile 同步)。

判定:PR 内容本身可合——修复正确、范围精准、测试双向钉死(本地定向 19/19)、CI 全绿(30 checks,0 failed,0 pending)、master 合并干净。因触碰 kernel/,按 Kernel Boundary 属人工评审档:已提交 findings-only review 与更新版 🔶 需要决策 评论、needs-decision 标签已确认,合并待 owner 授权。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

第三轮复审收尾确认(head a3abdd7c203,master 合并后):

  • PR 自身 window 守卫逐字节未变(unit-projection.ts + report.ts 未被合并触碰),前两轮已验证正确。
  • master 合并干净:带入的 [PR] fix: two adjacent ranges in one compress batch both claimed the shared seam tool pair — first-come-first-served #7428 batch-seam 修复在 compress.ts apply 阶段、不读 preExistingCoverage,与守卫无交互(唯一交互是预期内的越窗合并拦截);master ba2e8198203 完全包含,旧 head aa4175ffa 为祖先。
  • 版本 master 0.0.201 → PR head 0.0.202,双 lockfile 一致(version-guard 绿)。
  • 验证:本地定向 19/19 绿;CI 30 checks,0 failed,0 pending。

结论:无阻塞发现、无小发现需修,PR 内容本身可合。因触碰 kernel/,按 Kernel Boundary 属人工评审档——已在 PR 上提交 findings-only review 与 🔶 需要决策 评论、needs-decision 标签已确认,合并待 owner 授权。完整八问见上方楼层。

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

compress merges disjoint ranges into earlier coverage but retains only the last summary

1 participant