@sema-agent/core 7.57.0 → 7.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +385 -0
- package/dist/agents/subagent-steps.js +2 -4
- package/dist/brain/route-adjudicator.js +2 -1
- package/dist/core/a2a.d.ts +2 -1
- package/dist/core/a2a.js +23 -10
- package/dist/core/allow-entry.d.ts +2 -1
- package/dist/core/allow-entry.js +2 -1
- package/dist/core/ask-origin.d.ts +21 -2
- package/dist/core/ask-origin.js +5 -1
- package/dist/core/auto-compaction.d.ts +4 -0
- package/dist/core/auto-compaction.js +1 -1
- package/dist/core/auto-mode-directive.d.ts +29 -5
- package/dist/core/auto-mode-directive.js +38 -8
- package/dist/core/checkpoint-requirements.d.ts +7 -1
- package/dist/core/checkpoint-requirements.js +2 -0
- package/dist/core/checkpoint-store.d.ts +27 -11
- package/dist/core/checkpoint-store.js +13 -3
- package/dist/core/engine-notice.d.ts +1 -1
- package/dist/core/fs-write-gate-policy.d.ts +4 -2
- package/dist/core/fs-write-gate-policy.js +7 -3
- package/dist/core/gate-fold.js +6 -3
- package/dist/core/gate-lanes.js +11 -2
- package/dist/core/git-worktree-env.d.ts +53 -11
- package/dist/core/git-worktree-env.js +96 -12
- package/dist/core/hooks.d.ts +4 -1
- package/dist/core/hooks.js +12 -5
- package/dist/core/human-input-projection.d.ts +1 -0
- package/dist/core/human-input-projection.js +3 -0
- package/dist/core/locked-config.d.ts +15 -1
- package/dist/core/locked-config.js +38 -2
- package/dist/core/mcp-call-meta.d.ts +66 -0
- package/dist/core/mcp-call-meta.js +103 -0
- package/dist/core/mcp-connection-pool.d.ts +3 -1
- package/dist/core/mcp-connection-pool.js +3 -1
- package/dist/core/mcp-failure.d.ts +7 -1
- package/dist/core/mcp-failure.js +10 -0
- package/dist/core/mcp-probe.d.ts +4 -0
- package/dist/core/mcp-probe.js +1 -1
- package/dist/core/mcp-server-link.d.ts +5 -2
- package/dist/core/mcp-server-spec.d.ts +46 -18
- package/dist/core/mcp-server-spec.js +1 -18
- package/dist/core/mcp.d.ts +6 -14
- package/dist/core/mcp.js +77 -37
- package/dist/core/memory-engine/scope-contract.d.ts +45 -4
- package/dist/core/memory-engine/scope-contract.js +80 -11
- package/dist/core/mode-policy.d.ts +8 -5
- package/dist/core/mode-policy.js +5 -4
- package/dist/core/mods/host.js +1 -1
- package/dist/core/mods/kernel/dispatch.d.ts +3 -0
- package/dist/core/mods/kernel/dispatch.js +10 -8
- package/dist/core/mods/kernel/events.d.ts +5 -1
- package/dist/core/mods/kernel/events.js +1 -1
- package/dist/core/mods/kernel/registration.d.ts +5 -1
- package/dist/core/mods/kernel/site-rules.d.ts +3 -0
- package/dist/core/mods/kernel/site-rules.js +10 -0
- package/dist/core/mods/package.d.ts +23 -0
- package/dist/core/mods/package.js +118 -0
- package/dist/core/mods/stations.d.ts +2 -2
- package/dist/core/mods/stations.js +1 -1
- package/dist/core/mods/tool-call.d.ts +5 -1
- package/dist/core/mods/tool-call.js +12 -3
- package/dist/core/path-guard-rows.d.ts +20 -0
- package/dist/core/path-guard-rows.js +11 -0
- package/dist/core/peer-seat.d.ts +186 -0
- package/dist/core/peer-seat.js +307 -0
- package/dist/core/present-plan-tool.d.ts +10 -1
- package/dist/core/present-plan-tool.js +46 -2
- package/dist/core/protocol-http-auth.d.ts +40 -29
- package/dist/core/protocol-http-auth.js +30 -32
- package/dist/core/redaction-marks.d.ts +16 -0
- package/dist/core/redaction-marks.js +16 -0
- package/dist/core/redaction-passes.js +8 -9
- package/dist/core/retention.d.ts +41 -15
- package/dist/core/retention.js +59 -12
- package/dist/core/rewrite-rejudge.d.ts +37 -0
- package/dist/core/rewrite-rejudge.js +40 -0
- package/dist/core/run-origin.d.ts +40 -0
- package/dist/core/run-origin.js +37 -0
- package/dist/core/runner/advertised-writable-dirs.d.ts +57 -38
- package/dist/core/runner/advertised-writable-dirs.js +126 -0
- package/dist/core/runner/compaction-restate.d.ts +15 -6
- package/dist/core/runner/compaction-restate.js +28 -2
- package/dist/core/runner/contracts.d.ts +13 -5
- package/dist/core/runner/gate-exit.d.ts +18 -4
- package/dist/core/runner/gate-exit.js +5 -1
- package/dist/core/runner/prepare-caps-and-workflow.d.ts +2 -0
- package/dist/core/runner/prepare-caps-and-workflow.js +1 -1
- package/dist/core/runner/prepare-config-doors.d.ts +8 -5
- package/dist/core/runner/prepare-config-doors.js +12 -10
- package/dist/core/runner/prepare-delegation-surface.d.ts +4 -0
- package/dist/core/runner/prepare-delegation-surface.js +15 -18
- package/dist/core/runner/prepare-gate-stations.js +1 -1
- package/dist/core/runner/prepare-hands-readface.d.ts +7 -3
- package/dist/core/runner/prepare-hands-readface.js +4 -1
- package/dist/core/runner/prepare-memory.d.ts +3 -0
- package/dist/core/runner/prepare-memory.js +19 -23
- package/dist/core/runner/prepare-policy-chain.d.ts +4 -4
- package/dist/core/runner/prepare-policy-chain.js +2 -2
- package/dist/core/runner/prepare-protocol-tools.d.ts +4 -2
- package/dist/core/runner/prepare-protocol-tools.js +3 -3
- package/dist/core/runner/prepare-suspend-saga.d.ts +2 -0
- package/dist/core/runner/prepare-suspend-saga.js +2 -1
- package/dist/core/runner/prepare-task.js +25 -12
- package/dist/core/runner/prepare-wiring-manifest.d.ts +1 -0
- package/dist/core/runner/prepare-wiring-manifest.js +2 -2
- package/dist/core/runner/prepare-workspace-restore.d.ts +3 -0
- package/dist/core/runner/prepare-workspace-restore.js +4 -4
- package/dist/core/runner/resume-admission.js +1 -1
- package/dist/core/runner/resume-checkpoint-screen.js +2 -0
- package/dist/core/runner/run-harness-handlers.d.ts +3 -4
- package/dist/core/runner/run-harness-handlers.js +1 -8
- package/dist/core/runner/run-identity-wiring.js +1 -0
- package/dist/core/runner/run-leg.js +5 -1
- package/dist/core/runner/run-notification-lane.js +3 -0
- package/dist/core/runner/terminal-account.js +3 -3
- package/dist/core/runner/tool-end-body.js +1 -0
- package/dist/core/runner/tool-occurrence.d.ts +4 -1
- package/dist/core/runner/tool-occurrence.js +2 -1
- package/dist/core/runner/write-protection-station.d.ts +8 -2
- package/dist/core/runner/write-protection-station.js +2 -0
- package/dist/core/runner-deps.d.ts +2 -2
- package/dist/core/sensitive-path-policy.js +6 -7
- package/dist/core/session-log-transfer.d.ts +24 -0
- package/dist/core/session-log-transfer.js +166 -0
- package/dist/core/session-store.d.ts +84 -19
- package/dist/core/session-store.js +162 -24
- package/dist/core/session.d.ts +92 -1
- package/dist/core/shell-read-silence.js +1 -0
- package/dist/core/steer-replay.d.ts +4 -2
- package/dist/core/steer-replay.js +2 -1
- package/dist/core/store-contracts/checkpoint-store-contract.js +17 -0
- package/dist/core/store-contracts/session-repo-contract.js +112 -5
- package/dist/core/store-contracts/session-store-contract.d.ts +4 -1
- package/dist/core/store-contracts/session-store-contract.js +236 -2
- package/dist/core/task-event.d.ts +68 -8
- package/dist/core/task-registry-shared.d.ts +2 -1
- package/dist/core/task-spec.d.ts +37 -0
- package/dist/core/task-stream.d.ts +2 -1
- package/dist/core/terminal-cause.d.ts +1 -1
- package/dist/core/tool-catalog-entries.js +1 -0
- package/dist/core/tool-result-store.d.ts +17 -10
- package/dist/core/tool-result-store.js +3 -1
- package/dist/core/types.d.ts +1 -1
- package/dist/core/untrusted-egress.d.ts +0 -2
- package/dist/core/untrusted-egress.js +10 -14
- package/dist/core/wiring-manifest.d.ts +12 -3
- package/dist/core/wiring-manifest.js +4 -3
- package/dist/core/workspace-snapshot.d.ts +44 -0
- package/dist/core/workspace-snapshot.js +34 -0
- package/dist/core/write-protect.d.ts +43 -3
- package/dist/core/write-protect.js +43 -16
- package/dist/engine/execution-env/node-execution-env.js +15 -11
- package/dist/engine/execution-env/symlink-chain.d.ts +7 -5
- package/dist/engine/harness/agent-harness.d.ts +5 -0
- package/dist/engine/harness/agent-harness.js +2 -0
- package/dist/engine/harness/types.d.ts +48 -7
- package/dist/engine/harness/types.js +5 -1
- package/dist/engine/llm/types.d.ts +12 -3
- package/dist/engine/llm/types.js +1 -1
- package/dist/engine/session/import-validate.js +3 -0
- package/dist/engine/session/memory-repo.d.ts +17 -9
- package/dist/engine/session/memory-repo.js +44 -34
- package/dist/engine/session/repo-utils.d.ts +22 -4
- package/dist/engine/session/repo-utils.js +49 -1
- package/dist/engine/session/storage-base.d.ts +10 -1
- package/dist/engine/session/storage-base.js +7 -1
- package/dist/index.d.ts +13 -6
- package/dist/index.js +10 -4
- package/dist/internal/harness-types.d.ts +1 -1
- package/dist/internal/harness.d.ts +2 -2
- package/dist/internal/harness.js +2 -2
- package/dist/stores/file/index.d.ts +4 -1
- package/dist/stores/file/index.js +4 -1
- package/dist/stores/file/session-store.d.ts +15 -8
- package/dist/stores/file/session-store.js +28 -13
- package/dist/tools/fs/fs-write.d.ts +6 -3
- package/dist/tools/fs/fs-write.js +8 -7
- package/dist/tools/fs/index.d.ts +3 -0
- package/dist/tools/fs/index.js +1 -1
- package/dist/tools/fs/safety.js +40 -8
- package/dist/tools/fs/search.js +6 -24
- package/dist/tools/fs/shell-read-check.d.ts +8 -1
- package/dist/tools/fs/shell-read-check.js +59 -15
- package/dist/tools/fs/shell-read-establish.js +2 -1
- package/dist/tools/fs/shell-read-identity.js +1 -1
- package/dist/tools/fs/shell-read-judge.d.ts +10 -1
- package/dist/tools/worktree.d.ts +42 -15
- package/dist/tools/worktree.js +60 -32
- package/package.json +4 -2
- package/test/export-surface.snapshot.json +63 -1
- package/wire-changes/core-stores-sql@7.58.0.json +29 -0
- package/wire-changes/core@7.58.0.json +2188 -0
- package/wire-changes/mods-kernel@7.58.0.json +81 -0
- package/wire-changes/primitives@7.58.0.json +29 -0
- package/dist/primitives/credential-ref.d.ts +0 -89
- package/dist/primitives/credential-ref.js +0 -125
- package/dist/primitives/index.d.ts +0 -2
- package/dist/primitives/index.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,381 @@
|
|
|
1
|
+
## 7.58.0 — 2026-10-26
|
|
2
|
+
|
|
3
|
+
### The release re-window refuses the rows it cannot decide and keeps each row's first promised window — `scripts/release/rewindow.mjs` (#2835; release tooling only, `src/` untouched; no behaviour change; hard-breaking: none; closed sets: none; exports: none)
|
|
4
|
+
|
|
5
|
+
- **Before.** At the R, `rewindow` moved every non-landed row windowed at the cut version: a P0 / P1 row, a row with no readable P level, a DESIGN-DONE row and a BLOCKED row went to the next version window with no car coordinate asked for, and `首次承诺窗` was read only from an explicit field and otherwise written as the version being cut — a row whose window history named 7.55.0 lost it. No re-window count was written.
|
|
6
|
+
- **Now.** Refused (LEDGER-LAW v2 §2.5; exit 3 in a dry run as in `--apply`; nothing moves and nothing is written; every refused row is named with why and how to write it): a row with no readable P level · a BLOCKED row missing any of `on` / 负责人 / 承诺解阻 / 下次复核 / 阻塞方 (a BLOCKED row is judged by its level and those five fields alone, P0 / P1 included: complete ⇒ it moves with the version) · and, for a row that is not BLOCKED: a P0 / P1 row with no car coordinate · a DESIGN-DONE row with no car coordinate. A coordinate is what git resolves from the status head: a car branch (or its `merge <car>` commit), or a commit that changes something beyond the bookkeeping files (ledger, retirement lines, anchor-claims stock group); a bookkeeping commit sha, a planned car with no branch and a session number are not. Every row the tool still moves (pending layer and next window alike) carries `首次承诺窗 <earliest window its history names>` and `改窗 <n + 1>` in its status head, the status word and the `原 …` tail kept: the first window is the earliest window the row names — a `首次承诺窗` field, the window cell's `原 x.y.z` / `原窗 x.y.z` / nested chain, an old re-window note (`a → b`, also `a → 待排`) — never defaulted to the cut, and a field is copied whenever the history agrees with it; the count is the largest explicit `改窗 n`, else the moves to a later window the two cells show (once per time it happened, a move told in both cells once, an advance not at all); going into the pending layer and back out copies both and only raises the count. Only the status head is read for the row's own car, sha and BLOCKED fields — a past status after `原 BLOCKED(` / `原 DESIGN-DONE(` / … is history. `--next` must be later than the cut.
|
|
7
|
+
- **Readings.** `rewindow 7.58.0 --dry-run` on main's ledger (4d71bbcfd) with the release head `origin/stage-7580` (d64bb24b1): the base tool moved 109 rows and refused none; this one moves 87 (34 into the pending layer, 53 to 7.59.0), refuses 22 (14 with no P level: #2357 #2361 #2378 #2392 #2404 #2405 #2411 #2413 #2426 #2427 #2428 #2429 #2698 #2699; P1 with no coordinate: #454 #1928; DESIGN-DONE with no coordinate: #1557 #1928; BLOCKED missing fields: #1444 #1595 #2596 #2609 #2631) and leaves 30 at 7.58.0 (26 landed, 4 with a car in the release); 109 = 87 + 22. 50 of the 87 carry a first promised window earlier than 7.58.0. Over the R 7.57.0 input (665 rows): of the 623 rows that entered the pending layer, 123 had a first promised window earlier than 7.57.0 that the R wrote as 7.57.0 (89 → 7.56.0, 20 → 7.53.0, 13 → 7.55.0, 1 → 7.52.0) — with the final reader 124 (one more is found from an `→ 待排` note: 1 → 7.48.0) — and 102 more carried a `首次承诺窗` field later than their own history (e.g. #901: 7.46.0 over `7.43.0 未兑现 → 7.46.0`): 226 in all; the ledger still carries the written values until the rows are lifted. A snapshot: the stage is not complete, so cars not yet merged read as outside the release.
|
|
8
|
+
- **Who is hurt.** Nobody at runtime. The R operator: `r-commit` / `rewindow` exit 3 until each of the 22 rows above has its level, coordinate or fields (or is closed, or `--keep`ed).
|
|
9
|
+
- **Pins.** `test/release-rewindow-refuse.test.ts` (X1–X12: the four refusals with a control each, one cell per BLOCKED field and the fullwidth separator, what a coordinate is — also against real git: a ledger-only commit, a mixed commit, a merge read against its first parent —, exit 3 through the command line in both modes with the file untouched, the first window from the history / an explicit field / the status notes, the count, the pending round trip, the stamp forms, `--next`); Twenty-one mutations of the tool (each refusal off, a bookkeeping commit read as work, a merge read without its first-parent diff, the first window defaulted to the cut or a field put above the history, the count restarted or an advance counted or repeated postponements collapsed, a past status read as the head, a fullwidth separator taken as a value, the stamp not written, the pending path or `--next` unguarded …) are each red in at least one cell, and the base tool is red in all 17. `test/release-chain-bookkeeping.test.ts` W1 / W2 / W4 re-pinned and the W7 acceptance freezes the 226 rows above (124 written as the cut, 102 a field later than the history) and checks each new window is earlier than the one written and named in the row's own cells.
|
|
10
|
+
- **Known limits.** A branch that exists but carries no work of its own (cut from the stage and never committed to) reads as a coordinate, as does any resolvable `car-…` word in the head, including one that only mentions another car; a commit counts as work if it touches any file beyond the three bookkeeping ones; the five BLOCKED fields are checked for presence, not for the quality of their values. The 226 ledger rows above are not repaired by this change.
|
|
11
|
+
|
|
12
|
+
### The approval card's reason an extension's ask is not cleared by a matching allow entry is one station-neutral sentence — a `tool.check` ask no longer reads as a PreToolUse hook's (#2827; wording change on the card's disclosure clause, open to veto; hard-breaking: none; closed sets: none; exports: none) (@cli @client-core @test)
|
|
13
|
+
|
|
14
|
+
- **Before.** An ask stamped with the extension provenance (`decisionReason: "hook"`, ask class `hook`) is raised by two engine stations: a `classic.PreToolUse` handler answering `ask` (folded over the standing verdict by `foldHookAsk`, `src/core/tool-policy.ts`) and a `tool.check` handler answering `ask` (`readToolCheck` and `questionOf`, `src/core/tool-check-reading.ts`). The class's reason row, `SHADOW_REASON.hook`, said `a PreToolUse hook asks about this call — the deployment's own screening is answered by a person`, so the card for a call the `tool.check` station asked about named a PreToolUse hook in its closing clause while its message half already named the extension that asked (`asked by extension "<name>"`). A deployment policy's own ask that declares `decisionReason: "hook"` (a tighten-only input the class derivation reads) is the same class and read the same clause.
|
|
15
|
+
- **Now.** One row, one sentence for both stations: `an extension's screening asks about this call (a PreToolUse hook or a tool.check station) — the deployment's own screening is answered by a person`. The card's clause and the exported `SHADOW_REASON.hook` are the same string. There is no row per station: the class is one class, and a sentence chosen by station would be two readings of it.
|
|
16
|
+
- **Not changed (stated).** The ask class set (`hook` stays the one class for both stations), the member phrase on the allow side (`a PreToolUse hook's allow` still names the member that matched, whichever station spoke the allow), `SHADOW_REASON` (still frozen, still exported from the root with the same keys).
|
|
17
|
+
- **Wording change (open to veto).** *What changed*: the closing clause of the card's disclosure for an ask of class `hook` has new words. *Who is hurt*: a host or test that matches the old clause by text. *Migration*: compare with the exported `SHADOW_REASON.hook`, never a copy of its text.
|
|
18
|
+
- **Consumers.** @cli @client-core: a host that renders the card's "why it cannot be cleared" half from `SHADOW_REASON` shows the new sentence with no change; one that snapshots the old clause by text re-pins to the exported row. @test black box: a `tool.check` ask beside a matching `allowedTools` entry ends its card `… does not clear the ask — an extension's screening asks about this call (a PreToolUse hook or a tool.check station) — the deployment's own screening is answered by a person`; a PreToolUse ask ends the same.
|
|
19
|
+
- **Pins.** `test/backlog2827-shadow-reason-hook.test.ts` (a real Runner and a real `Bash` call: a PreToolUse ask, a `tool.check` ask over an allow, and a `tool.check` ask while another registration's PreToolUse allow is the only member that matched — each card's why-clause is the exported row, names both stations and is never the old one-station claim; a deployment policy's own ask declaring the hook provenance; the clauses are byte-identical; the table stays frozen with no row per station); re-pinned to the exported row: `test/backlog1516-probe-mandate-disclosure.test.ts`.
|
|
20
|
+
|
|
21
|
+
### BREAKING — a write-protection hit only the disk reaches is its own ask class, `write_protection_on_disk`, which the auto-mode classifier does not answer (#2795, ruled C-R923; behaviour narrowing + `AskClass` +1, open to veto; hard-breaking: yes)
|
|
22
|
+
|
|
23
|
+
- **Before.** A write whose path as written names no row of the write-protection table, but whose real target (a link onto `.claude/settings.json`) or link chain (a hop through `.ssh`) does, was the same ask as a write that spells the row: class `write_protection`, which the auto-mode classifier may answer — so in `auto` a model could steer a write through an innocent-looking link and have the classifier, which sees only the arguments, clear it.
|
|
24
|
+
- **Now.** One table hit has two readings, judged per written target: the path as written names the row ⇒ `write_protection` (unchanged: the classifier may answer it); only where the path resolves on disk does ⇒ `write_protection_on_disk`, whose row is `write_protection`'s but for the classifier column. The classifier station still reads one cell (the folded row); the reading is the class. A write tool's target reads the judge's `via` (the judge reads the spelling first and answers there on a hit, so `target` / `chain` means the spelling names no row); a shell command reads each written target — one occurrence at one seat, never one canonical identity — its text judged by the table's spelling view alone. Its text is the command's own: for a pattern, the pattern, not the names a listing produced; otherwise its spellings but the ones a reading of the filesystem added — `EstablishedRead.derivedSpellings` (new, optional) marks them: the home's view of a landed target (a home reached through a bind mount or a kept link respells the target through the home), and the name of a GNU sed `--follow-symlinks` backup when the operand's links supplied it. A command with a spelled target and a linked one carries both classes; the disclosed word is `write_protection_on_disk` (it sits just before `write_protection` in `ASK_CLASSES`).
|
|
25
|
+
- **Where the new class goes, by mode:** `auto` — to the approver (the classifier is not asked; no approver ⇒ the headless refusal); `bypassPermissions` — released, as `write_protection` is (`released.askClass: "write_protection_on_disk"`); `dontAsk` — refused; a declared sandbox may still admit it (the row's sandbox column is `write_protection`'s); no allow rule clears either.
|
|
26
|
+
- **Unchanged:** the ask sentence (the resolved form already carries the reach clause `matched where the path resolves on disk (its real target or a link on the way)`), the mandate word `write_protection` and its card reason (`SHADOW_REASON.write_protection_on_disk` is the same sentence), and every other class.
|
|
27
|
+
- **Hard-breaking, three sentences.** *What breaks*: `AskClass` gains `write_protection_on_disk` (`ASK_CLASSES`, `MODE_ARBITRATION`, `SHADOW_REASON` one row each; `ShellReadVerdict` one optional mark `writeProtectedOnDisk`; `AskClassFacts.mandateMarks` one optional `writeProtectedOnDisk`; `EstablishedRead` one optional `derivedSpellings`; the station's `writeTargetJudge` seat one optional input `spellingOnly`), and a write that reaches the table only on disk carries it instead of `write_protection` on `tool_end.gate.disposition`, the approval request and the park row — and the auto-mode classifier no longer answers it. *Who is hurt*: a consumer exhaustive over `AskClass` (a `Record<AskClass, …>` table fails to compile once); a host that recognises a write-protection question by `askClass === "write_protection"` misses this one (read the mandate word, which names both); an `auto` deployment whose classifier used to clear a write through a link onto a guarded path now puts it to its approver. *Compensation*: the row differs from `write_protection`'s in one column; the mandate word, the card reason and the sentence are unchanged; consumers are named below.
|
|
28
|
+
- **Not changed, stated.** A park row a 7.58.0 engine writes with the new word is screened out by an older engine's class screen (the word is outside its closed set) — the pair is dropped, not misread. Where the reference has no counterpart: a deployment's configuration root given as a link and a write spelled under the root's real directory is the disk's reading here (the declared root's spelling does not name it) — a stricter reading.
|
|
29
|
+
- **Consumers.** @server: `src/run-local.ts` `NO_TTY_ASK_CLASS_ROW` (`Record<AskClass, …>`) needs one row (the remedy `write_protection` has fits: terminal only, no budget release). @client-core: the generated class table and arbitration mirror regenerate; an older package reads the word as outside its table. @cli: please check for a table over `AskClass` (none was seen in the tree last read); a fixture that maps the mandate word to a class keeps working (the mandate word is unchanged). @test: black-box — in `auto`, a Write whose path is a link onto `.claude/settings.json` reaches the approver without the classifier being asked, while a Write spelling `.claude/settings.json` is still answered by the classifier; `echo a > .vscode/settings.json; echo b > link.json` carries both classes.
|
|
30
|
+
- **Pins.** `test/backlog2795-on-disk-hit-to-person.test.ts` (real lane, `auto`: W1 spelled ⇒ classifier; W2 link onto the row / W3 chain through `.ssh` ⇒ approver, no classifier; W4 a data-root sub-path naming `.ssh` stays the spelling's; W5 no approver ⇒ refused; S1 `echo x > link`; S2 `rm .bashrc` (entry seat) the spelling's; S3 `rm notes/x` with `notes` → `.ssh` the disk's; S4 two targets ⇒ both classes; H1 a home reached through a bind mount / H2 a followed sed backup ⇒ the disk's reading, H3 the same sed spelled directly ⇒ the spelling's; T1–T5 the row, the order, the words, bypass / dontAsk, the retired `write_protection_unresolved` stays retired). Re-pinned: the releasable-class lists (`backlog1111`, `backlog1214`, `backlog1423`), the class ratchet (`backlog1731` A6), the linked configuration root (`backlog1419` P7a). `test/live-write-protect-ask.test.ts` ① keeps the spelling form only (the resolved form no longer reaches the classifier).
|
|
31
|
+
|
|
32
|
+
### `@sema-agent/core` depends on `@sema-agent/primitives` and reads it by name — a project that installs both holds one copy of the credential reference, and the root's tarball no longer carries `dist/primitives/` (#2749, ruled C-R910; install-shape change, open to veto; no behaviour change; hard-breaking: none; closed sets: none; exports: none — the six root values and six root types keep their names and kinds, now re-exported from the package) (@server @web-admin @settings-schema @cli @client-core @connectors @dgx)
|
|
33
|
+
|
|
34
|
+
- **Before.** The root compiled `src/primitives/` into its own `dist/` and re-exported that copy; it did not depend on the package. Installed side by side (both tarballs packed from one tree, installed into an empty project), `core.readCredentialRef !== primitives.readCredentialRef`, and the same for `CREDENTIAL_REF_KINDS`, `CREDENTIAL_REF_TRUST` and `CREDENTIAL_REF_PROBLEM_REASONS` — two module instances, as the 7.57.0 notes disclosed.
|
|
35
|
+
- **Now.** The root's `dependencies` name `@sema-agent/primitives` at the root's own version, exactly. `src/index.ts`, `src/core/peer-seat.ts` and `src/core/mcp-server-spec.ts` import the package by name; the root build excludes `src/primitives/` and compiles against the package's built declarations, so `npm run build` builds the package first (`scripts/build-root-deps.mjs`). The root's tarball goes from 1555 to 1551 entries (the four `dist/primitives/*` files). Installed side by side, all six values are the package's own (`===`), and npm keeps one copy. The package's declarations now carry their documentation (its build runs the second, comment-keeping declaration pass the root runs).
|
|
36
|
+
- **One law, both directions.** A package of the release names another only at the release version: a package's core peer (as before) and the root's dependency on a package (new). `gate:packages` checks the root's side — exact version, published, has source, does not take core (a cycle) — and the bump moves that cell (`scripts/bump-version.mjs`). The publish order is the manifests' dependency order (`scripts/release/lib.mjs` `publishSet`, whose code is unchanged; with the new dependency it reads `mods-kernel → primitives → core → core-stores-sql`, where it read core first); nothing else states it. Before the publish, the stranger installs (`gate:blackbox`, and `gate:packages:pack` for a package that takes core) install the root's tarball together with the tarballs of the packages it depends on, packed from the same tree — a new version is on no registry yet; the root's tarball must carry no file compiled from such a package's source; `gate:blackbox` checks the installed values are the package's own and that a consumer's compiler reads them as the package's own declarations. `gate:repro` refuses to judge a built `dist/` whose by-name import would not land in this tree's `packages/primitives` (no link, a link into another checkout, the package not built), naming the fix (`npm ci --ignore-scripts`, then `npm run build`). CI's fallback publish leg, which publishes the root alone, now refuses (`scripts/root-deps-published.mjs`) while a package the root depends on is not on the registry at the release version, or the registry cannot be asked — it no longer could land a root nobody can install; the refusal retires with that leg (#2803). `gate:spawn-sites` reads such a package as the repository's own source — every file it compiles must be under the `src/` it scans — instead of asking for a review row pinned to a version that moves every release; `criteria-lint` counts its source as shipped.
|
|
37
|
+
- **An intermediate step with its retirement condition, not a documented exception.** After #2802 (the three gates that read only `src/` — comment census, internal wording, module size — extended to `packages/*/src`) lands, the primitives source moves to `packages/primitives/src`, the build's exclusion and its `paths` entry retire, and the satellite packages have one layout.
|
|
38
|
+
- **Not changed: `@sema-agent/mods-kernel`.** The root still compiles the kernel into its own `dist/` beside the package (two module instances if both are installed; the kernel's README states two copies interoperate on plain objects and compare `KERNEL_CONTRACT_VERSION`). Reading it by name first needs a ruling on the kernel's public face, because the engine reads four of its non-entry modules — #2801, `KL-2749-a` (pending ruling, not accepted).
|
|
39
|
+
- **Install-shape change (open to veto).** *What changed*: installing `@sema-agent/core@X.Y.Z` now installs `@sema-agent/primitives@X.Y.Z` with it; every consumer's lockfile gains `node_modules/@sema-agent/primitives`. *Who is hurt*: nobody at runtime; a project that pins `@sema-agent/primitives` itself at a version other than its core's gets two copies (npm keeps core's own beside it), which `npm ls @sema-agent/primitives` shows. *Migration*: none for a project that does not import the package; one that does names the same version as its core.
|
|
40
|
+
- **Consumers.** @server @web-admin @settings-schema: a validator that reads `readCredentialRef` from `@sema-agent/primitives` names the package at your core's version — then it is the engine's own function, not a copy; your lockfile gains one entry when you take this release. @cli @client-core @connectors @dgx: one lockfile entry, no code change.
|
|
41
|
+
- **Pins.** `test/backlog2749-primitives-single-instance.test.ts` (over a throwaway release tree: the install set installs offline at an unpublished version and the root's re-exports are the package's values, declarations included; a root carrying a compiled copy is red in the tarball reading and in the identity probe; a root declaration re-exporting an unresolvable package is red in the declaration probe; the root's dependency law, red for a range, another version, an unpublished package, a peer entry; the bump writes the cell; the publish order; `gate:repro`'s precondition for each state; the CI fallback's refusal for a registry without the package, with it, and unable to answer, and its place before the leg's publish; the real tree's manifest, build config and build script). Re-pinned as well: `test/backlog1468-n1-core-stores-sql.test.ts` (`tsconfig.json`'s in-repo mappings are core and the package the root depends on). Re-pinned: `test/backlog2293-credential-ref.test.ts` (the pin that compared two source paths in one module graph — always the same module — is replaced by the source reading: the rest of `src/` reaches the folder only by the package name), `test/verify-packages.test.ts` (the root build program compiles no source of a package the root depends on and reads only that package's built declarations from `packages/`), `test/backlog1751-package-release-base.test.ts` (the bump's cells include the root's dependency; the lockfile links it at a version no registry holds).
|
|
42
|
+
|
|
43
|
+
### The hosted-connector assertion header has one name, and the engine owns it — `MCP_ASSERTION_HEADER` is exported from the root and a peer declaration that names it is refused (#1750; additive export, behavior narrowing, open to veto; exports: +1 `MCP_ASSERTION_HEADER`)
|
|
44
|
+
|
|
45
|
+
- **Before.** The name of the header a hosted connector reads the principal assertion from had no definition in the engine: it was a proposed value on the connector's side and a free string on the server's request face, while the engine — the party that sends request headers — let any peer declaration set a static header under it (or name it as the principal header) and sent it as declared.
|
|
46
|
+
- **Now.** `MCP_ASSERTION_HEADER` (`"connector-assertion"`) is defined once, in `src/core/protocol-http-auth.ts`, and exported from the package root. The one ownership judge, `headerOwnershipCollision`, gives the engine that name as its first owner: a declaration that names it as the principal header's name collides, and the dial (MCP and A2A alike, one judge) refuses the peer with `config.protocol_header_collision` before any request leaves; its siblings still mount. The judge's answer gains `engineOwned` (true for this collision, false for the ordinary two-spelling one; `first` is then the engine's spelling, `second` the declaration's). Names that only contain it (`x-connector-assertion`, `connector-assertion-id`) are the declaration's own and travel. This release sends nothing under the name and adds no member to any declaration: the constant is the name only; the assertion's value is not minted, held or sent here, and its path is the credential-resolution seat (#2294 / #2295). (In this same release #2294 removes `transport.headers` altogether: a declaration carrying any static header is refused by name before this judge runs, so the judge's static-header arm is reached by no declaration and answers `undefined` for it; its live arm is `principalHeader`.)
|
|
47
|
+
- **Behavior narrowing (open to veto).** *What changed*: a peer declaration naming the engine's assertion header as `principalHeader` is refused at its dial; it was sent as declared (a static `headers` entry is refused earlier and by name, #2294). *Who is hurt*: a deployment that put a pre-minted assertion into a static `connector-assertion` header of an MCP or A2A peer (that peer is now skipped with a coded warning), or that named the principal header `connector-assertion` (a hosted connector reads that header as an assertion, not as a bare principal). *Migration*: remove the entry; a connector that requires the assertion has no static-header path from this release on — the value reaches it under this name from the credential seat once that lands. Measured on a real MCP dial, previous stage head vs this one: a static `Connector-Assertion` header reached the listener and is refused with the listener hearing nothing; `principalHeader: "CONNECTOR-ASSERTION"` likewise.
|
|
48
|
+
- **Consumers.** @connectors: your CN-034 gate can read `MCP_ASSERTION_HEADER` from the package root — the value is your launcher's current `connector-assertion`, so nothing is renamed on your side. @server: S-1566 can default `assertionHeader` to this constant; `_CoreHasNoAssertionSeat` stays green — the constant is not a seat (no `assertionHeader` key on the http transport) — and an intake that judges a declaration with `headerOwnershipCollision` now also refuses the engine's name, reading `engineOwned` for the wording. @test: a black-box cell for each refused form (static any-case, with a principal header, as the principal header; MCP and A2A).
|
|
49
|
+
- **Pins.** `test/backlog1750-assertion-header-name.test.ts` (the name defined once as a string literal in the whole src tree, exported and a valid header name; the judge for each form with its controls; the MCP and A2A dials refusing before any request, a sibling still mounting); `test/export-surface.snapshot.json` regenerated (+1).
|
|
50
|
+
|
|
51
|
+
### The release is one tracked chain, `scripts/release/`, and each of its steps refuses what it cannot stand on (#2794; release tooling only; no behaviour change; hard-breaking: none; closed sets: none; exports: none)
|
|
52
|
+
|
|
53
|
+
- **Before.** The release steps after the last car ran from per-window script copies kept outside the tree, beside an in-tree publish script that read its token from a shell profile. On the 7.57.0 day five checks were left to a person and all five slipped: the publish took its RC-green sha and the gated `dist/` only when they were set (neither was), the live gate ran after the publish, the post kept a `<N>` slot and a "byte-for-byte" sentence its publish log contradicted through four green runs of the post lint, the "shipped" post number was claimed 68 minutes before the publish, the R bookkeeping wrote a `BLOCKED(on 派车槽)` status no blocker stood behind (taking 662 live rows out of the capacity count), and the satellites' printed pack shasums were taken before their gitHead was written, so none matched the registry.
|
|
54
|
+
- **Now.** `node scripts/release/chain.mjs <ver> <step>|--all [--dry-run]` runs r-commit → live-stamp → tag-push → publish → ship-number → ship-post-lint → post-ship with one state file (`.gate-logs/release-<ver>.json`); versions, trees and the package set (`publishClaimsOfTree`) are parameters. `publish` requires `RC_GREEN_SHA` (an ancestor of the tag with the same source trees) and `PUBLISH_GATE_DIST` (compared file by file; the log says `dist compared with … identical`), reads the token from the environment only, packs each satellite after its gitHead is written and prints only the registry's readings. `tag-push` refuses without a green live stamp for the content (`live-stamp` keeps the live gate's own verdict record per run: exit, files, passed, skipped, OMITTED, time; newest run exit 0, no skip, at most `--live-max-age-hours` old, default 6) and when main moved after the release commit; it pushes through a credential helper that reads the token at run time. `ship-number` claims the number only after the registry's three-way sameness for every published package. `rewindow` (one tool for the three re-window scripts) keeps an unmerged P2 / P3 row OPEN in `待排(C-R231 ②;<类别>;原窗 <ver>)` with its first promised window, leaves landed rows (the ledger gate's `LANDED_STATUS`, the word post-ship reads too) and car rows whose car is in the release head (`carReader`: an ancestor of the head, not of the previous tag, not on the release's own first-parent line), moves every other row windowed at the cut version to the next window, sets the window cap to its true count, never writes BLOCKED, refuses to decide a CHANGELOG-named live row (`--ledgered` records a disclosure), and writes nothing when the ledger gate is red on its result. A real run of a step already recorded ok is not run again (no second tag push, publish or post-number claim); `tag-push` is done only when origin holds the tag and finishes a local tag it does not; every child process gets only the credential its own step needs; `live-stamp` refuses a tree with uncommitted changes. `ship-post-lint` gains four post-text legs (from 7.58.0): a `<…>` slot left, a byte-for-byte sentence without the publish log's comparison line (`--publish-log`), a car named as part of the release that is not in the RC, an `在飞(car-…)` the ledger's IN-PROGRESS rows do not confirm. `post-ship` writes `[tag v<ver> <sha>]` into the core landing rows and refuses a cited feature whose FEATS index row lacks `shipped v<ver>` and a row windowed at the shipped version that has not landed. `run-live-gate.mjs` writes its verdict record when `LIVE_GATE_SUMMARY_FILE` is set. `scripts/publish-release.sh` is retired (its cells re-pinned on the new publish step).
|
|
55
|
+
- **Who is hurt.** Nobody at runtime: `src/` is untouched and the package's file list is unchanged (`scripts/` is not in `files`). The publisher runs the chain; a publish without the two variables, a tag without a green live stamp, and a post number before the registry shows the release are now refused.
|
|
56
|
+
- **Pins.** `test/release-chain-steps.test.ts` (publish P1–P10, tag-push T1–T12, live-stamp L1–L4, ship-number S1–S6, r-commit R1–R4, chain C1–C5, `sameContent` and `carReader` over real git, against throwaway repositories, a fake npm and registry and a recorder in front of every push, fetch and ls-remote); `test/release-chain-bookkeeping.test.ts` (rewindow W1–W10, W7 being the 7.57.0 R input against the C-R906 rows, `test/fixtures/release-chain/cr906-rewindow.json.gz`; the post-text legs A1–A4 / B1–B3 with the real 7.57.0 publish log / D1–D2 / E1–E2; post-ship F1–F5); `test/backlog2154-publish-checkout.test.ts` ③ ④ re-pinned on the one publish step; `test/post-ship-script.test.ts` fixture carries the three new anchors.
|
|
57
|
+
|
|
58
|
+
### A request to an MCP server or an A2A peer carries what the deployment's peer seat answers for that send — a declaration carries no value (#2294, slice S1 of the MCP credential seat, design/1494; hard-breaking, open to veto; security; closed sets: `MCP_FAILURE_KINDS` +1 (`credential_unavailable`), `CHECKPOINT_CONFIG_REFUSAL_CODES` +3 (`config.credential_in_declaration`, `config.credential_ref_invalid`, `config.peer_seat_missing`); exports: +5 root types (`PeerSeat`, `PeerQuestion`, `PeerAnswer`, `PeerSeatTarget`, `PeerAskCause`), `RunnerDeps.peerSeat` +1, `McpProbeOptions.peerSeat` +1, `materializeMcpTools` / `materializeA2aTools` +1 trailing parameter, `McpServerSpec.transport` −`headers` −`env` +`credentials`, `A2aServerSpec` −`headers` +`credentials`, `headerOwnershipCollision` takes the protocol, `DECLARATION_PATH_RULES` −3 rows, `DeclarationPathRule.holds` narrowed to `"a string"`) (@server @cli @client-core @connectors @settings-schema @web-admin)
|
|
59
|
+
|
|
60
|
+
- **Before.** An MCP http server's credential headers, a stdio server's child environment and an A2A peer's headers were VALUES in the declaration: read once when the transport was built and sent with every request, they rode wherever the declaration rode (a parked leg's stored request, a pooled connection's key, a child leg's inherited tools, a lock's kept copy), could not be renewed for a short-lived assertion, and could set the MCP SDK's own headers. A 401 was only a status: nothing asked for a fresh credential. An A2A card's endpoint was bound to the declared origins once, after the card was read, and only when the declaration had headers.
|
|
61
|
+
- **Now.** One seat, `RunnerDeps.peerSeat(question, signal)`, answers what a send carries beyond the protocol's own members, the SDK's own headers and the engine's principal header (`src/core/peer-seat.ts`). It is asked under the CONNECTION's identity — the server's name, its whole transport (url; or command and arguments), its opaque `credentials` reference, its fingerprint, the principal; never the session: before every http MCP request (the first as `cause: "connect"`), when a stdio child is started (its `env`; an answer's `expiresAt` retires the child before the next call through the server's one re-dial — concurrent calls re-dial once, the calls in flight on the old child settle before it is closed, and a pooled connection is replaced once for every holder), and before every A2A send (the question names that send's `destination`). The answer is `{ kind: "carry", headers? | env?, expiresAt? }` — `headers` for http and A2A, `env` for stdio, the other lane's member refused — or `{ kind: "unauthorized", authorizeUrl? }`. A declaration names at most one reference, `transport.credentials` (A2A: `credentials`), read by the one reader `readCredentialRef` (#2293) at every entrance; the engine resolves nothing. A 401 asks the seat once more (`cause: "rejected"`) and the next send carries that answer; a repeat-safe tool call (`effect: "read"` / `"idempotent"`) answered 401 is sent once more on the same connection after the revocation probe and `reach` are asked again, when the re-ask answered other pieces; a write-class call is not sent again; a dial whose handshake or first listing was answered 401 is dialed once more on the same terms. A seat that throws, does not answer within 30 s, answers off-lane or off-shape, answers a header the protocol writes itself (`mcp-session-id`, `mcp-protocol-version`, `content-type`, `accept`, `last-event-id`), or answers `unauthorized` sends nothing: the new failure word `credential_unavailable` (delivered `no`; no liveness observation); a re-send that was not delivered (the seat could not furnish it, the endpoint refused the connection) ends with the first attempt's failure, so a call one of whose attempts was sent never reads `no`. Every value a connection's sends carried is what its remote's words are read without (the failure texts, status records and operator warnings); a seat's credential headers and credential-judged stdio variables are held from spawned children like any credential the engine receives. An A2A send carrying pieces goes only to a declared origin, judged at every send (`config.protocol_endpoint_unbound`); a card read under pieces that names an outside endpoint still refuses the peer at once. The connection pool's key holds no value by construction. A 401 after the re-ask keeps today's reading (`http_status`, `delivered: "unknown"`); the structured `unauthorized` failure and its readers are the next slice (#2295).
|
|
62
|
+
- **Hard-breaking (open to veto).** (1) *What changed:* `McpServerSpec.transport.headers` (http) and `.env` (stdio) are removed; a declaration that still carries either — whatever it holds — is refused by name at every entrance (the preparation door, a resume's pre-claim screen, `materializeMcpTools`, the no-run probe, `materializeA2aTools`: `config.credential_in_declaration`, the value never repeated), and a declaration naming `credentials` with no seat wired is refused (`config.peer_seat_missing`; an unknown reference kind `config.credential_ref_invalid`). *Who is hurt:* every host that builds an MCP declaration with values — server (roster `resolveMcpServers`, request surface `task-mcp.ts`, S-1907's sealed `checkpoint_ctx` copy), a shell or client that builds one in-process, a library user; settings-schema's `RequestMcpTransport` mirror (its two-way drift gate reds); readers of `DECLARATION_PATH_RULES` (the `transport.env` / `transport.headers` rows are gone). *How to migrate:* move the values into `peerSeat`, answering by server name AND url (or command): `peerSeat: async (q) => (q.peer.protocol === "mcp" && q.peer.server === "github" && q.peer.transport === "http" && q.peer.url === GITHUB_URL ? { kind: "carry", headers: { Authorization: … } } : { kind: "carry" })` — never one token for every peer; resolve roster references inside the seat; a request surface's literal values go into the deployment's own store, and the submitted declaration names `{ kind: "handle", id }` instead. (2) *What changed:* `A2aServerSpec.headers` is removed (refused the same way), and the card endpoint is bound at every send that carries the seat's pieces rather than once after discovery. *Who is hurt:* a host declaring A2A peers with headers; a peer whose card names another origin and whose seat answers pieces for it (refused). *How to migrate:* as (1), with `q.peer.protocol === "a2a"` and `q.peer.destination`.
|
|
63
|
+
- **Behavior narrowing (open to veto).** A principal header named as a header the MCP transport writes itself (any case) refuses the server at its dial (`config.protocol_header_collision`) — it would have replaced the SDK's own. The engine's `MCP_ASSERTION_HEADER` is now the seat's to answer (the assertion's path), and still never the principal header's name. `headerOwnershipCollision(t, protocol)` takes the protocol (the protocol-owned names are per protocol; A2A has none) and judges a send's answered headers with the principal header; the judge's answer is unchanged in shape.
|
|
64
|
+
- **Consumers.** @server: `peerSeat` is yours to implement (roster `headerRefs` / `envRefs` resolved at send time, bound to the roster entry's url; request-surface literals stored and rewritten to `handle` before anything persists — design/1494 §9 is S-1907's retirement test); the assertion header is answered by the seat under `MCP_ASSERTION_HEADER`; `credential_unavailable` is a new `errorCode` word on the status record, the manifest row and `tool_end`. @settings-schema: `RequestMcpTransport` loses `headers`, gains `credentials` (`CredentialRef`). @cli / @client-core: a host that builds declarations in-process needs a seat (single-machine form: a local token store); renderers keyed on `errorCode` meet `credential_unavailable`. @connectors: the assertion arrives under `connector-assertion` from the deployment's seat; a write-class tool answered 401 is not re-sent by the engine. @web-admin: a validator reads `readCredentialRef`; vault entries bind their destination for the seat to check.
|
|
65
|
+
- **Pins.** `test/backlog2294-peer-seat.test.ts` (D: the retired members refused by name at the door and the library entrance, an `undefined` member absent, the reference read by its reader, a reference with no seat refused at the door and at the dial; H: an ask before every request, an answer that changes between calls changing the header between them, the question's identity without a session, no seat ⇒ no piece; F: four ways a seat fails to furnish a call ⇒ `credential_unavailable` / `no` and no call at the server; R: a read call re-sent once with the re-ask's answer, a write call not re-sent and the next call carrying the new answer, an unchanged re-ask sending nothing again, an unfurnished re-send keeping the first failure's verdict, a 401'd handshake re-dialed; E: an echoed token absent from a failure text, a status record and a warning; S: one ask per stdio child carrying its variable, an expired child retired before the next call with four concurrent calls re-dialing once; A: the card read carrying the answer with the send's destination, an outside card endpoint refused under pieces and mounted without; E3 a re-dial's new value scrubbed from a first-connection tool's failure; S3 an `expiresAt` without `env`); the migrated MCP / A2A pins.
|
|
66
|
+
- **Known limits.** After a dial, only tool calls are sent again on a renewed 401 — a refresh listing and the resource tools fail once (KL-2294-a); concurrent 401s on one connection share one re-ask (KL-2294-b); an expired stdio child is retired at the next tool call, not by the resource tools, and a failed re-dial leaves the server down (KL-2294-c).
|
|
67
|
+
|
|
68
|
+
### An MCP `tools/call` carries `_meta["sema/toolUseId"]` — the id of the call it executes — and `_meta["sema/requestMeta"]` — the record of strings the call's `tool.call` chain handed on; one mint, one judge where a handler hands the record on, and the host supplies it as a deployment-seat `tool.call` handler (#2461; behavior change on the wire, open to veto: the request meta is wider than the reference, see Divergence; hard-breaking: one — `KERNEL_CONTRACT_VERSION` 3 → 4; closed sets: none; exports: none (a new internal module `src/core/mcp-call-meta.ts` and an internal `materializeLegMcpTools`, neither index-exported); members: +1 optional `ModDispatchOptions.checkHandOn`; signatures: none — the public `materializeMcpTools` takes no request-meta source, so a library materialization's calls carry the id and never a record) (@server @cli @client-core @test)
|
|
69
|
+
|
|
70
|
+
- **Before.** The one `tools/call` the engine sends handed the server `{ name, arguments }` and the SDK's own `progressToken`, nothing else; a server could not tie what it did to the call that asked for it, nor tell the engine's one resend after a dropped session from a new call. A `tool.call` handler that passed `next({ ...e, requestMeta })` had the member received and silently dropped at the chain bottom.
|
|
71
|
+
- **Now.** Every `tools/call` carries `_meta["sema/toolUseId"]` = the executing call's id — the `toolCallId` of its `tool_start` / `tool_end` (an extension's own `$.tool.call` executes under its `ext-` id, a resumed call under the id it was asked under) — whenever that id is a non-empty string; both attempts of a resent call carry the same. It correlates; it is not a global identity: the engine keeps it unique among one response's calls, but a model may reuse an id on a later turn and legs share a pooled connection, so a server that needs the session or the agent is stamped by the host. A `tool.call` handler may hand on `requestMeta`, a plain record of strings (at most 262144 UTF-8 bytes of keys and values): it rides as `_meta["sema/requestMeta"]` on that call when the tool is an MCP tool, as a frozen copy without a prototype (an empty record rides as nothing). It is judged where the handler hands it on, off the payload's own data member (an inherited one is not handed on; no getter, `toJSON` or Proxy trap runs): anything else — a member that is not a string, a list, a class instance, an accessor, a symbol key, over the bound — is the handler's violation, like a changed pinned key: its `next` does not descend, and the call is refused before its body naming the extension (the station's violation sentence: `a tool.call extension gave an answer the station cannot take (extension "<name>" next() handed on a requestMeta the call cannot carry: …) before this call to "<tool>" ran; the call was NOT executed (fail-closed)`), unless that handler's `.catch` answers. The record reaches the MCP tool on the body's own async chain, per leg: a child leg's calls, a second call in flight, a direct `execute` outside any body and a timer left behind read none of it.
|
|
72
|
+
- **The host's record and an extension's.** One source: the host is a `tool.call` handler at the deployment seat. Who wins a member is the chain's order — the value that rides is what the last handler before the body handed on; a deployment handler in the `append` tier is the innermost, and a task handler can neither `next.to` past it nor answer in its place except by refusing. Stated: the host's stamper is its own registration that makes no calls — a registration's own `$.tool.call` runs without that registration's handlers (the re-entry law), so a stamper that also calls tools does not stamp its own calls.
|
|
73
|
+
- **Contract 3 → 4 (hard-breaking, @server @cli @client-core).** What changed: `KERNEL_CONTRACT_VERSION` is 4 — a station may judge what a handler hands on (`ModDispatchOptions.checkHandOn`: its sentence is the handler's violation, a throwing check is one too; the dispatch's own `e` passed on unchanged is not judged), and `tool.call` takes `requestMeta`. Who is hurt: a host that loads `@sema-agent/mods-kernel` beside the engine and compares the contract for equality reads a mismatch until it takes the 7.58.0 kernel; a `tool.call` handler that already handed on a `requestMeta` member that is not a record of strings (none known) is now refused instead of ignored. How to migrate: take `@sema-agent/mods-kernel@7.58.0` with core 7.58.0; a handler that never sets `requestMeta` changes nothing.
|
|
74
|
+
- **Divergence (open to veto).** The keys are sema's own (`sema/toolUseId`, `sema/requestMeta`; the reference spells its id `claudecode/toolUseId`) — a server that reads only the reference's key reads nothing. The reference's request meta is a closed first-party relay: a hook may set one allow-listed key, it is read only behind a feature value that is off by default, and it reaches only the engine's own remote-session servers; sema has no such first party, so its record is open (any string member) under its own key and reaches every MCP server the engine calls — the hosts that write it are the deployment's and the task's in-process code. Not covered: in-process code that changes the shared prototypes (`Object.prototype.toJSON`) changes how the SDK serializes every message, this one's too.
|
|
75
|
+
- **Consumers.** @server: a stamper for a session, agent or driver identity is a deployment registration at `append` that makes no calls; equality checks of the kernel contract move to 4 with this release. @cli @client-core: the kernel copy's contract equality moves to 4. @test: the wire is observable on a real MCP server (`request.params._meta`). A server that de-duplicates resends keys on the id within one call's life, not across a session.
|
|
76
|
+
- **Pins.** `test/backlog2461-mcp-call-meta.test.ts`: a real `@modelcontextprotocol/sdk` server in process records `_meta` — the model's call (id = the frames'), two calls in one turn, a handler's record byte-equal with an own `__proto__` key, the chain's order both ways, five malformed shapes refused before the body, `{}`, a non-MCP tool, a `.catch` recovering with a good record, an inherited `Object.prototype.requestMeta` getter never run, an extension's `$.tool.call` (its `ext-` id; a stamper that makes no calls stamps it, one that makes the call does not), a direct `execute("")`; the judge, the mint and the seat (two holds under one id, a hold with none beside one with a record, outside, after, another seat) and the kernel's `checkHandOn` as units.
|
|
77
|
+
|
|
78
|
+
### A server that declares `sessionMetaKey` is sent the sending leg's own session id on every `tools/call` and `resources/read`, under that key in `_meta`, over stdio and Streamable HTTP alike; absent by default, and a key that would land on a reserved or engine-owned place is refused by name (#2296; additive; behavior change on the wire for a declaring server only, open to veto — the reference sends no session id; hard-breaking: none; closed sets: none; exports: none (the new member is on the exported `McpServerSpec` type; `judgeSessionMetaKey` and `McpLegMetaReader` are internal to `src/core/mcp-call-meta.ts`); members: +1 optional `McpServerSpec.sessionMetaKey`; signatures: none public — the internal mint takes the declared key and the leg's session id as two more optional arguments, the internal seat constructor takes the session id) (@server @cli @client-core @connectors @test)
|
|
79
|
+
|
|
80
|
+
- **Before.** The engine never told a server which session a request came from: `mcp-session-id` is the server's own per-connection id, the principal header names the user, and a connector that keeps state per (principal, session) — a browser's login state, a profile per session — had no key to keep it under. Pooled connections are shared by legs, so a connection-level header could not carry it either.
|
|
81
|
+
- **Now.** `McpServerSpec.sessionMetaKey?: string`. With a key declared, every `tools/call` and every `resources/read` the engine sends that server carries `params._meta[key]` = the sending leg's `sessionId` (the id its events carry), over stdio and Streamable HTTP, per call — so two legs on one pooled connection each send their own. The `_meta` has still ONE writer: the mint `mcpCallMeta` (`src/core/mcp-call-meta.ts`) takes the declared key and the leg's session id beside the call id and the request meta; the resource handle's read params and the tool call's request both come from it. Absent ⇒ nothing is sent. A dial with no leg (a direct `materializeMcpTools`, the no-run probe) has no session id, so a declared key rides nothing there. A delegated child is another session: its own calls carry its own id, not its parent's; the engine does not guess a root, and the principal (`principalHeader`) is shared by every session of one user, so it is not a tree key either.
|
|
82
|
+
- **The key is judged once**, by `judgeSessionMetaKey`, where the declaration is judged — the preparation door (the whole prepare is refused) and the materialization entrance (that server is never dialed: `invalid_config`, a warning naming the key; siblings mount). Refused under `config.invalid_argument`, naming the server and the key, never dropped or defaulted: a non-string, an empty or over-long (> 128 characters) one; one outside the MCP `_meta` key-name format (an optional prefix of dot-separated labels and a slash — a label starts with a letter, ends with a letter or digit, holds letters, digits and hyphens — then a name of letters, digits, hyphen, underscore and dot that begins and ends alphanumeric; this also keeps out `__proto__`, which the SDK's own request parse drops before a server handler sees it); a key in a prefix MCP reserves (the prefix is the text before the first `/`; its SECOND label — compared with case folded — is `modelcontextprotocol` or `mcp`: `io.modelcontextprotocol/`, `dev.mcp/`, `com.mcp.tools/` are refused, `com.example.mcp/` is not; MCP 2025-11-25 "General fields"); `progressToken` (the SDK writes it over any `_meta` it carries); and anything under the engine's own `sema/` namespace (`sema/toolUseId`, `sema/requestMeta` and whatever the engine mints later).- **Divergence (open to veto).** The reference's per-call `_meta` carries its tool-use id and no session id; here a session id leaves the process under a key the deployment chooses, only for the servers that declare one. Default is the reference's.
|
|
83
|
+
- **Consumers.** @connectors @client-core: a connector that keeps state per (principal, session) declares `sessionMetaKey` on its server entry and reads `request.params._meta[key]` in its tool and resource handlers (a browser-class server: key the storage state on the pair; `principalHeader` carries the principal). @server: the entry's request / roster schema and its two-way drift gate need the new optional member if the deployment is to declare it; nothing changes for entries that do not. @cli @test: a session id is sent only to a server that asked; the wire is observable on a real MCP server (`request.params._meta`). A session id that looks like a credential goes out as written (it is the engine's own correlation id, and the key name is never rewritten).
|
|
84
|
+
- **Pins.** `test/backlog2296-session-meta-key.test.ts`: a real `@modelcontextprotocol/sdk` server in process (and a stdio child) records `_meta` — absent key sends nothing on a call or a read; declared key on both; two legs two ids; a delegated child's own id; a credential-shaped id out byte-equal under a credential-named key while a declared header value is still taken out of a failure text; the judge's twenty-six refusals and thirteen accepted keys; two legs on one pooled connection, interleaved; the door and the library entrance; the mint, the seat, one writer of `_meta`, and no `prompts/get` sender in core.
|
|
85
|
+
|
|
86
|
+
### What started a task, when its host says so — `TaskSpec.runOrigin: "scheduled"` is declared once where the task starts, carried with the task across its legs, and reported by the leg's wiring manifest and the checkpoint listing (#1556 S1, design/1556 r2; new seat; hard-breaking: two closed-set words (below); behavior change for a resume config that carries the word, open to veto; closed sets: `REQUIREMENT_WORDS` +1 `run_origin`, `CHECKPOINT_CONFIG_REFUSAL_CODES` +1 `config.run_origin_invalid`; exports: +3 root names `RUN_ORIGINS` (frozen `["scheduled"]`), `RunOrigin` (type), `isRunOrigin` (function); new optional members `TaskSpec.runOrigin`, `WiringManifest.leg.runOrigin`, `CheckpointState.runOrigin`, `CheckpointSummary.runOrigin`) (@server @cli @client-core @dgx @test)
|
|
87
|
+
|
|
88
|
+
- **What changed.** A run the deployment's scheduler started (a cron job, a heartbeat, a delayed wake-up, a stored routine) looked
|
|
89
|
+
exactly like a run a person sent, on every face the engine reports — the event stream, a parked approval, the inbox listing. The
|
|
90
|
+
host now says so on the task it starts: `runOrigin: "scheduled"`. The config doors read it once (`runOriginOfLeg`), the leg's
|
|
91
|
+
`wiring_manifest` reports it (`leg: { kind, runOrigin }`), a park records it on the row (`state.runOrigin`, every gate kind, one
|
|
92
|
+
serializer), a leg a decision resumes reads it back from the row (a wake opens its leg with the input it hands over — the
|
|
93
|
+
#2664 entry above), and `summarizeCheckpoint` echoes it on the listing (only as a member of the
|
|
94
|
+
set). Absent = the host said nothing — never "a person sent it"; there is no positive word for that. Attribution only: no
|
|
95
|
+
permission, approval, mode or scope decision reads it, and it never enters the model's context. A delegated child does not
|
|
96
|
+
inherit it (a child is its parent's model's work; its tree is reached through `parentTaskId`).
|
|
97
|
+
- **Resume (behavior change, open to veto).** A leg a decision resumes continues the row's word. A resume config carries none —
|
|
98
|
+
any word on it is refused before the claim (`checkpoint.config_refused`, `detail.field: "taskConfig"`,
|
|
99
|
+
`detail.code: "config.run_origin_invalid"`; the row stays pending; the #2664 entry above retired the restatement this slice
|
|
100
|
+
first allowed). A row whose own word this engine does not know is refused before the claim too, after the row's reader
|
|
101
|
+
requirements (`detail.field: "inheritedGate"`).
|
|
102
|
+
- **Bad values (loud).** A present value outside the set — `null`, `""`, `"Scheduled"`, `"scheduled "`, a number, a boolean, an
|
|
103
|
+
object, an array — is refused at prepare (`config.run_origin_invalid`, naming the value) and on a resume config before the claim.
|
|
104
|
+
- **Hard-breaking (two closed-set words).** *What changed*: `REQUIREMENT_WORDS` gains `run_origin` — a row that carries
|
|
105
|
+
`state.runOrigin` requires a reader that knows the word; `CHECKPOINT_CONFIG_REFUSAL_CODES` gains `config.run_origin_invalid` — a
|
|
106
|
+
resume's pre-claim refusal can carry it as `detail.code`. *Who is hurt*: a consumer that pins either set (a store conformance
|
|
107
|
+
table, a retry-policy table over `detail.code`, a test enumerating the words); in a mixed fleet an older worker refuses a row
|
|
108
|
+
carrying `run_origin` as `version_newer` — only rows of tasks a host declared scheduled carry it. *Migration*: add the two words
|
|
109
|
+
to the pinned tables; upgrade the workers before the scheduler starts stamping `runOrigin`; a deployment that never stamps it
|
|
110
|
+
writes byte-identical rows.
|
|
111
|
+
- **Trust.** Set `runOrigin` only at the deployment's own scheduler fire path, never from a request body — the engine cannot
|
|
112
|
+
verify it, and a passed-through field lets any caller mark its run as scheduled.
|
|
113
|
+
- **Consumers.** @server: stamp `runOrigin: "scheduled"` where the scheduler / heartbeat fires `runTask`, not from the request
|
|
114
|
+
body; when a stored spec is replayed as a resume config, strip the field (a resume config carries none — the #2664 entry above);
|
|
115
|
+
add the two words to the store kit's and the
|
|
116
|
+
retry policy's tables; a SQL store that rebuilds `state` member by member must keep `runOrigin` (its row carries the word).
|
|
117
|
+
@cli: the TOC daemon's fire path stamps the word the same way. @client-core: the inbox may read `CheckpointSummary.runOrigin`
|
|
118
|
+
and the stream `wiring_manifest.leg.runOrigin` to mark scheduled work; unknown fields stay ignored. @dgx: the audit face reads
|
|
119
|
+
the same two fields through server. @test: a black-box cell per face (manifest, listing, resumed leg, refusals).
|
|
120
|
+
- **Pins.** `test/backlog1556-run-origin.test.ts` (real Runner): the manifest reports the word / the bare leg without it; eight bad
|
|
121
|
+
values refused at prepare; a park records the word under its requirement word and the listing echoes it; a resume that omits
|
|
122
|
+
it inherits it; a re-suspend keeps it; a bad resume word, a row-unknown word, a config word the row does not carry and (since
|
|
123
|
+
#2664) a restatement of the row's are refused before the claim with the row pending; a task that declares nothing parks with no member, word or key;
|
|
124
|
+
unit cells for the door, the listing echo, the static half and the child seat. Re-pinned: `backlog1320` H (the maximal row
|
|
125
|
+
carries the member), `backlog1950` (a recipe for the new code), `public-knob-liveness` (the seat's proof), the four fixtures that
|
|
126
|
+
spell a `SerializedCheckpointState` / the wiring-manifest phase input.
|
|
127
|
+
|
|
128
|
+
### The write-protection ask and the sensitive-path refusal say how a path met a guarded row in one clause — a hit through the real target and a hit through a link on the way read one sentence; the spelling form is unchanged (#2793; wording change on the ask the auto-mode classifier reads, open to veto; hard-breaking: none; closed sets: none; exports: none) (@cli @test)
|
|
129
|
+
|
|
130
|
+
- **Before.** The write-protection table's judge records which reading of a write target met a row (`via`: the spelling, the real target, a hop of the leaf's link chain), and the ask it minted said that in three sentences: `tool "W" writes to a write-protected path (table entry "N") — explicit approval required`, `… — its real target resolves onto table entry "N" — …` and `… — its symlink chain passes through table entry "N" — …`. That ask is the auto-mode classifier's `askMessage`. A live sample that put all three on one fixed call disagreed (spelling allow, target and chain block): the spelling sentence there described a write the call did not show, and the two resolved sentences were two wordings of one fact — the row was met by following the path on disk. The sensitive-path deny set worded the same three readings its own way, and each of the two guards read a hit's view kind into `via` through its own copy of the mapping.
|
|
131
|
+
- **Now.** One table reads a hit's view kind as its `via`, and one clause says how a reading other than the spelling met the row: `matched where the path resolves on disk (its real target or a link on the way)` (`src/core/path-guard-rows.ts`, read by both guards). The ask for a target or chain hit is `tool "W" writes to a write-protected path (table entry "N") — matched where the path resolves on disk (its real target or a link on the way) — explicit approval required`; the sensitive-path refusal is `write to "P" is blocked: the guarded sensitive path "N" — matched where the path resolves on disk (its real target or a link on the way)`. The spelling forms are unchanged byte for byte (`… (table entry "N") — explicit approval required`; `write to "P" is blocked: its path names the guarded sensitive path "N"`). The clause says which reading met the row and nothing about the spelling: inside the data root, where the identity exemption lets only the real target vote, a spelling that names the row is met by the target reading and reads the resolved sentence. `WriteProtectionVerdict.via` keeps its three values; its declared type is the alias `GuardHitVia`, structurally the same union.
|
|
132
|
+
- **Who may answer (settled in this release by #2795).** A hit the spelling itself names stays `write_protection` and the classifier may answer it; a hit only the disk reaches (its spelling alone names no row) is its own ask class, `write_protection_on_disk`, which the classifier does not answer — see the #2795 section. No path text enters either ask sentence.
|
|
133
|
+
- **Wording change (open to veto).** *What changed*: the classifier, the approval card and the model's refusal read one sentence where a target hit and a chain hit read two, and the deny set's resolved refusals have new words. *Who is hurt*: a consumer that matches the old resolved sentences by text. *Migration*: match the quoted row name, or the clause above.
|
|
134
|
+
- **Consumers.** @cli: `src/components/bypassModeDisclosure.test.tsx` ③e greps the core dist for `is blocked: its real target resolves onto the guarded sensitive path`; the dist now says `is blocked: the guarded sensitive path "<pattern>" — matched where the path resolves on disk (its real target or a link on the way)` for that refusal (a hit is still a deny) — one anchor to re-pin; the B-002 live gate's short anchor `guarded sensitive path` is unchanged. @server: the spelling refusal your `task-settings` cell anchors (`names the guarded sensitive path ".env"`) is unchanged. @test black box: one guarded row written through a one-hop alias onto it and through a link chain passing through it puts the same ask text on the card (and in the classifier's question); a direct write keeps the spelling sentence.
|
|
135
|
+
- **Pins.** `test/backlog2793-ask-sentence.test.ts` (the view-kind table and the clause; three readings mint exactly two ask sentences, the spelling one historical, row before clause; the real judge and the real deny set on a real filesystem for the direct spelling, a one-hop alias and a chain hop; the data root's identity exemption; neither guard keeps a private mapping or wording); `test/live-write-protect-ask.test.ts` (offline half: the sentence family; live half: each distinct sentence, asked beside a call consistent with it, yields a parseable ruling — the two rulings are printed, not compared; the old "three sentences agree on one fixed call" cell is retired, KL-842-live closed); rewritten to the new words: `test/backlog851-symlink-chain-hops.test.ts`, `test/backlog1737-probe-states-no-approver.test.ts`.
|
|
136
|
+
|
|
137
|
+
### A test run no longer leaves its fixture directories in the temp root — one net in the suite's setup file removes every `mkdtemp` result under it, and `gate:tmp-hygiene` measures that it does (#2194; test infrastructure — no behaviour change; hard-breaking: none; closed sets: none; exports: none; members: none)
|
|
138
|
+
|
|
139
|
+
- **Before.** About eight hundred test files make their fixture directory with `mkdtemp(join(tmpdir(), "<prefix>-"))` and most never remove it. One host collected 108,602 top-level entries in its temp root in 17 hours (about 45,000 under this repository's prefixes); listing the directory, the file-event daemon and the page cache all got slower for every other process on the machine. One test file alone, run once, left 828 (`b1685*`), 700 (`b1672*`) or 505 (`b1643*`) entries behind.
|
|
140
|
+
- **Now.** `test/setup-reap.ts` wraps the three `mkdtemp` entry points (`mkdtempSync`, `mkdtemp` with a callback, `fs.promises.mkdtemp`) once per worker and publishes the wrappers to the ESM named exports, so every spelling a test or the code under test uses is covered. A directory made strictly inside the physical temp root is registered by its physical path, with the temp root, the working directory and the `encoding` option read when `mkdtemp` is called (a result written as hex or as bytes is decoded to its pathname); the registry is emptied at the end of each test file (after the file's own hooks, so a test's own cleanup still finds its directory) and on the worker's exit / SIGINT / SIGTERM passes. Only registered paths are removed; each removal first checks that the path still resolves to itself (a path with a link now in it — an ancestor swapped for a link to somewhere else, even somewhere else inside the temp root — is refused and named), the temp root itself is never registered, a process whose working directory lies inside a directory about to be removed steps back to where the worker started, and a failed removal is a stderr warning, not a red. A directory outside the temp root is neither registered nor mentioned. `SEMA_KEEP_SCRATCH=1` — the switch `scripts/scratch-dir.mjs` already had, now read by one function (`keepScratchRequested`) for both lifecycles — keeps the directories and names each on stderr; any other non-empty value other than `0` is said aloud once and reads as "remove".
|
|
141
|
+
- **Gate.** `gate:tmp-hygiene` (`scripts/verify-tmp-hygiene.mjs`; static tier of `gate:all`) runs a fixed batch of six test files — five that left 34 to 505 entries each before the net, and the net's own pin — under a private temp root of its own (never the shared one, which other processes write to) and is red unless the root is empty afterwards, naming the five most frequent prefixes; a batch that did not pass is red whatever the count, and so is a batch file that executed no test (read from the runner's JSON report — a filter that matches nothing is not an error to the runner). `--full` runs the whole suite; file arguments run those files.
|
|
142
|
+
- **Out of reach, on purpose.** A directory made by a child process (a spawned engine, a probe), by a call that is not `mkdtemp`, or by a worker killed outright: the net lives in the worker's own `fs`. The gate counts them if they happen inside its batch (KL-2194-a). The file-end pass is skipped when a file's hooks are (every test skipped, collection failed) or when an `afterAll` registered after it throws, and a function returned by a file-level `beforeAll` runs after it; the worker's exit pass then removes what is left.
|
|
143
|
+
- **Consumers.** None — the net, the gate and the cases are repository-only (not in the package: the `npm pack --dry-run` file list is unchanged).
|
|
144
|
+
- **Pins.** `test/backlog2194-tmp-hygiene.test.ts` (in-process: registered directories removed and an unregistered sibling left, a swapped ancestor refused, the working directory left first; child process, each with a temp root of its own: nine `mkdtemp` spellings gone after the file with their contents and still there at the file's own last hook, an outside directory left alone and unmentioned, the keep switch and its bad value, a worker signalled mid-file — and not outliving the signal —, a file's directories gone before the next file starts in the same process; the gate's verdict and report-reading functions; in-process: a link retargeted inside the temp root, results written as hex and as bytes, a temp root changed while a call is in flight, a differently-cased spelling of the root), `test/gate-all-roster.test.ts` (the gate's seat); fourteen mutants of the net, each red in at least one cell.
|
|
145
|
+
|
|
146
|
+
### An input says what brought it, and a leg's word is the word of the input that opened it — a wake opens its leg with the newest input it hands over (`PendingSteerInput.runOrigin`), each `human_input` frame carries its input's word, a one-input message carries it too, and a resume config carries none (#2664, #1556 slice S2, design/2664 r2, ruled C-R873 and its note 1, C-R867 note 1; behavior change for a woken leg and for a resume config, open to veto; hard-breaking: two closed-set words (below); closed sets: `PENDING_STEER_FROZEN_FIELDS` +1 `runOrigin`, `STEER_REPLAY_FACETS` +1 `runOrigin`; exports: none; new optional members `human_input.runOrigin`, `UserMessage.runOrigin`, `PendingSteerInput.runOrigin`, `PendingSteerEntry.runOrigin`) (@cli @client-core @web-client @server @test)
|
|
147
|
+
|
|
148
|
+
- **What changed.** The run-origin word (`"scheduled"`) was a task's: a scheduled task a person woke still reported
|
|
149
|
+
`scheduled` on the woken leg, its next parked row and the inbox; a task a person started and the scheduler woke reported
|
|
150
|
+
nothing; and no `human_input` frame or transcript message said `scheduled` at all, so a UI rendered the scheduler's objective as
|
|
151
|
+
someone typing. The word is now an input's, stated by its host on the input's carrier — the objective's `TaskSpec.runOrigin`, a
|
|
152
|
+
parked or waking message's `runOrigin` — and a leg's word is the word of the input that opened it: the objective for a fresh
|
|
153
|
+
leg; for a wake, the NEWEST input the wake hands over — its message, else the parked entry it delivers last — so a
|
|
154
|
+
message-bearing wake and its atomic equivalent (`setPendingSteer`, then a message-less wake) answer the same. An input that
|
|
155
|
+
says nothing makes the woken leg say nothing — there is no fall-back to the row. A decision on a parked leg (approval,
|
|
156
|
+
resource limit, review) opens nothing and continues the word the parked leg recorded. The manifest's `leg.runOrigin`, the row
|
|
157
|
+
a leg parks (`state.runOrigin`) and its listing (`CheckpointSummary.runOrigin`) read that one value, so the inbox names the leg
|
|
158
|
+
that raised an approval. Each input's own word rides its `human_input` frame (objective, wake message, parked steer — applied
|
|
159
|
+
or withheld); a message that carries one input carries it too (`UserMessage.runOrigin`, the objective's), while a resumed
|
|
160
|
+
leg's continuation — several inputs in one message — carries none, exactly like `actor`.
|
|
161
|
+
- **Resume config (behavior change against #1556 S1, unreleased; open to veto).** A resume config carries no run origin —
|
|
162
|
+
`ResumeTaskConfig` omits `runOrigin` beside `objective` and `userAttachments`, and a config that carries one anyway — the
|
|
163
|
+
row's own word included — is refused before the claim (`checkpoint.config_refused`,
|
|
164
|
+
`detail.code: "config.run_origin_invalid"`, the row pending; the sentence says to omit it and that a wake states its word on
|
|
165
|
+
its message). A resume hands the engine no objective, so the field had nothing of its own to describe, and a restatement of
|
|
166
|
+
the row could silently disagree with the word a wake opened the leg with. A bad `message.runOrigin` (or `setPendingSteer`
|
|
167
|
+
`runOrigin`) is refused loudly before the claim, `steering.invalid_content` (the steering entry's own refusal family); a
|
|
168
|
+
hand-built resume that skips the entrance meets the config doors' `config.run_origin_invalid` on the same value.
|
|
169
|
+
- **Hard-breaking (two closed-set words).** *What changed*: `PENDING_STEER_FROZEN_FIELDS` gains `runOrigin` (a parked entry may
|
|
170
|
+
carry it) and `STEER_REPLAY_FACETS` gains `runOrigin` (re-parking an `inputId` under another word is
|
|
171
|
+
`steering.duplicate_input_id`, `detail.differs: ["runOrigin"]`, not a replay). *Who is hurt*: a consumer that pins either set
|
|
172
|
+
(a store's round-trip table, a test enumerating the facets); in a mixed fleet an older worker refuses a wake or a
|
|
173
|
+
`setPendingSteer` that carries `runOrigin` as an unknown steering field (`steering.invalid_content`, before the claim — the frozen
|
|
174
|
+
set's designed refusal), and an older worker that claims a row on which a newer host parked a worded steer, and re-parks that
|
|
175
|
+
steer before delivering it, has its own `setPendingSteer` refuse the entry — the instruction is lost. *Migration*: add the word
|
|
176
|
+
to the pinned tables; upgrade every worker and store adapter before a scheduler stamps a wake message or a parked steer; a
|
|
177
|
+
deployment that never stamps it writes byte-identical entries.
|
|
178
|
+
- **New members (additive).** *What changed*: `human_input` frames gain `runOrigin`, `UserMessage` gains `runOrigin` (attribution
|
|
179
|
+
metadata — `stripEngineMetadata` strips it; built-in brains never send it). *Who is hurt*: a renderer that shows every objective
|
|
180
|
+
or wake message as typed user input keeps doing so until it reads the member; a custom Brain that serializes messages whole
|
|
181
|
+
without `stripEngineMetadata` would see one more key. *Migration*: render a frame / message carrying `"scheduled"` as the
|
|
182
|
+
scheduler's; unknown members stay ignored.
|
|
183
|
+
- **Import.** The session-import door keeps a `UserMessage.runOrigin` that is a member of the set and drops anything else, with no
|
|
184
|
+
operator flag — the word grants nothing and the importer is a host that could state it on a task it starts (the posture the
|
|
185
|
+
door already gives `engineMinted`, not `actor`'s, whose strip guards an ingress-verified identity).
|
|
186
|
+
- **Trust.** Stamp `message.runOrigin` (and a parked steer's) only on the deployment's own scheduler path, never from a request
|
|
187
|
+
body.
|
|
188
|
+
- **Consumers.** @cli / @client-core / @web-client: read `human_input.runOrigin` to render a scheduled objective, wake message or
|
|
189
|
+
parked steer as the scheduler's, and `UserMessage.runOrigin` on a one-input message (the objective) when replaying a
|
|
190
|
+
transcript. @server: stamp `message.runOrigin: "scheduled"` where the daemon wakes a parked task (or on the steer it parks
|
|
191
|
+
before a message-less wake), not from the request body; strip `runOrigin` from a stored spec replayed as a resume config; after a
|
|
192
|
+
woken leg parks, the row carries the woken leg's word (`CheckpointSummary.runOrigin`); a SQL store that rebuilds parked entries
|
|
193
|
+
member by member must keep `runOrigin` (`PENDING_STEER_FROZEN_FIELDS` names it), and so must one that rebuilds a resolved
|
|
194
|
+
row's stored wake outcome (its `message`). @test: the two KL-1556-a directions as black-box cells, in both the message form
|
|
195
|
+
and the park-then-wake form.
|
|
196
|
+
- **Not yet.** An input that opens a model turn inside a leg — a live `"later"` steer — or rides a decision resume does not
|
|
197
|
+
change the leg's word (KL-2664-a); the live `TaskStream.steer` and next-turn carriers take no word; a resumed leg's
|
|
198
|
+
continuation carries no per-input word in the transcript; a compaction that drops the objective's message drops its word from
|
|
199
|
+
the transcript with it.
|
|
200
|
+
- **Pins.** `test/backlog2664-message-origin.test.ts` (real Runner): the objective's frame and message; both KL-1556-a directions on
|
|
201
|
+
the leg and the frame, in the message form and the park-then-wake form; the woken leg's re-parked row and listing in both
|
|
202
|
+
directions; six bad message words, a wake config that declares a word and one that restates the row's refused before the
|
|
203
|
+
claim, row pending; a withheld parked steer's frame; the newest-input rule; the replay facet; an approval resume (leg word
|
|
204
|
+
continued, continuation carries none); the strip and the import door. Re-pinned in `test/backlog1556-run-origin.test.ts`: a
|
|
205
|
+
restating resume config is now refused before the claim.
|
|
206
|
+
|
|
207
|
+
### A session's write faces live on the store contract under one write law: `SessionStore.logTransfer` moves a log between backends through a staging nobody reads before its commit, `SessionStore.delete` deletes a session at its owner's request, and a deployment's cleanup runs before every row the bundled store deletes (#1468 S4 / #2166; behavior narrowing, open to veto; hard-breaking: 2 — `SessionRepo.importEntries` refuses an import onto a row that is not the importer's, and the store kit's optional-face report names two more faces; closed sets: +2 words `logTransfer` / `delete` on `SessionStoreContractHooks.onOptionalMember`'s `member`; exports: +6 types `SessionLogTransfer`, `SessionLogExportOptions`, `SessionLogReplace`, `SessionLogCommit`, `SessionLogCommitView`, `SessionStoreHooks`; members: optional `SessionStore.logTransfer` / `SessionStore.delete`, `TtlSessionStoreOptions.hooks`, `FileStorageBackendOptions.sessions`) (@server @dgx)
|
|
208
|
+
|
|
209
|
+
- **Before.** A cross-backend move of a session had no face on `SessionStore`: a deployment wrote the session rows itself, or reached under the store to `SessionRepo.importEntries`, which replaced the log of an existing row whoever imported it — another principal's import onto an owned row, or an anonymous import onto one, replaced the owner's history and kept the owner. A deletion at an owner's request had no store face either, and a deployment's own records keyed by a session id (a title, a pin) had no hook on the rows the bundled store deletes. And `TtlSessionStore` served a cached view while the row named the same occupant, so a log replaced under that occupant — an import through the repo, or through another store instance — was not seen until the view was dropped: the next acquire handed out the old history.
|
|
210
|
+
- **Now.** One write law, read by every face that writes a session's log (`importRowCells`, the bundled repos' one reading): an existing row keeps its occupant and its owner and takes a new log only when it is already the committer's (owners compared null-safe; `undefined` names `null`); another owner's row is refused `conflict` and a placed row `placement_refused`, with nothing written, and the check and the write are one step, so a row another writer created after the committer looked is refused, never taken; an id with no row becomes a row recording the committer and a fresh occupant. `SessionStore.logTransfer` (optional) carries it to the store: `listEntryIds` / `exportStream` read the whole log (`null` = no row; `exportStream({ afterSeq, batchSize })`, a bad option refused `config.invalid_argument`), and `beginReplace(id, { preserveActorAssertions })` opens a staging whose `append` passes each batch through the import gate (`StreamingImportValidator`; a refused batch ends the staging) and whose `commit({ owner, decide })` judges the write law first — `decide` is never asked about a row the committer may not write — then hands `decide` the destination's ids as they stand now and the staged ids (with a `read` of either side), writes on `"replace"`, leaves the log on `"keep"` (refused for an id with no row), and answers the row's head, all under the store's hold of the id; a refusal, or a throw from `decide`, writes nothing (against writers the hold does not see — another instance, the repo — the commit's step is the repo's conditional import; see the conditional row writes below). Staged entries are detached copies, and `decide` reads copies of both sides, so nothing it writes to reaches a log. The first commit call ends the staging, whatever its outcome. `SessionStore.delete(id, { owner })` (optional) deletes only a row whose owner is `owner` (`null` deletes only an anonymous row; a placed row is `release`'s), answers whether it deleted, and refuses a guard that names no owner. `TtlSessionStoreOptions.hooks.beforeSessionDelete` (and `FileStorageBackendOptions.sessions`, which reaches it) runs, awaited, before every row the store deletes — the owner's delete, a placed release, an `evict: "delete"` release or idle sweep — and when it rejects the row stays and the deletion rejects with it, and an owner's `delete` or a placed release called again runs both again (an ordinary release that failed has dropped its view and, as before, deletes nothing on a second call); after the hook the deletion lands only on the row the store judged (the repo judges it in the removal's own step, below), so a row another writer created under the id meanwhile is not deleted. A hooks record is read by the receipt law: a getter that throws, a member the store does not run or a member that is not a function is refused `config.invalid_argument`. `TtlSessionStore` serves a cached view only while the row names its occupant and holds its leaf; a commit through the store drops the view inside its hold, and an acquire whose resolution of the id a hold (a commit, a delete, a release) overtakes resolves it again after the hold instead of publishing the view it read. The bundled store implements both faces over a repo with `readRow`, `importEntries` and a head read (both bundled repos; `delete` needs `readRow` and the head read); its staging lives in process memory and ends with the process (a store that stages durably owes a sweep of abandoned stagings; the face has no member for it until such a store lands).
|
|
211
|
+
- **Hard-breaking.** (1) *What changed*: `SessionRepo.importEntries` onto an existing row refuses `conflict` unless the row's owner is the importer (null-safe), and refuses a placed row `placement_refused`; the store kit `sessionRepoContract` pins it. *Who is hurt*: a caller that imported onto another principal's row, or anonymously onto an owned one, and relied on the log being replaced; a third-party `SessionRepo` that replaced the log of any row — it now fails the kit's import case. *How to migrate*: import as the row's owner (a deployment that moves a session on behalf of its recorded owner passes that owner), or delete the row first; a repo applies the same reading (`importRowCells` in the bundled repos) in the step that replaces the log. (2) *What changed*: `SessionStoreContractHooks.onOptionalMember` reports `member: "logTransfer"` and `member: "delete"` too. *Who is hurt*: a kit consumer that asserts the exact set of reported faces, or switches over `member` exhaustively. *How to migrate*: add the two words (a store without the faces reports them `absent`).
|
|
212
|
+
- **@server.** The session-sync commit maps onto `logTransfer.commit` with one change of argument: the commit's `owner` is the owner cell the import's gate judged when that cell names a row (`expectedOwner === undefined ? importingPrincipal : expectedOwner`) — the write law then is the store-side owner check the route's `expectedOwner` comparison makes today, and a commit whose gate saw no row but meets a row of the importer's own refuses in `decide` (it sees `current` non-null). The narrow legacy arm that commits an anonymous row under the default principal stops re-stamping the row's owner (today the SQL upsert writes `owner = 'default'` over `NULL`); under the law that commit passes the recorded `null`. `OwnerAwareSessionStore`'s import / replace / staging / delete faces map onto `logTransfer` / `delete`; `restamp` is `keep`. The local lane's `LocalSessionStore` keeps owners in its own sidecar while the core rows it creates carry `null`: its replace (delete, then import onto the absent id) is not affected; its fresh-only `importEntries` onto a row that exists, with a named owner, is now refused `conflict` instead of replacing that row's log. A row-deletion cleanup of the deployment's own tables (title, pin) is `beforeSessionDelete` on the File lane. The SQL stores keep the same law in one transaction per commit / delete; the conditional row writes below give the bundled store the same row-level step.
|
|
213
|
+
- **@dgx.** A File-lane deployment that imports sessions through `FileSessionRepo.importEntries` imports as the row's owner; one that keeps its own records per session id wires `FileStorageBackendOptions.sessions.beforeSessionDelete`.
|
|
214
|
+
- **Pins.** `test/backlog1468-s4-session-write-faces.test.ts` (W1–W5; red on the previous release for every pin: the foreign and placed imports replaced the log there, and a repo import's new log was not served); the kit's `[transfer]` and `[delete]` groups, run on the in-memory, File and `FileStorageBackend` lanes by `test/backlog1468-s1-session-store-kit.test.ts`; `sessionRepoContract`'s import case. Re-pinned to the law (they pinned the replaced log): `test/backlog1468-s2-session-row-head.test.ts` H4c and the three H8 cases. Ratchet: `comment-ratio-ratchet` `src/core/store-contracts` 0.1742 → 0.1600 banked (the kit's new groups are case code).
|
|
215
|
+
- **Known limits (KL-1468-s4-b / -c; KL-1468-s4-a, the per-instance atomicity, is retired by the conditional row writes below).** A log replaced through another instance by one with the same entry ids keeps that instance's view standing (its occupant and leaf match). `list` lends a standing view's last run to a row whose log was replaced. An idle sweep whose deletion hook rejects keeps the row without a retry. `SessionStoreHooks` carries no leaf-advance hook (the bundled store does not observe a session's writes).
|
|
216
|
+
|
|
217
|
+
### A store's retention word has one reading — the deployment deletes this store's rows on schedule — and the party that runs the sweep gives it when it constructs the store; the deployment's startup check holds the word to the executor it runs, and the per-leg preflight judges the words alone (#1468 T4; hard-breaking: 2 — `assertRetentionCapability` requires `executor`, and the three bundled declarers' `retention` member widens from the literal `"none"`; open to veto: an executor stated absent refuses every "managed" store, locked or not; closed sets: none; exports: +1 `readRetentionDeclaration`; members: optional `TtlSessionStoreOptions.retention`, the `retention` constructor option of `InMemoryCheckpointStore` and `InMemoryToolResultStore`, required `executor` on `assertRetentionCapability`'s input) (@server)
|
|
218
|
+
|
|
219
|
+
- **Before.** The word had two readings: core's documents said a store declaring `"managed"` PROMISES the `ManagedRetentionCapability` methods, while the deployment that declares it read it as "this store's rows are deleted on schedule by the deployment's managed retention" — the methods live on one executor that spans several stores, not on each store. And the word was a class constant: the bundled stores carried `"none"` for every deployment, a deployment's SQL store classes carried `"managed"` for every deployment, so a store taken out of the assembly that runs the sweep kept its word while nothing deleted its rows. Whether a deployment that declares managed stores runs any executor was judged by the deployment alone, after core's check had passed.
|
|
220
|
+
- **Now.** One reading, written in `retention.ts` and on each declaration face: `"managed"` = this store's rows are deleted on schedule by the deployment; `"none"` (or absent) = nothing deletes them on schedule. The bundled declarers take the word as a constructor option — `new TtlSessionStore({ retention })`, `new InMemoryCheckpointStore({ retention })`, `new InMemoryToolResultStore({ retention })` — default `"none"` (unchanged), read by the one declaration reader, `readRetentionDeclaration` (now exported from the package root; `@sema-agent/core-stores-sql` reads its `retention` option through it too), so a word other than the two is refused at construction (`config.retention_capability`). The file backend runs no executor, so its stores stay `"none"`: its options carry no word, and a word an untyped caller hands it anyway is refused before it takes its root (it used to be dropped). The check is two calls over one reader. The per-leg prepare preflight, which holds no executor, runs the declaration half alone (the policy value, each store's word, and the locked policy over `"none"` stores — as before). The deployment's startup call `assertRetentionCapability({ policy, locked, stores, executor })` runs that half and holds the words to the executor it runs: `executor` is required — the deployment's `ManagedRetentionCapability` (a backend's `retention` member) or `null` when it runs none, `undefined` refused naming it, so a backend's absent member is never read as "judge the words alone"; with `null`, every store declaring `"managed"` is refused naming those stores, locked or not; an executor whose four members are not all functions, or whose member read throws, is refused naming the member — whatever was thrown, the refusal is coded (the thrown value is read by the one guarded describer); a `"none"` store beside an executor is refused only by a locked policy. The refusal of an unparseable word now describes any value (a `bigint` word threw a raw `TypeError` from the message builder before).
|
|
221
|
+
- **Hard-breaking.** (1) *What changed*: `assertRetentionCapability`'s input requires `executor: ManagedRetentionCapability | null`; a call without it fails to compile, and at run time one without it (or with `undefined`) is refused `config.retention_capability`. *Who is hurt*: every deployment that calls the startup check — the server's governance seam calls it with `{ policy, locked, stores }`. *How to migrate*: pass the executor the deployment runs, or `null` when it runs none: `executor: backend.retention ?? null`. (2) *What changed*: the `retention` member of `TtlSessionStore`, `InMemoryCheckpointStore` and `InMemoryToolResultStore` is typed `RetentionDeclaration`, no longer the literal `"none"`. *Who is hurt*: code that holds the member as the literal type (`const r: "none" = store.retention` fails to compile). *How to migrate*: type it `RetentionDeclaration` (its value is still `"none"` unless the constructor was given `"managed"`).
|
|
222
|
+
- **@server.** At the startup call, pass the executor: `assertRetentionCapability({ policy, locked, stores, executor: retentionExecutorWired ? retentionExecutor : null })` — required now (hard-breaking 1) — and core answers "a store says managed and nothing deletes its rows"; the deployment's own `retentionExecutorWired` judgment beside it retires. That judgment only warned when the policy was unlocked; core refuses, locked or not — a narrowing: an unlocked SQL deployment with the sweep lane off, whose SQL store classes still carry `MANAGED_RETENTION`, is refused at startup until its assembler gives those stores `"none"`. The `MANAGED_RETENTION` / `UNMANAGED_RETENTION` store-class constants retire when the SQL stores move into `@sema-agent/core-stores-sql` (its backend factory gives the word from `SqlStorageBackendOptions.retention`); until then they keep compiling — the change for them is the reading. PICK7570 must-check.
|
|
223
|
+
- **Pins.** `test/backlog1468-t4-retention-declaration.test.ts` (each declarer × absent / `"none"` / `"managed"` / a bad word at construction; the member's type; the root reader; `executor` omitted / `undefined` / a backend's absent member refused, at the type and at run time; each declarer given `"managed"` × a complete executor under a locked policy / `null` locked or not / an executor missing each of the four members; a member that is not a function, a member read that throws an Error, an Error whose `message` getter throws, a Proxy whose prototype trap throws, a symbol and a bigint; a non-object executor; the words half alone; the full chain through a Runner's prepare preflight, managed and one seat left at the default; the file backend has no option, refuses one handed to it before taking its root, and its stores read `"none"`). Re-pinned to the two calls: `test/retention-declaration.test.ts` (the words half) and `test/backlog1468-k3-engine-backend.test.ts` (the startup call with the backend's executor). Ratchet: `module-size-ratchet` `src/core/checkpoint-store.ts` 4 076 → 4 077 banked.
|
|
224
|
+
- **Known limits (KL-1468-t4-a / -b).** The per-leg preflight holds no executor, so a deployment that skips the startup call and declares a store `"managed"` while running no executor is judged by its words alone there, as today (exit = an executor seat the preflight can read). An option bag whose `retention` read itself throws (a throwing getter, a Proxy) makes the constructor throw that value, uncoded — as every other member of those option bags does.
|
|
225
|
+
|
|
226
|
+
### A ledger's year-less `MM-DD` window is read by one function, against the row's filing day — the debts gate no longer calls next year's window due (#2805; release tooling only, `src/` untouched; no behaviour change; hard-breaking: none; closed sets: none; exports: none)
|
|
227
|
+
|
|
228
|
+
- **Before.** `scripts/verify-debts.mjs` read a date window as that day of the CURRENT year, so a window `01-05` filed in October was "due" on 2026-10-25: four server rows (S-1064, S-1442, S-1495, S-1813) were named by `gate:debts:rc` and worked around by hand. After New Year the same reading failed the other way — a window `10-27` read as the next October and dropped out of the due list. `scripts/verify-backlog-ledger.mjs` kept a second, different year rule (the year that puts the day in [today − 274, today + 90]).
|
|
229
|
+
- **Now.** `windowDateOf(window, filedOn, today)` in `scripts/ledger-dates.mjs` is the only year reading, and both gates call it. The filing day is the most recent day with that month-day that is not after today (a row is not filed in the future); the window falls in that year, or in the next when its `MM-DD` is earlier than the filing day's (a window ON the filing day is the same year's). The debts gate takes the filing day from the row's 开账 cell; the backlog-ledger gate takes it from the window's own note, the stamp a row already carries: `10-30(10-25 11:2x 立)`. A row with no readable filing day has no year to take: red, named (`立票日缺席,窗无法定年`), never read against the current year. A day that is not on the calendar (`13-45`, `02-30`, `02-29` in a common year) is named too. The ledger gate keeps its 90-day horizon (`MM-DD` more than 90 days ahead is a version, not a date). `VERIFY_DEBTS_TODAY=YYYY-MM-DD` pins the debts gate's day, as `BACKLOG_LEDGER_TODAY` does the ledger gate's; both read the pin through `isoDayOf` (exactly `YYYY-MM-DD`), and one that is set but not a day on the calendar (`soon`, `2026-02-30`, which `Date` alone would roll over to March) exits 2 — never the real today, never a rolled-over day.
|
|
230
|
+
- **Who is hurt.** Nobody at runtime. A live row of the core ledger whose window is a bare `MM-DD` and whose window note carries no `MM-DD HH:Mx 立` stamp is red from now on, naming the missing stamp; the ledger holds no such row (996 live rows at this tree: 353 version windows, 643 pending), so the gate reads the same ledger identically before and after. A debts row is unchanged in form — 开账 was already a required column.
|
|
231
|
+
- **Readings.** `gate:debts:rc` at 7.58.0 over the real ledgers, base gate vs this one, on 2026-10-25: DEBTS-core 0 → 0 due; DEBTS-server 6 → 2 (the four rows above leave; S-2275 and S-2359 stay, both truly due; seven CLOSED rows the format gate already rejects were set aside so the RC arm is reached); cli, client-core, test, deploy and web-admin unchanged. Pinned to 2027-01-06: DEBTS-server 3 → 329 due — 326 overdue rows the current-year reading carried as next October. Core ledger gate: 0 findings before and after.
|
|
232
|
+
- **Consumers.** @server: the four rows you carried by hand are no longer named at the RC gate; the workaround (`--year-wrap-move`) can be retired once you read this release's gate.
|
|
233
|
+
- **Pins.** `test/backlog2805-window-date-year.test.ts` (47 cases: the reader R1–R8 and the clock pin R9; the debts gate D1–D11 over a throwaway ledger and over the four server rows copied verbatim into `test/fixtures/backlog2805-debts-server-four-rows.md`; the ledger gate L1–L6; both gates answering the reader's answer on nine triples, and neither keeping a year reading of its own). Eleven mutations (no wrap / absent falls back to the current year / either gate bypasses the reader / window on the filing day wraps / a future filing day kept / ledger ignores the stamp / debts drops 开账 / horizon removed / due-day exclusive / the clock pin rolls over) are each red; 15 of the 47 are red on the base gates. The date-window fixtures of `test/backlog-ledger-gate.test.ts` carry the stamp.
|
|
234
|
+
- **Known limits.** The filing day carries no year, so a row left open for more than a year reads against the latest such day — a window in the months ahead of it is not yet due, as before. `scripts/rulings-gate.mjs` reads a bare `MM-DD` on its own rule (today's year, shifted back when more than 183 days ahead) and still calls a next-year window such as `01-05` due on 2026-10-25; it keeps no filing day and is not changed here.
|
|
235
|
+
|
|
236
|
+
### A session row is written only as it was read: `SessionRepo.importEntries` and `SessionRepo.delete` take an expectation the repo judges in the write's own step, the import answers the head it wrote, and `SessionRepo.readRow` reads a row whole — the bundled store's commit and every deletion it makes go through them (#2583, design/2583 slice S1; hard-breaking: 2 — `SessionRepo.importEntries` answers a `SessionHead` (it answered nothing), and a repo with `readRow` judges the expectation of the writes it is handed; behavior narrowing, open to veto; closed sets: none; exports: +2 functions `sessionRowMatches`, `sessionLogMarkOf`, +3 types `SessionRowExpectation`, `SessionRowRead`, `SessionLogMark`; members: optional `SessionRepo.readRow`, `SessionRepo.delete`'s optional `expect`, the `expect` option of `SessionRepo.importEntries`) (@server @dgx)
|
|
237
|
+
|
|
238
|
+
- **Before** (the write faces above, as first landed). The store's write faces were atomic only against its own writers. A commit read the row's metadata and its log in two reads, so `decide` could be shown the log of a row another owner created under the id in between; a write through another instance landing while `decide` weighed the destination was overwritten by the commit; and the head was read after the write, so a fault there rejected a commit whose log was already in place. Every deletion judged the row, ran the hook, judged it again and then deleted the id unconditionally, one await later.
|
|
239
|
+
- **Now.** One rule for every write that must land only on the row it judged: it carries the row as the judging read found it — a `SessionRowExpectation`, the occupant (`row`: its owner and occupant cell; `null` = no row) and, when the log binds, the log's mark (`log`: its length and last entry id, `sessionLogMarkOf`) — and the repo judges it inside the write's own step with one function, `sessionRowMatches`; a miss writes nothing and is refused `SessionError("conflict")`, the answer the leaf CAS already gives a stale append. The occupant cell is compared as written (a row from before the cell existed matches only an expectation without one: every write that creates a row mints a token, so such a row cannot be created again). `SessionRepo.readRow(id)` (optional) reads metadata, head and whole log of one row generation; `SessionRepo.importEntries` judges `options.expect` with the write law and answers the head of the row it wrote. A commit now reads the row once, judges the owner on that read, shows `decide` that log, and imports expecting that row and that log, answering the head the import wrote (on `"keep"`, the head read). Each deletion the store makes passes the row it judged: an owner's delete and a placed transcript's deletion expect the occupant they read BEFORE the hook ran (an append to it does not make it another row), an `evict: "delete"` release or idle sweep of a cached view expects the view's occupant and the view's log as it stands after the hook (an append through the view itself is still its log; a write through anyone else is not), and a cold release expects the head it read before the placement (no row read ⇒ it deletes none). A missed expectation answers `false` (`SessionStore.delete`) or deletes nothing (`release`, sweep). Both bundled repos judge and write in one synchronous step (the in-memory repo reads its storage's mark synchronously; the File repo's reads and writes are synchronous file calls). The store passes expectations, and has `delete` and `logTransfer`, only over a repo with `readRow` (and a head read); over any other repo a deletion after the hook is of the id judged.
|
|
240
|
+
- **Hard-breaking.** (1) *What changed*: `SessionRepo.importEntries` answers `Promise<SessionHead>` — the owner and occupant of the row the write committed and the leaf its new log leaves it on. *Who is hurt*: a third-party `SessionRepo` implementing `importEntries` (a TypeScript one stops compiling; a JavaScript one that answers nothing makes the bundled store's commit refuse with a `storage` error saying the log was written and no head answered). *How to migrate*: answer the head from the write's own step (the leaf is the one after the new log's last entry). (2) *What changed*: a repo with `readRow` judges `expect` on `delete` and `importEntries` (`sessionRowMatches` with the row as it stands in that step; a miss ⇒ `SessionError("conflict")`, nothing written). *Who is hurt*: a third-party repo that adds `readRow` and ignores the expectation — the store would then delete or replace a row it did not judge; the repo kit's conditional cases fail it. *How to migrate*: call `sessionRowMatches(expect, row, () => sessionLogMarkOf(log))` in the step that writes. No repo in this release's consumers implements `SessionRepo` (the server's and the File lane's deployments use the bundled repos). The write faces above ship in this same release, so for a consumer they arrive once, with these primitives under them.
|
|
241
|
+
- **Behavior narrowing (open to veto).** A commit whose destination was written by anyone since the commit read it is refused `conflict` (before: the write landed over it); a deletion whose row was written, deleted or created again since it was judged deletes nothing (before: the id was deleted). A caller retries by reading the row again.
|
|
242
|
+
- **@server.** The SQL session stores implement `SessionStore` directly, so they keep the same rule in their own transaction: the commit's read, owner judgement, `decide` and write, and a delete's judgement and removal, each over a row revision every append moves (a `FOR UPDATE` on the session row alone serializes only writers that also lock it; a revision column, or a `SERIALIZABLE` transaction over the entries, covers appends) — the store kit's new `[transfer]` case (a write through a replica while `decide` runs is refused `conflict` and stands) is the check. The local lane's direct `repo.delete` / `repo.importEntries` calls on the bundled File repo pass the expectation of the row they read (`readRow` / `headOf`), or move to `SessionStore.delete` / `logTransfer`; without it they stay unconditional, as before.
|
|
243
|
+
- **@dgx.** A File-lane deployment that calls `FileSessionRepo.importEntries` directly reads its answer as the committed head (it answered nothing); to write only the row it read, it passes `expect`.
|
|
244
|
+
- **Pins.** `test/backlog2583-session-row-conditional-writes.test.ts` C1–C8 (on the previous state 14 of 17 red: the appended or leaf-moved destination overwritten, `decide` shown another owner's log, the post-write head fault rejecting and a write landing right after the import answered as the commit's head, the owner's delete and a cold placed release removing a row created in the last step, an eviction removing a replaced log, the judge absent; the three controls green on both); the repo kit's four conditional cases (`sessionRepoContract`) and the store kit's `[transfer]` replica case. Re-pinned: `test/backlog1468-s4-session-write-faces.test.ts` W6 (the post-write head fault no longer rejects the commit); `test/hardening-session-durability.test.ts`'s silently-dropping import answers a head; `test/compaction-state-carrier-omit.test.ts`'s three imports read the answered head (they pinned the import resolving to nothing).
|
|
245
|
+
- **Known limits.** KL-1468-s4-a retired. KL-2583-a: a log replaced whole by one of the same length ending on the same entry id between a read and a write is not told apart by the mark (the same gap as KL-1468-s4-b; a row log-revision cell closes both). KL-2583-b: a repo without `readRow` is handed no expectation (the hook's window stays open there). KL-2583-c: a leg writing through a view after a commit replaced its log — refused `log_closed` on the File lane, landing in the replaced object on the in-memory repo.
|
|
246
|
+
|
|
247
|
+
### Inside a worktree the write roots are that worktree — the structured write tools, the shell's write targets and the accept-edits gate read one write location; managed worktrees live at `<repo>/.sema/worktrees/<name>` on the new branch `sema/<name>`, refused when any managed level is a symlink; the write-protection table reads the current tree as its base checkout (#2290, design/1456 S1, #568 folded in; hard-breaking + behavior narrowing; open to veto)
|
|
248
|
+
|
|
249
|
+
- **Before.** EnterWorktree switched the working directory but every write root stayed the task root: from inside a worktree a
|
|
250
|
+
write to the base checkout, or to another task's managed worktree under `.sema-worktrees/`, passed the structured write tools
|
|
251
|
+
and the shell's write-target judgment as an in-root write (#568: one task could Edit another task's checkout). Trees were minted
|
|
252
|
+
DETACHED at `<repo>/.sema-worktrees/<name>-<random>` with no screen on a symlinked managed path, and a name the grammar did not
|
|
253
|
+
accept was silently sanitized.
|
|
254
|
+
- **Now.** The reference implementation's permission-root relocation ("This moves the session's working directory and write
|
|
255
|
+
access there"; "After a further switch, previously-visited worktrees are no longer writable"): a leg's write location is ONE
|
|
256
|
+
reader (`currentCheckoutOf`, the active worktree while one is tracked, else the task root), read live by every write-root
|
|
257
|
+
reader — Edit / Write / NotebookEdit containment, the shell station's write roots, and the `acceptEdits` mode gate's
|
|
258
|
+
accepted directories. A write outside the write roots is judged by the existing semantics (the structured tools refuse under
|
|
259
|
+
`writeFace: "roots"`; a shell write target there asks; under `writeFace: "open"` the tools do not judge containment, and the
|
|
260
|
+
accept-edits gate now asks for a base-checkout write instead of passing it). Read roots do not move. The one mint
|
|
261
|
+
(`addWorktree`, also the subagent isolation lane's) creates `<repo>/.sema/worktrees/<slug>` (a name's `/` flattened to `+`) with
|
|
262
|
+
`git worktree add --no-track -b sema/<slug>`; an existing branch or directory of that name is refused, never reset or reused; a
|
|
263
|
+
symlink at `.sema`, `.sema/worktrees` or the tree's own directory refuses the mint; names follow the reference grammar (each
|
|
264
|
+
`/` segment `[A-Za-z0-9._-]+`, ≤ 64 characters, no `.` / `..` / `.git` segment) and a bad name is refused. Removal (ExitWorktree,
|
|
265
|
+
the mint's own `destroy`) deletes the tree's own branch only while its tip is still the base commit (one compare-and-delete of
|
|
266
|
+
that ref, never through a symbolic ref; an unusable base witness keeps it); a branch carrying commits is kept and named in the
|
|
267
|
+
reply. The always-on write-protection table judges every view of a target inside the CURRENT managed tree (the EnterWorktree
|
|
268
|
+
switch, or a task root that is itself a managed tree — an isolated child) as the same relative path in its base checkout: an
|
|
269
|
+
ordinary file of the tree meets no `.sema` question, while the tree's own `.sema/settings.json` / `.git`, every sibling tree and
|
|
270
|
+
the base checkout's ancestry are judged as ever.
|
|
271
|
+
- **What changed (hard-breaking, three sentences).** Inside a worktree the write roots of the structured write tools, the shell
|
|
272
|
+
write station and the accept-edits gate are that worktree plus the existing additional roots, so a write to the base checkout
|
|
273
|
+
or to another managed worktree is judged as a write outside the roots; the managed parent moves from `<repo>/.sema-worktrees/`
|
|
274
|
+
to `<repo>/.sema/worktrees/` (`WORKTREE_PARENT` is now `".sema/worktrees"`), and every minted tree checks out the new branch
|
|
275
|
+
`sema/<name>` instead of a detached HEAD.
|
|
276
|
+
- **Who is hurt.** A model or skill that edits the main checkout while a worktree is active (now refused or asked); a deployment
|
|
277
|
+
or script that reads `WORKTREE_PARENT === ".sema-worktrees"`, lists that directory, or expects `addWorktree` to leave no branch
|
|
278
|
+
behind (a tree with commits now keeps its `sema/<name>` branch after removal); an EnterWorktree caller that relied on a random
|
|
279
|
+
suffix to reuse a name; trees still under `.sema-worktrees/` (registered git worktrees, no longer managed: a resumed session
|
|
280
|
+
inside one keeps writing it, a new mint never lands there). Deployments with `writeFace: "open"` see no change to the structured
|
|
281
|
+
tools' containment.
|
|
282
|
+
- **How to migrate.** Exit the worktree (or add the directory to `additionalDirectories`) to write the base checkout; read
|
|
283
|
+
`WORKTREE_PARENT` instead of a literal; move old trees with `git worktree move <old> <repo>/.sema/worktrees/<name>` or remove them
|
|
284
|
+
with `git worktree remove`; delete `sema/<name>` branches a reaper no longer wants with `git branch -D`.
|
|
285
|
+
- **Consumers.** @server — the SVC-3 isolation wrapper (`src/plugins/worktree-isolation.ts`) mints through `addWorktree`: its
|
|
286
|
+
trees move to `.sema/worktrees/` and gain a branch; a reaper or disk cap that scans by directory name reads `WORKTREE_PARENT`.
|
|
287
|
+
@cli — any display or cleanup of `.sema-worktrees` / detached worktrees; the EnterWorktree / ExitWorktree replies now name the
|
|
288
|
+
branch. @client-core — the worktree card (`type: "worktree"`) is unchanged in shape; the reply text names the branch and the
|
|
289
|
+
write-access move. Open to veto: the branch law `sema/<name>` (the reference CLI uses `worktree-<name>`), refusal of an existing
|
|
290
|
+
name instead of the reference's resume-as-is, and the current-tree-only narrowing of the `.sema` exemption (the reference
|
|
291
|
+
exempts every `.claude/worktrees` tree and relies on the write root for siblings).
|
|
292
|
+
- **Exports.** No names added or removed. `WORKTREE_PARENT` value changes; `AddWorktreeOptions` gains `name?`; `addWorktree`
|
|
293
|
+
resolves with `name` / `branch` / `baseSha?` beside `env` / `worktreeDir`; `ActiveWorktreeSession` gains `name?` / `branch?`
|
|
294
|
+
(validated by `normalizeWorkspaceState`); `WriteProtectionCompileOptions` gains `checkoutOf?`; `FsWriteGatePolicyOptions.acceptDirs`
|
|
295
|
+
also takes a getter.
|
|
296
|
+
- **Pins.** `test/backlog2290-write-root-path-law.test.ts` (real Runner lanes over real git: base-checkout and sibling writes
|
|
297
|
+
refused from inside a tree, writable again after Exit; a shell write there asks as a write outside the roots; the open-face
|
|
298
|
+
accept-edits gate asks; an aliased task root; the managed location and branch; branch kept when it carries commits, deleted when
|
|
299
|
+
clean; an existing branch refused; a record naming another branch, a branch turned into a symbolic ref and a null base witness
|
|
300
|
+
each delete nothing they do not own; a symlink at each of the three levels; the name grammar; the accept-edits gate comparing the
|
|
301
|
+
live roots as keys after a tree root is swapped for a link; the current-tree reading — ordinary file unasked (also through an
|
|
302
|
+
aliased root and for a leg whose task root is a managed tree), sibling / in-tree settings / `.ssh` ancestry still asked, a `..`
|
|
303
|
+
remainder / name-prefix sibling / case alias judged as they stand; the record's two allocation facts).
|
|
304
|
+
|
|
305
|
+
### A mod package on disk has one reader, `loadModPackage`; an admission record carries the registration's provenance and says what it only watches; three real packages drive a real run (#2809; additive export and additive wire member, behavior narrowing on `observe` (C-R925), open to veto; hard-breaking: none; closed sets: none; exports: +1 function `loadModPackage`, +2 types `ModPackageHost`, `ModPackageRegistration`; members: +1 optional `ModAdmissionRecord.provenance` on both arms, so `wiring_manifest.mods[].provenance?` and `mods.registration_refused` `detail.provenance?`; `KERNEL_CONTRACT_VERSION` stays 4 — this release's move, whose sentence now names the record's two members) (@server @cli @client-core @test)
|
|
306
|
+
|
|
307
|
+
- **Before.** A mod reached the engine only as an object a host built in code: nothing read a mod package from disk, and every mods pin drove in-process kernel objects. An admission record named a registration by name, seat and tier only, so a `wiring_manifest.mods[]` row could not say whether the host minted it or a deployment declared it.
|
|
308
|
+
- **Now.** `loadModPackage(dir, { tier?, provenance?, options? })` (`src/core/mods/package.ts`) reads `.claude-plugin/plugin.json` (`name`, and `version` / `description` / `author`), `hooks/hooks.json` (`modules` — exactly one `.mjs` path relative to it; `contract`, compared for equality with `KERNEL_CONTRACT_VERSION`; `uses`; `description`) and imports the module, returning the registration with a `digest`: the sha256 of the newline-joined sha256 of the three files' bytes, in that order. Every file it reads is, as the package stands when it is read, a regular file whose real path lies inside the package, opened once and judged and read through that one handle (a pipe is refused without waiting on it); a directory of the package changed while it is read — a link put in place of one — is outside what the reader judges: the directory is the host's, as the code in it is. A member either JSON file does not take is refused, never ignored; a refusal is `config.mods_invalid` naming the package directory and the file, never a manifest's text — what the module throws while it is imported is described as the kernel describes a throwing `register()`. The seat, tier, provenance and option values are the host's argument — a package that states a tier is refused. What the kernel judges of a registration (its name, `uses`, the `register` export, every `on`) is the kernel's screen at admission, not judged a second time. **The module is imported from the bytes read and hashed** (a `data:` URL of them, ruled C-R926 and its note 1), never from its path again: the module that runs is the module `digest` names, the same bytes are one module instance in a process wherever they sit, changed bytes load anew, and bytes put back are the first instance again. So a hooks module is one self-contained file: a relative or package import has nothing to resolve from and is refused when it loads (`… could not be imported (…); a hooks module is imported from its own bytes, so it is one self-contained file: a relative or package import has nothing to resolve from`); node builtins import as usual. What the module's code loads beyond its own bytes — an absolute URL, a file it reads — is its own act in the host's process and is not in `digest`. Wherever the runtime's sentence quotes the module's URL (its bytes, encoded), whole or cut, the refusal names the module by its path instead. The admission record carries the registration's `provenance` on both arms as the host gave it — absent when none was given, no default minted — and the refusal notice's `detail` carries it beside the record's other members.
|
|
309
|
+
- **Fixtures.** `test/fixtures/mods/` holds three packages written for this repository (`sec-default`: a deployment guard on `plugin.register`, `tool.check` and `tool.call` — the last refuses a held tool's call before its body runs, the one refusal whose `tool_end` names the extension in `answeredBy`; `diff`: a `classic.PreToolUse` rewrite with a read call of its own, a `classic.PostToolUse` line on the result, and a `tool.call` answer in place; `telemetry`: watch-only). They share names with the reference CLI's built-in mods and none of their code — the reference's source is not licensed for copying. They are not in the package's `files`.
|
|
310
|
+
- **`observe` says what a registration only watches (ruled C-R925).** A mounted record's `observe` lists the patterns of its `events` on which every handler the registration hung is a watcher (`{ observe: true }`); a pattern that also carries a judging handler is in `events` alone. So "this registration only watches" has one reading: `observe` present and holding every pattern of `events`. Before, a pattern with any watcher was listed, and a registration that watched and judged on one pattern had an `observe` equal to its `events` — indistinguishable from one that only watches (`src/core/mods/kernel/dispatch.ts`, the record's mint).
|
|
311
|
+
- **Behavior change (open to veto).** A host that gives no provenance sees records and notices byte-identical to before; one that gives one sees one more member on its `mods[]` rows and refusal notices. *Behavior narrowing*: a registration that hangs a watcher and a judge on one pattern no longer lists that pattern in `observe` (its record had it listed; a registration with no such pattern sees the same record). *Who is hurt*: a reader that took `observe` as "has a watcher here" — none in this repository; a reader that took `observe` equal to `events` as "watch-only" now reads it right. Nothing else at run time changes.
|
|
312
|
+
- **Consumers.** @server: S-2388's deployment loading calls `loadModPackage` once per declared package, logs `digest` as given, and keeps `assertDeploymentModsAdmitted` as the boot self-check; the `mods[]` projection picks members row by row, so `provenance` is a new optional member there — read it where present, never decide a code on its presence. @cli: the MO-1 view takes the optional `provenance` the same way; the three-cell wire sentences (refusal, answered in place, own call) are in the #2809 criteria. @client-core: the record type gains `provenance?`; "watch-only" is the mounted arm with `observe` holding every pattern of `events` (your U-10 — no new member); the refusal's extension name on `tool.check` (#2810) and the rewrite disclosure (#2811) are the two faces with no member yet. @test: the L1 cells and the server-lane chain are in the #2809 criteria; the server lane is blocked on the server's loading entry.
|
|
313
|
+
- **Divergence (open to veto).** Against the reference (2.1.309): `uses` is declared in `hooks.json` where the reference scans the module's source for it; `hooks.json` carries `contract`, which the reference has no member for; a hooks module is `.mjs` only (the reference takes eight extensions and transpiles); the module is imported from its own bytes, so a relative or package import is refused (C-R926), where the reference allows relative paths and its own module name and refuses a dynamic `import()`; `options` are the host's values as given (the reference fills a manifest's `userConfig` defaults); `plugin.json` takes four members and `hooks.json` four — `$schema` and settings `hooks` included are refused.
|
|
314
|
+
- **Pins.** `test/mods-real-e2e.test.ts` — D1–D12 (the reader: each file's members, the contract, the module path and an import-time throw described, containment by real path, no manifest text in a refusal, the kernel's own judgments, the digest and the module instance it names, a relative or package import refused without the module's bytes in the sentence whole or cut and a node builtin loaded, the running module's own URL holding exactly the hashed bytes, a pipe refused without waiting, one instance per bytes across paths and back again after a change), R0–R7 (one real Runner over the three packages from disk: the manifest rows in run order with provenance, the rewrite and the extension's own read call, the refusal at `tool.check` by name in the sentence and with no `answeredBy`, the card, the watcher's rows, a run without the watcher equal to one with it, the answer in place, the refusal at `tool.call` with `answeredBy`), K0–K5 (the run order across tiers and seats and each package's result line in that order, an unlisted task-seat package refused with its notice and its code never run, a task-seat allow under and over the deployment's refusal, one broken package among good ones, a failing watcher, a package that cannot mount), S1–S2 (the server's boot self-check over the three; the same three minted in code, as the server's chain is today, giving the same records, run and watcher rows as the packages); `test/backlog2809-admission-record-members.test.ts` — P1–P4 (`provenance` on both arms and on the notice as given, absent when none, not judged against a list), O1–O4 (`observe`: a pattern with a watcher and a judge in `events` alone, a watch-only registration's `observe` equal to its `events`, a judging one without the member, a handler hung with a matcher counted by its own options); `test/export-surface.snapshot.json` regenerated (+3); `scripts/consumer-smoke-probe.mjs` checks `loadModPackage`.
|
|
315
|
+
- **Known limits.** KL-2809-a: no server entry loads a package from disk yet, so the server lane here is the boot self-check and the code-minted comparison (S1, S2); the server-loaded run is verifiable once the server takes this release. KL-2809-b: `digest` names the module that runs, not code that module loads by an absolute URL or reads itself; the package's files are judged as the package stands when read (a directory swapped for a link meanwhile is followed).
|
|
316
|
+
|
|
317
|
+
### The redaction mark has one source, and the package root exports it; the agent name someone chose reads back from the root (#2821, #2822; additive exports, narrowing of two diagnostics, open to veto; hard-breaking: none; closed sets: none; exports: +2 `REDACTION_MARK`, `chosenAgentName`)
|
|
318
|
+
|
|
319
|
+
- **Before.** The bracket mark a redaction writes was spelled where it was written: `[redacted]` as a string literal in four modules (the pass runner, the egress tiers, the request-echo scrub, the terminal account's detail snapshot), its `-credentials` variant in three (the pass runner, the egress tiers, the route adjudicator's URL-userinfo strip), `-url` and `-path` in the egress tiers; and it was recognized by three hand-written patterns (the egress tiers' exact set; the pass runner's preexisting-mark count and the sub-agent display cut, each a looser `[redacted-<letters>]` shape). A host that had to tell "the engine withheld this" from a literal in the text kept a copy of its own (the server's reader, S-2408). Separately, "did someone choose this agent's name or is it the derived one" (`chosenAgentName`) was an internal reader: 7.57.0 made `name` required and gave an unnamed agent `agent-<12 hex>`, and a serving layer's roster could not read the fact back from the handle and the name.
|
|
320
|
+
- **Now.** `src/core/redaction-marks.ts` holds the table (`REDACTION_MARKS`: `whole`, `credentials`, `url`, `path`), the bare mark (`REDACTION_MARK`) and the one reading of "where are the marks in this text" (`redactionMarkerSpans`, and `eachRedactionMarkerSpan`, its lazy form — one pattern derived from the table; the display cut reads the lazy form, so a line of a million marks costs it the few before its bound). Every pass that writes a mark, the request-echo scrub, the terminal account, the route adjudicator, the preexisting-mark count and the display cut read it; no `[redacted` spelling is left in `src/` outside that file. The package root exports `REDACTION_MARK` (`"[redacted]"`) and `chosenAgentName(handle, name)` (`undefined` when the name is the one `engineAgentName(handle)` derives, else the name; `engineAgentName` was already a root export). What a redaction pass writes is byte-identical to 7.57.0.
|
|
321
|
+
- **Narrowing (open to veto).** *What changed*: a marker-SHAPED word that is not one of the four marks (`[redacted-foo]`) is no longer counted in `RedactionReport.preexistingMarkers`, and a display cut (`cutAt`, `redactThenCut`) that lands inside such a word is no longer moved back before it. *Who is hurt*: a reader that counted or guarded that shape; the engine writes no mark outside the four, so nothing it wrote is affected. *Why*: the egress tiers already read the exact set (a word a remote wrote is not a mark); the two looser patterns were a second reading of one question.
|
|
322
|
+
- **Consumers.** @server: S-2408 / S-2411 can delete the hand copy of the mark and read `REDACTION_MARK`, and read "chosen vs derived" from a row's handle and name through `chosenAgentName` (no stored column). @cli @client-core: nothing to do.
|
|
323
|
+
- **Pins.** `test/backlog2821-redaction-mark.test.ts`: the four spellings; the root values; every site driven through its real entry point with the table replaced by different spellings (a site that still holds a literal writes the old one); a scan of `src/` for a second spelling; `chosenAgentName` for the derived name, a chosen one, another agent's derived name and a handle that is not a durable agent handle; the exact-set reading of a mark.
|
|
324
|
+
|
|
325
|
+
### `tool_end.rewrite` — when the gate lets a call go with arguments other than the ones it took, the end frame says what it let the call go with and who replaced them (#2811, ruled C-R922 and its note 1; additive member; closed sets: +1 `RewriteAuthor` kinds `extension` / `policy` / `approver`; exports: +2 types `RewriteAuthor`, `ToolInputRewrite`; hard-breaking: none)
|
|
326
|
+
|
|
327
|
+
- **Before.** Three judges can replace the arguments a call's body is handed — an extension's `classic.PreToolUse` answer (`updatedInput`), the leg's restriction chain (`allow` / `ask` with `updatedInput`), the approver of an ask answering with an edit — and no frame member said so: `tool_start.args` is the model's own, and the bytes the gate let go reached only the loop (`ToolGateResult.updatedInput`, whose doc told a host to compare values — a host on the wire never had the value to compare).
|
|
328
|
+
- **Now.** `tool_end.rewrite = { by, input }`: `input` is the gate's frozen plain-data projection of the arguments it let the call go with (`finalInput`), `by` one `RewriteAuthor` per replacement that changed them, in the order they were made (`{ kind: "extension", name }` — this leg's registration, by name; `{ kind: "policy" }` — the bytes came back in the restriction chain's answer, whoever inside it wrote them; `{ kind: "approver" }` — whose answer is `gate.settlement.who`). Inside one `classic.PreToolUse` dispatch every handler whose answer's `updatedInput` differs from what its `next()` returned is named, innermost first; one that hands a lower rewrite on unchanged is not. Present exactly when the gate's allow exit let the call go, the frame carries no `notExecuted`, and the bytes let go differ from the bytes the gate took at its entry (both as the tool reads them — the loop's argument preparation is no rewrite); absent on a call refused before it was let go, on a parked or answered-in-place call and on a rewrite set back; a refusal recorded after the call was let go (the shell read admission) leaves it beside the `denied` record. It says what the gate let the call go with, never that the body ran (a tool's refusal of those arguments is `isError` beside it; the loop's re-validation refusal of a rewritten call carries no `notExecuted` today — #2817). On the frame only: the persisted `toolResult` row does not repeat it. One account per gate pass (`RewriteAccount`, `src/core/rewrite-rejudge.ts`) written where each rewrite is adopted, read once at the allow exit; bytes that moved with no author named is an engine defect and throws.
|
|
329
|
+
- **CC 2.1.309.** CC adopts a hook's and a permission decision's `updatedInput` into the call's input and discloses no structured record of it (its only side channel is the hook's own raw output on `system/hook_response`, without a `tool_use_id`); this member is an additive divergence — every frame CC emits is unchanged.
|
|
330
|
+
- **Not covered (#2814, 7.59.0).** A resumed leg's frames carry no `rewrite`: its `tool_start.args` are the decided bytes, a re-screen's rewrite of an approved call is not recorded, and a rewrite made before a durable park is already folded into the parked row's bytes.
|
|
331
|
+
- **Consumers.** @cli: the MODS155 rewrite-notice cell reads `tool_end.rewrite` (present ⇒ the call was let go with other arguments; `by` names them). @server: S-2392 projects `tool_end.rewrite` whole beside `requestedBy` / `answeredBy`. @client-core: CC-1042 ③b reads `rewrite.by` / `rewrite.input`; ③a (`notExecuted ∧ ¬isError ∧ answeredBy`) and ③b are exclusive. @sdk: the two types. @test: L1 cell M6b reads the member.
|
|
332
|
+
- **Pins.** `test/backlog2811-rewrite-disclosure.test.ts` (real Runner: one extension; two in one dispatch, both named; a hand-on that names nobody; a re-spelling the tool reads as the same bytes that names nobody; an intermediate form the tool cannot read, replaced further out, that refuses nothing; an extension's own call beside `requestedBy`; an extension then the chain; the approver's edit; an extension rewriting the approver's edit, the form approved — three entries in order; controls: nobody, the same bytes handed back, a rewrite set back, a refused rewritten call, a rewritten call answered in place; gate-level: a host's edit the one judge refuses — a getter, a Map, a Date, a class instance — is never read by the account, a plain edit is named as the approver's).
|
|
333
|
+
|
|
334
|
+
### The judge of an MCP entry's `sessionMetaKey` is a root export — a schema package or a host that validates the field reads the engine's judgment instead of copying it (#2830; additive export; hard-breaking: none; behavior change: none; exports: +3 `judgeSessionMetaKey`, `MCP_SESSION_META_KEY_MAX_CHARS`, type `SessionMetaKeyReading`)
|
|
335
|
+
|
|
336
|
+
- **Before.** The key a server declares in `McpServerSpec.sessionMetaKey` is judged by `judgeSessionMetaKey` (`src/core/mcp-call-meta.ts`), but the function, its bound and its reading type were reachable only inside the package; a package that checks the field at its own door had to write the key-name format, the refusal list and the length bound a second time.
|
|
337
|
+
- **Now.** The package root exports `judgeSessionMetaKey(value: unknown): SessionMetaKeyReading`, the bound `MCP_SESSION_META_KEY_MAX_CHARS` (128) and the type `SessionMetaKeyReading` (`{ key: string | undefined } | { problem: string }`). They are the module's own members, re-exported on one line of `src/index.ts`: the function the preparation door and the materialization entrance ask is the function the root hands out (`===`), and the root declares no copy. A key that can ride answers `{ key }` (`undefined` answers `{ key: undefined }`); every refusal answers `{ problem }` naming the key — a non-string, the empty string, more than 128 characters, a name outside the MCP `_meta` key-name format, the SDK's `progressToken`, anything under the engine's `sema/` namespace, a prefix MCP reserves.
|
|
338
|
+
- **Not changed, stated.** No behavior moves: the judge's body, its sentences, the door and the entrance that ask it, and the wire are byte-identical to the previous release. The three names are new on the export surface only (`test/export-surface.snapshot.json` +3: a function, a variable, a type).
|
|
339
|
+
- **Consumers.** @settings-schema: the MCP entry schema's `sessionMetaKey` check can call `judgeSessionMetaKey` and report its `problem` rather than carry its own format; a deployment's own limit on top of the engine's is its own rule. @computer-use @desktop: a key such as `computer-use/sessionId` answers `{ key }`; `sema/…` and `progressToken` answer a problem.
|
|
340
|
+
- **Pins.** `test/backlog2830-session-meta-key-export.test.ts` (the root answers a key that rides, the engine namespace, the SDK key, a reserved prefix, the bound ± 1, a non-string and the empty string; the root function is the module's function; one declaration of the judge and of the bound in `src/`; the root's one export line names all three; the reading type is one type; the frozen snapshot registers the three kinds and tiers). Smoke: `judgeSessionMetaKey` (function) and `MCP_SESSION_META_KEY_MAX_CHARS` (number) are in `SMOKE_CHECKED_EXPORTS`, so a stranger install proves them reachable from the package root.
|
|
341
|
+
|
|
342
|
+
### A relative path is anchored, never folded — a `..` is the filesystem's: the execution seam's path law (`FileSystem`, `absolutePath`) is "anchor only, no `..` folding, no symlink resolution", `NodeExecutionEnv` reads every path that way, a not-yet-created target's key carries no `.` / `..` segment, and `resolveKey` reads one base (#902, design/902; behavior correction on the base-less reading, open to veto; hard-breaking for remote execution environments: their `..` folding is now out of contract (open to veto); closed sets: none; exports: none) (@server)
|
|
343
|
+
|
|
344
|
+
- **Before.** One spelling named two files. With `bridge` a symlink into `elsewhere/sub`, the fs throat keyed `bridge/../next` as `<dir>/elsewhere/next` (the file the kernel opens) when the caller had a base, but as `<dir>/next` when it had none: the spelling went to `env.absolutePath`, and `NodeExecutionEnv` anchored it with `path.resolve`, which folds `..` lexically. Every member of that environment read a relative path the same folding way (`readTextFile("bridge/../next")` read the other file), while the seam's contract said only "without resolving symlinks". A target that did not exist yet was keyed by rejoining its missing tail as written, so `missing/../x`, `gap/./new` and `gap//new` minted keys with `.`, `..` or a separator run in them — a second key for a file a later spelling keys differently. `resolveKey` read a call's target against `cwd ?? root`, and where that base was unusable read it again against the environment's own `cwd`.
|
|
345
|
+
- **Now.** The seam states the law (`src/engine/harness/types.ts`): a path a method is handed is absolute as written or relative ANCHORED at `cwd`; no method folds a `..` (the filesystem resolves it, components first); `absolutePath` anchors only, and an environment that owns no working directory refuses a relative path — the engine never places one at `cwd` on its behalf. `NodeExecutionEnv` reads every path through one anchor (the chain walk's `anchorAtLinkDir`, unfolded, one separator): its members (a relative `cwd` is the process's, so `absolutePath` never answers with a relative path), `joinPath` (a later segment is a segment, never a root), the parent a write creates (`dirname`, so `bridge/../newdir/f` creates `elsewhere/newdir`) and the paths a listing reports (under the path it was handed — the JS search fallback now matches its echo against the start as written, and its lexical collapse helper is gone). Below a target's deepest existing ancestor the missing tail is applied the way the kernel will apply it once the write creates it, as far as nothing on the way can be a link: under the first missing name `.` and separator runs fold and a `..` cancels the missing name before it; a `..` that cancels the last missing name, or climbs to the canonical prefix's parent, lands in a directory that exists, and the rest of the spelling is probed again from there (a link on it is followed, a regular file on it is no directory) instead of being folded on. With nothing on the chain at all the same rule runs below the path's own anchor. `resolveKey` refuses a call whose base it cannot use (`cannot resolve path "…": the base this call resolves against (…) is not a fully-qualified path of this tree's family; refused.`) instead of reading it a second time. The throat is unchanged: with a base it anchors (`anchorSpelling`), with none it hands the spelling to the environment.
|
|
346
|
+
- **Who is hurt.** A caller that relied on the fold: a relative path handed straight to `NodeExecutionEnv` whose `..` follows a directory that does not exist now fails the way the kernel fails (`ENOENT`) instead of landing beside it, and one whose `..` follows a symlinked directory now lands where the link leads. Through the engine, a spelling whose `..` cancels a name that does not exist yet (`gap/../x`) is keyed where it lands once that name is created (`<root>/x`, judged there by every fence), so a write that used to fail with `ENOENT` now writes there. The engine's own tools hand the environment canonical keys and are not affected; a base-less relative spelling reaches the corrected reading only at the deployment-text seats (a rootless write gate's target and domains, a relative data root, a protected-target judgment with no base) and in `resolveKey` on a base it cannot use (now refused).
|
|
347
|
+
- **Consumers.** @server — hard-breaking, open to veto, three sentences: (1) the seven remote adapters (adb / device / e2b / host / k8s / local-docker / ssh) read a path with `posix.normalize`, which folds `..` on absolute paths too, so on every remote lane `<base>/bridge/../next` is asked as `<base>/next` — their shared `resolve(p)` should keep `p` as written when absolute and join it under `cwd` when relative, never folding a `..` (the remote filesystem resolves it), and a listing should name its entries under the path it was handed; (2) `DeferredSandboxPathEnv.absolutePath` keeps refusing a relative path, and its absolute arm stops folding `..` the same way; (3) both land in ONE server version — adapters that stop folding while the gate environment still folds would have the write gate judge `<base>/next` while the tool opens `<base>/elsewhere/next`. Until then the remote lanes keep their fold (consistent between gate and tool, unlike the shell, which resolves `..` on the remote kernel). A host's own `ExecutionEnv` reads the new contract text.
|
|
348
|
+
- **Reference.** The reference CLI's path expansion folds lexically (`normalize` / `resolve`) and opens the folded path; this tree resolves `..` by the filesystem on every face (the fs throat with a base already did, as do the symlink chain walk and the shell read establisher), so the fs tools and the shell agree on what one spelling names. Registered as a divergence (`fs-throat-dotdot-resolved-by-filesystem`).
|
|
349
|
+
- **Pins.** `test/backlog902-relative-anchor.test.ts` on a real filesystem (`bridge -> elsewhere/sub`, `elsewhere/next` against a decoy `next`): the base-less key, the based key with a base that is not the environment's `cwd`, and the kernel's `realpath` and inode name one file; an environment member, `absolutePath`, the leaf chain, a listing, a write's parent and `joinPath` read the spelling the same way; the missing tail's `..` / `.` / separator run and a `..` climbing past it through the link (checked against the file the kernel then creates); a `..` back into an existing directory followed by a link out of the root (refused by containment where it leads) and by a regular file (refused); the nothing-exists fallback and its root; `joinPath`'s later segments; a relative environment `cwd`; a remote write gate's shape (a `StubExecutionEnv` with cwd `/` refusing relative paths) still refuses a base-less relative spelling; `resolveKey` on an unusable base; the example environment's `absolutePath`. 17 of the 20 cases are red on the previous tree; the based-key control, the gate-shape case and the later-segment `joinPath` case are green on both. Re-pinned: `backlog840` (#840) G6 (the canonicalizer's roster names `effective-path-target.ts`, the reader `resolveKey` goes through) and G15 (the stated limit — a separator run kept in the missing tail — is retired: one key on every family); `fs-search-honesty` #318 (the win-shaped stub lists entries under the start as written, and a stub that folds falls back to the projection).
|
|
350
|
+
|
|
351
|
+
### A run may declare its session plan file — `TaskSpec.planFile` — and the plan then lives there: every gate that judges a write reads the one admission (the file tools' root fence for write and read, the permission-mode write gates, the write-protection table), `ExitPlanMode` takes no `plan` and presents what the file holds, the planning frames name the file, and a compaction refers back to it; undeclared, nothing changes (#1503 + #2745, design/1503, C-R887; behavior widening on a new seat, hard-breaking: three sentences below, open to veto; closed sets: +1 refusal code `config.plan_file_invalid`, +1 tool contract `core.exit_plan_mode_file@1`; exports: none; members: +1 `TaskSpec.planFile`, +1 optional `filePath` on the `exit-plan-mode` card) (@cli @server @client-core)
|
|
352
|
+
|
|
353
|
+
- **Before.** The shell keeps the plan in a file under its configuration root and tells the model it is the one file it may edit, but never told the engine. A Write to that file in plan mode asked (`mode` + `write_protection`), and after Yes the root fence refused it: `path "…/.sema/plans/<slug>.md" resolves outside the allowed roots …; access denied` (test [9700] U2). Three gates, three lists of what is writable, none of them holding the plan file.
|
|
354
|
+
- **Now.** `planFile` is the absolute path of this session's plan file in the leg's execution environment (the reference's `<plans directory>/<slug>.md`). Declared, it is admitted through the advertised-writable seat as its third advertiser (beside the scratchpad and the memory root) — a FILE: its key is the canonical parent joined with the declared name, frozen at admission. The root fence admits it for write and read, every permission mode's write gate admits it through the request's advertised roots (no question in `plan`, `default` or `acceptEdits`), and the write-protection table does not demote it — the reference's order, where "Plan files for current session are allowed for writing" is answered before the dangerous-path check and before the plan-mode question (CC 2.1.309 `checkEditableInternalPath`).
|
|
355
|
+
- **The file, and what stays as it was.** The fence and the write gates admit the declared path and anything beneath it until #2746 (the advertised seat has one reach, "the path and below"; a file-only reach is that ticket — KL-1503-a); the write-protection table exempts exactly the file — by identity: the write's real target must be the admitted key, and a spelling that names the plan file only waits for that answer — so a path below it, and the plan's own spelling once a link replaced the file (the `.sema` row asks again, and the landing is judged too), still meet the table. A sibling in the same directory and every deny row (the opt-in sensitive-path set, a person's rules) stay as they were. Not inherited: a delegated child, a fork or a workflow step plans in its final answer.
|
|
356
|
+
- **Refused, coded.** A declared value the gates cannot hold refuses the run (`terminal: { kind: "failed", code: "config.plan_file_invalid" }`, the value and the reason stated): not a string, empty, not absolute, not in lexical normal form, or not tellable to the model verbatim (a control character, a run of whitespace, an envelope marker, over 4096 characters); the leaf is a symbolic link, a directory or another non-file kind; its directory does not resolve, or is not a directory (the host creates the plan file's directory before the run — the engine never materializes it); the leg's hands are read-only or absent; the key would hold a fence root. Refused rather than skipped: the plan-exit tool's arm (#2745) is fixed at mount, so a declared file is never narrowed away later.
|
|
357
|
+
- **The plan-exit tool reads the file (#2745).** One fact picks the arm, as in the reference (CC 2.1.309 keys both on one host fact: a diskless session passes the plan as `plan`; any other reads the plan file). Declared, `ExitPlanMode` is mounted in its FILE arm — contract `core.exit_plan_mode_file@1`, no parameters, the reference's disk-arm description naming the file — and when called it reads the plan through the seat's one reader at the admitted key: the plan text rides the tool result (fenced) and the `exit-plan-mode` card as `plan`, with `filePath` (the declared path, the reference's `ExitPlanModeOutput.filePath`); a file not written yet (absent or blank) is refused with the reference's sentence — `No plan file found at <path>. Please write your plan to this file before calling ExitPlanMode.` — before any review is requested, and a file no longer the admitted object (an ancestor or the leaf replaced by a link, a directory, another kind) or over 1 MiB is refused with the reason, never read through; where the environment can hold what it opens (`openBound`) the bytes are the judged object's, else the file is judged again after the read (KL-1503-b). An existing file is keyed by its own canonical spelling (a case-insensitive volume keeps the stored case). Undeclared, the parameter arm is byte-identical (`plan` required, contract `core.exit_plan_mode@1`).
|
|
358
|
+
- **The frames name the file (#2745).** A plan-mode leg that carries the plan-exit tool and declared a plan file gets the reference's disk-arm planning frame — the edit ban "with the exception of the plan file mentioned below" and its `## Plan File Info:` section naming the file ("NOTE that this is the only file you are allowed to edit") — and the sparse restatement "Read-only except plan file (<path>)"; the file's existence is left to the model (the reference words the section two ways off a disk read; this frame names both actions). The exit frame is the one every planning wording shares. Every other leg's frames are unchanged.
|
|
359
|
+
- **A compaction refers back to the plan (#2745).** After a landed compaction a leg whose run admitted a plan file that holds a plan gets the reference's `plan_file_reference` in one engine-minted reminder — "A plan file exists from plan mode at: <path>", the plan fenced, "If this plan is relevant to the current work and not already complete, continue working on it." — in any mode; an absent or blank file says nothing.
|
|
360
|
+
- **One reading retired.** The permission-mode write gate no longer exempts `envFacts.scratchpadDir` by its own spelling: what it never asks about is the run's advertised seat, read off each request — the admission the fence holds. A scratchpad the seat skipped (and the fence already refused) is no longer exempt at the gate.
|
|
361
|
+
- **Open to veto — hard-breaking, three sentences.** (1) `TaskSpec.planFile` is new: a deployment that declares it gets the plan-file arm — `ExitPlanMode` with no `plan` argument, reading the file — and a declared value that is not the absolute path of a regular-or-absent file in an existing directory refuses the run with `config.plan_file_invalid` instead of starting. (2) The declared file is written with no question in every permission mode (plan included) and is exempt from the write-protection table — the `.sema` row no longer asks about it. (3) The permission-mode write gate stops reading `envFacts.scratchpadDir` on its own: a scratchpad the advertised seat skipped is no longer exempt at that gate.
|
|
362
|
+
- **Consumers.** @cli (primary): declare `planFile: getPlanFilePath()` on the session's runs and create `getPlansDirectory()` before the run (today it is created when the plan prompt is first built); the plan-file prompt then matches the engine's gates and its frames (the shell's own plan-mode prompt, CC's `plan_mode` attachment text, can retire in favour of the engine's marked frame); `ExitPlanMode` now arrives with no `plan` argument — render the plan card from the card's `plan` / `filePath` (or the file) rather than from the call's arguments. @server: pass a deployment-supplied `planFile` through the task body (absolute path in the run's execution environment) or leave it absent; map `config.plan_file_invalid` like the other `config.*` refusals. @client-core: no change unless it builds task specs.
|
|
363
|
+
- **Pins.** `test/backlog1503-plan-file-seat.test.ts` (real Runner, NodeExecutionEnv over temp directories: the U2 lane declared ⇒ written with no card, undeclared ⇒ refused as before; `default` / `acceptEdits`; Read + Edit; sibling refused; inside the task root's `.sema` the plan file is not demoted while its sibling asks with `write_protection`; an alias spelling of the declared file; a link planted after admission; nine bad forms coded; the seat's key; the child seat; the scratchpad in plan mode; #2745: the file arm's empty schema, description and card (`plan`, `filePath`), nothing written refused with the reference's sentence, a link planted before the call never read through, the parameter arm unchanged; the planning frame names the file, the fold reads it back as its row; the post-compaction reference and its silent cases).
|
|
364
|
+
|
|
365
|
+
### `workspace_changed` is the leg's whole snapshot — every leg opens with one (`cwd`, `root`, `entered?`, `project?`, `remote`), then one per change; `TaskSpec.projectId` is judged against the checkout's marker by the leg's one project judge, which memory v2 now reads (#2291, design/1456 slice S3; hard-breaking, open to veto: the frame gains required members and a frame on every leg, `resolveProjectId` becomes `(fs, rootDir) => Promise`; behavior narrowing: a declared project unequal to the marker refuses the leg) (@server @client-core @cli @web-client)
|
|
366
|
+
|
|
367
|
+
- **What changed (hard-breaking, three sentences).** (1) `workspace_changed` is now a WHOLE snapshot of where the leg stands — `cwd`, `root` (the task root as the leg's root receiving point settled it) and `remote` always, `entered: { dir, byPath? }` while an EnterWorktree switch is active, `project: { id, source: "marker" | "declared" }` when the leg has a project identity — and EVERY prepared leg (fresh, resumed, continued, child; read-only legs and legs with no execution env included, where `cwd` is `root`) sends one after `wiring_manifest` (and after the leg-start `tool_disclosure` census when it defers tools), before its first model or tool interaction, then one each time the snapshot changes; `TaskSpec.projectId` (new) is judged with the checkout's `.sema/project` marker by one judge once per leg (marker present: the declaration must equal it, else `config.project_identity_mismatch`; no marker: the declaration is the identity; not a UUID: `config.project_id_invalid`), and `resolveProjectId` reads through the filesystem the root names: `resolveProjectId(fs, rootDir)` returns a Promise. (2) Who is hurt: a consumer that treated every `workspace_changed` as "the directory moved" (it now also sees the leg-start frame, equal to what it may already hold), a consumer or fixture that constructs the frame with `cwd` alone (two required members), a host that sends a `projectId` unequal to the checkout's marker (the leg is refused), and a caller of `resolveProjectId(dir)`. (3) How to migrate: replace your copy of the snapshot with each frame and render a move only when `cwd` differs from the one you hold (keep the last frame as the session row's place, project and remoteness — read the frame, do not re-derive them from the disk); send `TaskSpec.projectId` on every leg with the marker's id (or none); call `await resolveProjectId(env, dir)` with the execution env the directory lives in (`new NodeExecutionEnv({ cwd: dir })` for a host path). @server: the session row's project and place are the last frame's — read the frame and retire the self-computation (`src/project-identity.ts` `resolveProjectIdentity`'s own marker walk).
|
|
368
|
+
- **The rule (what got fewer).** Where a leg stands is one projection (`workspaceSnapshotOf`, `src/core/workspace-snapshot.ts`) announced by one per-leg seat (`Prepared.workspaceFrame`: the identity wiring binds it after the manifest, the tool walk and the resumed approved call observe it; a snapshot equal to the last one sent is not sent — the digest is the snapshot's canonical JSON, so every member takes part). Which project a leg belongs to is one verdict (`resolveSessionProject`), read by the frame and by memory v2. Retired: the cwd-only dedupe seeded so that a leg's starting place was never announced (a resumed or continued leg's restored cwd now reaches the wire); the frame's four-sentence contract (moves only / real shell only / initial not announced / resets across a suspend — the last was already false); memory v2's own marker read and its own unreadable-marker catch; the inline remoteness reading beside `onWorkspaceResolved` (the restore phase computes the leg's one reading and returns it to both); the host-only marker read (`existsSync` / `readFileSync`).
|
|
369
|
+
- **Project identity (behavior).** The verdict is decided on the task root, once per leg (never re-resolved within it). A marker that cannot be read (nested below the repo root, corrupt, a lookup the filesystem cannot answer) leaves the frame without `project` and is told to `onError` (phase `config`, the marker's own code) on every leg; only a leg that consumes project identity is refused with it — memory v2 with a `proj:` / `userproj:` scope (as before) and, new, a leg that declared `projectId`. A leg with an execution env reads its marker through that env (a remote env's marker is the one in the env); a leg without one reads the host at its root, as memory did. Memory v2 keys its mount by the verdict only when it came from the marker (a declared-only identity does not change the memory key or its write-target check). Changed for memory: the marker is read at the leg's task root, where before it was read at `rootPath` when one was configured — they differ for a delegated child in its own worktree (the worktree's committed copy of the marker is read) — and through the remote env for a remote leg (before: a host path that did not exist there, so the path key).
|
|
370
|
+
- **Consumers.** @server: `src/trace/core-keyset-guard.ts` gains `root` / `remote` / `entered` / `project` on the `workspace_changed` arm; the session row's `projectId` and place are the LAST frame's (`project.id`, `root`, `cwd`, `entered`) — `src/project-identity.ts` `resolveProjectIdentity` is the reading this frame retires (read the frame, retire the self-computation); forward the session's project as `TaskSpec.projectId` on every leg (S-1348). Kinship stays in its existing words: fork lineage is `SessionMetadata.forkedFrom`, delegation lineage is `parentSessionId` — do not record a fork as `parentSessionId`. @client-core: `workspaceChangedArm` reads the new members (CC-495); the frame is a snapshot. @cli: do not render "directory changed" for a frame whose `cwd` equals the one already shown (the leg-start frame). @web-client: the session header can show the root, the active worktree and the project from the last frame.
|
|
371
|
+
- **Not in this slice (stated).** `repository` (the repository's main worktree root) and `entered.name` / `entered.branch` arrive with the worktree path-law slice (S1), `session` with the session-checkout slice (S2) — each is a new member of the same snapshot.
|
|
372
|
+
- **Exports and wire shape (the release's wire manifest).** No name added or removed; `resolveProjectId` changes signature (`(rootDir) => marker | null` → `(fs, rootDir) => Promise<marker | null>`). `TaskEvent` `workspace_changed` gains `root` and `remote` (required — a constructor of the frame breaks) and `entered?` / `project?`; `TaskSpec` gains `projectId?`. Closed sets: +1 new, `workspace_changed.project.source` (`marker` | `declared`). Refusal codes: +2 (`config.project_identity_mismatch`, `config.project_id_invalid`); an unreadable marker keeps `config.memory_project_marker` / `config.memory_project_marker_nested`.
|
|
373
|
+
- **Memory side effects of a refused leg (narrowing).** The write-target check (`config.memory_project_identity`) now runs before the marker hint is recorded and before the key-switch carry-over drains the path-keyed announcement queue, so a leg it refuses leaves neither behind; the hint and the carry-over are written only from a verdict decided on the memory partition's own root.
|
|
374
|
+
- **Order of the project read (no contract change).** The leg's project judge runs once the caller's mounts are judged, so a leg its mounts refuse (`config.tool_mount_denied`) is refused before any marker read and its rejection settles at the same depth as before this slice; a leg refused on both counts reports the mount refusal. The frame's place (after `wiring_manifest`, before the first model or tool interaction), the judge's two codes and `resolveProjectId(fs, rootDir)` are unchanged. Pinned in `test/backlog2291-session-facts-frame.test.ts` (no marker-walk read on a mount refusal, with its admitted control; the stream order) and `test/design393-s6-run-leg-lanes.test.ts` (rejection depth held at 52).
|
|
375
|
+
- **Pins.** `test/backlog2291-session-facts-frame.test.ts` (real Runner: the leg-start frame on a shell / read-only / env-less leg, changed-only frames, the continuing leg's restored cwd, the resumed leg, the remoteness reading, EnterWorktree / ExitWorktree, no kinship key; the judge's four outcomes and its two refusals, an unreadable marker reported vs refused, the env-face read; memory v2 on an env-less leg still keyed by the host marker, declared-only identity not keying memory, an unreadable marker refusing a consuming session); re-pinned `test/workspace-changed.test.ts`, `test/design393-s2-run-lanes.test.ts`, `test/memory-scope-contract.test.ts`.
|
|
376
|
+
|
|
377
|
+
no-notes: #2575(the multi-package release-base pin now reads a fixture repository whose history it writes instead of the checkout's own tags and packages; a pin that was red on the v7.56.0 tag tree and on a depth-1 clone is green on both; test only; no script or export change), #1030(test fixture only: the 1751 pin's fixture body now reads the RC manifest through the one git seam; the seam itself shipped in 7.54.0), #2700(ticket named by the 2604-fix1 commit, not fixed here: Monitor skipping the kill guard is a 7.58.0 car), #926(sweep: session-log-transfer renders thrown values through thrownText; behaviour unchanged for an Error and a string)
|
|
378
|
+
|
|
1
379
|
## 7.57.0 — 2026-10-25
|
|
2
380
|
|
|
3
381
|
### A Model object the engine cannot read is refused by name at every seat that takes a model — `Runner.runTask` and `Runner.compactSession` read the one model-binding judgment (#2769; behavior narrowing, open to veto; hard-breaking: none; closed sets: none — the refusal is the existing `config.unknown_role` / `not_a_model_ref`; exports: none) (@server @cli)
|
|
@@ -46,6 +424,13 @@
|
|
|
46
424
|
- **Exports.** +2 types `CompactSessionRequest` / `CompactSessionResult`; `Runner` gains `compactSession`. Closed sets: +2 refusal codes from the new verb only (`compact.invalid_request`, `compact.session_busy`).
|
|
47
425
|
- **Pins.** `test/backlog2451-compact-session.test.ts` (real Runner: landing + frames + next run reads the summary; held session refused; a leg arriving mid-pass waits; the doors; withdrawn request; deployment block; the facade's seats; an unavailable seat; summarizer failure; activation snapshot restated; a credential callback that never settles; the summary model's route fallback; `disabled` / `noop`).
|
|
48
426
|
|
|
427
|
+
### The checkpoint-store contract kit judges the run origin — a row's `state.runOrigin` round-trips verbatim, rides the listing, stays absent when absent, and a word outside the closed set is kept on the row and read as absent in the listing (#2670; contract kit only, `src/` behavior: none; hard-breaking: none; closed sets: none; exports: none; members: none) (@server)
|
|
428
|
+
|
|
429
|
+
- **Before.** `CheckpointState.runOrigin` (7.57.0, `TaskSpec.runOrigin: "scheduled"`) is a persisted member carrying the requirement word `run_origin`, and the listing echoes it as `CheckpointSummary.runOrigin`. The store-contract kit never put a row with the member, so a backend that rebuilds `state` member by member — the shape of a SQL store written before the member existed — passed the whole kit while handing back a row whose requirement list still names `run_origin` and whose content does not. The resume screen refuses that row as `requirements_damaged`, for every worker, for good: a scheduled task's parked approval could be listed and never resumed. Measured on the tree this change started from: five stores, each with one defect on this member, each passed every kit case.
|
|
430
|
+
- **Now.** `checkpointStoreContract` carries one more case, `run origin: …`, over three rows. (1) A row whose `state.runOrigin` is `"scheduled"` comes back with the member verbatim. (2) The listing echoes it. (3) A row without it comes back without the key (never `null`, `""` or a key holding `undefined`), and its listing summary has no key. (4) A row carrying a word outside the closed set comes back with the word kept verbatim (the resume screen refuses it loudly; the store never launders it) and its listing summary has no key. The case runs unchanged over `InMemoryCheckpointStore`, `FileCheckpointStore` and `PgCheckpointStore` (pg-mem); all three pass. No engine behavior changes: `src/` carries only the kit case.
|
|
431
|
+
- **Who is hurt.** A third-party or server-side `CheckpointStore` that drops or fabricates `state.runOrigin`, echoes a word outside `RUN_ORIGINS` in its listing, or launders an outside word on write now fails the kit at `run origin: …`. @server: a SQL checkpoint store that rebuilds `state` by hand must carry `runOrigin` as its own member — absent when the row has none, never `null` — echo it in the listing only for `"scheduled"`, and keep an outside word on the row verbatim; run the kit over your store and read the failing assertion's message.
|
|
432
|
+
- **Pins.** `test/backlog2670-run-origin-kit-case.test.ts`: a premise cell (a stamped row that comes back without the member is `damaged` at the resume screen's own judge), a control (the reference store passes every case) and five bad stores, each the reference store with one defect, each red at exactly the new case and at exactly the named assertion — A rebuilds `state` without the member (1), B a listing that never echoes (2), C a rebuilt `state` carrying `null` for an absent row (3), D a listing that echoes an outside word (4, listing half), E a store that drops an outside word on write (4, row half). All five pass the kit whole on the tree this change started from. Mutations: `mutations.md` in the car receipt.
|
|
433
|
+
|
|
49
434
|
### The rulings-landing gate reads every ledger the way it is written — one row splitter, a `path:line` + snippet is a claim judged on the file's content, a window's note is history it never reads, a disposition addresses ONE row, one comms root per run — `scripts/rulings-disposition.mjs` drafts the post's 裁定处置 lines, and the backlog gate counts only work as a car coordinate (#2113, #2260; release tooling only; behavior change: none; hard-breaking: none; closed sets: none; exports: none; members: none) (@test @cli @server @client-core)
|
|
50
435
|
|
|
51
436
|
- **Before.** Six readings of `scripts/rulings-gate.mjs` disagreed with the books it judges. (1) `BLOCKED(on #N)` took the ticket's state from the FIFTH cell of its backlog row: 188 of 2098 ticket rows are wider than six cells (a bare `|` in a head cell), so for them the "state" was whichever cell stood fifth, and `SHIPPED-…` was never "landed". (2) An `已落` row passed when any ONE of its tokens resolved, so a row that cited a commit and a symbol the code no longer holds read as landed (on the comms ledger of 10-24: 12 `path:line` + snippet claims in 10 rows name text that is not in the file at all — `DATE_ANCHOR_CUSTOM_TYPE` moved to another file, `ENGINE_ATTESTATIONS` likewise, `judgeRead(read, boundary)` changed shape — and 128 more name a line the snippet is no longer on). (3) A ruling that owns several rows in one repo shares one key, so one line in the post disposed of all its due rows. (4) With `--ledger` named, `BLOCKED(on S-563)` was still looked up in whichever comms checkout sat beside the tree; a `#N` / `core@x` blocker in another repo's row could never resolve. (5) A window cell with a note — `7.57.0(10-24 R 对账改窗:7.56.0 未并 / 未派;原 7.56.0)` — was an unreadable window: the 33 rows re-windowed that way were neither format-clean nor due, so leg (a) never asked the post for a line about them. (6) The backlog gate's "car coordinate" was any `car-…` string anywhere in the status cell, so a car that finished, a plan that never ran and an OPEN row naming a planned car all kept a twice-re-windowed row out of the "moving without work" list (22 of the 53 such rows on the stage-7570 ledger).
|