@sema-agent/core 7.73.0 → 7.74.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 +246 -0
- package/dist/agents/list-agents-tool.js +1 -1
- package/dist/agents/retain-ledger.js +3 -3
- package/dist/agents/send-message-tool.js +4 -4
- package/dist/brain/anthropic.d.ts +42 -1
- package/dist/brain/anthropic.js +54 -4
- package/dist/brain/failover.d.ts +5 -0
- package/dist/brain/failover.js +51 -22
- package/dist/brain/model-lane.d.ts +12 -3
- package/dist/brain/model-lane.js +5 -5
- package/dist/brain/open-responses.js +3 -3
- package/dist/brain/openai.js +1 -1
- package/dist/brain/route-adjudicator.d.ts +33 -4
- package/dist/brain/route-adjudicator.js +49 -12
- package/dist/brain/stream-engine.js +9 -7
- package/dist/brain/stream-shared.d.ts +4 -3
- package/dist/brain/stream-shared.js +2 -2
- package/dist/core/allow-entry.js +1 -1
- package/dist/core/ask-class.d.ts +2 -2
- package/dist/core/ask-headline.d.ts +1 -1
- package/dist/core/ask-origin.d.ts +44 -4
- package/dist/core/ask-origin.js +29 -10
- package/dist/core/background-agent-store.d.ts +1 -0
- package/dist/core/background-agent-store.js +49 -8
- package/dist/core/checkpoint-row-verdict.d.ts +1 -1
- package/dist/core/checkpoint-row-verdict.js +2 -2
- package/dist/core/checkpoint-store.d.ts +2 -0
- package/dist/core/checkpoint-store.js +8 -2
- package/dist/core/config-refusal-codes.d.ts +1 -1
- package/dist/core/config-refusal-codes.js +1 -0
- package/dist/core/cron.js +9 -1
- package/dist/core/deployment-shape.d.ts +7 -0
- package/dist/core/deployment-shape.js +19 -0
- package/dist/core/engine-capabilities.d.ts +9 -1
- package/dist/core/engine-capabilities.js +1 -1
- package/dist/core/engine-notice.d.ts +14 -9
- package/dist/core/engine-version.js +1 -1
- package/dist/core/gate-fold.js +5 -4
- package/dist/core/gate-lanes.js +8 -12
- package/dist/core/gate-outcome.d.ts +8 -2
- package/dist/core/gate-outcome.js +10 -3
- package/dist/core/governance-codes.d.ts +8 -2
- package/dist/core/governance-codes.js +9 -1
- package/dist/core/hook-condition.d.ts +37 -0
- package/dist/core/hook-condition.js +567 -0
- package/dist/core/hooks.d.ts +2 -0
- package/dist/core/mode-policy.d.ts +4 -0
- package/dist/core/mode-policy.js +18 -2
- package/dist/core/model-seat.d.ts +8 -5
- package/dist/core/model-shell.d.ts +129 -0
- package/dist/core/model-shell.js +249 -0
- package/dist/core/mods/kernel/digest.d.ts +4 -0
- package/dist/core/mods/kernel/digest.js +5 -0
- package/dist/core/mods/kernel/dispatch.d.ts +3 -0
- package/dist/core/mods/kernel/dispatch.js +15 -6
- package/dist/core/mods/kernel/events.d.ts +21 -5
- package/dist/core/mods/kernel/events.js +19 -10
- package/dist/core/mods/kernel/hash-mirror.d.ts +1 -0
- package/dist/core/mods/kernel/hash-mirror.js +55 -0
- package/dist/core/mods/kernel/index.d.ts +1 -0
- package/dist/core/mods/kernel/index.js +1 -0
- package/dist/core/mods/kernel/package-reader.d.ts +48 -0
- package/dist/core/mods/kernel/package-reader.js +149 -0
- package/dist/core/mods/kernel/site-rules.d.ts +4 -0
- package/dist/core/mods/kernel/site-rules.js +13 -0
- package/dist/core/mods/package.d.ts +7 -3
- package/dist/core/mods/package.js +47 -80
- package/dist/core/permission-rule-org.js +13 -3
- package/dist/core/permission-rules.js +4 -1
- package/dist/core/retain-seat.d.ts +42 -0
- package/dist/core/retain-seat.js +76 -0
- package/dist/core/rewind-refusal-codes.d.ts +8 -0
- package/dist/core/rewind-refusal-codes.js +12 -0
- package/dist/core/roles.d.ts +2 -2
- package/dist/core/roles.js +15 -1
- package/dist/core/rule-store-fault.d.ts +9 -7
- package/dist/core/rule-store-fault.js +8 -3
- package/dist/core/runner/checkpoint-scope.d.ts +1 -0
- package/dist/core/runner/checkpoint-scope.js +4 -2
- package/dist/core/runner/compact-session.js +1 -1
- package/dist/core/runner/construction-doors.js +2 -0
- package/dist/core/runner/cross-boundary-lane.d.ts +8 -1
- package/dist/core/runner/cross-boundary-lane.js +4 -0
- package/dist/core/runner/gate-exit.d.ts +7 -0
- package/dist/core/runner/gate-exit.js +2 -1
- package/dist/core/runner/model-lane-seat.d.ts +3 -0
- package/dist/core/runner/model-lane-seat.js +4 -0
- package/dist/core/runner/person-path-rows.d.ts +6 -0
- package/dist/core/runner/person-path-rows.js +13 -0
- package/dist/core/runner/prepare-config-doors.js +9 -5
- package/dist/core/runner/prepare-gate-stations.d.ts +6 -0
- package/dist/core/runner/prepare-gate-stations.js +3 -1
- package/dist/core/runner/prepare-hands-readface.js +3 -2
- package/dist/core/runner/prepare-offload-wrappers.js +1 -1
- package/dist/core/runner/prepare-task.js +6 -3
- package/dist/core/runner/prepare-wiring-manifest.js +3 -4
- package/dist/core/runner/resume-policy-outcome.js +5 -2
- package/dist/core/runner/role-seat-defaulted.d.ts +3 -3
- package/dist/core/runner/role-seat-defaulted.js +1 -1
- package/dist/core/runner/rule-store-unreadable-notice.d.ts +1 -1
- package/dist/core/runner/rule-store-unreadable-notice.js +3 -3
- package/dist/core/runner/run-harness-handlers.js +1 -1
- package/dist/core/runner/run-leg.js +2 -2
- package/dist/core/runner/shell-env-withheld.d.ts +3 -2
- package/dist/core/runner/shell-env-withheld.js +24 -1
- package/dist/core/runner/sub-agent-deny-lists.js +9 -5
- package/dist/core/runner/tool-end-body.d.ts +1 -1
- package/dist/core/runner/tool-not-executed.d.ts +27 -8
- package/dist/core/runner/tool-not-executed.js +22 -11
- package/dist/core/runner/write-protection-station.d.ts +1 -1
- package/dist/core/runner/write-protection-station.js +1 -1
- package/dist/core/runner-deps.d.ts +4 -0
- package/dist/core/secret-env.d.ts +8 -0
- package/dist/core/secret-env.js +5 -2
- package/dist/core/shell-read-silence.d.ts +40 -2
- package/dist/core/shell-read-silence.js +23 -4
- package/dist/core/task-event.d.ts +4 -4
- package/dist/core/task-notification.js +6 -1
- package/dist/core/task-registry-agent.d.ts +1 -0
- package/dist/core/task-registry-agent.js +1 -1
- package/dist/core/task-registry.d.ts +1 -0
- package/dist/core/task-registry.js +4 -3
- package/dist/core/task-result.d.ts +5 -3
- package/dist/core/task-spec-members.js +8 -0
- package/dist/core/tool-gate-phase.d.ts +6 -3
- package/dist/core/tool-gate-phase.js +1 -0
- package/dist/core/tool-mount-facts.d.ts +7 -3
- package/dist/core/tool-mount-facts.js +6 -2
- package/dist/core/tool-mount-plan.d.ts +1 -1
- package/dist/core/tool-mount-plan.js +4 -3
- package/dist/core/tool-result-store.d.ts +37 -1
- package/dist/core/tool-result-store.js +168 -23
- package/dist/core/trace.d.ts +3 -3
- package/dist/engine/execution-env/node-execution-env.d.ts +75 -1
- package/dist/engine/execution-env/node-execution-env.js +225 -13
- package/dist/engine/harness/types.d.ts +25 -0
- package/dist/engine/llm/types.d.ts +8 -0
- package/dist/engine/llm/validation.d.ts +8 -1
- package/dist/engine/llm/validation.js +31 -2
- package/dist/host-env.d.ts +10 -0
- package/dist/host-env.js +1 -0
- package/dist/index.d.ts +10 -2
- package/dist/index.js +9 -2
- package/dist/internal/harness-types.d.ts +1 -1
- package/dist/orchestration/goal.js +1 -1
- package/dist/orchestration/workflow-primitives.js +10 -1
- package/dist/orchestration/workflow-script-runner.d.ts +2 -2
- package/dist/orchestration/workflow.d.ts +1 -1
- package/dist/orchestration/workflow.js +2 -2
- package/dist/shell/lex.d.ts +2 -2
- package/dist/shell/lex.js +1 -1
- package/dist/tools/fs/bash-model-shell.d.ts +23 -0
- package/dist/tools/fs/bash-model-shell.js +25 -0
- package/dist/tools/fs/bash-readonly-classifier.d.ts +6 -0
- package/dist/tools/fs/bash-readonly-classifier.js +3 -0
- package/dist/tools/fs/fs-bash.js +13 -11
- package/dist/tools/fs/shell-read-argv.js +1 -0
- package/dist/tools/fs/shell-read-check.js +39 -9
- package/dist/tools/fs/shell-read-plan.d.ts +2 -3
- package/dist/tools/fs/shell-read-plan.js +8 -5
- package/dist/tools/fs/shell-read-word.d.ts +8 -0
- package/dist/tools/fs/shell-read-word.js +13 -4
- package/dist/tools/monitor.js +12 -8
- package/dist/tools/scheduler-tools.d.ts +1 -0
- package/dist/tools/scheduler-tools.js +5 -2
- package/package.json +3 -2
- package/test/export-surface.snapshot.json +62 -3
- package/wire-changes/answers/core-stores-sql@7.74.0.json +7 -0
- package/wire-changes/answers/core@7.74.0.json +68 -0
- package/wire-changes/answers/mods-kernel@7.74.0.json +21 -0
- package/wire-changes/answers/primitives@7.74.0.json +7 -0
- package/wire-changes/answers/wiki-gate@7.74.0.json +8 -0
- package/wire-changes/core-stores-sql@7.74.0.json +143 -0
- package/wire-changes/core@7.74.0.json +2210 -0
- package/wire-changes/mods-kernel@7.74.0.json +421 -0
- package/wire-changes/primitives@7.74.0.json +174 -0
- package/wire-changes/wiki-gate@7.74.0.json +145 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,249 @@
|
|
|
1
|
+
## 7.74.0 — 2026-11-28
|
|
2
|
+
|
|
3
|
+
Known limits (`docs/KNOWN-LIMITS.md`), against 7.73.0: 22 rows added, 2 retired, 9 rewritten — each named in its section below; the ones no section names: added `KL-1914-a`, `KL-4504-a`, `KL-4127-a`, `KL-5273-a`, `KL-R18-a`; retired `KL-971-a`; rewritten `KL-1935-b`, `KL-4050-a`, `KL-4747-a`, `KL-4698-a`.
|
|
4
|
+
|
|
5
|
+
### Engine-awaited host `ToolResultStore.put` writes in tool-call offload, background long reports, and command records wait at most 10 seconds (behavior change: yes, below; hard-breaking: none; closed sets: none; exports: none; wire: none)
|
|
6
|
+
|
|
7
|
+
- **Rule.** When the engine awaits a host `ToolResultStore.put` write in tool-call offload (content body and `details` strings), a background task's long completion report (`completionResultField`), or a background command's missing/incomplete-file record (`commandRecordSink`), it waits at most `OFFLOAD_PUT_WAIT_BOUND_MS` (10 000 ms) via one shared internal wait (`waitForOffloadPuts`). At the bound each site answers its existing unconfirmed arm without announcing a ref or claiming write failure: tool-call body returns the original result as is; each unsettled `details` member renders ref-free (`render(false)`) while settled siblings keep their refs, sharing one 10 s deadline per tool call from its first wait; a write not yet started when the call's deadline has passed is not started (that site answers its existing unconfirmed arm directly); a background long report returns the existing `unconfirmed` truncation line and never calls `record` afterwards; a command record emits its frame on the existing `ref === undefined` arm and a late settlement neither emits a second frame nor records a handle. On a tool call, an abort signal ends the wait at once. Every write already in flight when abandoned at the bound or on cancel keeps running in the background with a rejection handler attached (late rejections never raise `unhandledRejection` and are reported nowhere; late settlements never mutate answered results). Tool-call offload emits `tool_result.offload_put_unsettled` at most once per tool call covering its body and `details` writes pending at the bound (`detail: { refs, sessionId, boundMs, occurrenceId }`, never on cancel); the two background places emit no notice code. The contract sentence of `tool_result.offload_put_unsettled` in `engine-notice.ts` is widened accordingly (once per request batch, or once per tool call covering its body and `details` writes pending at the bound; audience, attention level, and minter unchanged).
|
|
8
|
+
- **Behavior change.** A host `ToolResultStore` whose `put` never settles (or takes longer than 10 s) no longer hangs tool calls with oversized results/`details`, background long-report completion frames, or command-record terminal frames. Writes that settle within 10 s and immediate store rejections behave identically to before; unawaited short background reports keep their unbounded background write.
|
|
9
|
+
- **Hard-breaking: none.** No public type change, no root export change, no new notice code, and no new closed-set member.
|
|
10
|
+
- **Consumers.** A probe that pins "a tool call waits as long as the store is slow" or "a long report's frame always carries a reference" goes red when the store is slower than 10 s.
|
|
11
|
+
- **Not carried.**
|
|
12
|
+
1. When the host store never settles, a request that exceeds the aggregate tool-result budget (`tool-result-budget.ts`) or enables stale-result pointer replacement (`compaction-call-options.ts`) still hangs, and neither cancellation nor a wall-clock timeout ends that wait (neither site takes a signal, and `transformContext` is awaited bare); the earlier 7.73.0 note that the wall clock ends that wait holds only for the 7.73.0 cleared-batch flush wait.
|
|
13
|
+
2. A tool call carrying an image or document over the pass-through size limit still hangs when the host store never settles (binary retention in `image-admission.ts` and the binary blocks of `mcp.ts`).
|
|
14
|
+
3. Background long reports and command records emit no notice code at the 10 s bound; operators see only the frame's unconfirmed wording.
|
|
15
|
+
- **Pins.** `test/f12w1-r18-host-store-wait.test.ts` (cells 1, 2, 3, 4, 4b, 5, 6, 7, 8 — real `Runner` for tool-call body and cancel, `prepareOffloadWrappers` for shared `details`+body deadline, per-member sibling preservation, no post-expiry body put, exact pending `refs`, and healthy-store body write/ref, `completionResultField` and `TaskRegistry` command-record sink, plus 2 s healthy guard with exact literal text comparisons, 15 s short-report guard, and immediate/late-rejection guard; verified with mutations recorded in the review record, not in the tree).
|
|
16
|
+
|
|
17
|
+
### A stored `toolResult` row of a call that never ran carries the gate verdict its `tool_end` frame carried as `details.gate` (#5267; behavior change: additive on never-ran rows and tool-written `details.gate` is dropped on newly written rows, below; hard-breaking: one, for tool authors, below; closed sets: none; exports: none — `GateOutcome` is already exported; wire: new optional member `ToolResultMessage.details.gate?: GateOutcome`)
|
|
18
|
+
|
|
19
|
+
- **Rule.** The end projection (`emitSettled`, `src/core/runner/tool-end-body.ts`) already carries the frame's `gate` on `SettledOccurrence`; the row helpers in `src/core/runner/tool-not-executed.ts` (`rowDetailsOf`, `withRowNotExecuted`, `stampRowNotExecuted`) take that settlement and write `details.gate` as a structural copy (`structuredClone`) of the frame's `GateOutcome` on the row the leg itself writes when `details.notExecuted === true` and the frame carried `gate`. No second place computes a gate for the row, and the stored object never aliases the frame's object.
|
|
20
|
+
- **New optional member.** `ToolResultMessage.details.gate?: GateOutcome`. Present on the row the leg itself writes for a call that never ran (`details.notExecuted === true`) when that call's `tool_end` frame carried `gate` (value-for-value equal to `tool_end.gate`). `details.gate` says what the gate decided, not why the call did not run — a never-ran row whose gate allowed the call was stopped after the gate (the frame's own fields say by what). Absent on calls that ran, on never-ran calls whose frame carried no `gate` (e.g. a batch-halted sibling), and on rows written by recovery (crash reconciliation, or terminal adoption after the leg's own write failed), which carry `notExecuted` without `gate` — a reader treats absence as "not recorded", never as "no gate judged it".
|
|
21
|
+
- **Behavior change.** Additive on rows the leg writes for calls that never ran. From this version the engine drops a tool-written `details.gate` (alongside `details.notExecuted`) when it writes a row (including on calls that ran) — a tool that used a `gate` key in its `details` loses that key on newly written rows while its other `details` keys stay intact; rows already stored by earlier versions are not rewritten, and replay keeps old rows as stored (so an older stored row may still hold a tool-written `details.gate`).
|
|
22
|
+
- **Hard-breaking (one, for tool authors).** A tool (a host's own, an MCP bridge's, a mod's) whose result `details` carries a key named `gate` loses that key on every row written from this version, a call that ran included; its other keys stay, except a tool-written `notExecuted`, the engine's key, which was dropped or replaced before this version too (measured: a tool that ran returning `details: { gate: "west", n: 1 }` is stored `{ gate: "west", n: 1 }` on 7.73.0 and `{ n: 1 }` here). A host that reads its own tool's `details.gate` back from a session answers differently across the upgrade, and a row this version writes for a call that never ran carries the engine's `GateOutcome` under that name. Rename the tool's key. **Consumers:** a probe or test that pins a refused call's stored `details` as strictly `{ notExecuted: true }` goes red and must allow `gate` beside it; @server, @client-core and @cli, where a host tool or a transcript reader reads `details.gate`.
|
|
23
|
+
- **Pins.** `test/backlog5267-stored-row-gate.test.ts` (person refusal, policy deny, approved-then-hook-veto, ran-call guard live and resumed with row-existence check, tool-written `gate` + `notExecuted` stripped live and resumed, never-ran `gate.batch_halted` sibling without `gate`, structural-copy non-aliasing check, and post-gate schema-invalid refusal storing the allowing gate); `test/backlog1831-not-executed.test.ts` and `test/backlog2817-loop-refusal-not-executed.test.ts` stay green untouched.
|
|
24
|
+
|
|
25
|
+
### One exported pure judge answers which header carries an Anthropic API key and which `anthropic-beta` the outgoing credential asks for: `anthropicCredentialHeadersOf` (behavior change: none; hard-breaking: none; closed sets: none; exports: +`anthropicCredentialHeadersOf`, type `AnthropicCredentialHeaders` (additive); wire: none)
|
|
26
|
+
|
|
27
|
+
- **Rule.** `anthropicCredentialHeadersOf({ apiKey?, headers? })` answers `{ key?: { header: "authorization" | "x-api-key", value: string }, beta?: string }` using the same two rules (`anthropicKeyHeaderOf` and `credentialBetaOf`, over `BEARER_CREDENTIAL_BETAS`) that `createAnthropicBrain` applies to its own request, over the same pair the adapter reads: first the route law's two readings of blank, shared with the adapter's request path rather than copied (`keyCarriedBy`: a key that is blank — the empty string or white space only — is no key; `dropBlankCredentialHeaders`: a credential header whose value is blank, `Authorization: ""`, is dropped from the copy of `headers` and holds no seat), then the two rules: `key` is present when `apiKey` is a string that is not blank (`authorization` as `Bearer <apiKey>` when the key opens with a row head of `BEARER_CREDENTIAL_BETAS` (`sk-ant-oat`) and `headers` has no `authorization` entry in any letter case, else `x-api-key` carrying `<apiKey>`); `beta` is the row's `anthropic-beta` (`oauth-2025-04-20`) read on the headers as they would go out (a null-prototype shallow copy of `headers` without its blank credential headers, with `key` written into its header, replacing any spelling of that header name) when exactly one header folds to `authorization`, its HTTP-trimmed value has scheme `Bearer` (any letter case) and its credentials open with a row's head (letter case as written). The head is written into the value by the provider that minted it; no header name, source or host word is read beside it. For plain data inputs (own enumerable data properties, header values that are strings) it performs no I/O, reads no environment, does not mutate its input and does not throw; `input.apiKey` and `input.headers` are read once each, a header value that is not a string is copied as it is (the blank-credential reading does not judge it), an own `__proto__` member of `headers` is copied as a plain member without invoking a setter (a bag whose own `__proto__` member holds an object is outside the agreement with the adapter, whose merge assigns it through the prototype setter), `Proxy-Authorization` is not read, the judge does not send requests or validate the key, and `key.value` contains the credential itself — do not log the result.
|
|
28
|
+
- **New export.** `anthropicCredentialHeadersOf` (function) and `AnthropicCredentialHeaders` (interface) from the package root (`src/index.ts`) and `src/brain/anthropic.ts`, additive (exported for a host that builds its own direct request to the same provider).
|
|
29
|
+
- **Behavior change: none from this export** (against 7.73.0 the adapter's request building DID change in this release — a bearer-form key now rides `Authorization` with its `anthropic-beta`, described in the OAuth-bearer section below; this export adds nothing to that: the adapter reads the same two rules that section introduces, and the export answers with them; the one internal move is the route law's loop that drops blank credential headers, which became the named function `dropBlankCredentialHeaders` in `src/brain/route-adjudicator.ts`, not a package-root export, read by `applyRouteCredentialHeaders` and by the judge).
|
|
30
|
+
- **Hard-breaking: none.** No removed export, no changed signature, no closed-set or wire change.
|
|
31
|
+
- **Pins.** `test/model-hop-credential-headers-judge.test.ts` (root export, 10-case table, boxed `Authorization` and own-`__proto__` literal base-adapter parity rows, numeric `Authorization` rule pin, `Proxy-Authorization` Bearer negative row, single-read and input immutability, and eight rows that feed one (key, header bag) pair to the judge and to the real adapter request path and compare the judge's key header, key value and beta with the wire: blank `Authorization`, blank `X-Api-Key`, white-space-only key); `test/model-hop-oauth-bearer.test.ts`, `test/model-hop-oauth-capability.test.ts`, `test/model-hop-oauth-strict-refusal.test.ts` (unchanged); `test/export-surface.snapshot.json` (registers the two new names).
|
|
32
|
+
|
|
33
|
+
### Model-written shell text runs on a bash the execution environment declared and asked: `ExecutionEnv.modelShell`; an environment's own start for model text never falls back to `sh` (a host's override that hands the call on to another environment gets that environment's own start, refused where it has only `sh`; options handed over without the start get the ordinary selection: `KL-1131-e`) (#1131; behavior change: yes, below; hard-breaking: six, below, open to veto @server @cli @client-core @test; closed sets: `EngineNoticeCode` (`ENGINE_NOTICE_CODES`) +2 `config.model_shell_unmounted`, `config.shell_state_env_dropped`, `ToolMountFact` (`TOOL_MOUNT_FACTS`) +1 `env.modelShell`; exports: +`SHELL_STATE_ENV` `shellStateEnvRowOf` `SHELL_KIND_QUESTION` `SHELL_KIND_QUESTION_OPTIONS` `readShellKindAnswer` `hasModelShell`, types `ExecutionEnvModelShell` `ShellStateEnvRow` `ShellStateInherited` `ShellKindAnswer` `DroppedShellState`; wire: `ExecutionEnv.modelShell?`, `ExecutionEnv.modelShellDropped?`)
|
|
34
|
+
|
|
35
|
+
- **Rule.** Bash (foreground and read-only), background commands and Monitor hand the model's text, byte for byte as before, to `ExecutionEnv.modelShell` (`exec`, `spawnBackground`, `ready`), never to `ExecutionEnv.exec` / `spawnBackground`. The member — the method group — is received once per environment object: the first read that answers an object is kept, and every reading, statement and start on that environment uses that group; a getter on the environment that would answer another group later (after the first was asked) is not read again. What is kept is the group, not its members: its `exec` / `spawnBackground` are read off it at each start and its `ready` at each leg's reading, so a group whose members are getters can still answer differently from one read to the next. The leg asks the environment's own group: a `NodeExecutionEnv` subclass whose override hands the start on to another environment runs it on that environment's own bash, which the leg did not ask (below). A leg reads it at assembly (`ready` bounded at 5 s): absent ⇒ undeclared; `ready` absent or reporting a bash of 3.2 or later ⇒ mounted; reporting zsh, a bash below 3.2 or a version that does not read, no shell kind, failing, throwing or not settling ⇒ unavailable with its cause. Only a mounted reading offers the shell tools (mount fact `env.modelShell` on the `bash`, `bash-readonly` and background rows; the background face also needs `modelShell.spawnBackground`). A tool a host mounts directly on an environment without the member refuses before anything starts: "this environment does not start commands on bash; no command can run here". The static statement (`describeStaticWiring(...).toolPlan`) reads the same declaration before anything is asked: a start with no `ready` is mounted, an absent or unusable one is not, and one whose `ready` the leg still asks (`NodeExecutionEnv`'s) is not stated — Bash, Monitor and the rows that follow from a background command read `conditional` on `env.modelShell`, where the line head said `mounted` and the leg then left them out. Against 7.73.0 this is a change on every `NodeExecutionEnv`, the default one on a machine with bash included (measured on the default environment of a machine with bash: Bash, Monitor, TaskStop, SendMessage, AgentTranscript and ListAgents were `mounted` in the static statement and are `conditional` (`when: ["env.modelShell"]`) now; mounted names 19 on 7.73.0, 13 here); the leg offers each command tool by its own row's conditions. A host that lists the static statement's `mounted` names (a capability preview in @server, @cli or @client-core) sees those six fewer on the default plan — in the static list (the plan of a freshly started top-level task), a plan where a workflow or a retained background agent mounts the four task-control tools (`TaskStop`, `SendMessage`, `AgentTranscript`, `ListAgents`), or where a statically established peer lane mounts `SendMessage` and `ListAgents`, keeps those tools `mounted` (a parent notification keeps `SendMessage` only when a child leg is actually prepared — that is a run-time reading, not part of the static list); `@server`'s reading of the plan's `executionEnv` and store cells does not move.
|
|
36
|
+
- **`NodeExecutionEnv.modelShell`.** The candidates, in order — the host's `shellPath` alone, else win32 Git Bash, else `/bin/bash`, then `bash` on the child's PATH; never `sh`, and no zsh is searched for — each fixed as one absolute program and asked (`[path, "-f", "-p", "-c", SHELL_KIND_QUESTION]`, five seconds, a fixed least environment: the host process's own `PATH`, `HOME`, `LANG`, `LC_*` and nothing else); the first that answers a bash is taken. `bash M.N` (3.2 or later, not in POSIX mode) is taken; `zsh M.N[.P]` is recognized and not taken; anything else is `shell_unavailable` naming each candidate and why. `ready` answers `{ shell: "bash", version }`. Starts are `[path, "-c", script]`. `exec` (the engine's own commands) and `getShellConfig` are unchanged; a call whose options refuse the read of the start's symbol (a host's strict Proxy) is an ordinary call and starts as on 7.73.0, except that the read itself is new: a getter or trap for that symbol runs once (with whatever it does before it throws). What the search found is kept by three readings: a candidate answered a bash ⇒ kept for the environment's life; candidates answered no (not a bash, a bash below 3.2, a zsh) or there was nothing to ask (no such path; on the PATH search a candidate without execute permission, or under a directory that cannot be entered, counts as not there) ⇒ kept, so a bash installed or made executable later is not seen by that environment object; a candidate was asked and gave no answer (it could not be started, timed out or was ended by a signal) and no bash was found ⇒ not kept: the next leg's reading asks again, and each such leg's reading waits up to its 5 s bound.
|
|
37
|
+
- **Shell state.** `shellEnv` and a call's `env` no longer carry shell state into the model's shell on an environment's own start (options a host's override hands over without the start get the ordinary composition, configured `BASH_ENV` included, as on 7.73.0: `KL-1131-e`): every name of `SHELL_STATE_ENV` (`SHELLOPTS`, `BASHOPTS`, `BASH_ENV`, `ENV`, `BASH_COMPAT`, `POSIXLY_CORRECT`, `POSIX_PEDANTIC`, `PS4`, `BASH_FUNC_*`, a value starting `() {`) from configuration is dropped, and the host process's own value of a name configuration set or cleared does not reach the child either; of the host process's own, `SHELLOPTS`, `BASHOPTS`, `POSIXLY_CORRECT` and `POSIX_PEDANTIC` are dropped and a relative `BASH_ENV` / `ENV` is dropped. What an environment's own starts dropped is recorded by that environment — one entry per name and where it came from (configured or inherited), so one name can stand twice; the first 32 entries, past which only a mark that there were more is set — and told as each call ends, each entry once per run (`config.shell_state_env_dropped`, names only): a later call that adds an entry tells again, a name past the 32 is not told, and on an environment several sessions share the record is the environment's, so a session can be told a name another session's start dropped. A start handed on to another environment is that environment's, recorded there, and the run, which reads the outer one, does not tell it (`KL-1131-e`).
|
|
38
|
+
- **New closed-set members.** `ToolMountFact` (the `TOOL_MOUNT_FACTS` set) gains `env.modelShell`; `EngineNoticeCode` (the `ENGINE_NOTICE_CODES` set) gains `config.model_shell_unmounted` (once per leg with hands on an I/O environment and no mounted start; `detail: { reason, cause? }`) and `config.shell_state_env_dropped` (`detail: { keys }`). Breaking for a reader exhaustive over either set.
|
|
39
|
+
- BREAKING (behaviour): an execution environment that does not declare `ExecutionEnv.modelShell` no longer offers Bash, Monitor or background commands; each leg reports `config.model_shell_unmounted` once. Declare the member (a bash 3.2 or later the environment asked with `SHELL_KIND_QUESTION`), or forward `NodeExecutionEnv`'s. An environment's own start never falls back to `sh` (a host's override that hands the call on is `KL-1131-e`).
|
|
40
|
+
- BREAKING (behaviour): a host that points the shell at zsh, or a machine with zsh and no bash, has no command-line tools in this version (the notice says so); starting model text on zsh is planned for 7.75.0. `ready` already reports `{ shell: "bash" | "zsh", version }` so that version adds no member.
|
|
41
|
+
- BREAKING (behaviour): a machine with `sh` and no bash (Alpine, busybox images), and a host whose `shellPath` names `sh` (dash, or macOS's `/bin/sh`, a bash in POSIX mode), has no command-line tools in this version: 7.73.0 ran the model's commands on that `sh` (measured: `shellPath: "/bin/sh"` on Linux, `shell=/bin/sh` on 7.73.0; no Bash and `config.model_shell_unmounted` with "/bin/sh gave no answer to the shell-kind question (it exited with status 127)" here). Install a bash, or point `shellPath` at one.
|
|
42
|
+
- BREAKING (behaviour): a `NodeExecutionEnv` subclass whose `exec` / `spawnBackground` override hands the call on to another environment whose own shell is no bash (an `sh`). The leg asked the outer environment, whose bash answered, so the leg offers the shell tools and gives no `config.model_shell_unmounted`; every such call is then refused, nothing started (`command did not run: No bash (3.2 or later, not in POSIX mode) to start commands on: /bin/sh gave no answer …` — the refusal names the inner environment's program, not the mismatch); 7.73.0 ran the call on that `sh` (measured: an outer environment with bash forwarding to one whose `shellPath` is `/bin/sh` — Bash offered, each call refused here; run on `/bin/sh` on 7.73.0). Give the inner environment a bash, or forward `modelShell` from the environment that runs the calls (`KL-1131-e`). Saying the mismatch to the operator would need a notice code of its own (`config.model_shell_unmounted` says the tools are not offered), a new closed-set word, so this version does not.
|
|
43
|
+
- On each of the first three (not the fourth: there the outer environment's reading mounts the background face, so the four stay offered), a leg whose one source of a task that outlives its call was a background command (no workflow tool, no background agent, no parent or peer lane) also no longer offers `TaskStop`, `SendMessage`, `AgentTranscript` or `ListAgents`: they act on such tasks, and their row reads whether the leg can start one (measured on the same `/bin/sh` environment: 7.73.0 offered all four, this version none). A leg with a workflow tool or a background agent keeps them; `SendMessage` stays with a parent or peer lane, `ListAgents` with a peer lane.
|
|
44
|
+
- **Hard-breaking (closed set).** `EngineNoticeCode` (the `ENGINE_NOTICE_CODES` set) gains `config.model_shell_unmounted` and `config.shell_state_env_dropped`; breaking for a reader that is exhaustive over the set. The table typed over the set gains both rows alike: `NOTICE_MINTER` (`Readonly<Record<EngineNoticeCode, NoticeMinter>>`; both `engine`, and the audience and attention tables gain theirs): a host value typed `typeof NOTICE_MINTER` written to 7.73.0's table fails to compile until it adds both rows; reading the table still compiles.
|
|
45
|
+
- **Hard-breaking (closed set).** `ToolMountFact` (the `TOOL_MOUNT_FACTS` set) gains `env.modelShell`; breaking for a reader that is exhaustive over the set. A tool plan's mount condition reads the set: `ToolMountCond`'s `fact` gains `env.modelShell` alike, so a plan held as its 7.73.0 type, or a reader exhaustive over a condition's `fact`, fails to compile until it places it.
|
|
46
|
+
- **Who needs it.** Everyone whose permissions rest on the read station: it reads a command by bash's grammar and vouches for it, and the text could reach `sh`, a host-given zsh, or a bash whose reading configuration changed (`BASH_ENV`, exported functions, `SHELLOPTS`, `BASHOPTS`, `POSIXLY_CORRECT`) — reads and a write outside the root with no question, measured on the 7.72.0 line.
|
|
47
|
+
- **Who is harmed.** A host adapter without the member (remote lanes, device lanes, custom environments) loses the shell tools until it declares one; a zsh-only machine or a host shell set to zsh / `sh` loses them in this version; a host whose override forwards the start to an environment with only `sh` keeps the tools offered and has every call refused; a host that configured shell state through `shellEnv` loses it on model starts.
|
|
48
|
+
- **What compensates.** One notice per leg says why and how to declare the member; `NodeExecutionEnv`'s member can be forwarded whole; the question, its options, its reader and the shell-state table are root exports a host's own start reuses; host process state that passes is listed in `KL-1131-c`.
|
|
49
|
+
- **A late declaration (#4437, #1768).** On a host whose own-credential declaration names an entry of an environment's `inheritEnv` after the environment was built, the model used to be offered Bash and read the refusal at every call; now the leg reads its start, the reading is refused with the same sentence, the leg offers no command-line tools, and the sentence (with its way out) reaches the operator as the cause of `config.model_shell_unmounted`. Refusals of the environment's other children are unchanged.
|
|
50
|
+
- **Subclasses of `NodeExecutionEnv`.** Its member's starts end in `this.exec` / `this.spawnBackground`, so an override of either (one that routes commands into isolation) still sees every start for model text; the base method its `super` call reaches starts the asked bash with the start's environment. An override that hands the call on to another environment's method gets that environment's own start — its asked bash and its `shellEnv` — never the composition of the environment it was handed from (measured: an `exec` override forwarding to another environment ran the model's command with the first environment's `shellEnv` on the line head; 7.73.0 and this version run it with the second's, as the engine's own commands always were). The child's environment is composed as the child starts, so a credential declared while the question runs does not reach it; the question is asked in its fixed least environment, never with `shellEnv` or an earlier snapshot. A resumed leg reads its start after the workspace is restored.
|
|
51
|
+
- **Wrappers.** An environment made by `Object.create(env)` keeps the member; a wrapper that copies members one by one must forward `modelShell` whole or not at all.
|
|
52
|
+
- **Known limits.** `KL-1131-a` (a candidate reports its own identity), `KL-1131-b` (bash only in this version), `KL-1131-c` (the host process's own `BASH_ENV` / exported functions still pass), `KL-1131-d` (a start that fails after assembly has used its approval; a program replaced at the asked path runs the replacement), `KL-1131-e` (a start forwarded to an environment with only `sh`: offered, then refused); `KL-shell-dialect-b` is closed; `KL-4862-b` and the `sh` paragraph of `KL-shell-dialect-a` are rewritten.
|
|
53
|
+
- **Pins.** `test/backlog1131-model-shell-reading.test.ts`, `-node-env.test.ts`, `-registers.test.ts`, `-tools.test.ts`, `-assembly.test.ts` (readings d – m on the real Runner); `test/rel7740-a-static-model-shell.test.ts` (the statement and the leg over one declaration), `test/rel7740-g-start-received-once.test.ts` (the asked start runs, real Runner), `test/rel7740-f-shell-unanswered-not-kept.test.ts` (no answer is not kept, an answer is), `test/rel7740-l-forwarded-start.test.ts` (a start handed on to another environment: whose variables, which program — `$BASH` names the inner environment's bash — and the `sh` arm refused, nothing run), `test/rel7740-r7-options-read-fails.test.ts` (options that refuse the symbol read: an ordinary call, as on 7.73.0); re-pinned for the static reading: `test/backlog1131-model-shell-registers.test.ts` and `-assembly.test.ts` (a start with a `ready` is not stated before it is asked), `test/backlog3802-static-tool-plan.test.ts` G1 and `test/backlog2411-static-facts.test.ts` (a member conditional only on `env.modelShell` is the leg's), and the two prepare-phase harnesses (`test/prepare-task-phase-pins.test.ts`, `test/backlog1293b-person-path-rows.test.ts`) hand the start's reading in as prepare does.
|
|
54
|
+
|
|
55
|
+
### The read station no longer vouches for a read command whose word holds an unquoted bracket pattern (#1131, the bracket half; behavior change: a narrowing, below; hard-breaking: none; closed sets: none; exports: `ReadCandidate` gains the optional member `bracket` (additive); wire: none)
|
|
56
|
+
|
|
57
|
+
- **Rule.** The read plan reports on each candidate whether the shell matches its word as a pattern holding an unquoted `[` with an unquoted `]` after it (`ReadCandidate.bracket`): written in the word (a leading input redirection's target too, assignment-shaped or not: `< X=.[A-Z]* cat` — a target is never an assignment the shell strips, and the lexer now forms its pattern there as it does for every other target), or in the pattern a value hands over — an unquoted expansion's value (`X='.[A-Z]*'; cat $X`), a name a `for` list bound to a pattern's matches, read through a quoted reference too (`for f in .[A-Z]*; do cat "$f"; done`; a name `set --` or an array binds that way was already asked before and still is). Where the station's final answer is a vouch and a read or write candidate carries it, the answer is the one the table already gives a word the station cannot read (`unestablishable`): the full shell's ordinary question, refused on the read-only face and on the re-judge after an edit. A bracket quoted by `'…'`, `"…"`, `$'…'` or a backslash (also beside an unquoted expansion or `*`: `X=q; cat 'a[1]'$X*`), a quoted expansion (`cat "$X"`), a file name inside a program's own script (`sed 'r a[1]' x`) and an assignment's value (a launcher's `env X=.[A-Z]* …` included: its matches become the environment, not a read) do not count. The question follows the read face's guard: on the open read face with no deny or ask row there is no question, as for any word the station cannot read (a write target is guarded apart from this, by the write guards, as before). Every other answer (a refusal, a question, the station's silence, unread rule partitions on the mounted station) is unchanged; nothing is read again and no candidate is added. Both entries, the mounted station and `judgeShellRead`.
|
|
58
|
+
- **Why.** The station lists a bracket's names by code point; the shell matches them by the locale's collation, a name's byte width and its own options. Apple's bash 3.2 under UTF-8 hands `cat .[A-Z]*` the file `.env`, bash 5 does once `globasciiranges` is off, and `cat secrets[[.period.]]json` reads `secrets.json` on both — the station vouched for all three, so a deny rule naming the file was not met and the default mode asked nothing.
|
|
59
|
+
- **Narrowing.** Read commands with a bracket pattern (`ls file[0-9].txt`, `ls *.[ch]`, `cat .[A-Z]*`, in a list, a pipeline, a background start, a substitution, a subshell, a redirection's source or braces alike) now ask once in the default mode where the read face guards something (an allow rule such as `Bash(cat:*)`, or an answerer, clears it) and are refused on the read-only face and on the re-judge.
|
|
60
|
+
- **Forms that now ask too.** `unset arr[0]` (bash matches the unquoted `arr[0]` against file names before `unset` sees it; quote it: `unset 'arr[0]'`). `env a[0]=~/x …` (the word is an argument to `env`, matched as a pattern too). `rm -r x[a]` (a removal whose operand is a pattern). `grep [a-z] x` (an unquoted grep pattern is a pathname pattern the shell matches first; quote it: `grep '[a-z]' x`). `X='!'; cat [$X]` (the brackets are counted as written; the field the shell forms, `[!]`, holds no class and names the file `[!]` — an over-ask, on purpose: reading the formed field instead loses a real class whose members are quoted, `[["x $PWD"]]`).
|
|
61
|
+
- **Known limit (`KL-shell-dialect-c`, rewritten).** A deny rule covers only the names the station lists; once the question is cleared (a permissive mode, an allow rule, a person's yes), a name the shell matches beyond that list is read even if a deny rule names it.
|
|
62
|
+
- **Pins.** `test/backlog1131-bracket-word-not-vouched.test.ts` (the forms on both entries and both seats, the cost cell, the gate cell through the package root and the allow-rule cell, unchanged cells against answers recorded on the base line, real-shell witnesses, the re-judge of an approved edit through the package root, and probe cells of every road to a read and every shape that must not move); `test/backlog4791-two-stations-one-table.test.ts` (one known-limit cell that pinned a bracket glob as vouched); #775's pin `test/backlog775-glob-canonical-recheck.test.ts` (`cat .[!.]*` leaves the list the shell answers: one question) and `test/rb474-glob-read-boundary.test.ts` (`cat [.]hidden-link` on the read-only face: refused as a bracket word, nothing read); the two program-read-model equivalence pins' allowed lists (one class, `1131-candidate-bracket`: every row that moved carries the member, and with it stripped nothing moved); the #4958 read-plan equivalence pin's `test/fixtures/backlog4958-read-plan-equivalence.json` (re-recorded by its own algorithm: 339 rows, all holding a bracket — the plans every face hashes now carry the member; with the member stripped, nothing differs from the record before it).
|
|
63
|
+
|
|
64
|
+
### `SendMessage` and `ListAgents` peer descriptions, receipts, and full-box refusal no longer state when a parked message will be read; the receipt confirms acceptance into the box only (#5286; behavior change: wording of `SendMessage` / `ListAgents` peer descriptions, two peer receipts, and the `queue_full` refusal; hard-breaking: none; closed sets: none; exports: none; wire: none)
|
|
65
|
+
|
|
66
|
+
- **Rule.** The `SendMessage` peer-lane description, its `peer_queued` / `peer_parked_offline` receipts, its `queue_full` refusal ("it drains the box at its next turn"), and the `ListAgents` peer description ("and delivered when it next runs") drop the read/delivery timing claims and state only durable acceptance into the recipient's session box (the concurrent-deletion warning is unchanged).
|
|
67
|
+
- **Pins.** `test/backlog5286-peer-receipt-no-timing-promise.test.ts` (live receipt, offline receipt, `SendMessage` description, concurrent-deletion guard, `ListAgents` description, `queue_full` refusal).
|
|
68
|
+
|
|
69
|
+
### An unserializable workflow result counts as `Infinity` against `maxResultChars` (#2693; behavior change: cyclic, `BigInt`, or throwing-`toJSON` results fail with `workflow.result_too_large` when `maxResultChars` is set; hard-breaking: none; closed sets: none; exports: none; wire: none)
|
|
70
|
+
|
|
71
|
+
- **Rule.** When `maxResultChars` is set, a workflow result whose size cannot be measured (`JSON.stringify` throws) is assigned `size = Number.POSITIVE_INFINITY` instead of `0`, throwing `WorkflowResultTooLargeError` (`workflow.result_too_large`, `workflow result is too large: Infinity chars > max <max>`). Runs without `maxResultChars` are unchanged.
|
|
72
|
+
- **Pins.** `test/backlog2693-result-cap-unmeasurable.test.ts` (cycle, throwing `toJSON`, `BigInt`, plus uncapped and bounded guards).
|
|
73
|
+
|
|
74
|
+
### Workflow script primitive `parallel(thunks, opts?)` forwards its second argument (`{ errors }`) to `ctx.parallel` and rejects non-array `opts.errors` before any thunk runs (#4401; behavior change: `{ errors }` collector passed from workflow scripts now receives failed slot entries, and a non-array `opts.errors` is rejected with `TypeError` before running thunks; hard-breaking: none; closed sets: none; exports: `WorkflowPrimitives.parallel` gains optional `opts?: unknown`; wire: none)
|
|
75
|
+
|
|
76
|
+
- **Rule.** `buildWorkflowPrimitives` treats a non-object `opts` (`null`, primitives, `undefined`) as absent, rejects a present non-array `opts.errors` immediately with `TypeError("parallel: opts.errors must be an array")` before any thunk runs, and otherwise forwards `{ errors }` to `ctx.parallel` so workflow scripts collect `WorkflowFanOutSlotError` entries (`{ index, kind, message }`); omitting `opts` keeps the existing fold-to-null behavior.
|
|
77
|
+
- **Pins.** `test/backlog4401-parallel-errors-option.test.ts`.
|
|
78
|
+
|
|
79
|
+
### `runGoal` hands `doneCheck` the session id the iteration actually ran in (#4522; behavior change: `doneCheck` receives `result.sessionId` rather than the caller's configured `sessionId`; hard-breaking: none; closed sets: none; exports: none; wire: none)
|
|
80
|
+
|
|
81
|
+
- **Rule.** `runGoal` passes `sessionId: result.sessionId` to `spec.doneCheck` (so an empty caller `taskSpec.sessionId: ""` yields the iteration's minted session id).
|
|
82
|
+
- **Pins.** `test/backlog4522-goal-donecheck-session.test.ts`; `test/backlog4510-later-leg-session-entry.test.ts` unchanged.
|
|
83
|
+
|
|
84
|
+
### A call's arguments that run into a limit of the runtime (the stack, a size) are a validation failure of the usual form, not the platform's own sentence (#2187; behavior change: the text of one failure, below; hard-breaking: none; narrowing: none; widening: none; closed sets: none; exports: none; wire: none)
|
|
85
|
+
|
|
86
|
+
- **Rule.** `validateToolArguments` answers a limit of the runtime met while it clones, converts or checks the arguments — a real `RangeError` whose words are the call stack, an invalid array / string / buffer length or a failed buffer allocation (one table, `RUNTIME_LIMIT_PHRASES`) — with `Validation failed for tool "<name>":\n- checking the arguments ran into a limit of this runtime (<the platform's words>); the call was not run\n\nExpected parameter schema:\n<schema>` — the form of every other validation failure. The original rides on `cause` and the structured marks it carried (`details`, `errorKind`) are read from the new error as from the original. It says nothing of why: a deep value overflows the stack, a shallow one whose enumerable getter raises a length error ends the same way (a tool's `prepareArguments` can hand the engine either). Every other error leaves as it was thrown, a `RangeError` that is no limit included (`(1).toFixed(101)`, `new Date(NaN).toISOString()`), and an `Error` merely named `RangeError`; no depth is refused (100 levels validate as before).
|
|
87
|
+
- **Engine words.** No engine gives a machine-readable code for these limits, so the table reads the sentence's opening, as V8 (Node ≥ 20) spells it; the words change with an engine's version, and a sentence not in the table is not read as a limit — its `RangeError` leaves as the platform threw it, as before this change.
|
|
88
|
+
- **Before.** The platform's sentence (`Maximum call stack size exceeded`, `Invalid array length`) left as a bare `RangeError`, and the model read it as the tool result with nothing to say it was the arguments' check.
|
|
89
|
+
- **Readers (read, not inferred).** The dispatch (`agent-loop.ts` `prepareToolCall`, and its re-read of a rewrite) turns any throw of the check into an error tool result carrying the thrown text: that text is the new sentence. The batch partition (`isBatchSafeToolCall`) and the gate's re-read (`readToolCallArguments`, also the resume path in `run-leg.ts`) treat any throw alike (not batch-safe; the value as given), so what they do is unchanged. The rewrite path's own `structuredClone` of a hook's `updatedInput` is outside the check and still throws the platform's sentence.
|
|
90
|
+
- **Pins.** `test/backlog2187-validation-runtime-limit.test.ts` (3000 levels, skipped where the runtime does not overflow there; a shallow getter raising a length `RangeError`, the sentence and the schema text spelled out; the 100-level guard; another class of error as thrown; a Runner turn whose tool's `prepareArguments` hands the getter object; `toFixed(101)`, `new Date(NaN).toISOString()` and an `Error` named `RangeError` as thrown; an engine-raised length limit with the original on `cause`; marks carried; a `RangeError` raised after the clone).
|
|
91
|
+
|
|
92
|
+
### A `waiting` frame's `atTimeout` counts the request the call falls back to: on a tried request, a cut the budget alone would call `fail` is `retry` (#4655; behavior change: the value of one frame form, below; hard-breaking: none; narrowing: none; widening: none; closed sets: none; exports: none; wire: none — no member, key or type changes)
|
|
93
|
+
|
|
94
|
+
- **Rule.** A `waiting` frame's `atTimeout` is the cut's own reading (the first-byte budget at the response headers; the mid-stream tiers at the first and the next token) with one more fact: when the attempt is a tried request — the model's entry does not declare the thinking tier the request carries, so the request tries it (`tryUndeclared`) — and nothing was kept of it, its cut leaves through the fall-back before any budget is read, and the engine tries the request without the keys. A `fail` of the budget reading is then `retry`. One side-effect-free judgment (`forecastOfCut`) is asked by the header wait and the token waits, about a cut of the code the watchdogs mint (one constant, `WATCHDOG_CUT_CODE`, read by the three stalls' mints, the header's fall-back gate and the forecast); a cancel and a refused credential are excluded as the fall-back excludes them. `keep` (text arrived), no frame after the provider's finish frame, and every `retry` are as before; `fallBack` and the cut happen when they did.
|
|
95
|
+
- **What `retry` promises.** That the engine tries again — not that a request is sent: committing the fall-back runs the route's admission again, and it can still refuse (a credential rebound to another origin during the wait, for one). `fail` now reads "nothing more is tried", not only "the budget is spent". `docs/INTEGRATION-CORE.md` (the `atTimeout` row), `docs/TIMEOUTS.md` and the public JSDoc of `atTimeout` (`TaskEvent` status frame) say so; the timeout table's `firstByteRetries: 0` cell no longer promises one request for a call that tries a thinking tier (it sends the request without the keys first).
|
|
96
|
+
- **Before.** With the budget spent (first-byte retries 0; `maxRetries` 0 or the thinking budget used) a tried request's frames said `fail` and a request followed: the frame announced the end of a call that then went on.
|
|
97
|
+
- **Now.** The same frames say `retry`; the request that follows the cut is that retry. The plain request's own frames (after the fall-back, or when nothing was tried) are unchanged, `fail` at the last.
|
|
98
|
+
- **Consumers.** Hosts that render the frame (client-core, the terminal, the server's trace projection) see `retry` where a tried request met a spent budget; nothing else about the frame (members, wait segment, timing) moves.
|
|
99
|
+
- **Pins.** `test/backlog4655-wait-frame-forecast-fallback.test.ts` (headers and first token × budget 0 / left × tried / not tried, a tried request whose text arrived, the provider's finish frame; the red cells on the tree before are the two spent-budget tried ones; and two coupling cells — the first frame says `retry` exactly when a request followed — that hold for any value of the one code source and break when a reader asks another).
|
|
100
|
+
|
|
101
|
+
### The `summarize` line of an unheld role seat says "or the tier default for that role" exactly when that tier default is bound, from the fact the seat's listing reports rather than inferred from its cause (#4814; behavior change: the sentence of one notice, in two forms, below; hard-breaking: none; narrowing: none; widening: none; closed sets: none; exports: none; wire: none)
|
|
102
|
+
|
|
103
|
+
- **Rule.** `UnheldRoleSeat` carries `ownTierBound` — the role's own tier default is bound in the catalog (the tier's entry is there and is a record: its presence is read, as the walk's absent-tier reading reads it, never the model's members), told once where the seat is listed — and `roleDefaultedNotice` says the clause for the `summarize` role when it is true and for no other case. It replaces `ownTierAbsent`, which only this sentence read. The read never refuses and never receives the model: a tier entry that is no record (or a catalog that throws when read) reads as not bound, and the entry's refusal stays with its owners (the catalog's intake at `new Runner`, the walk's own read of the tier default) — so the public `resolveTaskModel` still honours a seat's `select`, the notice phase still delivers its line over such a hand-built catalog, and a model that answers a second read differently (an `id` getter) is selected as before this change.
|
|
104
|
+
- **Before.** The clause was left out only for an absent tier word beside an absent default, so it was said in two cases where the compaction pass has no tier default to take: a deployment that declares no tiers, and a name the catalog does not hold beside tiers that bind nothing at the role's tier or below it.
|
|
105
|
+
- **Now.** In those two cases the line ends `… runs on the conversation's own model.` (before: `… own model (or the tier default for that role, when tiers are declared).`). Every other case reads as before: the clause is said while the default is bound (a name the catalog does not hold, or an absent tier word such as `haiku`, beside a bound `flash`); a seat that names the absent default, or `best` beside a tier of the deployment's own, leaves it out. The code, `detail`, the once-per-session key and the other roles' sentences are unchanged.
|
|
106
|
+
- **Consumers.** A host that matches this notice's sentence sees the two shorter forms. `UnheldRoleSeat` is not exported from any package entry, so nothing compiled against the package changes.
|
|
107
|
+
- **Pins.** `test/backlog4814-summarize-clause-tier-bound.test.ts` (a real Runner per scenario: no tiers declared, a name beside a bound and an absent default, an absent tier word beside a bound default, the role's own absent default, `best`, a non-`summarize` seat; the mint's `ownTierBound` per scenario and per role; and a catalog whose entry under the role's tier word is no model: the public walk, the notice phase and the mint); the clause cells of `test/backlog2614-tier-absent-fallback.test.ts`, `test/backlog4639-user-notice-no-internal-names.test.ts`, `test/backlog4717-notices-second-slice.test.ts` and the type fixture of `test/backlog5303-lineage-new-frame-values.test.ts` follow the new reading.
|
|
108
|
+
- **Docs.** `docs/INTEGRATION-CORE.md` §1.10e, `docs/CLOSED-SETS.md` (`RoleSeatStandInCause`, which now names the notice's entry `reason` instead of the retired code's `detail.reason`) and `docs/wiki/core/models.md` say what the clause is about: the role's other readers (the next-prompt suggestion pass, the consolidation and classifier chains), not compaction, which does not read the seat.
|
|
109
|
+
|
|
110
|
+
### Bad values are refused aloud; an advisory is said once per deployment (f1w3)
|
|
111
|
+
|
|
112
|
+
- config.toolpolicy.unmatched_names is told once per deployment and unmatched set when RunnerDeps.roles is declared (#3070).
|
|
113
|
+
- foldPermissionMode refuses a requested or ceiling word that is no permission mode and a whenUnset word that is no start word (config.permission_mode_invalid, detail.field) (#5136). A leg whose inherited ceiling is not a mode word is refused the same way at its start (before: it ran with no ceiling applied).
|
|
114
|
+
|
|
115
|
+
no-notes: #4312(pins only — PermissionDenied already empty on plan reject and empty question answer)
|
|
116
|
+
|
|
117
|
+
### Pure hook-entry `if`-condition judge `judgeHookCondition` exported on package root and `@sema-agent/core/host-env` (#4994; behavior change: additive; hard-breaking: none; closed sets: new `HOOK_CONDITION_EVENTS`, `HOOK_CONDITION_UNTESTED_REASONS`; exports: root and `./host-env` +`judgeHookCondition`, +`HOOK_CONDITION_EVENTS`, +`HOOK_CONDITION_UNTESTED_REASONS`, +type `HookConditionInput`, +type `HookConditionVerdict`; wire: none)
|
|
118
|
+
|
|
119
|
+
- **Rule.** Adds `judgeHookCondition(input: unknown): HookConditionVerdict` (with frozen closed tables `HOOK_CONDITION_EVENTS` and `HOOK_CONDITION_UNTESTED_REASONS`) to both the package root and `@sema-agent/core/host-env` so a host selecting local settings hooks can evaluate an entry's `if` condition without loading the engine graph. Version 1 first checks that `Object.prototype` and `Array.prototype` currently carry the exact own-key lists captured at module load (catching any key added, removed, or reordered with `untested:invalid_input` for every input), then validates the full structure (outer record and present tool-specific `toolInput` shape) before any answer, and returns a definite `matched` verdict ONLY for three classes: (1) empty condition `""` → `matched` (before the event gate), (2) canonicalized tool names equal (via the reference's four legacy-name rows `Task→Agent`, `KillShell→TaskStop`, `KillBash→TaskStop`, `Brief→SendUserMessage` and `ENGINE_TOOLS` aliases), inside `ENGINE_TOOLS`, not `Monitor`, and no content → `matched`, and (3) `Bash` with `engineOwned: true`, content at most 1 000 characters, a valid `BashInput` (`timeout`, if present, an integer in `0..600000`, and neither `run_in_background` nor `dangerouslyDisableSandbox` present as an own key), and a plain-character strictly flat command matching the reference's `:*` prefix or wildcard pattern → `matched`. A condition with content is judged only when the caller states the tool is the engine's own (engineOwned: true), on a command made of plain characters only, and answers matched or untested — this version does not answer not_matched. Every other case returns a pre-frozen `{ verdict: "untested", reason, detail }` with one of the five reason words (`not_a_tool_event`, `condition_unreadable`, `name_unjudged`, `content_unjudged`, `invalid_input`). Never throws and runs no `RegExp` against inputs.
|
|
120
|
+
- **Plain-data input contract.** `input` and `input.toolInput` should be plain deserialized data (`Object.prototype` or `null` prototype, enumerable own string data properties only; no proxies, functions, getters, symbols, or arrays). Both promises (a definite answer only where the reference would give the same, and no host code run for plain data) hold in a realm whose built-in objects are as loaded; the base-prototype own-key check (R-J) catches a key added, removed, or reordered on `Object.prototype` or `Array.prototype` relative to load, whereas any other modification to built-ins (changed enumerability or descriptor flags, replaced values, changed prototype links such as `Array.prototype`'s own prototype, other built-in prototypes modified) or pre-load pollution is outside the contract (`docs/KNOWN-LIMITS.md` KL-4994-b), and cross-realm exotic objects with `null` prototype (such as a Node `vm` global) are not guaranteed against `Reflect.ownKeys` traps (`KL-4994-a`).
|
|
121
|
+
- **Pins.** `test/backlog4994-hook-condition.test.ts` (153-row vector table `test/backlog4994-hook-condition.vectors.tsv` plus R-A/R-E purity, poisoned-global no-throw, frozen-identity, R-F config-dependent keys, R-G 1 000-char ceiling, R-J unpolluted-realm base-prototype key check, KL-4994-b known-limit pin, H1, H5 real-process light-graph probe, H6 8-name `host-env` parity, H7 single-definition and catalog-successor invariants) and `test/backlog5007-settings-env-base.test.ts` E1 (5 → 8 names).
|
|
122
|
+
|
|
123
|
+
### Mods kernel surface table: 151-name closed set, eleven surface method stations, owner-only `ui.message` / `ui.fault` stations, and contract 13 (ships in 7.74.0; behavior change: yes, below; hard-breaking: two, below; closed sets: `ModEventName` (`MOD_EVENT_TABLE`) +6 (`theme.set`, `theme.clear`, `ui.place`, `ui.cancelNotify`, `prompt.paint`, `decision.ask`); exports: none — `ModStation` gains optional `ownerOnly`, `closed` and `answers`, `ModDispatchOptions` gains optional `owner`, `KERNEL_CONTRACT_VERSION` 12 → 13; wire: version literal `KERNEL_CONTRACT_VERSION 12 -> 13` and `ModEventName` closed set +6)
|
|
124
|
+
|
|
125
|
+
- **Rule.** The kernel's closed event vocabulary (`MOD_EVENT_TABLE`, `src/core/mods/kernel/events.ts`) grows from 145 to 151 names: `theme.set`, `theme.clear`, `ui.place`, and `ui.cancelNotify` join on the `surface` side with `method(true)` stations; `prompt.paint` joins on the `surface` side by name only (no station); `decision.ask` joins on the `engine` side by name only (no station). Seven existing `surface` method rows (`ui.status`, `ui.open`, `ui.close`, `ui.panes`, `ui.view`, `ui.notify`, `ui.blit`) also gain `method(true)` stations, so host-supplied chain bottoms on a surface bus are now reachable through `$`. `ui.message` (pinned `surface`, `component`, `requestId`, `element`, `module`; `data` rewritable; answers may carry `props`) and `ui.fault` (pinned `surface`, `component`, `requestId`, `element`, `module`, `phase`, `reason`; observe-only) gain `skip` / `grace` surface stations marked `ownerOnly: true`: `bus.dispatch` rejects when `options.owner` is absent or empty and restricts delivery (chain handlers, observers, and re-entry frames) to the named plugin only — read off those two rows, `options.owner` read once at the dispatch's door and delivered by that reading (an accessor that answers the name, then nothing, cannot widen delivery to every handler); every other row ignores `options.owner`. Two station columns, read by the dispatch on any row that carries them: `closed` (what a handler hands on keeps the event's own members, none added or dropped — on `ui.message` only `data` changes) and `answers` (the members an answer of a handler's own may carry: `props` on `ui.message`, none on `ui.fault`, which is observed); a breach is the handler's violation, skipped, and what its `next(e)` answered always stands.
|
|
126
|
+
- **Hard-breaking.** (1) `KERNEL_CONTRACT_VERSION` moves from `12` to `13`. Every mod package (`hooks/hooks.json` `"contract"`) and every host or shared library comparing `KERNEL_CONTRACT_VERSION` across `@sema-agent/core` and `@sema-agent/mods-kernel` (including operator-configured deployment packages, whose mismatch refuses server boot) must re-stamp to `13` and upgrade both copies in lockstep; any package still declaring `12` is refused with `config.mods_invalid`. (2) `ModEventName` gains six members (`theme.set`, `theme.clear`, `ui.place`, `ui.cancelNotify`, `prompt.paint`, `decision.ask`), breaking consumers that switch exhaustively or key a total `Record<ModEventName, …>` over it; what is typed over the vocabulary widens alike — the table itself (`MOD_EVENT_TABLE`: a value typed `typeof MOD_EVENT_TABLE` written to 7.73.0's 145 rows fails to compile until it adds the six) and the frames a dispatch is raised under (`ModDispatchOptions`' `frames`, whose handler frame `ModFrame` carries the `event`: a reader exhaustive over a frame's `event` fails to compile until it places the six).
|
|
127
|
+
- **Pins.** `test/mods-r1-surface-table.test.ts` (151-row per-row fixture `test/fixtures/mods-kernel-table-r1.json` pinning `side` and exact `station` shape for every row, `$.theme.set` and all eleven surface methods reaching host-supplied chain bottoms, `ui.message` / `ui.fault` owner-only delivery and missing-owner rejection, pinned-key enforcement, and exact contract 13 pin), `test/mods-kernel-296.test.ts` (`test/fixtures/cc321-mod-events.json`), `test/mods-kernel-wave2.test.ts`, the three restamped fixture packages under `test/fixtures/mods/`, and `test/rel7740-h-owner-read-once.test.ts` (one read of the owner).
|
|
128
|
+
|
|
129
|
+
### A mod package's shape has one reader, in the kernel: bytes in, facts and the module's bytes out, nothing imported; the side is the host's, the path rule is one rule on every platform, a pinned digest is compared before anything is imported (ships in 7.74.0; behavior change: yes, below; hard-breaking: three, below; closed sets: none; exports: `@sema-agent/mods-kernel` +`readModPackage` `MOD_PACKAGE_FILES` and types `ModPackageSource` `ModPackageRead` `ModPackageUnreadMember`; root: `ModPackageHost` gains `expectDigest` and is closed; wire: `ModPackageUnreadKey.file` is `/`-separated on every platform, a `config.mods_invalid` from `loadModPackage` may carry `detail.contract` or `detail.digest`)
|
|
130
|
+
|
|
131
|
+
- **Rule.** `readModPackage({ plugin, hooks, readModule, side, expectDigest? })` (kernel folder, zero dependencies, no import, no `node:*`) is the one reader of the package shape: it takes the two manifests' bytes, a callback that reads the hooks module (asked once, by its path inside the package, `hooks/…`) and the bus the host reads the package for, and hands back `name` and `contract` as stated, `uses` as its two lists (`events`, `calls`), the unread members by their names (a member of `uses` beside the two lists among them, as `uses.<name>`: through `loadModPackage` on the registration's `unread` and as `mods.package_key_unread`, as a file's own unread member is — 7.73.0 handed `uses` back whole), `digest`, `modulePath` and the module's bytes. It compares no contract number: the copy that imports does (`loadModPackage` compares with its own `KERNEL_CONTRACT_VERSION`). `loadModPackage` reads the files from disk for it and imports the bytes it handed back. Its argument is closed.
|
|
132
|
+
- **Path.** `modules[0]` may start with `./`; the rest is `/`-separated segments, none empty, `.` or `..`, none holding `\` or `:`, ending `.mjs` — judged the same on every platform, before anything is opened. The three shipped fixtures (`./register.mjs`) load as they are.
|
|
133
|
+
- **Side.** Every item of `uses.events` and `uses.calls` is expanded on the host's side (`expandOnSide`) at the read: an item the kernel does not know, or that selects only the other side's names, refuses the package; so does a package that selects only names both buses read (`plugin.register`) or none. `loadModPackage` reads for the engine bus.
|
|
134
|
+
- **Digest.** One SHA-256 on the whole chain, the primitives package's: the kernel carries a generated mirror of it (`kernel/hash-mirror.ts`, written by `scripts/gen-kernel-digest.mjs`; `gate:kernel-digest` fails on drift) because the kernel imports nothing outside its folder; `sha256Hex` in the primitives package also accepts bytes; the engine no longer uses `node:crypto` for it, and the value for the same bytes is unchanged. `expectDigest` (on the reader and on `ModPackageHost`): other bytes refuse with `detail.digest { expected, actual }` before a byte of the module is handed out — nothing of them is imported. A match is not admission: it proves the bytes are the pinned ones; which package may run in the process stays the host's decision (a shared deployment is to refuse user- and plugin-supplied packages before reading them, matching digest or not — the server's rule; the reader does not know the deployment's form).
|
|
135
|
+
- **Refusals.** Still `config.mods_invalid`; a contract other than the kernel's carries `detail.contract { stated, kernel }` (`stated` `null` when the package wrote none or no number). A sentence names the module by the member that names it (`hooks/hooks.json: modules[0]`), never by the path the package wrote; an unreadable file is described by the platform's error code, not its sentence. Both manifests are read before either is parsed (a package missing `hooks.json` is told so even when its `plugin.json` is broken).
|
|
136
|
+
- **Hard-breaking.** (1) `ModPackageHost` is closed and is a plain object, received as every engine door receives a host's record: a member other than `tier`, `provenance`, `options`, `expectDigest` (or a host that is not an object) refuses the load (`config.mods_invalid`), and a class instance, a Proxy or an object whose prototype was changed is refused (`config.invalid_argument`) even when its own members are all allowed — a host that passed extra members or a class instance must pass a plain record (the server's boot call passes an object literal of `tier`, `provenance`, `options` only). The kernel reader's argument is closed over all its own keys (a symbol-keyed or non-enumerable extra refuses). (2) Packages refused that loaded before: a module path with a `..` or `.` segment, a `\`, a `:` or an empty segment (`./x/../register.mjs`, `.\register.mjs`); an empty `uses`, a `uses` of `plugin.register` alone, or one naming a surface event, read for the engine (before: loaded, then refused or mounted at admission) — an operator package of either form now refuses server boot. (3) On Windows `ModPackageUnreadKey.file` and the notice's `detail.file` read `.claude-plugin/plugin.json` / `hooks/hooks.json` (before: the platform's separator). A refusal's sentence changed for the module path (`modules names "<path>"` is gone). Named consumers: @server (`deployment-mods.ts` reads `loadModPackage`'s code and sentence; it may read the new `detail`), @client-core (can read packages with the kernel's reader; its kernel range `>=7.54.0` needs an upper bound or a runtime contract read before 7.74.0).
|
|
137
|
+
- **Mixed installs.** A host passing `expectDigest` reads `KERNEL_CONTRACT_VERSION` of the copy that imports first and refuses to load when it is below 13 (a 12 copy took open hosts and would drop the member). Kernel 13 reading a package for core 12: core 12 compares the contract, the package states 13, refused. Operator packages still stating 12 refuse server boot.
|
|
138
|
+
- **Known limits.** No load sandbox in this version: a package whose digest matches, once imported, has the whole engine process (`docs/KNOWN-LIMITS.md` KL-5243-a: what a local confirmation names — the model credentials in the process, a subscription token handed to a local engine through its environment, the login and registry credential stores).
|
|
139
|
+
- **Pins.** `test/rel7740-j-uses-unread-member.test.ts` (a member of `uses` beside the two lists, kernel reader and engine loader), `test/mods-r3-package-reader.test.ts` (K1–K6 kernel reader, H1–H2 sha256 against `node:crypto` and against what 7.71 computed for the same bytes (the algorithm is unchanged; the three shipped fixtures were re-stamped in this release, so their own digests are new values, pinned by F6), E1–E5 engine, F1–F6 each mismatch in a fresh process with no module mark), `test/backlog2104-mods-kernel-publish.test.ts` (the installed package loads no builtin and reads a package from bytes), re-pinned `test/mods-real-e2e.test.ts` D4 D5 D6 D9 D10, `test/backlog4050-sibling-path-reading.test.ts` S2b.
|
|
140
|
+
|
|
141
|
+
### A subscription token on the Anthropic lane: the token's own head decides its seat and the one header its protocol requires; capability word `brain.anthropic_oauth_bearer`; the refuse-write grade knows the token's shape (ships in 7.74.0; behavior change: a widening for a host that hands a subscription token, a narrowing for a memory write that holds one; hard-breaking: `EngineCapability` (the `ENGINE_CAPABILITIES` set) gains `brain.anthropic_oauth_bearer`, and the strict form of `@sema-agent/primitives`' `openai-api-key` row, below; closed sets: `EngineCapability` (`ENGINE_CAPABILITIES`) +1 `brain.anthropic_oauth_bearer`; exports: none; wire: none — no code, no env name, `RequestRoute` unchanged)
|
|
142
|
+
|
|
143
|
+
- **Rule.** A credential whose value opens with `sk-ant-oat` (the head the provider writes into a subscription's OAuth access token) rides on the Anthropic lane as `Authorization: Bearer <value>` when the host put it in the key seat (`apiKey`, per brain or per call) and no header bag filled `Authorization`, or when it put it in an `Authorization` header itself; and a request whose one `Authorization` header is such a Bearer carries `oauth-2025-04-20` in its `anthropic-beta` list. A credential a header bag put in `Authorization` is the host's: beside it the key keeps `x-api-key`, so the documented dual-auth shape (a key beside a gateway's own Bearer) goes out as before, header for header. A token a bag spelled as `X-Api-Key` stays in that header as written. "The credential that goes out" is read once, on the headers as sent: exactly one header whose name folds to `authorization`, its value read as the transport sends it (edge white space trimmed), scheme `Bearer` in any letter case, the credentials part opening with the head in its letter case. Two spellings of the name, another scheme (`Basic`), the head in capitals, a Bearer another source's credential shadowed and `Proxy-Authorization` ask for nothing; a beta the host declared is not added twice; any other value keeps its seat byte for byte. Which knobs conflict is unchanged (measured on 7.71.1 and here, a subscription key and any other alike): a per-call key beside an `x-api-key` header is refused `route.credential_answer_conflict`, beside an `Authorization` header both ride. The beta joins the one beta fold; no credential source, carrier, env name or code is added. No header that states a client identity is sent; the prompts are this product's own.
|
|
144
|
+
- **Who needs it / who is harmed / what compensates.** A person with a subscription who runs the engine on their own machine (the desktop's settings page): the token went out as `x-api-key`, or as a Bearer without the beta, and was refused. A deployment that sends a gateway-issued Bearer opening with `sk-ant-oat` to a proxy that does not know the beta now sends one more beta (unlikely). The capability word and the docs state the reading; the beta rides only on that head.
|
|
145
|
+
- **Refusals are reported as they are.** A refusal on this lane is one terminal as the provider stated it — `auth` (401 / 403), `rate_limit` (429; with the subscription quota headers `providerCondition: "quota_exhausted"`) or `invalid_request` (400), with `detail.kind: "provider_rejected"` and the route the request took. The same credential is sent again only where any request is sent again today: the provider's own `x-should-retry: true`; a retryable condition (overloaded, throttled, a 5xx) or a transport failure (a connection that failed or broke) within the brain's retry budget; the fast-mode recovery (the standard-speed re-send after a fast refusal); the capability fall-back (a request carrying thinking parameters the model's entry does not declare, sent once more without them); and the output-cap recovery (a context-overflow refusal re-sent once with a lower `max_tokens`). `auth`, `invalid_request` and `quota_exhausted` are not retried unless the provider says to. What only the host's assembly keeps honest: (1) an entry that declares a fallback chain walks on `rate_limit` under the default gate (a subscription quota 429 is one) and may reach another credential — a subscription entry declares no chain; (2) a failover brain moves on any failure before content — a subscription brain is not composed into one; (3) side calls resolve credentials again: the classifier ladder falls back to the main model (`RunnerDeps.autoMode.classifierFallback: "none"` turns it off), compaction resolves its credentials again and walks the model fallback.
|
|
146
|
+
- **The refuse-write grade.** The strict form of the `openai-api-key` row spells the `ant-oat01-` head beside `ant-` / `ant-api03-` / `proj-`: a word boundary, `sk-ant-oat01-`, at least 20 consecutive `[A-Za-z0-9_]` characters and a word boundary is refused (a token glued to a word before it, `xsk-ant-oat01-…`, is not) in a memory write (`scanMemoryWrite`, `detected openai_api_key`); a shorter body, one broken by another character before 20, and a sentence that only mentions the token kind pass. The wide (egress) form already read the shape.
|
|
147
|
+
- **A served-model name that echoes the request's credential (all three lanes).** Before, a provider's name for the model that answered rode into `turn_end.responseModel` and `TaskResult.responseModel` whenever it fit the echo shape, a credential the request carried included (measured on 7.71.1). Now it passes the stream's mint first, as the request id, the provider's error word and the stream-end words already did: a name holding what the request was declared with, or a credential shape, is dropped and counted (`echo_dropped`, `field: "responseModel"`), never rewritten. "What the request was declared with" is the mint's one list, with no shortest length, the same list the request id and the error word are judged by: every header-bag value, a configured protocol version, each beta entry a bag declared, and the key when it names a secret (the values the brain writes itself are not among them). So when one of them is part of the served name — a key `demo-pool` in `demo-pool-west`, a header `X-Label: sonnet` in `pool-sonnet-west` — that name is not reported. A dropped name is not an update, as a name outside the echo shape never was (#1204): when an earlier frame of the same response named a model that passes, that earlier name stands — a `response.created` naming `pool-a` before a `response.completed` naming `pool-sonnet-west` reports `pool-a` (measured; 7.73.0 reported `pool-sonnet-west`); with no such earlier name the response reports no served name. Names that hold none of them (slashes, dots, colons, `@` included) ride as before. An absent `responseModel` is not agreement: `TaskResult.responseModel`'s statement now says so (absent when the provider named the requested model or none, or named one the engine dropped), and the live gate's `served=` line prints an absent name as `?` with the reason — the provider named the requested model or none, or the engine dropped the name it gave — where it printed `served=<requested> (as requested)` before (measured: request `router`, key `demo-pool`, served `demo-pool-west`). The other provider echoes were checked: `requestId` and `apiErrorCode` (`echoCarried`), the finish / stop word and the stream-end ledger (`echoFoldedWord`, `providerWords`), the stop-details words, the in-band error sentence and `providerMessage` already pass it; `usage.speed` is read only as `"fast"`. A provider-minted tool-call id is carried as its wire id (it is sent back to the provider) and is not changed here.
|
|
148
|
+
- **Hard-breaking (two).** `EngineCapability` (the `ENGINE_CAPABILITIES` set) gains `brain.anthropic_oauth_bearer`: a consumer that lists every word exhaustively (the server's capability fact table does) fails to compile until it lists it. The word says the request's shape only — whether the endpoint accepts the credential, and whether the account may use it, it does not answer: a shell may offer "a subscription token can be entered" on it, never "it works". The strict form of the `openai-api-key` row ships with `@sema-agent/primitives` (and so reaches the settings contract package, which depends on it): a text holding `sk-ant-oat01-…` that a consumer's refuse-write face let through is refused there.
|
|
149
|
+
- **Not measured.** Whether the provider accepts a subscription request sent under this product's own identity (KL-oauth-a): only the credential's owner can measure it. Costs on such a run are list-price estimates, and `maxCostUsd` still stops by them.
|
|
150
|
+
- **Pins.** `test/model-hop-oauth-bearer.test.ts` (A the wire on a real Runner; S1–S7 the seat — the conflict matrix as before, the dual-auth shape header for header and its route, an `X-Api-Key` bag as written; B1–B13 the one reading — any letter case, two spellings, dual auth, the entry's and the answer's headers, a shadowed Bearer, a declared beta, `Proxy-Authorization`, edge white space, another scheme, the head in capitals, a retry, the fast-mode re-send; C1–C6 refusals with one request, a parked row and the events with no value, the fallback walk as it is, an echoed served-model name); `test/model-hop-oauth-capability.test.ts`; `test/model-hop-oauth-strict-refusal.test.ts`; `test/fixtures/secret-detect-fixtures.json` +2 fixtures. Re-pinned: `backlog954` (the ledger's strict row), `backlog1754` V7 (the word list), `backlog1204` E3 (the mint handed to the served-model note).
|
|
151
|
+
|
|
152
|
+
### A Runner that declares itself confined releases an unfinished read check under bypassPermissions (ships in 7.74.0; `RunnerDeps.deploymentShape`; behavior change: a relaxation on declaring Runners only; hard-breaking: two, below)
|
|
153
|
+
|
|
154
|
+
- **Rule.** `RunnerDeps.deploymentShape` (`"isolated_sandbox"` | `"own_device"` | `"single_user_host"`, `DEPLOYMENT_SHAPES`) is the host's statement that it has one owner and that every call of this Runner runs confined. It is checked once, at `new Runner`: a word outside the set, or the seat beside `crossBoundaryPosture: "multi_tenant"`, throws `config.deployment_shape` (input `deps`). On such a Runner, under `bypassPermissions`, the mode point reads `unfinished_check` (a read check that did not finish) as releasable — the same kind of reading as `target_unresolved` on the shell face (`RELEASED_ON_CONFINED_RUNNER`). It releases only where three facts hold (`ConfinedCall`, read by the mode point and by the headless way out alike): no person was already required on the question when the check went silent (the ask's real-approval bit stood before the silence, whoever brought it — so an engine guard's own bit, the session-transcript guard's, keeps the question too, KL-5087-d; a hook's, an ask rule's, an organization's question keeps its own immune class anyway); the call's own declared destination stays on the leg's hands (no egress mark, a hand of the environment, every declared boundary leg the environment's); and what the check did not see can hold no write a deny row protects (`unseenGuardsNothing`) — where the read station answered, no deny row that guards writes (the write face's rows: `readDenyPatterns` entries guard writes since #4800; the built-in tiers alone do not) stands on the call's own table or on the one in force now, or the engine's read-only reader proves the command read-only (the allow layer's read-only arm, one function both read); where the station gave no answer at all and the gate put its fallback in place, no deny row of any kind stands on either table. Rows that could not be read, or tables that could not be handed over, count as rows. The rule reads no fact of the station's own: whether a removal's subtree was searched to the end is not asked (KL-5087-e). What users lose: on a deployment where a row guards writes, a command the read-only reader does not prove read-only (writes, variables, scripts, `npm test`), keeps its question when its check did not finish. Every other class, every other mode and every Runner without the seat answer as before; the class set on the card, the park row and the classifier is unchanged. Where nobody can be asked, the way out offers `bypassPermissions` for such a question only where asking for it would run the leg under it (the leg's own mode fold over its ceiling and the deployment's `RuntimeCaps.bypassPermissions`) and the mode point would then release it (the predicate the mode point reads); plan mode's own question beside it included. A Runner without the seat keeps its way out word for word. On a Runner without the seat the write-protection judge's lookup notice keeps its sentence byte for byte; on a declaring Runner it adds that a shell command's such write is a question bypass releases there where no deny row guards writes.
|
|
155
|
+
- **Record.** A release that stood on the declaration carries `released.confined: true` (`ModeRelease.confined`), its `classes` keeping `unfinished_check`; the outcome screen (I7) accepts `confined` only on such a record. The confined list is the new export `confinedReleasableAskClassesFor(face)`; `releasableAskClassesFor(face)` is unchanged (signature and answers). The silence's "a person was already required" fact is the call's own and rides no host-reachable object: `EngineAttestation`, the approval request, the park row and the event frames gain no member. The shell read station's answer (`ShellReadVerdict`) gains no member: the read station and `src/tools` read as without this feature.
|
|
156
|
+
- **What changes for a user.** On a declaring Runner under `bypassPermissions`, when the read station reports an unfinished check, a shell command runs without a card if the engine's read-only reader classifies it as read-only or if no deny row guards writes — including, where no deny row guards writes, a shell write whose target lookup did not finish (`target_unresolved` beside `unfinished_check`, whereas `target_unresolved` alone is already released on the shell face on any Runner): the engine lets it run, and whether the write lands is the system's answer (through a directory the engine could not look up it can; into a real link loop the system refuses it); beside a write-guarding deny row, that shell write is still asked. When the read station gives no answer at all and the gate puts its fallback in place, it runs without a card only if no deny row of any kind (built-in tiers included) stands on either table — otherwise even a read-only command or a write with no write-guarding row keeps its question (H2, H5). The file tools' unresolved targets are still refused in every mode, on a declaring Runner too. Auto mode still puts an unfinished check to a person. A Runner that does not declare sees nothing change: a terminal that wants this has to declare `own_device` itself.
|
|
157
|
+
- **Who needs it / who is harmed / what compensates.** Needed by server deployments in isolated sandboxes and by people who run their own device under `bypassPermissions` (one card fewer). Undeclared Runners are not harmed; a declaring Runner accepts KL-5087-a..c and KL-5087-f..h (when the read station reports an unfinished check, the read-deny table is not applied to what a read-only-classified command's check did not see — including commands that may write housekeeping state such as `git status` refreshing `.git/index`, KL-5087-f — nor, where no row guards writes, to a write's, including into a write-protected location, KL-5087-h; where the station gives no answer at all and the gate falls back, any deny row including a built-in one keeps the question; a row added after a call's tables were read is invisible to that call until another read on the leg lands it in the table in force, from which point the declaring Runner's confined arbitration counts it and keeps an unfinished write's question, KL-5087-g; a networked hand can send what it read; the declaration covers every leg of the Runner) and keeps KL-5087-e's questions. Compensation: the declaration is explicit, and its costs are written beside the seat and in `docs/KNOWN-LIMITS.md` (KL-5087-a..h).
|
|
158
|
+
- **Reference.** A departure: the reference implementation keeps an unfinished check out of reach of its bypass mode.
|
|
159
|
+
- **Hard-breaking (two; open to veto by `@sema-agent/server`, the terminal and `@sema-agent/client-core`).** (1) `CONFIG_REFUSAL_CODES` gains `config.deployment_shape`: a host holding a `satisfies Record<ConfigRefusalCode, …>` table fails to compile until it places the word. (2) The release record (`tool_end.gate.disposition.released`, `ModeRelease`) gains the optional member `confined?: true`: a reader exhaustive over the record's key set fails to compile until it places the key — @server's key-set guard over `ModeRelease` (`src/trace/core-keyset-guard.ts`) is one (measured: a reader written as that guard is compiles on 7.73.0 and fails here, TS2344 naming `confined`). `RunnerDeps.deploymentShape` is optional. New exports: `DEPLOYMENT_SHAPES`, `DeploymentShape`, `RELEASED_ON_CONFINED_RUNNER`, `confinedReleasableAskClassesFor`, `ConfinedCall`; `arbitrateByMode`'s call argument gains the optional `confined` (a `ConfinedCall`), and the input of the root export `runToolGate` (`ToolGateInput`) gains the optional member `confined` (`staysOnHands`, `bypassArmed`, and `denyRows`: whether any deny row, and one that guards writes, stands on the call's tables), present on the Runner's own gate only where the Runner declares its shape (`ConfinedCall` holds `personAlreadyRequired`, `destinationOnHands`, `unseenGuardsNothing` and `bypassArmed`; `headlessApprovalRemedy`, which also takes a `confined`, is internal and not on the export surface). Not changed: `releasableAskClassesFor`'s signature and lists (`ASK_FACES.map(releasableAskClassesFor)` reads as before), the members of `EngineAttestation`.
|
|
160
|
+
- **Pins.** `test/backlog5087-confined-differential.test.ts` and `-hang.test.ts` (the differential table cell by cell, each cell read on a Runner that declares no shape — the 7.74.0 line's reading — and on `own_device`: A1 a read released beside a guarding row, A2 / A3 / A4b / A5b / A5c / A10 / A12 / A13 writes, removals and scripts asked with the protected file kept, A11 / A12b no guarding row ⇒ released, K1 a read past a home row no home places released, the residuals that run on any Runner; B the station's own readings; C the production gate, C5 both tables read; H1–H6 the station giving no answer: released only where no row at all stands), `test/confined-deployment-stops.test.ts` (real Runner: R1 each shape releases `cat ./link` whose lookup the environment refused, R2 a write to an unresolvable target where no row guards writes; G1–G6 the answers of today without the seat, under the other five modes, with a policy's real-approval bit, with a written ask rule, a policy bit beside an unread rule store, the file tool's unresolved write in six modes; A the seat's door), `test/confined-deployment-table.test.ts` (the mode point, the class table's outside look, the published lists and I7, the headless remedy, the production gate), `test/confined-deployment-removal.test.ts` (real Runner: M1 a removal whose deny-row search did not finish keeps its card and the protected file, M2 the same card as an undeclared Runner's, M3 a found name refused, M4 no row ⇒ run at once, M5 a read silence beside the row still released, M6 the way out offers no bypass there), `test/confined-deployment-judge-arms.test.ts` (J1 / J2 a spelling past the floor's bound in a command that is not read-only keeps its card), `test/confined-deployment-repair2.test.ts` (O3 / O3b the way out offers bypass for a write only where no row guards writes), `test/confined-deployment-repair1.test.ts` (nothing outside the cell moves: the notice, the way out, the root export's signature, no new member on a host object, the engine's own guard, the record, the destination reading over a real roster, an undeclared multi-tenant run, the refusal's input).
|
|
161
|
+
|
|
162
|
+
### Permission and approval wording says what is true (f1w3; hard-breaking: none)
|
|
163
|
+
|
|
164
|
+
- Docs: a lane that wires a program to answer approvals does not declare approvalReach "none" (#3042).
|
|
165
|
+
- The ungated-write warning, where an effect-aware gate is wired, says the mode's question does not reach the calls and that a deployment policy may still ask (#3036).
|
|
166
|
+
- A near-miss spelling in a run's own tool list, where a reachable delegation pool is unlisted, names declaring extraToolNames (#1936).
|
|
167
|
+
- An org row's respelling is offered only when the org layer would read it; otherwise the row says the layer reads only Bash command rules (#2368).
|
|
168
|
+
- The primary-field rule issue gives the shell example only for shell tools (#2255).
|
|
169
|
+
- **Not breaking: `clampValuesOf`.** This release's manifest lists `signature changed: clampValuesOf` because the judge could not take apart its old overload list (`uncertain`; its leaf holds other rest-parameter functions too — `foldClampSources`, `toolPolicySkippedRules`, `joinFloors`, `joinedFloors`) — no posture failed, and none of the five signatures changed: `src/core/child-clamp-seats.ts` and `src/tools/fs/shell-read-bindings.ts` are byte-identical to 7.73.0, and in `src/core/permission-rules.ts` only the text of the `invalid.primary_field` sentence changed (#2255), not `toolPolicySkippedRules`.
|
|
170
|
+
- A card names a shadowed hook allow as "a hook's allow", whichever hook gave it (#2829).
|
|
171
|
+
|
|
172
|
+
no-notes: #1777(test only: adds real-Runner WebFetch earlier-grammar allowlist refusal pin; the rewrite clause already holds on the base, nothing in the package changes)
|
|
173
|
+
|
|
174
|
+
### Closed sets a host reads are exported from the root; a lookup reads own properties only (f13w1)
|
|
175
|
+
|
|
176
|
+
- noticeAudienceOf reads only the catalog's own rows: a code spelled like an inherited object member (constructor, valueOf, …) reads "operator" (#4776).
|
|
177
|
+
- BRAIN_STATUS_SEATS: the status-frame seat words as a frozen root-exported list, fenced to the gate-phase set at compile time (#3141).
|
|
178
|
+
- ROUTE_PAIRING_STATUSES: the pairing-status words, spelled in a frozen root export fenced both ways to the type (#1969).
|
|
179
|
+
- REWIND_REFUSAL_CODES: the rewind verbs' refusals that happen before any work (ten words), root-exported; rewind.restore_failed and the two rewind notices are not in it (#4310).
|
|
180
|
+
- compact.session_busy says what can hold the session — a running or queued task, a compaction or rewind in progress, an unsettled write — without naming program interfaces (#5191 ①).
|
|
181
|
+
|
|
182
|
+
no-notes: #1998(docs only — one JSDoc sentence on RunnerDeps.onError.context.sessionId)
|
|
183
|
+
|
|
184
|
+
### A checkpoint row's verdict and summary say what a reader can act on (f4w1; hard-breaking: two, below)
|
|
185
|
+
|
|
186
|
+
- Behavior change (@server): a checkpoint row whose skill-scope section does not read as a list of skill names now reads terminal: true (checkpoint.invalid_outcome, skill_scopes_damaged) — no release resumes it, so a host stops offering a retry and a workflow settles the card's decision (#4796, #4818). Its sentence now ends as every terminal row's does.
|
|
187
|
+
- **Hard-breaking (key set, one).** `CheckpointSummary` carries `ruleOffersAbsence` — the row's word, screened against `RULE_OFFERS_ABSENCES` — so a listing tells why a parked card offers no persisted rule without a get (#1723); a reader exhaustive over `CheckpointSummary`'s keys fails to compile until it places `ruleOffersAbsence` — @server's inbox summary guard (`src/trace/core-keyset-guard.ts`, `_GuardInboxSummary`) is one (measured: a reader written as that guard is compiles on 7.73.0 and fails here, TS2344 naming `ruleOffersAbsence`).
|
|
188
|
+
- A resume whose content-ask answer does not read as an answer is refused naming which way it fails (#3885).
|
|
189
|
+
- **Hard-breaking (source, one).** `TaskRegistry.reconcileParkedAgents` leaves a row that does not read (`agent_record.row_malformed` — from the listing, a keyed read or a write) as stored and counts it once in a new `unreadable` member of its receipt; any other store error still throws. The receipt's `unreadable` is a required member of the method's return type, so a host subclass of `TaskRegistry` that overrides `reconcileParkedAgents` and returns `{ failed, rolledBack }` no longer compiles (measured: TS2719 on this version, compiles on 7.73.0); return `unreadable` (a count) beside them. A caller that only reads the receipt is not affected (@server calls the method on the registry).
|
|
190
|
+
- A durableApproval opt-in whose ttlMs, or another member, is not plain data is refused naming that member in detail.field and the sentence; a member the opt-in does not declare is never named back (#3786).
|
|
191
|
+
no-notes: #2453(measurement probe only), #5126(measurement probe only), #2510(measurement probe only), #4161(measurement probe only), #4685(measurement probe only)
|
|
192
|
+
no-notes: #4246(pin only: the synchronous delegation lane parks nothing; the arm's removal left the wave after review)
|
|
193
|
+
|
|
194
|
+
### A person whose saved permission rules cannot be read is told once per session under the relaxed modes too (f13w1 R6, C-R3318; behavior change: yes, below; hard-breaking: none; closed sets: none; exports: none; wire: delivery scope and wording of existing notices only)
|
|
195
|
+
|
|
196
|
+
- **Rule.** `permission.rule_store_unavailable` (audience `user`) is delivered once per session per fault set when met at run start — and once per run when a fault is first met at a call (`KL-4698-b`: the call-time digest is not persisted) — whatever the permission mode, through the same once-per-session record and digest (`announceDigest("permission.rule_store_unavailable", ruleStoreFaultsKey(faults))`) across asking and relaxed modes (`auto`, `bypassPermissions`), with unchanged detail members (`at`, `sessionId`, `runId`, `faults`, no `mode` member). Under an asking mode the sentence is unchanged byte for byte; under a mode that answers `rule_unreadable` unasked (`auto`, `bypassPermissions`), the sentence names the mode and states that the unread rules by themselves do not make the engine ask (under `auto` the classifier judges such a call, where a no-ruling result can still ask, and retained deny/ask rows from the last successful read still refuse or ask in both modes), so until a read succeeds only the deny and ask rows most recently read from them this run apply (none, if no read has succeeded) — a deny rule saved since may not be in force. The operator's `permission.rule_store_unreadable_relaxed` stays once per session per `(fault set, mode)` when met at run start (once per run when first met at a call) with the same detail members, and its sentence now states that the unread rules by themselves do not make the engine ask (noting the classifier under `auto`) and that the person is told by their own notice (without claiming a frequency). What is released, classified or asked does not change. The `rows` form (individual rows whose identity could not be read) is unchanged: told to the person by `config.entries_not_applied` (`stored_rule_row`) and to the operator by `permission.rule_store_unreadable_relaxed`.
|
|
197
|
+
- **What changes for a user.** Under `auto` and `bypassPermissions`, a person whose saved permission rules cannot be read is told once per session per fault set when met at run start (once per run when first met at a call, `KL-4698-b`); nothing more is asked or refused, and switching modes later in the same session over the same persisted prepare-time fault set does not repeat the notice.
|
|
198
|
+
- **Who needs it / who is harmed / what compensates.** Who needs it: a person running under `auto` or `bypassPermissions` whose saved deny rules are not in force because their rule store could not be read — before, they were told nothing. Who is harmed: a user or consumer running under a relaxed mode over an unreadable store that expected zero `permission.rule_store_unavailable` frames (and probes asserting that absence). What compensates: delivery is capped at once per session per fault set when met at run start (once per run when first met at a call, `KL-4698-b`, one digest across modes), adds no code or detail member, and changes no call's release or approval decision.
|
|
199
|
+
- **Wire.** `@cli @client-core`: the user-audience notice `permission.rule_store_unavailable` now also arrives on legs running under a relaxed mode (`auto`, `bypassPermissions`), with a second sentence form stating what that mode does — same code, same detail members (`at`, `sessionId`, `runId`, `faults`). `@server`: the operator's `permission.rule_store_unreadable_relaxed` sentence lost its "so the person is not told" clause and now notes that the person is told by their own notice.
|
|
200
|
+
- **Hard-breaking: none.** No new notice code, no new detail member, no export or closed-set change, and no change to what is released or asked.
|
|
201
|
+
- **Pins.** `test/c3318-rule-store-told-under-relaxed-modes.test.ts` (`(a)` `bypassPermissions`, `(b)` `auto` with classifier, `(c)` second run same session, `(d)` `bypassPermissions` then `default` same session one digest, `(e)` `default` asking-mode sentence byte-for-byte control, `(f)` `rows` form under `bypassPermissions`, `(g)` `auto` then `default`, `(h)` `default` then `bypassPermissions`, `(i)` `rows` form under `auto`); re-pinned `test/backlog4698-ask-rows.test.ts` (`R1`, `R2`, `O1`), `test/backlog4809-unread-notice-settled-mode.test.ts` (`U4b`, `U4c`), `test/backlog2355-rule-store-unreadable-sentence.test.ts` (`①` bypass, `⑦` host store bypass and sentence call site), `test/backlog1653-consolidation-reads-write-judge.test.ts` (bypass cell), `test/backlog7340rj-unread-path-rows.test.ts` (`①`, `④` bypass), and `test/rev7340rm-rule-store-partitions.test.ts` (`R4 ②/③/④` bypass).
|
|
202
|
+
|
|
203
|
+
### A failover gateway asks a leg before it sends it: a leg whose own route judgment refuses, throws, or answers anything but `{ ok: true }` or `undefined` (a Promise, `null`, …) is not dispatched — `undefined` or no judgment face goes ahead, as before; for a leg not dispatched, its `stream` / `complete` is not called and the request is not sent to it; its own judgment is still asked with the call's key and headers (`KL-4241-d`) (#4257, f8w1 R7; behavior change: yes; narrowing: four, below, open to veto @server; widening: two; hard-breaking: none; closed sets: none; exports: none)
|
|
204
|
+
|
|
205
|
+
- **Rule.** `createFailoverBrain` asks each leg it is about to send — `adjudicateRoute(model, identity)`, the identity the request carries, two arguments — in the step it would hand the request over, and reads the answer where the model lane reads a hop's (`readRouteJudgment`): `{ ok: true }`, `undefined` or no judgment face goes ahead; anything else is that leg not sent. A leg not sent is a clean failure of that leg before anything went out: the chain moves on, and when it is the last leg (or the only one tried, `resilience.allowFailover: false`) its refusal is the answer — `[invalid_request] <code>: <fixHint>`, the error a first-party brain's request gate throws for the same request, with that gate's credential notice, a known-zero usage, `aborted` when the request is already cancelled. A leg not sent is not among the requests the answer left behind.
|
|
206
|
+
- **Before (7.72.0 and the 7.74.0 line head before this change, measured on both: 18 cells, a host-written gateway leg in front of a first-party one, the lane's two faces and a Runner run).** The chain's judgment admitted the request when any leg did, and the walk then called every leg in order without asking it: the leg that had refused received the per-call `apiKey`, headers and `credentialOrigin` in all 18 cells, and a gateway that forwards what it is handed sent the key on the wire in 15. The pass-through did the same on both faces.
|
|
207
|
+
- **Now (measured: the same cells).** 0 of 18; nothing on the wire; the admitting leg serves. With first-party legs only nothing moves on the wire — a refused first-party leg was already stopped by its own request gate.
|
|
208
|
+
- **Narrowing (@server, hosts with their own gateway legs).** (1) A host-written leg whose judgment refuses, throws, answers a Promise or any other non-verdict, and whose `stream` would have served, is no longer tried; to be tried, answer `{ ok: true }` or `undefined` — synchronously. (2) First-party chains: a turn in which a leg was refused by the pairing law and another leg served carried a zero-usage `brain.call` row and `usageMissing: true` for the refused leg; both are gone (nothing was sent). A refused leg behind `createCircuitBreakerBrain` no longer passes the breaker (no probe slot taken, no `circuit_open` frame for it). (3) The one reading of a judgment (`readRouteJudgment`: the gateway's ask, the model lane's ask before a hop, a derived seat's pre-flight) tells a Promise first, by the `then` it shows (a `then` that will not read shows none: that answer is read by its `ok`, as 7.73.0 read an answer whose members read the same at every read — measured, real Runner: a leg, a one-leg chain and a single host brain whose strict Proxy verdict `{ ok: true }` throws on a `then` read serve, as on 7.73.0; reading `then` before `ok` is new, and an answer whose reads disagree can be read otherwise: `KL-4241-d` (9)): a judgment that answers a Promise is read as one that answered a Promise whatever `ok` it carries — the model lane now refuses a hop whose judgment answers a Promise carrying `ok: true` (it admitted it). An answer that hides its own `then` is read by the `ok` it gives. (4) Behind a chain, an answer that would otherwise admit (`ok: true`) whose `then` throws on the first read and answers a function on the second is refused, where 7.73.0 served it (reachable only by a verdict object whose reads disagree; `KL-4241-d` (9)).
|
|
209
|
+
- **Widening.** (1) A leg whose judgment and `stream` both throw used to end the request on the throw; it is skipped and the next leg serves. (2) On a single brain, an answer whose `ok` is changed from false to true by reading `then` while that `then` read exposes no callable (a getter that sets `ok` to true and answers a function is refused before `ok` is read) is admitted, where 7.73.0 refused it (reachable only by a verdict object whose reads disagree; `KL-4241-d` (9)). These are the measured forms; a verdict object whose reads disagree from one read to the next can differ from 7.73.0 in further ways, all of the class `KL-4241-d` (9) describes.
|
|
210
|
+
- **Timing and robustness.** On the pass-through a refused leg's terminal arrives through the pass-through's asynchronous forwarding (it used to be queued before `stream()` returned); the message is the same. The chain's judgment face reads each leg's answer's `then` once and absorbs the settlement of a Promise whose `then` reads and works (no unhandled rejection; its verdict unchanged, except as `KL-4241-d` (9) says). A model whose `id` will not read no longer makes the reading throw or an error terminal go missing: the id is said as `<unreadable model id>`.
|
|
211
|
+
- **Not moved.** The chain's judgment face's verdicts (a leg's answer whose `then` will not read — a host's strict Proxy verdict — shows no `then` and is read by its `ok`, as on 7.73.0 for an answer whose members read the same at every read: `KL-4241-d` (9)), the router, the breaker, the spend meter, every wire shape. First leg sent and failed, second leg refusing the key now bound to the first leg's origin: same terminal code and sentence, same `brain.failover` frame, same notice (measured).
|
|
212
|
+
- **Known.** `KL-4241-d` is rewritten: what is still open around the ask, the lane's cancel exception first; its item (10): the words of a leg's judgment that throws are said in its refusal as written and reach the error terminal — a host judgment whose error quotes the per-call key it was handed puts the key there.
|
|
213
|
+
- **Pins.** `test/backlog4257-failover-leg-judgment.test.ts` (cells C01–C26 and X-a–X-c, 32 tests, loopback listeners and invented credentials only; 23 red on the base, 9 guards green on both; 19 named wrong implementations and a new `try/catch` in `failover.ts` each turn at least one cell or the silent-arm gate red; R1–R6, 10 tests, in-process legs: a Promise carrying `ok`, a Promise the chain's face drops, the legs' array throwing on a read, the model's id read only to say a refusal, an id that will not read, a `then` that reads differently twice — each red before its fix and under its mutation); `test/backlog4241-route-unavailable.test.ts` (the gateway-layer cell rewritten: a first leg whose judgment and stream throw is not sent and the second leg serves, as the requested model and as a later hop).
|
|
214
|
+
|
|
215
|
+
### A cron row the engine's grammar refuses is shown as written, not with an invented human reading; a cron refusal echoes the refused expression and time zone on one line (f10w1 R2, #4941; behavior change: yes, below; hard-breaking: none; closed sets: none; exports: none; wire: none)
|
|
216
|
+
|
|
217
|
+
- **Rule.** `cronToHuman` (the words after a `CronList` row's schedule, and `details.jobs[].humanSchedule`) translates only what the engine's cron grammar accepts (`isValidCronExpr`, judged after the backend's `cron ` display prefix is dropped). Anything else comes back as it was given: a minute of 61, an hour of 25 or a weekday of 8 is no longer read as `every hour at :61`, `daily at 25:00` or `weekly on Monday`; a `delay 60s` / `at <iso>` display string, a seconds field, a name and an `@` shorthand were never translated and still are not. A refusal of `nextCronFireTime` / `cronIntakeRefusal` (a bad expression, an unknown time zone, an expression that never fires) quotes the refused text through the engine's one single-line echo (`inlineUntrusted`) when the expression is at most 100 characters; a longer expression is still quoted by its length alone.
|
|
218
|
+
- **Update note, two changes.** (1) A stored row the grammar refuses used to show an invented human reading; it now shows only its own text, and its `humanSchedule` equals that text. (2) The echo of a refused expression or time zone name inside the refusal sentence may no longer equal the text given: every run of white space (a tab, a line break, several spaces) is folded to one space, an unrenderable character (a direction control, a zero-width character) is folded to a space, and an envelope marker is rewritten (`</system-reminder>` reads `</system-reminder>`). The same price as `KL-3826-a`. A clause after the echo says what the fold changed that a reader cannot see, in fixed words (no count, never the bytes): `(the text given holds control or non-printing characters, shown folded)` when the fold turned something other than an ordinary space into a space — a control, zero-width or direction character, a tab, a line break, a byte-order mark — judged from the fold's own product, and `(the text given holds white space at its start or end)` for what it trimmed (`UTC ` is shown as `UTC` with that clause; both together read `holds control or non-printing characters, shown folded, and white space at its start or end`); a text the echo shows as it is, or differs from only by a run of ordinary spaces, carries no clause, so an ordinary bad expression reads word for word as before. Examples: the expression `0 9<TAB>*<LF></system-reminder>` is refused as `invalid cron expression "0 9 * </system-reminder>" (the text given holds control or non-printing characters, shown folded) — only 5 space-separated cron fields …`; `0 9 * *<NUL>1` as `invalid cron expression "0 9 * * 1" (the text given holds control or non-printing characters, shown folded) — only 5 space-separated cron fields …`; the time zone `Mars<U+202E>/ Base` as `invalid time zone "Mars / Base" (the text given holds control or non-printing characters, shown folded) — the runtime knows no time zone by that name …`.
|
|
219
|
+
- **Who needs it / who is harmed / what compensates.** Who needs it: the model that reads `CronList` (a refused stored row no longer reads as a schedule that could fire) and every reader of a refusal sentence (the text it carries is one line and cannot open a forged envelope). Who is harmed: a probe or a consumer that pinned the old echo of an expression or zone name holding white space other than single spaces, a direction or zero-width character or an envelope marker; a consumer that read the invented reading of a refused row. What compensates: the sentences are otherwise word for word as before (the refusal words, the 100-character bound, the character count of a longer expression), and a row the grammar accepts reads as before.
|
|
220
|
+
- **Consumers.** `@server`: its own never-fires sentence (`scheduler-support`) is not changed by this release, so the engine's refusal and that sentence quote the same text differently from now on. `@client-core` / `@cli`: the human text of a refused stored row, where a card forwards the engine's `humanSchedule`, is the row's own text; a five-field string longer than 100 characters, which the engine's grammar refuses, is no longer translated by the engine.
|
|
221
|
+
- **Not changed.** The wording of every refusal, the grammar, the translation of an accepted expression, CronCreate's receipt, the length arm of the echo. No claim is made that the reading is the reference's (which reads the raw text's fields by shape and also translates forms this engine never did).
|
|
222
|
+
- **Pins.** `test/backlog4941-cron-human-and-refusal-echo.test.ts` (cell 1 `CronList` over a store holding a refused row of each kind, a good row, a `cron `-prefixed good row, a prefixed refused row and `delay 60s`; cell 2 the bad-expression echo word for word; cell 3 the bad-time-zone echo word for word; cell 4 the never-fires echo; cells 5 – 8 the clause — a NUL, several characters (no count), a NUL with a line break, a tab, a byte-order mark, a run of plain spaces (no clause), a zone name with trailing white space, no clause on an ordinary bad expression, the never-fires sentence; cell 9 a list of grammar-refused spellings, the old formatter's among them; cell 10 the 100-character bound of the echo); unchanged and green on both sides: `test/backlog4890-cron-next-fire.test.ts` (`I3`, `I4`, `I5`, `F2`) and `test/scheduler-tools.test.ts`.
|
|
223
|
+
|
|
224
|
+
### A bad `TaskSpec.retainSubagentSessions` is refused when the run reads its spec, before the session is taken: `null`, `0`, a fraction, a string, a stray key, a member whose read throws and a record that is not plain no longer start a run (f10w1 R5, #4289, #4503; behavior change: yes, a narrowing, below; hard-breaking: one, below; closed sets: none; exports: none; wire: none)
|
|
225
|
+
|
|
226
|
+
- **Rule.** One judge, `screenRetainSeat` (internal), reads the option once, in `readCallerSpec`, and the run holds its frozen copy: `undefined` and `false` are off; `true` is on with the defaults (30 minutes, 16 children); a plain record (prototype `Object.prototype` or none) is on, and only `ttlMs` and `max` are keys, each — when present and not `undefined` — a whole number from 1 to 2^53 - 1. Everything else is refused with `config.invalid_argument`, the sentence opening with the field (`TaskSpec.retainSubagentSessions`, `.ttlMs` or `.max`) and saying the kind of the value, never the value; the failed terminal carries the field at `terminal.detail.detail.field`. The retain ledger is built from that copy in the reference phase, so the caller's record is read once (at the door, before the session store is taken) and never again; the ledger's constructor asks the same judge, for a host that builds one itself. The judge answers every input with one of its two arms and never throws: a value whose read throws (a revoked Proxy as the option or as a member, a Proxy whose traps throw) is refused the same way, the sentence saying it could not be read and never what was thrown, so `runTaskStream` does not throw at the call, `runTask` ends with the failed result and `judgeTaskStart` returns its verdict. The instruction preview and the start judge read the spec through the same entry and refuse the same way. A host seat that answers its owner once is read once for a whole delegation tree, on every lane it delegates by — both fork lanes and the background and synchronous child (#4503: the ticket's form did not hold; pinned as a witness, no code).
|
|
227
|
+
- **Update note.** Before, the constructor checked the record's shape and not its values, and it ran in the reference phase, after the run's session was taken: a stray key, a member whose getter throws, a class instance or a Proxy failed there, late; the values were not judged at all — as a member, `NaN` (it never expired a retained session), `0`, a negative number, a fraction, `Infinity` and a string were taken as written and `null` read as its default; as the option itself, `null` and `0` read as off (a fraction or a string failed later, in the reference phase). Now every one of those is refused at the spec's read: `null` (the option or a member), `0`, a negative number, a fraction, a whole number past 2^53 - 1, `NaN`, `Infinity`, a string, a stray key (named, with the nearest member), a member whose getter throws (the sentence says it could not be read, never what it threw), a class instance and a Proxy. `false`, `true`, `{}` and a record of whole numbers from 1 are as before.
|
|
228
|
+
- **Who needs it / who is harmed / what compensates.** Who needs it: the host that sets a window or a capacity (a window that never expires pins retained sessions until the process ends). Who is harmed: a host that passes `null` as "off", `0` as "none", or a computed fractional or string window; `null` was read as off, and is now refused. What compensates: write `false` (or leave the member out) for off, and whole numbers for the members; the refusal names the field and the kind of the value.
|
|
229
|
+
- **Hard-breaking (one).** Values the option's type admits — a member `ttlMs` / `max` of `0`, a negative number, a fraction, `NaN`, `Infinity` or past 2^53 - 1 (all `number`) — started a run before and now refuse the whole run at its door (measured: `retainSubagentSessions: { ttlMs: 1.5 }` ran to its end on 7.73.0 and ends `config.invalid_argument` here). A host that computes the window or the capacity must hand over a whole number from 1.
|
|
230
|
+
- **Consumers.** `@server` / `@client-core` / `@cli`: a retain configuration that reaches the engine as `0`, a fraction or a string is refused now (a host that already drops `0` and rounds fractions before it hands the value over, or hands `true`, is not affected).
|
|
231
|
+
- **Pins.** `test/backlog4289-retain-seat-at-the-door.test.ts` (B: each of `ttlMs` and `max` × `null`, 1.5, `"100"`, 0, -1, `NaN`, `Infinity`, 2^53, a boolean, an array and an object, each with the kind its sentence says, and the option as `"yes"` and as `null`, each refused at the door with the store untaken and no model turn; S: stray key, throwing getter, class instance; G: eight guards, the top of the safe range among them; R: the read-once guard and the order cell — the member is read before the session store is taken; J: the judge, the spec's read, an earlier refusal that stands, and the constructor; N: a revoked Proxy and a Proxy whose traps throw, as the option and as a member, through the judge, the spec's read, `runTaskStream`, `runTask` and `judgeTaskStart`; N2: a throw inside the receipt that is not its own refusal) and `test/backlog4503-owner-seat-answers-once.test.ts` (the FORK, SFORK, background and synchronous lanes, one read of a seat that answers once).
|
|
232
|
+
|
|
233
|
+
no-notes: #1504(released under its own section in an earlier version; named here only by the merge header saying its one-table pin is green again after #4994's hook condition took bash's reserved words from that table — nothing of #1504 changes)
|
|
234
|
+
no-notes: #4346(lowered in face 8 wave 1 — no code change: the terminal already carries `detail.kind: "response_cut"` and the stream the `gave_up` status frame since 7.69.0, and the extra engine notice the ticket asked for is not built; named here only by the merge header of the lowered root)
|
|
235
|
+
no-notes: #768(released in an earlier version; named here only by a #1131 repair commit that puts one spy of its G12 pin back to its base form — test only, nothing in the package changes)
|
|
236
|
+
no-notes: #1403(released in an earlier version; named here only by a #1131 gates commit that restamps the wiki page whose anchor moved with a fixture — the page's claims are unchanged)
|
|
237
|
+
no-notes: #2944(released in an earlier version; named here only by a #1131 commit that makes the model-shell foreground start spell its byte floor where it starts, and moves its row of the start-site table — the floor itself is unchanged), #3190(same commit; its start-site pin shares that table)
|
|
238
|
+
no-notes: #2485(a known-limit line retires: the server reads the root-exported peer-name judge on both of its sides, so the two readings the line described no longer differ; no engine behaviour changes), #5273(named only by a ledger commit: the row is closed by the owner's ruling — the task's total duration stays retired — and `KL-5273-a` records it; nothing of the engine changes)
|
|
239
|
+
no-notes: #1472(released in an earlier version; named here only by this line's test commit and merge header making its redaction pin read regular files at any depth under the run store's directory — test only, nothing in the package changes)
|
|
240
|
+
no-notes: #3202(named here only by an internal refactor of the Anthropic credential-header copy that avoids a hand-written key-gate shape counted by the #3202 census — behaviour unchanged, nothing a host sees changes)
|
|
241
|
+
no-notes: #2411(released in an earlier version; named here only by a 7.74.0 review pin commit whose law of the two rows reads a static member conditional only on `env.modelShell` as the leg's — test only, the change itself is under #1131), #3802(same commit; its G1 cell reads the three delegation tools conditional on `env.modelShell` on the static half — test only)
|
|
242
|
+
no-notes: #4505(shipped in 7.72.0 under its own section; named here only by this line's merge header taking the 7.73.0 line into 7.74.0 — nothing of #4505 changes on this line)
|
|
243
|
+
no-notes: #4791(shipped in 7.72.0 under its own section; named here only by a #1131 bracket-half pin commit updating its known-limit cell — test only, nothing of #4791 changes on this line)
|
|
244
|
+
no-notes: #5329(shipped in 7.72.0, repository tooling only; named here only by this line's merge header taking the 7.73.0 line into 7.74.0 — nothing the package ships changes)
|
|
245
|
+
no-notes: #5334(shipped in 7.71.1 under its own section; named here only by this line's merge header taking the 7.73.0 line's no-notes line into 7.74.0 — ledger only, nothing in the package changes)
|
|
246
|
+
|
|
1
247
|
## 7.73.0 — 2026-11-26
|
|
2
248
|
|
|
3
249
|
### Two known limits of the shell read station are carried by this release; one is newly documented (`KL-shell-dialect-b`, `KL-shell-dialect-c`; behavior change: none; hard-breaking: none; closed sets: none; exports: none; wire: none)
|
|
@@ -76,7 +76,7 @@ export function createListAgentsTool(opts) {
|
|
|
76
76
|
? `Peer sessions are other sessions of this engine running for the same user, shown as \`name [ref] · state · active <N> ago · <directory> · self: agent=…, intent=… · peer session <where>\` (where it runs: ${Object.values(PEER_SESSION_WHERE_LABELS).join(", or ")}); send to one with its name (or \`name [ref]\` ` +
|
|
77
77
|
`when a name is ambiguous, or its \`session.<id>\` address). By default only FRESH peers are listed (working now, or active within the last ${formatAgo(windowMs)}); ` +
|
|
78
78
|
`pass includeAll: true to also list stale and offline ones. A peer that is offline or unlisted still accepts messages — they are parked ` +
|
|
79
|
-
`durably in its session box
|
|
79
|
+
`durably in its session box. `
|
|
80
80
|
: `Peer sessions of this engine are not addressable on this mount (no session directory). `) +
|
|
81
81
|
`Background agents you spawned are listed with their task_id, their status, when they last did anything, and — for one that is parked — what its park waits on (a person's approval, or a yield that continues when its owner runs again), the card id, state and deadline; for one that stopped, whether SendMessage can still continue it and for how long. ` +
|
|
82
82
|
`A ref is only valid against the listing (or disambiguation error) you read it from — do not invent one.`,
|
|
@@ -4,10 +4,9 @@ import { PEER_MESSAGE_NOTICE } from "./peer-admission.js";
|
|
|
4
4
|
import { createSafeNotifier } from "../core/safe-notify.js";
|
|
5
5
|
import { RETAIN_DEFAULT_TTL_MS, RETAIN_DEFAULT_MAX } from "../config/defaults.js";
|
|
6
6
|
import { asThrownError, codedRefusal } from "../core/thrown-value.js";
|
|
7
|
-
import {
|
|
7
|
+
import { retainSeatToBuild } from "../core/retain-seat.js";
|
|
8
8
|
import { readClampFloor } from "../core/child-clamp-seats.js";
|
|
9
9
|
import { CONTINUATION_ENDED_BY } from "../core/delegation-frames.js";
|
|
10
|
-
const RETAIN_CONFIG_KEYS = optionKeys()({ ttlMs: 0, max: 0 });
|
|
11
10
|
const FORK_AGENT_TYPE = "fork";
|
|
12
11
|
export function durableRungAdmitsRow(row) {
|
|
13
12
|
if (row.agentType === FORK_AGENT_TYPE)
|
|
@@ -81,7 +80,8 @@ export class SubagentRetainLedger {
|
|
|
81
80
|
lastFailure;
|
|
82
81
|
notifier = createSafeNotifier();
|
|
83
82
|
constructor(config, hooks) {
|
|
84
|
-
const
|
|
83
|
+
const seat = retainSeatToBuild(config);
|
|
84
|
+
const cfg = seat === true ? {} : seat;
|
|
85
85
|
this.ttlMs = cfg.ttlMs ?? RETAIN_DEFAULT_TTL_MS;
|
|
86
86
|
this.max = cfg.max ?? RETAIN_DEFAULT_MAX;
|
|
87
87
|
this.hooks = hooks;
|
|
@@ -175,7 +175,7 @@ export function createSendMessageTool(opts) {
|
|
|
175
175
|
: `Continuing a finished agent requires the run to retain sub-agent sessions; when the session was not ` +
|
|
176
176
|
`retained (or is no longer held) you get an honest error and should launch a new agent with the needed context instead.`) +
|
|
177
177
|
(peerLane.active
|
|
178
|
-
? ` Peer SESSIONS — other sessions of this engine for the same user${opts.peerListingMounted === false ? "" : opts.peerListingMounted === true ? " (list them with ListAgents)" : " (list them with ListAgents where that tool is mounted)"} — are addressed by name, by \`name [ref]\` when a name is ambiguous, or by their \`session.<id>\` address. A message to a peer is parked durably in its session box
|
|
178
|
+
? ` Peer SESSIONS — other sessions of this engine for the same user${opts.peerListingMounted === false ? "" : opts.peerListingMounted === true ? " (list them with ListAgents)" : " (list them with ListAgents where that tool is mounted)"} — are addressed by name, by \`name [ref]\` when a name is ambiguous, or by their \`session.<id>\` address. A message to a peer is parked durably in its session box; the receipt confirms the box accepted it, not that the peer read or acted on it.${opts.peerChannel !== undefined ? " A peer whose box is not in this host's mailbox store — a Claude Code session, or a session of this engine on another store — is reached over its socket instead: nothing is parked for it, the message is sent once and only while it runs, and its receipt says so." : ""}`
|
|
179
179
|
: ""),
|
|
180
180
|
parameters: sendMessageParameters,
|
|
181
181
|
execute: async (args, ctx) => {
|
|
@@ -297,7 +297,7 @@ export function createSendMessageTool(opts) {
|
|
|
297
297
|
catch {
|
|
298
298
|
}
|
|
299
299
|
if (boxFull) {
|
|
300
|
-
return { content: `Message not sent: ${inlineUntrusted(peerLabel, 200)}'s session box is at its queued-message limit (${admissionConfig.maxQueuedPeerMessages.toFixed(0)}) — the message was NOT queued
|
|
300
|
+
return { content: `Message not sent: ${inlineUntrusted(peerLabel, 200)}'s session box is at its queued-message limit (${admissionConfig.maxQueuedPeerMessages.toFixed(0)}) — the message was NOT queued. Resend later. ${DEDUP_RETRY_NOTE.slice(0, 200)}`, details: { error: "queue_full", code: "queue_full", to }, isError: true };
|
|
301
301
|
}
|
|
302
302
|
let seq;
|
|
303
303
|
if (message !== "") {
|
|
@@ -398,8 +398,8 @@ export function createSendMessageTool(opts) {
|
|
|
398
398
|
const verdict = { ok: true, disposition: offline ? "parked_offline" : "queued", via: "store" };
|
|
399
399
|
return {
|
|
400
400
|
content: offline
|
|
401
|
-
? `Message parked for ${peerLabel}: that session is offline, so the message was parked durably in its session box (seq ${seq})
|
|
402
|
-
: `Message queued for ${peerLabel} (seq ${seq}): it is parked durably in that session's box
|
|
401
|
+
? `Message parked for ${peerLabel}: that session is offline, so the message was parked durably in its session box (seq ${seq}) — subject to the deployment's mailbox retirement policy, which does not notify you. Continue with your task; do not resend the same content.${subscriptionNote}${rowNote}`
|
|
402
|
+
: `Message queued for ${peerLabel} (seq ${seq}): it is parked durably in that session's box. This receipt confirms acceptance into the box, not the peer's judgment of the message. Continue with your task; do not resend the same content.${subscriptionNote}${rowNote}`,
|
|
403
403
|
details: { type: "send-message", status: offline ? "peer_parked_offline" : "peer_queued", to, address: handle, seq, verdict, ...(subscription !== undefined ? { subscription } : {}), ...(subscriptionSeq !== undefined ? { subscriptionSeq } : {}), ...(rowRestored !== "present" ? { directoryRow: rowRestored } : {}), ...(doorbell !== undefined ? { doorbell } : {}) },
|
|
404
404
|
};
|
|
405
405
|
};
|
|
@@ -4,7 +4,7 @@ import { type StreamEngineConfig } from "./stream-engine.js";
|
|
|
4
4
|
export interface AnthropicBrainConfig extends StreamEngineConfig, Pick<RoutePairingConfig, "requireCredential"> {
|
|
5
5
|
/** Base URL of the Anthropic(-compatible) API. Default {@link ANTHROPIC_DEFAULT_BASE_URL}. Overridden by model.baseUrl. */
|
|
6
6
|
baseUrl?: string;
|
|
7
|
-
/** API key (`x-api-key`). Overridden by per-call options.apiKey / getApiKeyAndHeaders. */
|
|
7
|
+
/** API key (`x-api-key`; a subscription token, head `sk-ant-oat`, rides as `Authorization: Bearer` while no header bag fills that seat). Overridden by per-call options.apiKey / getApiKeyAndHeaders. */
|
|
8
8
|
apiKey?: string;
|
|
9
9
|
/** `anthropic-version` header. Default `2023-06-01`. */
|
|
10
10
|
version?: string;
|
|
@@ -43,6 +43,47 @@ export interface AnthropicBrainConfig extends StreamEngineConfig, Pick<RoutePair
|
|
|
43
43
|
* names the Anthropic API's own root — the {@link fable5Model} preset, a host's disclosure of where a default request
|
|
44
44
|
* lands — reads this one spelling. */
|
|
45
45
|
export declare const ANTHROPIC_DEFAULT_BASE_URL = "https://api.anthropic.com";
|
|
46
|
+
/** What {@link anthropicCredentialHeadersOf} answers for an Anthropic request: which header carries the API key (when one is supplied) and which `anthropic-beta` token the outgoing credential asks for (when any). */
|
|
47
|
+
export interface AnthropicCredentialHeaders {
|
|
48
|
+
readonly key?: {
|
|
49
|
+
readonly header: "authorization" | "x-api-key";
|
|
50
|
+
readonly value: string;
|
|
51
|
+
};
|
|
52
|
+
readonly beta?: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The one pure judge on the Anthropic lane that answers with the same two rules the adapter applies to its own request
|
|
56
|
+
* (`anthropicKeyHeaderOf` and `credentialBetaOf`, over `BEARER_CREDENTIAL_BETAS`) — exported for a host that builds its own
|
|
57
|
+
* direct request to the same provider — over the same pair the adapter reads: the key and the header bag are first read as
|
|
58
|
+
* the route law reads them (`keyCarriedBy`, `dropBlankCredentialHeaders`: those two functions are the law's, read here and
|
|
59
|
+
* not copied).
|
|
60
|
+
*
|
|
61
|
+
* Two normalizations, then two rules (the head is written into the value by the provider that minted it; no header name,
|
|
62
|
+
* source or host word is read beside it):
|
|
63
|
+
* - **Blank is nothing.** A key that is blank (the empty string or white space only; `keyCarriedBy`) is no key, and a credential
|
|
64
|
+
* header whose value is blank (`Authorization: ""`; `dropBlankCredentialHeaders`) is dropped from the copy of the bag
|
|
65
|
+
* before anything reads it — so it holds no seat and asks for no beta.
|
|
66
|
+
* - **Key header (`key`).** Present when `apiKey` is a string that is not blank (`keyCarriedBy`): `authorization` (as
|
|
67
|
+
* `Bearer <apiKey>`) for a key whose head is a row of `BEARER_CREDENTIAL_BETAS` when that seat is empty on the headers; else
|
|
68
|
+
* `x-api-key` (value `<apiKey>`). A credential a header bag put in `Authorization` is the host's and stays as it is (the
|
|
69
|
+
* documented dual-auth shape).
|
|
70
|
+
* - **Credential beta (`beta`).** Read on the headers as they would go out (a null-prototype shallow copy of the given headers
|
|
71
|
+
* without its blank credential headers, with `key` written into its header, replacing any spelling of that header name):
|
|
72
|
+
* exactly one header whose name folds to `authorization`, its value read as the transport sends it (`httpTrimmed`), its
|
|
73
|
+
* scheme `Bearer` in any letter case, its credentials part opening with a row's head, letter case as written. Two spellings
|
|
74
|
+
* of that name (comma-joined on the wire) or another scheme ask for nothing.
|
|
75
|
+
*
|
|
76
|
+
* For plain data inputs (own enumerable data properties, header values that are strings) it performs no I/O, reads no
|
|
77
|
+
* environment, does not mutate its input and does not throw. A header value that is not a string is outside that: it is copied
|
|
78
|
+
* as it is and the blank-credential reading does not judge it. A header bag with an own `__proto__` member that holds an object
|
|
79
|
+
* is outside the agreement with the adapter too: the adapter's merge (`mergeHeaders`) assigns it through the prototype setter,
|
|
80
|
+
* this judge copies it as a plain member. What it does NOT answer: it does not send, does not validate the key, and does not
|
|
81
|
+
* read `Proxy-Authorization`. `key.value` contains the credential itself — do not log the result.
|
|
82
|
+
*/
|
|
83
|
+
export declare function anthropicCredentialHeadersOf(input: {
|
|
84
|
+
apiKey?: string;
|
|
85
|
+
headers?: Readonly<Record<string, string>>;
|
|
86
|
+
}): AnthropicCredentialHeaders;
|
|
46
87
|
/**
|
|
47
88
|
* Create a Brain for the Anthropic Messages API (`/v1/messages`) with **prompt caching** and
|
|
48
89
|
* **extended-thinking replay**. Translates the unified Context into an Anthropic request and the
|