Repository navigation
kernel: selector screens live carriers; withdrawal judged on original array class (#2663) - #2669
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.2970-pr.2669.7bc7081This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2669.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 PR #2669 review(kernel 变更 · human-only tier) 已对 master 结构化八问
版本纪律:仅 测试有效性:5 个新测试全有牙——主 repro(#2638 几何)对每一个广告区间跑 diff 整洁度:单提交、每行都服务于本 PR 目的,无跑题/空行/生成物 churn(除已说明的 lockfile resync)。干净。 次要观察(非阻塞,未推 commit):① 收工判定:可合并——方向打到根因、四个 facet 一并处理、双层测试有牙、CI 全绿、diff 干净、所有行为变更均已披露。按 Kernel Boundary,kernel 变更为 human-only,我不合并,请 owner 自行合并:#2669 |
6a50baf to
835db70
Compare
… array class (#2663) The range selector (buildCompressibleRanges) advertised spans the apply side structurally rejects: live checkpoint carriers (#335) survive pruning but are carved out at apply time, so a span bridging carriers over covered raws resolved to zero foldable messages and threw every turn (#2638). The two screens also judged two different array classes for integrity withdrawal. - state.ts: shared isLiveCheckpointCarrier predicate — single source of truth for selector and apply side - recommend.ts: live carriers screen as gaps so no advertised group bridges across them; new optional integritySource param lets the withdrawal screening run on the same array class the apply gate judges (default: passed array) - pipeline.ts/compress.ts: prune node stashes the pre-prune resent array in effects.originalMessages; recommend feeds it as the withdrawal source - report.ts: acp_status UNCOMPRESSED rows open a gap at live carriers so no reported range bridges across them - tests: carrier-advertise-validate.test.ts — #2638 production geometry end-to-end, carrier boundary (live/stale), withdrawal array-class contract, status-row consistency, plus both directions of the #2607 media split (archivable folds like text, unrecoverable stays pinned) Rebased after #2607 landed on master: the originally drafted blanket media carve was dropped — filterProtectedToolMessages already enforces the #1188 never-fold exemption for unrecoverable payloads, and a blanket carve would have re-pinned archivable media against #2607's fold-like-text direction. Media handling itself is untouched by this PR. kernel-change: advertise/validate disagreement lives inside the kernel (recommend.ts vs compress.ts); host side cannot express carrier-aware screening or the pruned-vs-original view split. Closes #2663
835db70 to
e7e5ea8
Compare
[bot] 🏷 结论先行:PR #2669 分支现在干净地落在当前 master 上、无冲突,可交 CI。但过程里我基于一个过期的本地快照做了一次 force-push,覆盖了分支上当时真正的 HEAD;发现后我已把它逐字节恢复。下面按八问说明。
判定:分支现为 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.269-master.cccf47d # this exact build
npm install -g billion-context@master # always the newest merged build
|
Closes #2663
kernel-change: advertise/validate disagreement lives INSIDE the kernel — buildCompressibleRanges (selector) and applySingleRange (apply gate) judge different array classes and lacked carrier awareness; the host side cannot express this screening (no access to the pruned-vs-original view split or the apply-side carve order). Owner-approved via #2663 (owner-opened issue stating why host-side cannot solve it, with explicit fix direction).
What changed
One failure domain — every advertised range must be foldable:
state.tssharedisLiveCheckpointCarrierpredicate +recommend.tsgap+skip, same shape as the existing integrity-withdrawal screening). A carrier of an ACTIVE block (fix: detect codex compaction requests before preflight; verbatim passthrough when not intercepted (#332) #335) sits outside that block's coverage on purpose and survives pruning; a span bridging over it drags the covering block in as consumed coverage while every direct message gets carved out → zero foldable messages → livelock guard threw EVERY turn ([Bug][preflight] range selector re-nominates a fully-folded span every turn — permanent "no new compressible messages" rejection loop + nudge churn #2638 production: spans like m00018..m00242 re-nominated+rejected per request on DSH/full-log hosts). Stale carriers (block inactive/unknown) still fold normally.pipeline.tseffects.originalMessages, stashed by the prune node;recommend.tsnew optionalintegritySourceparam, default = passed array for external callers). Turn grouping and call/result pairing are array-dependent; the selector previously computed withdrawals on the pruned view while the apply gate computes them on the full resent log.report.ts) so no reported range bridges across one; the carrier stays listed as visible mass. The primary Compressible-ranges table follows change 1 automatically.Rebase note (#2607 interaction)
Rebased onto current master after #2607 (fold archivable media like text) landed. The originally drafted blanket media carve was DROPPED:
filterProtectedToolMessagesalready enforces the #1188 never-fold exemption for unrecoverable payloads (and removes them from effectiveMessageIds via the Bug-39 block), so the extra carve was redundant — and under #2607's split it would have wrongly re-pinned archivable inline media. Media handling is untouched by this PR; the new test pins both directions of the #2607 split (archivable folds like text; unrecoverable stays pinned) as regression cover. Correction to the issue's facet 2: pre-#2607 apply did NOT silently fold media either — the same filter carved all media before the warning point; the warning was accurate.Behavior changes (old → new)
Config surface
None. No new env vars, config fields, or CLI flags.
Tests
kernel/tests/carrier-advertise-validate.test.ts(5 tests): the [Bug][preflight] range selector re-nominates a fully-folded span every turn — permanent "no new compressible messages" rejection loop + nudge churn #2638 production geometry end-to-end (steady-state turns ×3 — every advertised range must span no live carrier AND apply cleanly on a fresh state clone; negative control proves the old dead spans still reject), carrier boundary unit (live vs stale), withdrawal array-class contract (hand-crafted view pair — partial-pair visibility is unreachable through the pipeline today because prune's orphan stripping plus apply-side widening/gates keep pairs atomic; the comment documents why), status-row consistency, 建议:compress.stripImages默认开启——否则带图消息不可压缩会形成只升不降的输入地板撑爆上下文 #2607 media split both directions.