Commit Graph
90 Commits
Author SHA1 Message Date
ranxianglei bce26b64fc Merge pull request #3053 from ranxianglei/2026-10-13_kernel-prune-order-pairing
fix(kernel): order-based tool-call/result pairing so duplicate host ids don't brick sessions
2026-10-15 23:47:51 +08:00
ranxianglei 1169e77daa Merge branch 'master' into 2026-10-15_recommend-apply-integrity-shared-judgment 2026-10-15 23:46:20 +08:00
awork 5bcc34569c fix(review): finish the #3266 removal — orphaned kernel image types/stats fields + stale comments
Review of the main removal commit left dead code behind: ImageFormat/
ImageBillingMode type aliases and the CompressionStats imagesShrunk/
imageBytesSaved/imageTokensSaved fields (seeded by createInitialState,
asserted in the kernel persist test) had zero remaining readers after
src/image-compress.ts went away. Removed them and reworded three
comments that still described the image_full restore channel as live.
2026-10-15 23:10:30 +08:00
ework-agent 700722db9f feat!: remove image pre-compression and the image_full tool (#3266)
The opt-in compress.imageCompression pass and its image_full restore
channel are structurally broken where they matter most:

- hosts that reject bili-injected tools (codex) can never deliver the
  restore call — the downscale is permanent for them (#3270 disarmed
  the lane, which proved the tool was dead weight there);
- where the tool IS injectable, the model has no reliable way to learn
  the ref of the downscaled message (no ref annotations on the wire),
  producing the 38-round guess-reject-resend loop from #3266 (cache
  hit 75% -> 28%).

Remove the whole feature from host and kernel: arrival-time downscale
pass, image_full injection + sticky restore + fail-streak guardrail,
image stats, persistence keys, wire-contract tool variants, config
schema, docs, and the sharp optional dependency. Every image now passes
through byte-identical at original resolution.

Sessions persisted by older versions load unchanged; legacy
imageShrinks/imageFullRestored state keys and imageShrunk* stats are
ignored on load (storage corpus pins that as a fixture).

kernel 0.0.126.
2026-10-15 22:28:01 +08:00
awork b07444b20a kernel: bump acp-kernel 0.0.125 -> 0.0.126 — master consumed 0.0.125 via 164f5d9e4, which erased this PR's version delta in the clean auto-merge and tripped kernel-guard rule 2 (#3236) 2026-10-15 21:00:04 +08:00
ework-agent 49039fdbc0 kernel: order-based tool call/result pairing in prune guards (#3046)
Pair by order, not id-set membership: a result needs a same-id call EARLIER
in the view (forward pass), a call needs a same-id result LATER (backward
pass). An id-set cannot tell two instances apart when a host re-issues the
same tool-call id for different calls (Agent Teams name:index ids), so a
half-pair whose own partner was folded away used to survive because a
different same-id partner was still visible - shipping an unpaired role:"tool"
message (upstream 400 "tool_call_id ... is not found") or an unanswered
tool_call ("... did not have response messages") and bricking the session.

Unique-id sessions behave identically to the old set lookup; one call still
answers any number of same-id results (precedence, not multiplicity); compress
calls stay exempt.

Fixes #3046
2026-10-15 20:52:59 +08:00
ranxianglei ea0dbe7932 Merge branch 'master' into 2026-10-15_recommend-apply-integrity-shared-judgment 2026-10-15 20:41:42 +08:00
awork d1c47bae21 kernel: share one unit-projection judgment between recommend and apply (#3236)
Eligibility and execution used two different definitions of "can this
range fold": recommend screened turn-integrity over the GLOBAL
compressible set while apply judged each SUBMITTED range alone, on a
different array class, and widened boundaries within a capped window.
A turn whose partners sat in other advertised units passed global
screening yet made every submission throw "Range would split N
turn(s)" — a permanent advertise/reject loop (billion-context#3236).

- unit-projection.ts: projectUnit extracts applySingleRange's pre-block
  sequence verbatim (boundary widening -> carrier/coverage/media/
  protected-tool carve -> protected-zone carve -> turn-integrity
  withdrawal -> emptiness); returns the projection or the ready-to-throw
  fatal error (zone/split). collectCoverage moves here.
- applySingleRange delegates to projectUnit; errors/warnings stay
  byte-identical (existing suite passes untouched).
- recommendNode re-screens every FINAL merged unit through projectUnit
  and demotes fatal units to gaps (no re-merge after filtering).
- NodeEffects.applyView: judgment now runs on the EXACT array class
  applyCompression executes on; absent it, falls back to the pre-prune
  original (#2663) or the given view.
- report.ts: buildStatusReport accepts config + originalMessages; the
  uncompressed view appends an additive warning flag to rows whose
  projection is fatal (flagged, never dropped); legacy output unchanged.
- kernel/tests/issue3236-recommend-apply-consistency.test.ts: both
  divergence geometries (delayed results unreachable / reachable,
  double-burst interleave), healthy-turn non-over-screening, gate
  intactness on manual submit, and the acp_status flag surface.

kernel 0.0.124 -> 0.0.125
2026-10-15 16:56:58 +08:00
awork 164f5d9e4f kernel: exempt MCP-form compress calls from orphan stripping via isCompressTool
#3222 mandatory fix 2. stripOrphanedToolCalls hardcoded toolName === "compress", so a pending mcp__bili__compress call (no result yet) was deleted as an orphan under active coverage while its bare-name twin survived. prune() now takes an optional isCompressTool predicate (same family as Config.isCompressTool / hideConsumedCompressCalls); unset stays bare-name only, byte-identical to before. pruneNode passes ctx.config.isCompressTool through; renderHandoff keeps the default (no config on that path). Bumps acp-kernel to 0.0.125.
2026-10-15 10:53:29 +08:00
ranxianglei b1611bfc87 Merge branch 'master' into 2026-10-14_fix-3159-vertex-nudge-order 2026-10-15 09:43:05 +08:00
ranxianglei 757b551a6e Merge pull request #3163 from ranxianglei/2026-10-14_persist-fsync-self-heal
fix: fsync state writers before rename + self-heal corrupt session state (#3157)
2026-10-14 23:53:12 +08:00
ranxianglei 8f7ae10d19 Merge pull request #3097 from ranxianglei/2026-10-14_fix-responses-empty-text-part
kernel: drop empty text parts in patchTextParts (strict Responses 400, #3089)
2026-10-14 23:23:33 +08:00
awork 24f3313f4a kernel: normalize user-side part order for Vertex — plain text before functionResponse (#3159)
Vertex rejects a request whose user content carries plain (unsigned,
non-thought) text AFTER a functionResponse part with 400 'Requests
ending with a model turn are not supported' (controlled A/B matrix in
#3159; Gemini Developer API accepts both orders). coreToGoogle's
flushUser reassembled every user run as [responses..., content...],
so even a client sending the safe [text, functionResponse] order was
forwarded defective. Add normalizeGoogleUserPartOrder (stable
partition; signed/thought/non-text parts never move; byte-stable no-op
when no plain text follows a functionResponse) and apply it in
flushUser. Bump acp-kernel to 0.0.124.
2026-10-14 21:12:01 +08:00
awork f0a92566a2 kernel: fsyncFile must open read-write — "r" handle fsync throws EPERM on Windows (#3157)
Review fix for the original PR's fsyncFile: it re-opened the written file
with flag "r" before fsyncing. On POSIX that works (fsync is inode-level),
but on Windows the flush goes through the handle (FlushFileBuffers) and a
read-only handle fails with EPERM — breaking every async state write
(writeNow/scheduleSave) on that platform. Caught by the static-gates lane's
Windows kernel run: 23 persist.test.ts failures, all
'EPERM: operation not permitted, fsync' at StateStore.fsyncFile, while the
sync path (fd opened "w") stayed green.

Open with "r+" (write access, no truncate) so the flush succeeds on both
platforms. Rides the 0.0.124 marker — not yet released.
2026-10-14 18:46:42 +08:00
awork 75ca9bb9a4 fix: use full-write writeFileSync(fd) in the new durable writers (#3157)
Review fix on the #3157 PR branch: the new durable-write sites used a single
fs.writeSync(fd, data) whose return value was unchecked. writeSync may return
fewer bytes than requested (short write), which would publish a silently
truncated state file — the same corruption class this PR fixes. The repo's
own idiom (external-summary-credentials.ts set(), web/api.ts atomicWriteConfig,
instance.ts atomicWriteJson) writes through writeFileSync(fd), which loops to
a full write before the fsync. Switch all eight new sites to it; this also
removes the string/Buffer narrowing branches writeFileSync makes unnecessary.
2026-10-14 18:15:53 +08:00
awork 8083f9caf2 kernel: bump acp-kernel 0.0.123 -> 0.0.124 — master consumed 0.0.123 via #2970
Review fix on the #3157 PR branch (stale-base semantic collision, no textual
conflict): this PR branched when master's kernel was 0.0.122 and bumped to
0.0.123, but master independently consumed 0.0.123 (#2970 foreign-name
compress). Per the repo convention recorded in 9656fc0a1 ("bump past
master's number so each changeset keeps its own marker"), the fsync
changeset gets its own marker: 0.0.124.

Also syncs root package-lock.json packages[kernel], which the original
bump left stale at 0.0.122 (same convention: kernel/package.json + root
lockfile packages[kernel] move together; kernel/package-lock.json stays
as-is).
2026-10-14 18:15:53 +08:00
awork 93d0c8bc73 kernel: fsync state files before rename publishes them (#3157)
tmp+rename guarantees rename atomicity but NOT content durability: the bytes sit in the page cache until the OS flushes them, so a power loss / kernel panic between write and rename leaves a size-correct, VDL=0 all-zero file on disk (NTFS journals metadata, not user data). That is exactly the Windows BugCheck 0x1A corruption reported in #3157.

Add atomicWriteDurable (open/write/fsync/close) used by flushSync's canonical + spill writes, and fsyncFile (re-open + fsync, valid because fsync is inode-level) called after writeInner's async writeFile and before its fence-check+rename commit block. Bump acp-kernel to 0.0.123 per the Kernel Boundary version rule.
2026-10-14 17:56:12 +08:00
ranxianglei 393b6c9c48 Merge branch 'master' into 2026-10-12_fix-2886-recent-pair-integrity 2026-10-14 17:34:14 +08:00
ework-agent ef98fdd639 kernel: drop blanked secondary text parts in patchTextParts
A user message whose content has >=2 input_text parts (the typical
image+text layout: text | image | text) was rebuilt by patchTextParts
into [input_text(merged), input_image, input_text("")] -- the
consolidated-away text slots were left as EMPTY placeholders instead of
being dropped. Strict Responses backends reject an empty input_text.text
with 400 "text is required" (param points at the empty slot), failing the
whole request.

Consolidate all text into the first text part and DROP the remaining text
slots rather than blanking them to "". The zero- and single-text-part
paths are byte-for-byte unchanged.

Bumps acp-kernel 0.0.122 -> 0.0.123; also syncs the kernel lockfile root
version, which was stale at 0.0.121 on master. Adds a regression test
pinning that the multi-text-part + image rebuild emits no empty
input_text part.

Fixes #3089
2026-10-14 09:34:37 +08:00
ework-agent 9656fc0a19 merge: sync master into #2977 branch; resolve conflict + kernel version collision
Catch-up merge of origin/master (c800ed1) into the #2977 branch to clear the
merge_conflict. Conflicts were only in src/server/handle.ts and
tests/conflict-remediation.test.ts — neither is touched by this PR (#2970),
so both take master's side.

Kernel version collision: master independently consumed acp-kernel 0.0.122
(#3058 preserveRecentMessages 5->3); this branch had also bumped 0.0.121 ->
0.0.122 for #2970. Per the repo convention ("master took N via another PR"),
bump past master's number to 0.0.123 so each changeset keeps its own marker.
Updated kernel/package.json + root lockfile packages[kernel]; left
kernel/package-lock.json as-is (repo convention: not kept in sync).

PR core files (src/config.ts, src/loop/core.ts, kernel hide-consumed/types/
compress + their tests) are byte-identical to the pre-merge head — verified.
2026-10-14 01:03:58 +08:00
ework-agent 5eb1adb542 kernel: close tool-pair gap in recent-zone protection (#2886)
computeProtectedRefs can protect a recent tool-call while excluding its paired tool-result (whose name matches neverPreserveRecentTools) from the zone, since that list drops big-result tools from the visible set. The advisory carve then keeps the call visible and folds the result, stranding an orphan function_call that strict Responses validators reject with HTTP 400 invalid_request_error. Make the recent zone symmetric per pair: if either half of a (tool-call, tool-result) matched by toolCallId is protected, protect both. Monotonic - only adds refs.
2026-10-14 00:34:58 +08:00
ranxianglei ca93ef49f4 kernel: default preserveRecentMessages 5 → 3 (#3058) 2026-10-13 22:57:30 +08:00
ework-agent 1a4b6db6fe kernel: recognize foreign-name compress in consumed-call lifecycle (#2970)
hideConsumedCompressCalls matched only the bare "compress" name and resolved
carrier identity by raw toolCallId equality. MCP/plugin-mode folds expose
compression as mcp__bili__compress and mint a synthetic block id
(plugin_<ts>) that never equals the re-sent host call id, so those calls
bypassed inactive cleanup + live-range arg reduction entirely (#2970).

Add an optional host-injected isCompressTool predicate (default = bare name
only, byte-identical when unset) and resolve carrier identity by quoted range
when the direct id misses — scoped to non-bare-name calls so the proxy /
in-process path is untouched. Bump kernel 0.0.121 -> 0.0.122.
2026-10-13 22:47:05 +08:00
ework-agent 51dc492b26 kernel: bump to 0.0.121 for #2750 wording change (master consumed 0.0.120 via #2934) 2026-10-13 08:55:32 +08:00
ework-agent d438956918 kernel: make Open objectives binding until user closes them; drop confirm-and-resume hedge (#2750) 2026-10-13 08:46:34 +08:00
ework-agent 30eecd792f fix(#2934): sync kernel/package-lock with 0.0.120 bump (pre-existing 0.0.114 drift) 2026-10-12 22:31:19 +08:00
ework-agent 6ef17e8de9 fix(#2929): fold claim window covers the post-fold cold tail
A degenerate head fold (81-100% coverage) rewrote the whole prefix, but the
claim window only consumed the FIRST sample after it - the proxy re-request.
The client's echo re-bill ~25-66s later carried no foldSeq, fell into the
unattributed ttlRepay residual, and tripped cache-seam with "no fold
attribution". Every one of #2929's seven seams was exactly this shape.

Mirror the #1847 switch discipline for folds:
- kernel buildCacheReport: a fold claims its first sample unconditionally,
  then COLD continuations (hit < FOLD_CLAIM_WARM_HIT_PCT=85) up to
  FOLD_CLAIM_COLD_ROUNDS=4; a warm line retires every open window.
- cache-ledger recordCacheSample: same state machine on the sparse
  LedgerFold.claims/retired fields (legacy persisted ledgers keep the
  first-claim behavior).
- web trajectory chart: cause heuristic mirrors the window (foldSeq-first,
  fold-between-times fallback for pre-#2929 ledgers).
- i18n: the residual bucket is honestly "unattributed" (upstream
  TTL/eviction/unknown), not "TTL expiry"; seam tip mentions post-fold
  echo re-bills.

kernel 0.0.119 -> 0.0.120.
2026-10-12 22:31:19 +08:00
ranxianglei 0222ef26ab Merge remote-tracking branch 'origin/master' into 2026-10-10_storage-pins
# Conflicts:
#	kernel/package.json
#	package-lock.json
2026-10-11 18:33:38 +08:00
ranxianglei 4fa650d805 chore(kernel): bump 0.0.117 -> 0.0.118 (master took 0.0.117 via another PR) 2026-10-11 18:31:40 +08:00
ranxianglei 8e16c89e84 Merge pull request #2736 from ranxianglei/2026-10-11_durable-tool-identity
feat(#2446): durable-state carriers become virtual tool paths (Config.messagePathOf)
2026-10-11 18:01:42 +08:00
ework-agent d4133a851e kernel: keep rendered-summary retention when injectSummaries is off (#2733)
Review finding on the head-stability fix: knownSummaryIds was built from
state.blocks unconditionally, so with injectSummaries:false — a path with no
fresh render at all — rebuildMessages would DROP already-rendered summary
copies instead of keeping them, silently inverting that opt-out's semantics
(pre-change: copies stayed). No caller uses injectSummaries:false today
(kernel handoff/compress, host persist/plugin all use the default), but the
opt-out is part of the prune() contract, so the drop set is now scoped to
inject=true and a state-prune.test.ts case pins the retention behavior.
2026-10-11 17:00:09 +08:00
ranxianglei aaf6568091 kernel: keep handoff chronological head anchoring; request path stays pin-safe
The #2733 clamp landed as unconditional, which broke two kernel tests:
renderHandoff re-derives the model view through prune(), and handoff docs
WANT the summary of older absent material at the head (no provider prefix
cache at stake) — 're-pruning the same snapshot without folded resurrects
the summary at index 0'. PruneOptions now carries headSummaryAnchors
(default false = the pin-safe request path: tail parking + the
after-pin clamp); renderHandoff passes true. The promote-after-prune
regression's placement assertion moves to the new invariant (summary
after the pinned first user message) — its actual subject, consumption
of a pin-covering block via the surviving raw, is unchanged.

kernel suite 1271/1271; repo handoff/kernel/loop/responses/compress/
fold/anthropic/prune/absorb suites green; tsc + unused-exports clean.
2026-10-11 16:47:30 +08:00
ranxianglei 1f86891b11 merge master (took kernel 0.0.116 via #2663); keep 0.0.117 2026-10-11 16:37:02 +08:00
ranxianglei 8ccc86d31f Merge remote-tracking branch 'origin/master' into 2026-10-10_storage-pins
# Conflicts:
#	kernel/package.json
2026-10-11 16:29:56 +08:00
ranxianglei fed088ad32 kernel: bump acp-kernel to 0.0.117 (master took 0.0.116 via #2663) 2026-10-11 16:26:24 +08:00
ework-agent c6f248d318 kernel: bump acp-kernel to 0.0.116 (fold-summary head-stability fix, #2733/#2741) 2026-10-11 16:14:04 +08:00
ranxianglei cf5c9e60fe chore(kernel): bump to 0.0.117 (master took 0.0.116 via #2695)
The kernel-guard version discipline compares against current master:
master's #2695 bumped kernel to 0.0.116, making this branch's earlier
0.0.116 bump invisible in the PR diff. Bump past it so the panel.ts
storage-mode change (kernel-change: declared in the PR body) carries a
visible version delta.
2026-10-11 16:13:30 +08:00
ranxianglei db96692ccb fix(kernel): fold summaries may never precede the pinned first user message (#2733)
Production logs (issue #2733, codex/gpt-6-astra wire mode) show the request
after a fold matching only the ~11K immutable instructions+tools head while
the kernel expected the pre-foldPoint prefix (anchor) to stay cached:

  shrink 11% foldPoint=m01360 ... anchor≈34427 tok
  → next request cached=11125 (3%) instead of ≥ anchor

Root cause: when a summary block's anchor ids resolve to index 0 — a range
rooted at the pinned first user message (session 01a1210e: foldPoint=m00001),
or a chain re-fold whose effective ids are all pruned — rebuildMessages
splices the summary AHEAD of the pinned first user message. The pinned
message is the provider prefix-cache head; rewriting that slot collapses
the cached prefix on every fold, and the next request re-warms from the
constant head only. That double prefix-cache penalty per fold is 56% of all
uncached tokens in the #2733 log.

Fix (kernel/src/prune.ts), four parts:
- collectSummaryAnchors now prefers block.directMessageIds over effective
  (merged) ids and falls back to messages.length (tail) instead of 0, so a
  block whose ids were all consumed parks its summary after the surviving
  material, never at the head.
- rebuildMessages drops rendered summary copies of ANY known block
  (knownSummaryIds from state.blocks, including consumed ones) so stale
  copies of merged blocks cannot leak into loop rebuild views.
- after resolving anchors, insertAt is clamped to >= firstUserIndex + 1:
  a summary may never precede the pinned first user message.

tests/responses-refold-head-stability.test.ts pins the invariant across a
fold + two chain re-folds rooted at the pin: every summary-carrying view
must keep input[1] byte-identical to the pinned m00001 message. Red on the
old kernel (view 12 head = CHAIN2 summary), green with the fix.
2026-10-11 16:08:35 +08:00
ework-agent f3701bbc48 kernel: bump acp-kernel to 0.0.117 after merge of master (master already took 0.0.116) (#2736) 2026-10-11 15:57:42 +08:00
ranxianglei 9031c9fdbf merge master (includes #2747: #2658 rig unred) 2026-10-11 15:49:22 +08:00
ranxianglei 75c687d7dc chore(kernel): bump 0.0.116 — storage-mode panel line (#2671)
kernel-guard Rule 2: kernel/src/panel/panel.ts gained the host-rendered
storage-mode label (display-only); version bumped so the change can ship
as an independent acp-kernel release.
2026-10-11 14:42:16 +08:00
ranxianglei b09b25233c feat(#2446): durable-state carriers become virtual tool paths (Config.messagePathOf)
The four dsh durable-state text carriers (#2419 skill catalog, #2446 mcp
catalog, #2447 workspace-instructions baseline, #2481 runtime-context
snapshot) stop being host-hardcoded boolean guards. A lane-scoped host
classifier now projects each carrier to a canonical durable/<name>
identity via the new kernel Config.messagePathOf hook, and the EXISTING
protectedTools / protectedLatestTools pattern machinery governs them —
same knobs, same semantics as the tool channel (#1947).

kernel (0.0.116):
- Config.messagePathOf: host-projected virtual tool path (pure, cheap,
  never re-projects tool-call/tool-result)
- protected.ts: virtualToolPathOf; isMessageProtected + collectLatestProtected
  + isMessageLatestProtected accept virtual paths (protectedTools patterns
  and per-path latest semantics both apply to projected carriers)

host:
- durable-message-guards.ts rewritten: DurableMessageClassifier per
  carrier (same matching predicates, evidence comments preserved),
  durableMessageToolPaths registry (KDD #9 dsh-only allowlist unchanged),
  withDurableProtection() — default injects durable/* all-instance
  protection (byte-equivalent to the old boolean guards); ANY durable
  pattern in protectedTools/protectedLatestTools = whole-identity
  takeover (user policy wins verbatim, only the classifier is attached)
- handle.ts / session.ts wiring + config.ts JSDoc for both knobs

tests: kernel protected-virtual-paths 6 (projection domain, pattern
matrix, per-path latest, tool-channel parity); host durable-tool-identity
8 (policy units + e2e: default all-instance, durable/* latest takeover,
exact-identity takeover, lane scoping); the four #24xx suites migrated
to the Path API with e2e assertions unchanged (behavioral parity).

kernel-change: yes — kernel/package.json 0.0.115 -> 0.0.116; new optional
Config field messagePathOf plus virtual-path support in protected.ts.
Backwards compatible: without messagePathOf the kernel behaves exactly
as before (all suites unchanged).
2026-10-11 14:05:07 +08:00
ranxianglei 0a96d7e69b storage: surface effective storage mode in status panels (#2671)
'/acp' couldn't tell you which storage mode the lane actually took —
the only signal was grepping the lane log for '[storage] unified FULL
mode ENABLED'. The plugin status panel and the acp_status tool output
now carry a one-line label:

  storage: legacy (json only)
  storage: shadow (dual-write dry-run -> index.db)
  storage: full (unified-first reads, dual-write)
  storage: full requested — blocked by BILI_ENCRYPTION_KEY, running legacy-only

storageStatusLabel() in persist.ts mirrors the constructor's mode
resolution, so the panel can never claim a mode the store refused to
take (the encryption downgrade is rendered explicitly). The kernel
panel input is a pre-rendered string — the kernel never guesses.
2026-10-11 14:02:14 +08:00
ework-agent e7e5ea8a62 kernel: selector screens live carriers; withdrawal judged on original 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
2026-10-11 11:55:20 +08:00
ranxianglei 3956f57303 kernel: stop new cluster extensions from resurrecting dead fold blocks (#2695)
remintCoveredLiveIds now also dodges INACTIVE blocks' covered ids when the
same cluster root shows prior-pass continuity — the exact shape a new
duplicate instance lands on a dead block's number and resurrects it in
sync, rendering a carrier for content the instance was never part of (the
every-other-turn carrier flap). A whole-root arrival that is new to
lastPassIds (client rewind to a checkpoint still holding the folded
originals) keeps the converter's ids so the block legitimately resurrects.

kernel: 0.0.114 -> 0.0.115
2026-10-11 08:31:26 +08:00
ranxianglei f0b3f5d60f merge master (post-#2664/#2647) 2026-10-10 23:26:29 +08:00
ranxianglei 19c3f98f8f merge master 2026-10-10 23:25:42 +08:00
ranxianglei cd35263b41 Merge pull request #2647 from ranxianglei/2026-10-10_kernel-json-escape-hint
kernel: swap the JSON-poisoning phrases in the compress copy for escape hints (#2587)
2026-10-10 23:16:26 +08:00
ranxianglei a9fdc53747 refactor(#2607): remove compress.stripImages — default media folding replaces it
Default archivable-media folding (#2640) made the opt-in wire-side image
strip redundant, and the strip itself broke the prompt cache every turn on
three of four wires (sliding cutoff moves the byte boundary per turn; only
anthropic had the fold-anchored boundary). Media handling now has exactly
one path: fold + archive + decompress({ imageRef }) recovery.

- kernel: strip-images.ts (stripHistoricalImages) retired; wire barrel and
  wire-google tests updated; acp-kernel 0.0.113 -> 0.0.114
  (kernel-change: removing a public wire export that exists only for the
  removed host policy; no compression behavior changes)
- host: strip wiring, fold-anchored cutoff, and DEFAULT_STRIP_IMAGES_KEEP_RECENT
  removed from handle.ts/server.ts/compress-settings.ts; image-restore.ts keeps
  the always-on index + spill + decompress machinery (that is the default-fold
  recovery path, not the strip's)
- config: compress.stripImages / compress.stripImagesKeepRecent dropped from
  the type, whitelist, and parser; old configs get a one-time INERT warning
  (warnInertStripImages) instead of silent no-op
- docs: seeds + generated tables regenerated; EN/ZH prose sections replaced
  with removal notes; decompress error texts no longer reference the flag
- tests: strip-images / strip-images-compact / strip-log-observability /
  strip-cutoff-anchor suites deleted; compress-settings cascade/parse cases
  removed; new strip-images-removal.test.ts pins the INERT notice + silence

Closes #2608 (archival-failure-still-strips existed only on the strip path;
with the strip gone there is nothing to fail)
2026-10-10 23:10:45 +08:00
ranxianglei 63308103dc chore: bump kernel to 0.0.113 (master already took 0.0.112) 2026-10-10 22:14:07 +08:00