103 Commits
Author SHA1 Message Date
ranxianglei 7e327ace0d kernel: add WHEN NOT TO COMPRESS gate to compress prompts (all protocols)
Adds a kernel-level 'WHEN NOT TO COMPRESS' section to every compress system
prompt (function / text / hybrid), sitting between philosophy and
howToCompress. Previously the only 'when not to compress' guidance in the
kernel was the one-line 'be frugal' philosophy sentence; the dedicated
gate (mid-task work, live user discussion, closing-ritual folds, tiny
ranges, nudge voice) existed only in the pi adapter package and the
lean pack removed even that. Wording owner-approved in chat 2026-11-30.

Changes:
- kernel: new whenNotToCompress section slot (surface-config), gate
  constant + builder wiring (compress-tools), lean-pack variant and
  pack validation key (packs), new kernel test, regenerated fixtures
- root: ACP-TAGS-only lead prefix in src/compress-tool.ts now includes
  the gate between philosophy and howToCompress, keeping the #1881
  NEVER-echo prohibition for injectTool=false hosts
- tests: compress-prompt overhead (~450 tok/request) budget calibrations
  - e2e-google-compress: demand measured on conversation contents,
    self-calibrated against the session's own first-request overhead
    (fixed whole-body threshold made the demand point depend on prompt
    size); fold span proportional (first 2/3 of refs)
  - threads-lane plugin window 5000->6000; issue2672 split window
    8000->8500; preflight-hold/compress-responses/window-clamp/
    max-output-tokens budgets absorb the gate
  - cache-proof: FILLER(0,5) seed phase + byte-based rearm assertion +
    ZOMBIE_SETTLE_BOUND 9->10 (gate shifts the fold schedule)
  - storage-render goldens regenerated (+1798 B/turn, mechanically
    verified: only sha/bytes leaves)
- versions: kernel 0.0.217->0.0.218, root 0.1.218->0.1.219

Tests: kernel 1665/1665, root targeted compress/preflight set 252/252,
typecheck clean; full-suite delta vs clean-master baseline = 0 new
failures (remaining reds fail identically on the baseline).
2026-11-30 16:09:14 +08:00
ranxianglei 3128090997 kernel: remove the crush tool-result rewriter (owner decision) — config key inert with a one-time warning; invariant-judge crush exemption gone; kernel 0.0.217 2026-11-29 20:30:22 +08:00
ranxianglei f20fc4ab20 kernel: mixed-tier merges auto-split at the tier boundary — the higher-tier block stays active and UNCOVERED, the new block covers only the target-tier portion, and an 'Auto-split at tier boundary' warning rides in the receipt (#7770); kernel 0.0.216 2026-11-29 17:54:25 +08:00
ework-agent e9be105d76 Merge origin/master into kernel-warn-channel (kernel 0.0.214 → 0.0.215)
Resolves the kernel version conflict: master independently bumped to 0.0.214 (past the PR's 0.0.212); the PR's kernel changes (compress.ts/recommend.ts) now sit on top of master, so merged version = 0.0.215 (kernel version discipline). Root + kernel lockfiles synced to 0.0.215. No code conflicts — master's changes (sessions.dir #7803, etc.) auto-merged cleanly.
2026-11-28 21:53:59 +08:00
ranxianglei 31e0496267 chore: lock-sync for the kernel 0.0.214 bump 2026-11-27 09:51:32 +08:00
ranxianglei db73354cb7 chore: lock-sync for the kernel 0.0.213 bump 2026-11-27 01:07:22 +08:00
ranxianglei 92256b180d chore: sync root + kernel lockfiles with the 0.0.212 bump (lock-sync, #3782 class)
e7bf782c2 bumped kernel/package.json to 0.0.212 but only the root lock's
'kernel' entry and the kernel's own lock were still at 0.0.211 — the lane
that checks npm install --package-lock-only drift fails on exactly that.
2026-11-26 23:08:46 +08:00
wxy 66d11dfa1a chore(kernel): bump to 0.0.212 after upstream took 0.0.211 for #7735
kernel-change: mid-turn diagnostics now go through an injected Ports.warn sink
instead of console.warn, so the inline lane (whose process IS the pi host, whose
stderr is the TUI) no longer paints kernel lines over the input box; and the
funnel-zero diagnostic now only fires for units that cleared the merge gate and
then died at the screen, not for every ordinary short session (every sub-gate
island is the correct, everyday outcome). (#7791)

The host side cannot fix this: the kernel is inlined into every dist entry and
has no host-facing diagnostic port at all, so bili's tee logger could never own
these lines.
2026-11-26 21:59:35 +08:00
ranxianglei d6be1eacee merge: pull #7684 (cross-lane model/protocol switching) into the egress sweep — aligned to the 7773 materialized state
PR #7684 (wire-granularity pinning + cross-lane render fidelity + switch
hardening) was developed against the pre-7773 egress state shape. Aligned
on merge:

- stampEgressSeqs: featureEnabled -> egressPlaneGateOn (the plane has ONE
  gate, 7773 follow-up)
- tests/egress-authority-rethrow.test.ts: corrupt the materialized state
  by deleting it (no payload column left) — flow corruption unchanged
- c6/c7/fold-coords/switch-fold-db: the rollback sections audit the
  legacy tables, which a fresh 7-table eg instance never has — force the
  full DDL (BILI_TEST_FORCE_FULL_DDL, test-only) so those audits keep
  their meaning; the 7-table gate itself stays covered by
  eg-sweep-egress-identity
- lock-sync: regenerate root + kernel package-lock.json (the PR bumped
  kernel/package.json without its lock — the CI red it landed with)

Verified: kernel 1683/0, new PR suites green (c4-c7, crosslane-wire-pin,
rethrow, fold-coords, switch-fold-db, msgid-pin-wire-form, 6525), egress
family 201/202 (1 skip = bench gate), wire-contract 26/26, typecheck,
build, architecture-docs + lifecycle-ledger + config-coverage guards.
2026-11-26 17:59:38 +08:00
ci-check 7b609ee8af chore: sync kernel lockfile version with the 0.0.211 bump (lock-sync, #3782 class) 2026-11-26 17:38:01 +08:00
ranxianglei 356209602b [PR] kernel: bridge span-safe gaps at the merge gate so mega-turn islands …
Retarget the kernel version bump from 0.0.207 to 0.0.209: master has moved
to 0.0.208 (0.0.207 was consumed by an unrelated kernel release), and the
code does not depend on the number.

Co-authored-by: guowenjie1992 <52691423+guowenjie1992@users.noreply.github.com>
Source-PR: #6345
(cherry picked from commit bd4548a4d346b363c8fdb06b6e2602fb8184b9e9)
(cherry picked from commit 6ac84b74b3250ead06c5013a6742e3f03b43cb62)
2026-11-24 23:31:34 +08:00
ci-check accbec4bfb kernel: bump version 0.0.208 -> 0.0.209 for #7614 kernel/src change
Kernel Boundary rule 2 requires a version bump whenever kernel/src changes.
#7614 (covered-reasoning stopgap) changes instance-reid.ts + prune.ts but
dropped its bump (the original 0.0.206 -> 0.0.207 went stale against
master's 0.0.208). Re-bump from the current master version.

Fixes CI kernel-guard rule 2. Rule 1 (the 'kernel-change:' PR-body
declaration) still needs the author.
2026-11-24 10:53:32 +08:00
ranxianglei 4c8f0395ec kernel: no-op a split-doomed range instead of rejecting the whole batch (#7596)
A fresh-fold range whose integrity withdrawal leaves NOTHING foldable (a
tool turn astride the protected-zone boundary) used to fatal with
'Range would split N turn(s)...', and under the atomic batch contract that
one fatal rolled back every sibling range that would have folded fine.
The model then re-sent the same batch — full context re-read every time —
until the breaker fired. Like the zone fatal (#4521), an empty-after-
withdrawal fresh fold is now a legal no-op: siblings fold, the doomed
range gets one accurate warning pointing at older ranges.

UnitProjectionFatal gains 'degradable', set only by the fresh-fold
withdrawal path; the merge split fatals (excluded-merge / actionable
split) do not set it and stay hard errors. recommend/report sides are
unchanged (fatal units still demote to gaps / flag rows).

kernel-change: downgrade an apply-side fatal to a no-op receipt so one
doomed range can no longer kill a multi-range batch; the host side cannot
express this — the verdict is produced in the kernel projection.

⚠️ MODEL-FACING TEXT CHANGE: one new warning string (the no-op receipt);
no existing instruction text moved. The pinned turn-integrity tests
(issue684 / issue5531 / tool-pair-integrity) keep asserting the guard
holds — nothing of a split turn ever folds — while expecting the new
no-op outcome instead of the old error.
2026-11-24 00:26:47 +08:00
ci-check f9d9a01fef kernel: make compress length-rejection advice match the failure direction (#6730)
The batch rejection message told a too-short summary to "shorten or split
... to fit its cap" — backwards advice that made the summary shorter, so the
model retried into a guaranteed-fail loop (full context re-read each round)
until the circuit breaker fired.

validateSummaryLength now throws a typed SummaryLengthError carrying the
direction (empty / tooShort / tooLong); the batch screen tracks which
directions fired and renders direction-aware remediation: too-short/empty
-> "expand ... do NOT shorten it", too-long -> "shorten or split ... to fit
its cap", mixed -> both. The drop-the-range exit is always offered.

kernel-change: fix a self-contradictory error-message literal (mechanical
bug) — no algorithmic/state/wire-shape change, only the remediation text of
the batch length-rejection. Regression test:
kernel/tests/issue6730-length-remediation-direction.test.ts.
2026-11-23 23:09:19 +08:00
ci-check 856b4119cf kernel: sync package-lock.json version to 0.0.206 (lock-sync) 2026-11-23 10:33:49 +08:00
ci-check bdacb1ba7a chore(kernel): sync kernel/package-lock.json to 0.0.205 (lock-sync) 2026-11-22 20:48:05 +08:00
ci-check ecee5cf283 chore(kernel): rebump 0.0.203 -> 0.0.204 after merging master (#7522 landed 0.0.203) 2026-11-22 20:24:16 +08:00
ranxianglei ce781e54af kernel: orphan-sweep exemption recognizes the line-form compress args
⚠️ MODEL-FACING TEXT CHANGE: none — no model-visible string moves;
sweep/fate recognition only.

kernel-change: owner-directed ("kernel 的也一起提交吧", 2026-11-22,
issue #7521 thread provenance) — the mechanical-recognition gap class:
a carrier detector that provably mis-negates the current wire shape.
Reproducing regression rows added (line-form carrier exempt + line-form
negative control), declaration present, human review tier still gates.

The defect: hide-consumed's sweep-exemption detectors
(quotesActiveBlock / quotedRangeKeys) parsed only the JSON arg shapes
({content:[…]}, flat {startId,endId}, stringified array). The current
wire form is {content: "m00150–m00220 topic\n<summary>"} — a line-form
string — so JSON.parse failed, the re-sent carrier pair read as a
failed orphan, and the next fold at/before its ref swept it
permanently. With the bili-side anchor strip (#7479) in place that is
a zero-wire-carrier fold: the block's summary exists nowhere on the
wire (storage keeps it for decompress, but every bN citation
round-trips through decompress). The same blind spot demoted
foreign-name (MCP-dialect) line-form carriers from fate "active" to
"orphan".

The fix: quotedRangeKeys now UNIONs the legacy field extraction with
the canonical compress-args parser (parseCompressArgs — the grammar
applyCompression itself executes, #3236 single-projection discipline),
so every range shape the kernel will execute is recognized as a quote.
Recognition only grows (monotonic superset), keeping the established
fail-safe direction (unparseable = not a carrier = under-sweep, never
over-sweep). quotesActiveBlock is unified onto quotedRangeKeys — the
two near-duplicate detectors can no longer drift apart.

Evidence: kernel suite 1655/1655 on the stacked head; the #3769
carrier table gains the line-form carrier row and the line-form
negative control (both directions, #3617); typecheck clean.

Fixes #7521
2026-11-22 18:38:23 +08:00
ework-agent f717b6908b chore: sync kernel lockfile to v0.0.202 (lock-sync drift from the protectedMass param bump, #7465) 2026-11-21 21:01:37 +08:00
ci-check 0f4e18dda4 fix(lock): sync lockfiles with kernel 0.0.201 bump (lock-sync drift)
The top commit bumped kernel/package.json to 0.0.201 but skipped lockfile
regen, leaving acp-kernel at 0.0.200 in both package-lock.json (root,
acp-kernel entry) and kernel/package-lock.json. The lock-sync CI job (#2704
drift guard) regenerates via 'npm install --package-lock-only' and fails on
any residual diff. This commit is the exact output of that regeneration
(idempotent fixed point): 3 version lines 0.0.200 -> 0.0.201, no registry
churn. Fixes the red lock-sync check on PR #7428.
2026-11-21 11:19:43 +08:00
ci-check 88f67800c0 kernel: sync package-lock.json version to 0.0.200 (lock-sync with the 0.0.200 bump) 2026-11-19 17:40:02 +08:00
ework-agent 3a1bd65c0d chore: sync kernel lockfile to 0.0.199 (lock-sync #3782) 2026-11-18 12:46:11 +08:00
ranxianglei 399cd2b8c0 kernel: let content-free BLOCKED partners close their turn (#6709)
The #5919 merge no-op treats every ref='BLOCKED' partner as "cannot be
closed now", but that conflates two very different cases. A content-free
BLOCKED partner (body removed by native compression) carries no live wire
content and can never age into foldability, so letting it doom the merge
turns the no-op into a permanent deadlock: every merge covering its turn
re-hits the same skip and the session stays stuck at its context ceiling
(#6709, session-ad47cd30, 6,115 BLOCKED). A LIVE protected tool /
unrecoverable media is pinned to ref 'BLOCKED' by assignRefs too, with its
full body still in the wire — folding it in drops protected content and
leaving it split emits an orphaned tool_call/tool_result.

Exempt only content-free BLOCKED partners (ref BLOCKED AND not
live-protected-tool AND not host-protected AND not unrecoverable-media)
from the merge-deadlock; they flow to the #5919 rung-2 fallback and are
folded into the merged block, closing the turn. Live protected tools /
media still doom the merge into the honest no-op.

This is the correct superset of the two related PRs (#6719: flow-all-
BLOCKED-to-rung2; #6731: key-on-ref-BLOCKED, keep-split) — both keyed on
ref==='BLOCKED' alone, and both masked the live-protected case by giving
the protected partner a numeric ref in their regression tests. 5919-5 adds
that guard (live protected tool stored as ref BLOCKED still no-ops).

Refs: #6709, #6719, #6731
2026-11-15 11:48:29 +08:00
ranxianglei 1b15692af4 kernel: version 0.0.197 (batch4 kernel fixes: #6428 server-tool pair heal, #6345 span-safe gap bridging, #5166 liveness-by-coverage) 2026-11-13 17:57:37 +08:00
ranxianglei f2ee94a58a kernel: version 0.0.196 2026-11-12 22:23:16 +08:00
ework-agent efa3df7857 chore: merge master ahead of the #5765 blockOps gate (kernel 0.0.195)
Conflicts: kernel version files (master 0.0.193 from the #6132 fold-point
removal + this branch's 0.0.194 -> 0.0.195) and one relay.ts import line
(master dropped relocateCompressCarriers; this branch adds
buildBlockOpsSystemPrompt — the resolved import carries only the latter;
no fold-point call sites survive in the merged relay).

Re-verified on the merged tree: kernel 1631/1631, host targeted 201/201 +
surface/config 374/374, typecheck + build green.
2026-11-11 11:17:42 +08:00
ework-agent 6b33fd21a9 feat: gate the #5765 block-lifecycle tools behind compress.blockOps (default off)
Owner ruling (review of this PR): acp_retire / acp_restore / acp_rewrite
must sit behind ONE switch, default OFF, injected only when ON — the
always-on surface costs ~0.7k estimated tokens per request on every
session of an enabled proxy.

Follows the absorb opt-in pattern end to end:
- kernel: definitions + name consts stay exported, but the 3 tools leave
  the default arrays (ACP_TOOLS_{OPENAI,ANTHROPIC,RESPONSES,GOOGLE},
  ACP_READONLY_TOOLS_RESPONSES, ACP_TOOL_NAMES); they stay in
  ACP_MUTATING_TOOLS (dispatch must drive the compress loop when enabled).
  New BLOCK_OP_TOOL_NAMES set + buildBlockOpsSystemPrompt(lane) section
  builder; the default prompts are back to "four context-management
  tools". New Config.blockOps { enabled } (off by default); absorb/ccr
  tool-name predicates include the block ops.
- host: compress.blockOps config (3-level merge like absorb);
  blockOpsEnabled / effectiveBlockOpsConfig / storeEffectiveBlockOps
  (per-session, plugin tool API parity); isProxyToolFor, the proxy-lane
  inject* extras, the responses hybrid lane, the round-2 cache seam, the
  plugin manifest + tool API, the MCP dialect note and the system prompt
  all inject/advertise the 3 only while enabled; the MCP note, prompt
  and per-session metadata stay byte-identical to pre-#5765 while off
  (zero footprint: no metadata key written while off — the storage-render
  goldens match master byte-for-byte).
- dispatch: enabled calls run the kernel ops exactly as before; a stray
  call while disabled gets a model-facing "not enabled on this bili proxy
  (compress.blockOps.enabled is not true)" receipt and never touches state.
- wire-contract goldens revert to the master shapes (the default surface
  is unchanged), and this commit supersedes the three earlier fix commits
  on this branch (test-pin updates + storage-render regen + payload
  retunes): with the default surface back to the master shape, those
  test files return to the master versions and the 27 red CI tests are
  green again without any calibration changes.
- docs: compress.blockOps in configuration.md/.zh-CN.md + website seed;
  kernel 0.0.194.

Verified: kernel 1656/1656; host targeted 201/201 (the 15 previously
red CI files + block-ops/snapshot/wire-contract), 348/348 + 63/63
surface/config invariant files; typecheck + build green.
2026-11-11 11:12:54 +08:00
ework-agent 84d4f6a867 kernel: remove the compressAtFoldPoint fold-point relocation feature (#6132)
Owner-directed full removal of the experimental compressAtFoldPoint /
compressAtFoldPointClearThinking feature (v1 #5471 + unreleased v2 #5949):
two distinct live pathologies in 9 days on its own target model family —
2026-11-08 voluntary re-compress loops (v1, #5949 field report) and
2026-11-10 authorship misattribution (v1 in v0.1.213 production: the pair's
relocation left the turn's own answer text bare at the transcript tail, and
a 27B model read its own last utterance as a user message, m00376 chain).

- delete kernel/src/relocate-compress.ts + kernel/tests/relocate-compress.test.ts
- drop the relocate-compress-carriers pipeline node (after hide-compress-calls,
  before view-latch) and its registration
- drop Config.compressAtFoldPoint / .compressAtFoldPointClearThinking /
  .reasoningDroppable and the public relocateCompressCarriers/plan exports
- drop the already-folded-echo parse kind + v2 pointer marker
  (parse-compress-input.ts) and the two echo tests
- kernel 0.0.192 -> 0.0.193 (both package-locks)

kernel-change: removed relocate-compress.ts, the pipeline node, 3 Config
fields and the public exports (full feature removal, owner decision after the
2026-11-10 incident, #6132); with the switch off the transform was a
byte-identical no-op, so removal changes nothing for the default layout.
kernel 0.0.192 -> 0.0.193.

Closes #6132 (kernel side; host/web/docs follow in the next commit of this PR)
2026-11-10 23:23:06 +08:00
ework-agent 552b62a032 chore: merge master ahead of #5765 review fixes
kernel version: 0.0.183 (PR) vs 0.0.192 (master) -> 0.0.193
2026-11-10 22:34:41 +08:00
ci-check 52d287add1 Merge branch 'master' into 2026-11-08_batch-summary-floor
Resolve conflicts after master advanced (PR #5903):
- acp-kernel version -> 0.0.192 (master 0.0.191 + 1 for this PR's kernel/src change); synced kernel/package.json, root package-lock.json, kernel/package-lock.json
- CONFIGURATION.md/.zh-CN.md are redirect stubs now (docs moved to docs/ on master); regenerated docs/configuration*.md so compress.minSummaryLength carries the batch-total wording (#5894)
2026-11-10 16:24:51 +08:00
Gong Liu 5ac2983c5c kernel: version 0.0.191 2026-11-10 01:24:25 +08:00
mz 3740f16f2c Merge remote-tracking branch 'origin/master' into 2026-10-25_system-position-heal 2026-11-09 12:51:44 +03:00
ranxianglei e03cc4bfca Stop the compress-burst loop: ack fold-point pointer echoes, collapse repeat failure receipts, credit overrides cycle-stale meter
Field incident (2026-11-08, session 01a1b6b3, four symptoms, one loop):
a model under nudge pressure copied its most recent compress call as a
template — but compressAtFoldPoint v2 had rewritten that call's args to a
short ack pointer, so every re-send failed content-not-array; each failure
receipt re-appended the ~200-word format lecture plus a repeat counter the
model misread as "the user asked the same thing N times"; and because the
burst's turns never reached an upstream settle, the token meter fell back
to the raw resent-history bound and read 112% right after a successful
fold (238112/212992 while the real outbound was 83K) — re-nudging the very
loop the fold was supposed to end.

1. kernel: parse-compress-input classifies content echoing the v2
   relocation pointer as kind=already-folded-echo (no lecture), and
   salvages a content STRING that encodes one entry OBJECT (refs inside
   the JSON) through the shared entry validator.
2. host: stream.ts acks already-folded-echo as a one-line no-op (no
   repeat-guard counter; still loop-tracked so runaway bursts hit the
   #2146 breaker), and collapses identical parse-failure receipts to a
   one-liner from the 2nd occurrence on — first failure keeps the full
   teaching receipt.
3. meter: effectiveTokenCount's #5135 pending-credit branch no longer
   requires !anchorStale — during a compress burst the send chokepoint
   keeps contextTokensSource="estimate" so the credit exemption was dead
   exactly when needed; credit is still bounded by the next real settle.

kernel-change: acp-kernel 0.0.188 -> 0.0.189 (parse-compress-input: new
CompressParseKind member + stringified-entry salvage; owner-directed fix
per 2026-11-08 field review of session 01a1b6b3).
2026-11-08 23:18:55 +08:00
ranxianglei ae5c9a5224 kernel: version 0.0.188 (#5919 shredded-merge recovery) 2026-11-08 14:39:56 +08:00
ework-agent 8bbe7d55bd fix: docs-sync/lock-sync — throttle429Scope notes belong in the process.yaml seed (CONFIGURATION.* are generated), kernel lockfile 0.0.187 2026-11-08 01:31:51 +08:00
ci-check 4e5e8c635e Merge origin/master into 2026-11-08_batch-summary-floor (#5903)
Resolve version/lockfile conflicts: acp-kernel converges to 0.0.187
(master was at 0.0.186; the PR's kernel/src change sits on top, so it
bumps one past master). Synced across kernel/package.json, root
package-lock.json (kernel workspace entry), and kernel/package-lock.json
(top + packages[\u201c\u201d]) so all three surfaces agree.
2026-11-08 01:29:47 +08:00
ework-agent 5fff033a4b fix: P2 review batch — scan memo, ephemeral-ref pinning, preoom snapshot, msgid-rescue trace
- throttle F1: requestModelFromBody memoizes {body→model} on a request-scoped
  cacheHost so the pre-ingest early-hold gate and the full 429 gate share ONE
  body scan instead of walking the multi-MiB document twice per POST
- media-refs F2 (kernel): pre-signed/expiring HTTP(S) URLs (X-Amz-*/X-Goog-*/
  X-MS-*/SAS/Expires/Signature/…) are classified NON-recoverable — the handle
  lapses before a folded summary is decompressed, so the message keeps pinning
- persist: an envelope that OOM'd on decode is snapshotted before the next
  save overwrites it (preoomPending set + withPreoomSnapshot)
- session-resolve: every msgid-rescue firing now logs hits/exit-context as
  #5719 overlap-rung reachability evidence
- kernel 0.0.185 → 0.0.186 (media-refs change), lockfile synced

Review findings from #5865 master-diff review (P2 batch).
2026-11-07 23:06:19 +08:00
ranxianglei bcda253a56 kernel: bump 0.0.185 (nudge estimate-hold backstop; #5860 follow-up) 2026-11-07 20:10:22 +08:00
ework-agent 482fd0cb2c lock-sync: regenerate lockfiles for kernel 0.0.184 bump 2026-11-07 15:48:26 +08:00
ci-check 5705f1dcba ci: sync lockfiles to kernel 0.0.183 — lock-sync regen after the version bump (#5789) 2026-11-06 23:32:03 +08:00
ci-check 912fa39b23 Merge remote-tracking branch 'origin/master' into wt-5767-ework-daemon
# Conflicts:
#	kernel/package.json
2026-11-06 09:49:01 +08:00
ci-check 62f4bf8bef ci(#5758): sync lockfiles to kernel 0.0.182 — lock-sync regen after the version bump 2026-11-06 00:52:57 +08:00
ci-check 4379f19746 ci(#5698): sync lockfiles to kernel 0.0.181 — lock-sync regen after the version bump 2026-11-05 11:24:12 +08:00
ci-check 15adc9b448 merge: sync master into #4570 fix branch (adopt #5438 two-sided heal; keep final-array backstop; kernel 0.0.181)
Conflict resolution: master shipped the sibling fix for this family (#5438 via PR #5522: two-sided heal inside coreToAnthropic, demote-only) plus the insertBeforeTrailingSystemRun helper (host wiring pending in #5441). Take master's approved heal semantics wholesale; keep #4715's residual contribution: the healAnthropicSystemPositions standalone export + the three host final-array call sites + WC-023 pins (ledger entry kept from master's side, one entry per id). Branch move-past-next-user design superseded by the owner-approved #5438 approach. Kernel bumped 0.0.180 -> 0.0.181 (kernel-change-vs-base rule).
2026-11-04 19:15:50 +08:00
ci-check d126087abc kernel: ref-based media becomes foldable — re-access handles ride the stored summary (#5620)
The #5620 usage wall: in image-heavy workflows every message carrying
remote-URL images / DeepSeek Files API file refs was permanently pinned
by hasUnrecoverableMediaPayload, turn integrity pinned its partners, and
the context floor climbed to ~70% of the window while folds kept pace
with growth but could never lower it.

Split the class (conservative enumeration):
- new kernel/src/media-refs.ts: extractMediaRefs pulls known re-access
  handles (non-data: URLs, file ids, fileUris) from all five wire
  sidecar families; hasRefRecoverableMediaPayload = at least one handle;
  unknown opaque shapes keep pinning until their semantics are known
- hasUnrecoverableMediaPayload media branches now return
  !hasRefRecoverableMediaPayload(msg); control-plane structured system
  branches (#3992/#4166) and refless shapes are untouched
- apply path appends a deterministic MEDIA REFS section to the stored
  block summary (applySingleRange union incl. consumed-block carry;
  applyRefolds per-block carry), so handles survive folds/merges/
  distillations mechanically — never model discretion (on the wire a
  URL part is often invisible to the summarizer); decompress restores
  the original losslessly either way
- compression-rules: MEDIA REFS preservation added to T1/T2/T3 rules;
  golden regenerated (justification: #5620 root fix, three prompt fields
  extended additively, COMPRESS_PHILOSOPHY unchanged)
- cosmetic: normalize one stray leading space on the tier-2
  Open-objectives bullet (pre-existing, touched while inserting the
  sibling line)

Legacy sessions self-heal without migration code: pre-#5620 BLOCKED refs
on now-foldable media migrate to fresh numbers via the existing #3805
deferred-render path (carrier render deferred to next fold boundary).

kernel version 0.0.179 -> 0.0.180
2026-11-04 09:05:34 +08:00
ranxianglei 8f2cb35dc5 fix(kernel): false-ad batch — declare real schemas, align prompts, accept .. separators (#5555)
- acp_status: scope/view/tool/sort/limit/archiveDetail declared on ALL four wires (shared ACP_STATUS_PARAMETERS) — handler always read them, models could only guess
- google wire gains acp_cache (was acp_status-only; Gemini lanes got cache questions with no tool)
- compress input parser: '..' accepted like '...' in REF_PAIR_IN_LINE + LINE_ENTRY_REFS_RE — pre-fix an advertised separator was rejected and a two-dot header silently became continuation lines of the previous entry (#5555 audit item 8)
- prompt copy: five->four tools count (4 listed), decompress leaf-block note, search_context no-visible-messages correction, per-generation refs paragraph, ACP-TAGS addressable-only phrasing (BLOCKED/protected carry none)
- acp_retrieve desc: file-export branch for very large originals; 📦 bracket balanced
- acp_cache detail: full = line-item breakdown w/ stated cap, not 'every line item'
- absorb: '(nothing needed)' discard escape hatch
- report overview Tip no longer leaks buildStatusReport() internals; acp-panel LEGACY_STATUS_SECTION_STARTS accepts both tip wordings
- version 0.0.178 -> 0.0.179 (+lockfiles); wire-contract goldens regenerated (status params x13, new descs, google+cache); prompt fixtures regenerated
2026-11-03 00:39:06 +08:00
ranxianglei ca532d4f31 kernel: heal the follow side of Anthropic's mid-conversation system rule (#5438) 2026-11-02 13:25:01 +08:00
ranxianglei 833bfa408c chore: register #5470 fold-point switches in LIFECYCLE.md §1 + sync kernel 0.0.177 into both package-locks (CI gate fixes) 2026-11-01 22:15:42 +08:00
ranxianglei fb2f385501 chore: trailing newline in kernel/package-lock.json (lock-sync) 2026-11-01 16:26:45 +08:00
ranxianglei c91ef1a813 kernel: abort-heavy sessions stop starving the nudge cadence (#5415)
#5293 re-anchors the growth reference to the current meter on every
user-aborted turn, which also zeroes the MEASURED growth from the old
reference up to the pre-abort anchor. Abort-heavy clients (85 absorbs
in one reported 4.5h log) never cross the growth floor again: a 300K
ready mass idles for hours ("growth 4450 < floor 33750, ready: T1
302220") and the session finally compresses a ~330K backlog.

Fix, v2 semantics (single abort stays byte-identically quiet as #5293
pinned):
- the host banks the skipped measured growth into
  state.nudge.absorbedDebt and counts the absorbs (absorbCount);
- debt and the new backlog-drain guard pay only once absorbCount >= 2 —
  one abort after a long quiet stretch can bank a whole interval, but
  it must not re-fire the cadence on the user's redirect (#5293 pin);
  the second absorb proves the session is abort-heavy, not
  redirect-polite, and the 209-era cadence recovers;
- backlog-drain guard (same philosophy as the #194 first-sight
  bypass): count >= 2 + debt > 0 + no outstanding nudge + ready mass
  >= 2x the T1 threshold drains now instead of idling behind the
  starved growth leg;
- applyCompression resets the debt bank and the count with the other
  baselines; idle reasons surface the debt for diagnosability
  ("growth X + absorbed Y across N aborts < floor Z", or "held
  (single abort, #5293)" for count 1).

kernel-change: nudge decision only (kernel/src/compress.ts, types),
host booking only (src/session.ts absorbAbortedTurnGrowth); no config
surface added.

tests: kernel/tests/issue5415-absorb-debt-nudge.test.ts (8 cases incl.
the #5293 single-absorb pin), tests/issue5415-absorb-debt.test.ts
(booking arithmetic + count), #5293 e2e unchanged and green; kernel
suite 1521/1521; host nudge/abort suites 23/23; tsc clean.
2026-11-01 16:17:17 +08:00