Repository navigation
kernel: 已消费但非重折叠的压缩单元不再被推荐——推荐端与执行端对同一形状意见一致 - #3381
Conversation
screenRecommendedUnits advertised a message-ref unit whose entire span
is already owned by an active, NOT restored-inline block — the exact
shape applySingleRange's livelock guard (pi#199) is guaranteed to reject
('Range .. contains no new compressible messages'), unless the #398
refold verdict classifies it a genuine in-place refold. Recommend and
apply disagreed on one shape: advertise -> reject -> re-advertise, the
#3236 loop family reached through the consumed-unit corner.
The verdict (evaluateRefold + requestedRefoldSpan + RefoldDecision) moves
verbatim from compress.ts to refold.ts so both lanes consult the SAME
definition — the projectUnit discipline. The screen now mirrors the
apply-side guard exactly: filteredIds === 0 && consumedBlockIds > 0 &&
!isBlockBoundary survives only when evaluateRefold says 'refold'.
Block-boundary units (bN..bM promote/merge) stay exempt, same as apply.
No public kernel surface change; the golden ledger is untouched.
Also bumps kernel to 0.0.127 and regenerates package-lock.json, which
had drifted to 0.0.123 through six version bumps (#3331 review C-H1) —
npm ci in a clean checkout would have failed.
Kernel boundary: owner-approved via #3371.
Tests: kernel suite 1279/1279 incl. new issue3371 fixture (screened-out
shape + apply agreement, genuine refold stays advertised and updates b1
in place, fresh spans unaffected); bili-side compress-reject-reasons 4/4,
compress-recovery-ranges 10/10, e2e-compress-cascade 7/7; root tsc clean.
Closes #3371
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.3988-pr.3381.ef2d103This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3381.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 查重:不重复。 本 PR 是 #3371(来自 #3331 区间审查 C-M1)的修复 PR。open PR 里扫过同域(refold / recommend 筛选):#2785(overflow refold 采纳 Prepared)、#3353(coverage-regressing fold 拒绝)、#3141(empty view DEAD refs)——症状与机制均不同,无并行修复同一形状的死循环。 开始正式 review:拉分支、核对 diff、跑定向测试、查 CI,随后按八问出结论。 |
) The #3371 fix bumped kernel/package.json 0.0.126 -> 0.0.127 and regenerated kernel/package-lock.json, but the ROOT package-lock.json still recorded the linked kernel entry at 0.0.126 — the lock-sync gate (npm install --package-lock-only + git diff) fails on exactly that line, which cascades skips into every test leg (needs: lock-sync). Regenerated with npm install --package-lock-only; single-line change.
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) PR #3381 审核完成——可合(kernel 变更按规矩留人类合并)。审核独立重做:diff 逐文件读了改动前/后两侧代码,行为清单按既有行为逐项清点,不是复读 issue 结论。 结构化八问
证据(本地定向验证,非全量预跑)
审核中发现并已修的问题(独立标注 commit)原 head 收工判定方向对(修根因不修症状)、方案与执行端同构、回归清单干净、测试有牙且复现钉死、CI 全绿。建议合并;kernel 变更按 Kernel Boundary 第 3 条由人类执行合并,合并后 #3371 自动关闭。 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.494-master.73d9360 # this exact build
npm install -g billion-context@master # always the newest merged build
|
ai: zhipuai-lb/glm-5.3
kernel-change: screen consumed non-refold units out of recommendations so the recommend lane cannot advertise a range the apply lane is guaranteed to reject (#3371, owner-approved in-issue)
什么坏了(#3371)
压缩分两端,推荐端(
screenRecommendedUnits)决定给模型推荐哪些压缩区间,执行端(applySingleRange)决定提交后能不能真压。有一种形状两端意见相反:区间内没有任何新消息、整个区间都已被某个活跃折叠块占有,但该块不是行内还原状态(未restoredInline)。evaluateRefold认定它是合法的 fix: isolate side requests (title-gen) from main session kernel state #398 就地重折叠(区间内所有块已行内还原、祖先链完整)才放行。结果是:推荐 → 拒绝 → 状态没变 → 再推荐 → 再拒绝,模型被卡在死循环里——这正是 #3236 立项要消灭的循环,穿过最后一个没堵的形状活着。
修复
evaluateRefold+requestedRefoldSpan+RefoldDecision逐字从compress.ts提取到新模块kernel/src/refold.ts,推荐端和执行端从此查同一份判定——与 [Bug] recommend/apply 对同一区间的 turn-integrity 判定永久不一致:acp_status 反复推荐的区间被 apply 侧整段拒绝(0.1.196,Range would split N turn(s) at the protected-zone boundary) #3236 把projectUnit提取为单一投影同一纪律。filteredIds===0 && consumedBlockIds>0 && !isBlockBoundary的单元只有evaluateRefold判 "refold" 才保留;真重折叠(fix: isolate side requests (title-gen) from main session kernel state #398)照常推荐,块边界区间(bN..bM 提升/合并)照常豁免——与执行端完全同构。顺带:kernel 版本 0.0.126 → 0.0.127,并重新生成
kernel/package-lock.json——它已漂移到 0.0.123(六次版本 bump 没重新生成,#3331 审查 C-H1),干净 checkout 上npm ci会挂。此 PR 一并修正。测试
kernel/tests/issue3371-consumed-unit-screen.test.ts:①坏形状被筛掉且执行端同意见(拒绝信息正是 livelock 守卫);②真重折叠仍被推荐且执行端就地把 b1 更新(摘要换新、还原标记清除、不建新块);③新消息区间不受影响(无过度筛选)。Kernel Boundary 合规
来自 #3331 区间审查(C-M1)。Closes #3371。