Repository navigation
[PR] merge: tier-4 train — dsh/cache domain rework (7 PRs incl. p1 #3307/#3301/#3890); kernel straggler from #3680 reverted per boundary - #4572
Merged
Conversation
(cherry picked from commit 39d8cd7)
…3243) handlePluginManifest now takes an optional ToolPrompts surface and applies it to the ACP core tool arrays exactly like the wire injector; the admin manifest endpoint resolves it from the global compress settings via resolveCompressSurfaceDetailed. Registered plugin tools previously always carried kernel-default descriptions regardless of compress.promptPack — now they follow the top-level pack. Provider/model-level promptPack still shapes per-request system prompts only (the manifest has no route/model context, #1192 conservative boundary). Regression tests pin lean-pack descriptions on all three wires, unchanged defaults without a pack, and the route-level-only boundary. (cherry picked from commit e5d2470)
wire/upstream/restart already carried per-event data in the cache report (switchEvents / restartEvents) but handleAcpCache only ever rendered their aggregate counts in CACHE INVALIDATION — no per-line timestamps, so seam-vs-restart cross-checks (e.g. #3416 273->28 vs the 10 restart/refork events) were impossible to run off the report. Surface them exactly like the existing MODEL/KEY/PROMPT/PROJECTION sections. Refs #3307. (cherry picked from commit 5bdc878)
A host metadata-table refresh can re-serialize every past thinking turn of one session in a different wire form (reasoning_content field vs reasoning spliced into content), minting new ids for unchanged content. Fold re-anchor then reports 'covered id(s) missing with no anchor match' on every request: the turn-key pass only understood bare-concat merges, and pre-#2644 anchors lack p/x entirely — while the wire-side backfill can never fire because the flip puts the old id off the wire on the very pass that also rolls the order backbone forward without it. - fold-reconcile: extractThinkingMerge mirrors the kernel's demoted-thinking FORMS so merged-form cores register the same turn keys as split-form anchors (turnContexts + Pass 3 candidate side); ReconcileOptions.storedMessages rebuilds eligible legacy anchors from stored decompositions BEFORE the plan runs, so the flip pass itself claims. - storage: UnifiedStore.messagesForIds (+seq±1 neighbors for rc-pair adjacency), shadow/persist pass-throughs gated on full mode. - new fold-decomposition-lookup: per-pass capped lookup with a tried-set (index absence is stable, index unavailability retries). - import entry: record/session/ingest carry an optional decompositionLog (external converter payload) interned first at ingest; consume-once at save keeps the #3133 delta fast path intact; buildRecord never emits it. No new config surface. Additive optional fields only (ReconcileOptions. storedMessages, LegacySessionLike.decompositionLog, PersistedSession. decompositionLog) plus an internal metadata bookkeeping key foldStoredTried. No kernel/ changes. Fixes #3301 (cherry picked from commit b5756bb)
…re force-exit (#3890) Two independent defects made the proxy self-terminate on Windows while its parent lived on (12 events in 2.5h against one live pid): 1. The watchdog removed a watched pid from the set on a SINGLE failed kill-0 probe; the empty-set grace window that followed never re-probed, so one transient OpenProcess failure (Windows maps every non-ACCESS_DENIED failure to ESRCH — indistinguishable from a real death) force-exited the proxy ~6s later. Death now requires WATCHER_DEAD_CONFIRM_TICKS (=3, ~4-6s at the 2s tick) CONSECUTIVE failed probes; any live probe resets the streak. Heartbeat-expiry removal (#3544) keeps its immediate semantics. First failure of an episode logs the errno ([watchdog] kill-0 probe failed for pid N (code=...)) and recovery from a false alarm logs one line, so field episodes can be attributed. probePid() in instance.ts carries the errno; isPidAlive() is unchanged. 2. shutdown()'s hard backstop force-exited 10s after the signal regardless of live connections, cutting in-flight upstream streams mid-response. While connRecords are still alive the window now RE-ARMS, bounded by SHUTDOWN_DRAIN_MAX_PASSES (=10, worst-case total drain ~110s); then it force-exits exactly as before (the zombie backstop is preserved). Idle keep-alives don't hold the proxy — the keep-alive reaper clears them within one window, so a healthy drain still exits promptly. Behavior changes (old -> new): - owner-death -> exit latency: +up to ~6s (confirmation window) - shutdown backstop: unconditional 10s force-exit -> re-arms up to 10 extra passes while liveConns > 0, worst-case ~110s total, then force-exit as before - new log lines: [watchdog] kill-0 probe failed / pid N alive again / extending drain k/10 Tests: new suite pins tickWatchedPid (blip <3 survives, 3rd consecutive removes, recovery resets, heartbeat path unchanged, dead pids never take the heartbeat fast path) plus a LIVE child-process test proving the backstop no longer force-exits at 10s with a connection held open (verified to FAIL on pre-fix master: 'pre-#3890 behavior force-exited at 10s'). claude-native live-lane deadlines re-sized 15s->30s and the watcher-route grace phase re-timed for the wider confirmation window (ACP_TEST_CLAUDE_NATIVE-gated). (cherry picked from commit 3b8e4b3)
) detectSeam pushes both the #3023 client-side rewrite and the legacy suspected-rebuild fall-through into one shared capped ring (led.seamEvents); formatSeam's CACHE SEAM section iterated every event without filtering, so a host-owned client rewrite was also listed under the 'suspected mid-history prefix breaks' header. List only non-client events there so the two sections stay disjoint. (cherry picked from commit 4db43b0)
…on forensics start_ref, so the V' fallback is not the trigger: decomposeSample drops the fold when bestX = prefixTokensBeforeRef(start) >= billed input, zeroing structuralExcess. That value is in-memory (tokenSnapshot) and never persisted, so it cannot be reconstructed from the blocks table after the fact. Emit one [acp-compress-obs] fold-attribution line per fold carrying the actual X per block plus the same-space view tokens V/Vp. Cross-referenced against the ledger's billed input it separates the two candidate inflation sources: unit scale (kernel chars/4 estimate vs provider-billed tokens) vs view identity (snapshot tracked on a larger view than the shrunken outbound). Pure logging; no behavior change. (cherry picked from commit cfb2d31)
…view-factor forensics (cherry picked from commit 3a1541c)
…end (#3307 P1) V now measures the LIVE context being managed (ctx.messages / processedMessages, what gets billed next); applyCompression still runs on compressMessages (raw boundaries, #2627) so fold geometry is unchanged. The fold-attribution log now reports V(live) vs Vraw(inbound) so one capture shows the collapse. Behavior change (intended, disclosed): in stateless-client proxy sessions shrink% rises from the degenerate ~1% to its true value; the degenerate-fold gate (DEGENERATE_FOLD_COVERAGE=0.8) and the maxShrink advisory go from effectively-never-firing to firing correctly; postCtx and the next-request cache ceiling are computed from the live view. Unchanged when there is no separate raw resend (messages == compressMessages), which is what every existing unit test exercises. Regression: tests/issue3307-fold-view-basis.test.ts pins V = live view across single/multi-level folds, verifies Vp === V - S (same-view net change), and keeps the messages==compressMessages baseline unchanged. (cherry picked from commit e31661f)
…nflated snapshot (#3307 P2-A) #3307 P2-A: the snapshot-based fold prefix X (prefixTokensBeforeRef over the client un-shrunken resent history) exceeds the billed input for a stateless proxy client, so decomposeSample zeroes structuralExcess and the fold re-pay falls into the unattributed seam bucket. When a genuine bili-side mid-history break is present, measure the stable prefix off the wire (byte-LCP of this outbound vs the previous, scaled to billed input) and min() it into X before decomposeSample, so the fold is credited again instead of crying a false seam. Gated to mid-list breaks only (a tail append lands the LCP near the end -> xMeasured ~= input -> no effect) and never on a client-side inbound rewrite (#3023), whose earlier divergence would understate and mis-credit the fold. Host-side only -- no kernel change; decomposeSample is called as-is with the corrected firstFoldStartTokens. Regression: tests/issue3307-fold-attribution-wire.test.ts pins attribution for the inflated-X mid-history fold plus both guards (tail-append not credited; client rewrite stays client-side, not fold). (cherry picked from commit da6834e)
…shrank it) (#3307) The multi-level P1 test held the live view constant across folds, so it did not cover the re-fold topology the #3307 GO called out (a fold whose live view already embeds an earlier summary and is smaller than the raw resend). Add a case that shrinks ctx.messages after fold-1 and asserts fold-2 V tracks that current view, never the raw resend or a stale snapshot. (cherry picked from commit fad2033)
…h-train # Conflicts: # src/config.ts
This was referenced Oct 24, 2026
Contributor
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.823-master.2e70520 # this exact build
npm install -g billion-context@master # always the newest merged build
|
Contributor
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.5530-pr.4572.7ad0812This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr4572.tgz
npm install -g packageInstall instructions are refreshed on each push. |
ranxianglei
pushed a commit
that referenced
this pull request
Oct 24, 2026
…small fix) DecompositionSource (fold-decomposition-lookup.ts) and WatcherTickDecision (server.ts) are referenced only inside their own files - zero external usages across src/tests/kernel/pi-subagents. The unused-exports gate flags both INTERNAL_ONLY once the #4572 train landed on master. Dropping the export modifier is behavior-neutral (typecheck clean); StoredRow stays exported (has an external consumer).
ranxianglei
pushed a commit
that referenced
this pull request
Oct 24, 2026
…from #4572 train (#4559 small fix) The train added the external-summary config surface but the committed generated docs predate it, so docs-sync regenerated one new table row (compress.externalSummary) in each of the four derived files. Mechanical regeneration via tools/gen-config-docs.mjs - no hand edits.
This was referenced Oct 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
这是什么
第四列车:dsh/缓存域的 7 个 PR 重放(含 3 个 p1)。合并方式请选 Merge commit。
车上清单
边界声明
kernel/碰撞(pr-3680 携带的 kernel 提交已 revert,[PR] Guard open objectives against self-declared completion in compression summaries (#3538) #3660 保持 open 等 owner 批准)验证
#3307 5/5、#3301 22/22、#3243 3/3、#3472 6/6、cache-ledger 族 7/7;全量以 CI 为准。
关单
Closes #3472, Closes #3536, Closes #3243, Closes #3307, Closes #3301, Closes #3675, Closes #3890
未上车(下趟列车5的料)
#3045 #3440 #3460 #3592 #3746 #3880(挑失败需 merge 收编) #3951 #3954 #3907 及 4044/4061/4062/4263/4136-4142/4410/4442 等重活