@sema-agent/sdk 35.0.0 → 37.0.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.
Files changed (64) hide show
  1. package/README.md +133 -3
  2. package/dist/client.d.ts +3 -0
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +4 -0
  5. package/dist/client.js.map +1 -1
  6. package/dist/control-types.d.ts +2 -2
  7. package/dist/errors.d.ts +39 -8
  8. package/dist/errors.d.ts.map +1 -1
  9. package/dist/errors.js +42 -8
  10. package/dist/errors.js.map +1 -1
  11. package/dist/events.d.ts +134 -3
  12. package/dist/events.d.ts.map +1 -1
  13. package/dist/events.js.map +1 -1
  14. package/dist/health.d.ts +100 -10
  15. package/dist/health.d.ts.map +1 -1
  16. package/dist/health.js +13 -10
  17. package/dist/health.js.map +1 -1
  18. package/dist/index.d.ts +21 -6
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +10 -3
  21. package/dist/index.js.map +1 -1
  22. package/dist/resources/approvals.d.ts +4 -1
  23. package/dist/resources/approvals.d.ts.map +1 -1
  24. package/dist/resources/approvals.js +4 -1
  25. package/dist/resources/approvals.js.map +1 -1
  26. package/dist/resources/projects.d.ts +24 -0
  27. package/dist/resources/projects.d.ts.map +1 -0
  28. package/dist/resources/projects.js +19 -0
  29. package/dist/resources/projects.js.map +1 -0
  30. package/dist/resources/rules.d.ts +16 -11
  31. package/dist/resources/rules.d.ts.map +1 -1
  32. package/dist/resources/rules.js +2 -2
  33. package/dist/resources/rules.js.map +1 -1
  34. package/dist/resources/runs.d.ts +4 -2
  35. package/dist/resources/runs.d.ts.map +1 -1
  36. package/dist/resources/runs.js +4 -2
  37. package/dist/resources/runs.js.map +1 -1
  38. package/dist/resources/sessions.d.ts +44 -2
  39. package/dist/resources/sessions.d.ts.map +1 -1
  40. package/dist/resources/sessions.js +8 -0
  41. package/dist/resources/sessions.js.map +1 -1
  42. package/dist/resources/tool-approvals.d.ts +7 -6
  43. package/dist/resources/tool-approvals.d.ts.map +1 -1
  44. package/dist/resources/tool-approvals.js.map +1 -1
  45. package/dist/settings.d.ts +6 -0
  46. package/dist/settings.d.ts.map +1 -1
  47. package/dist/sse.d.ts +14 -4
  48. package/dist/sse.d.ts.map +1 -1
  49. package/dist/sse.js +23 -7
  50. package/dist/sse.js.map +1 -1
  51. package/dist/sync.d.ts +8 -4
  52. package/dist/sync.d.ts.map +1 -1
  53. package/dist/sync.js +6 -3
  54. package/dist/sync.js.map +1 -1
  55. package/dist/transport.d.ts +29 -5
  56. package/dist/transport.d.ts.map +1 -1
  57. package/dist/transport.js +29 -18
  58. package/dist/transport.js.map +1 -1
  59. package/dist/types.d.ts +273 -20
  60. package/dist/types.d.ts.map +1 -1
  61. package/dist/types.js +12 -0
  62. package/dist/types.js.map +1 -1
  63. package/openapi.yaml +615 -54
  64. package/package.json +2 -2
package/openapi.yaml CHANGED
@@ -895,8 +895,14 @@ paths:
895
895
  summary: Steer a RUNNING durable run — inject mid-flight direction (supervision).
896
896
  description: >
897
897
  design/80 D-A. The core of *supervision* (vs mere approve/deny): inject direction into a running run.
898
- AT-MOST-ONCE — steer is NOT idempotent (no retry). `trusted` is NOT a body field — the server derives it
899
- from the authenticated operator (the BFF's operator role); a network steer defaults to untrusted. A
898
+ AT-MOST-ONCE — steer is NOT idempotent (no retry). `trusted` is NOT a body field, and the caller's role does
899
+ not change how the text reaches the model (server >= 7.147.0): the body is ALWAYS delivered as USER input,
900
+ whether or not the caller is an operator — on the live leg the engine's "new message from the user while you
901
+ were working" section (a user message), on the parked / wake legs the engine's fenced data section
902
+ (`<<<UNTRUSTED supervisor steering message …>>>`) in the resumed run's first turn; never a `<system-reminder>`.
903
+ Operator identity only decides AUTHORIZATION (reaching another owner's run past the owner gate). The only text
904
+ delivered as system input is text the service itself mints (the `/decide` pointer text for a still-parked
905
+ workflow host). Servers <= 7.146.x minted an operator's steer body as a `<system-reminder>`. A
900
906
  durably PARKED run (row status `suspended` OR `needs_review`) → the steer is PARKED on the pending
901
907
  checkpoint and answered **202** `{status:<the row status the server read just before parking>,
902
908
  delivery:"queued"}`; it is injected when the run resumes. (server 7.16.0: `status` echoes the REAL
@@ -2447,7 +2453,11 @@ paths:
2447
2453
  `task_done` checkpoint and resume it as the next turn's input. This is NOT a gate decision: it never
2448
2454
  allows/denies a pending action — a pending gate ⇒ 409 `wake.gate_pending` (resolve through that gate's
2449
2455
  own decide entry; approvals are never bypassed). Empty park + no message ⇒ nothing to deliver.
2450
- Owner-scoped; operator principals may carry trusted (`<system-reminder>`-bearing) messages. Resume
2456
+ Owner-scoped. The `message` is ALWAYS delivered as USER input (server >= 7.147.0), whether or not the caller is
2457
+ an operator: the resumed turn reads it in the engine's fenced data section
2458
+ (`<<<UNTRUSTED supervisor steering message …>>>`), never as a `<system-reminder>` (servers <= 7.146.x minted an
2459
+ operator's message as one). Operator identity only decides AUTHORIZATION (an explicit operator passes the owner
2460
+ gate). Resume
2451
2461
  burns model budget — rate/quota/lease gates apply. 501 without the checkpoint store.
2452
2462
  requestBody:
2453
2463
  required: false
@@ -4609,6 +4619,114 @@ paths:
4609
4619
  schema: { $ref: '#/components/schemas/PolicyInfo' }
4610
4620
  '401': { $ref: '#/components/responses/Unauthorized' }
4611
4621
 
4622
+ /v1/projects:
4623
+ parameters:
4624
+ - $ref: '#/components/parameters/PrincipalHeader'
4625
+ get:
4626
+ tags: [projects]
4627
+ operationId: projectsList
4628
+ x-status: live # server >= 7.147.0 (contract GET /v1/projects). SDK projects.list().
4629
+ summary: List the project registry (read-only).
4630
+ description: >
4631
+ server >= 7.147.0 — the project registry's LIST face. The registry is published ONLY by the configuration center: a deployment with no center leg applying configuration has no registry
4632
+ and answers 501 `capability.unavailable` (capability bit `projects === false` reads the same fact — gate on the bit, never trial-by-501; ABSENT bit = an older server, both faces 404).
4633
+ Visibility fails closed: a fleet caller sees every registration; a caller with a verified principal sees only the registrations whose `registeredBy` is itself; no identity => 401.
4634
+ Archived registrations (`archivedAt` present) are NOT listed by default; `?archived=true` lists ONLY the archived ones; `?archived=false` = the default; any other value => 400 `request.query_invalid`.
4635
+ There is no write verb (create / update / archive answer 405 + `Allow: GET` today; a write face will get its own capability bit).
4636
+ parameters:
4637
+ - in: query
4638
+ name: archived
4639
+ required: false
4640
+ schema: { type: string, enum: ['true', 'false'] }
4641
+ responses:
4642
+ '200':
4643
+ description: The visible registrations (possibly empty).
4644
+ content:
4645
+ application/json:
4646
+ schema: { $ref: '#/components/schemas/ProjectsPage' }
4647
+ '400': { $ref: '#/components/responses/BadRequest' }
4648
+ '401': { $ref: '#/components/responses/Unauthorized' }
4649
+ '501': { $ref: '#/components/responses/NotImplemented' }
4650
+ /v1/projects/{projectId}:
4651
+ parameters:
4652
+ - $ref: '#/components/parameters/PrincipalHeader'
4653
+ - in: path
4654
+ name: projectId
4655
+ required: true
4656
+ schema: { type: string }
4657
+ get:
4658
+ tags: [projects]
4659
+ operationId: projectsGet
4660
+ x-status: live # server >= 7.147.0. SDK projects.get().
4661
+ summary: Read one registration (archived or not).
4662
+ description: >
4663
+ server >= 7.147.0 — one registry row (the same projection as a `GET /v1/projects` list row, key for key). Answers whether or not the registration is archived (a session row references it by id).
4664
+ `:projectId` must be a canonical UUID (an upper-case form is accepted and folded to lower case), else 400 `request.id_invalid`. 404 `not_found.project` = no such registration OR one the caller may not see — the two
4665
+ arms answer the same code and sentence (no existence oracle). 501 `capability.unavailable` = no registry on this deployment (see the list face). The session-to-project relation is read on the session view's top-level `projectId`.
4666
+ responses:
4667
+ '200':
4668
+ description: The registration row.
4669
+ content:
4670
+ application/json:
4671
+ schema: { $ref: '#/components/schemas/ProjectRow' }
4672
+ '400': { $ref: '#/components/responses/BadRequest' }
4673
+ '401': { $ref: '#/components/responses/Unauthorized' }
4674
+ '404': { $ref: '#/components/responses/NotFound' }
4675
+ '501': { $ref: '#/components/responses/NotImplemented' }
4676
+ /v1/sessions/{sessionId}/rewind-files:
4677
+ parameters:
4678
+ - $ref: '#/components/parameters/PrincipalHeader'
4679
+ - in: path
4680
+ name: sessionId
4681
+ required: true
4682
+ schema: { type: string }
4683
+ post:
4684
+ tags: [sessions]
4685
+ operationId: sessionsRewindFiles
4686
+ x-status: live # server >= 7.147.0 (contract section 28). SDK sessions.rewindFiles().
4687
+ summary: Restore the session's tracked files to an older boundary, outside any run (code only).
4688
+ description: >
4689
+ server >= 7.147.0 (contract section 28) — the CC "Restore code" arm as an immediate door: NO model call, NO session entry written, NO conversation fork — it only converges the session's TRACKED files (the ones the agent changed through
4690
+ Edit / Write / NotebookEdit; the same tracked set as the submit body's `restoreFiles` / `rewindFilesTo`) to an older boundary. The restore itself happens in the engine's out-of-run verb; this service does auth, handle translation,
4691
+ deployment-shape and occupancy checks, and pass-through. Body `{ to, dryRun? }` is closed (shape before value): not an object / no `to` / a key outside the set (including `acceptPartialRestore`, which belongs to the submit body's run
4692
+ seat) => 400 `request.body_shape`. `to` = a rewind handle (a prompt's `taskId`, the session view's `messages[].taskId`), 1..255 chars. `dryRun: true` previews only (no file written).
4693
+ 200 is the engine's `RewindFilesResult` verbatim, told apart by `dryRun`: `{ dryRun: true, preview }` where `preview` is `{ filesChanged, insertions, deletions }` OR `null` ("this deployment cannot give stats" — NOT "nothing would change");
4694
+ `{ dryRun: false, restore }` with the per-file ledger (`outcome` is `complete` or `partial`; a partial restore is a 200 listing every refused / failed file, and re-sending the same request keeps converging).
4695
+ Gate order: 429 `limit.rate_exceeded` -> capability facts (501) -> id shape (400) -> session head (404) -> owner or explicit operator (a stranger and "no such session" answer byte-identical 404) -> corrupt archive (500) -> body (400)
4696
+ -> the one execution-start resolver (read-only mirror 409 `conflict.session_mirror` + `forkPath`; `conflict.fork_in_progress`; `conflict.session_id_retired`; `execution_lane.not_served` + `boundLane`) -> workspace root (host lane: 409
4697
+ `conflict.session_workspace_unknown`) -> `to` resolution (404 `rewind_files_to.unknown_event`) -> the durable claim (409 `conflict.session_active_run` with `activeTaskId`) -> the engine. Not billed.
4698
+ Probe with the capability bits `sessionRewindFiles` / `sessionRewindFilesPreview`; an ABSENT bit = an older server (404 `not_found.route`). The SDK does not auto-retry (a POST with no idempotency key).
4699
+ requestBody:
4700
+ required: true
4701
+ content:
4702
+ application/json:
4703
+ schema: { $ref: '#/components/schemas/SessionRewindFilesRequest' }
4704
+ responses:
4705
+ '200':
4706
+ description: The engine's rewind result, told apart by `dryRun`.
4707
+ content:
4708
+ application/json:
4709
+ schema: { $ref: '#/components/schemas/SessionRewindFilesResult' }
4710
+ '400': { $ref: '#/components/responses/BadRequest' }
4711
+ '401': { $ref: '#/components/responses/Unauthorized' }
4712
+ '404': { $ref: '#/components/responses/NotFound' }
4713
+ '409':
4714
+ description: >-
4715
+ Told apart by `errorCode` (all `ConflictError`): `conflict.session_active_run` (body `activeTaskId` — the run holding the session's durable claim, including one parked on an approval; wait or cancel it, then resend);
4716
+ `rewind.session_busy` (TRANSIENT — this engine process has work running / queued on the session or a write it issued has not settled; nothing was touched; resend after it ends);
4717
+ `conflict.session_workspace_unknown` (host lane — this process does not know the session's restorable working directory: the submit body's `cwd` is registered inside the server process and is gone after a server restart until the
4718
+ next submit that carries `cwd`, or the registered directory is no longer on disk; real restore and `dryRun` judge the same, nothing written, the sentence never echoes a path — send a submit with `cwd` first, then resend);
4719
+ `rewind.files_env_unsupported` / `rewind.store_unconfigured` (no filesystem-mounting execution environment / no file-history store — the capability bit is false and the door answers 501 first; these rows are completeness: change the deployment);
4720
+ plus the shared execution-start refusals (`conflict.session_mirror` + `forkPath`, `conflict.fork_in_progress`, `conflict.session_id_retired`, `execution_lane.not_served` + `boundLane`).
4721
+ content:
4722
+ application/json:
4723
+ schema: { $ref: '#/components/schemas/ErrorResponse' }
4724
+ '422':
4725
+ description: '`rewind_snapshot.unresolvable` — that entry has no usable file-history boundary (never minted, evicted by retention, or unreadable).'
4726
+ content:
4727
+ application/json:
4728
+ schema: { $ref: '#/components/schemas/ErrorResponse' }
4729
+ '501': { $ref: '#/components/responses/NotImplemented' }
4612
4730
  /v1/models:
4613
4731
  parameters:
4614
4732
  - $ref: '#/components/parameters/PrincipalHeader'
@@ -6616,10 +6734,10 @@ paths:
6616
6734
  🔴 SETTLE RULE (server >= 7.145.0, one rule for both redeem doors — cc-import and local-import answer the SAME receipt from ONE mint point):
6617
6735
  when the redemption walk completes with the engine's COMPLETE member table, the redemption settles — `200` + the receipt
6618
6736
  `RuleImportReceipt` `{ members, rev }`, one row per member in the engine's walk order. A member the engine refused is a row with
6619
- outcome `indeterminate` + reason `store_refused` + `detail` (the engine's sentence verbatim: its refusal carries free text only, so the
6620
- server does not guess whether it is a verdict or a transient, and neither claims it landed nor guarantees it did not); the ticket is
6737
+ outcome `indeterminate` (it is NOT KNOWN whether it landed) or `refused` (KNOWN not written; server >= 7.146.0) — both carry `reason` (the engine's `RuleRefusalCode` verbatim; a 7.145.x server's one word is `store_refused`) + `detail` (the engine's sentence verbatim); see the `RuleImportMember`
6738
+ schema for the arm definitions (one definition). The ticket is
6621
6739
  USED (the same ticket again ⇒ 404). Reconcile against `GET /v1/rules` by `key` (the identity triple of a listing row); to fill a gap,
6622
- run a fresh import (idempotent — landed members read `no-op`). `refused` is a RESERVED outcome word, not minted by this server.
6740
+ run a fresh import (idempotent — landed members read `no-op`).
6623
6741
  <= 7.144.x answered such a member with 503 `state.rule_import_retry` until the ticket expired, with the old body `{ result: { members, rev } }` (retired, no alias).
6624
6742
  requestBody:
6625
6743
  required: true
@@ -7430,7 +7548,8 @@ components:
7430
7548
  SEVERAL producers share this status, so `errorCode` — not the status — is the branch key. Known today:
7431
7549
  (a) session-ownership — reusing a `sessionId` that belongs to another principal; mapped to AuthError.
7432
7550
  (b) `execution_lane_not_allowed` — this worker's execution lane is outside the principal's policy
7433
- allowlist; the body carries `allowedLanes` + `lane`. Mapped to plain APIError (no typed class yet);
7551
+ allowlist; the body carries `allowedLanes` + `lane` (lane words of `Capabilities.executionLane.provider`: `none` from server
7552
+ 7.147.0, `in-process` on servers <= 7.146.x). Mapped to plain APIError (no typed class yet);
7434
7553
  raised while PREPARING a task, so it can appear on any submit endpoint, not only this one.
7435
7554
  (c) `memory.admission_denied` (server >=7.0.0, synchronous `POST /v1/tasks`) — the principal holds no
7436
7555
  grant on the requested org-memory tenant plane, or the verdict tried to widen the request, or the
@@ -8522,11 +8641,10 @@ components:
8522
8641
  environment (`{ ...process.env }` verbatim, CC interactive shape); `scrub` = the default scrub (credential-shaped variables
8523
8642
  stripped), accepted on EVERY lane and deployment. ABSENT = the default scrub AND clears the session's previous
8524
8643
  declaration (not sticky). Verdicts (all three submit doors): out-of-vocabulary ⇒ 400 `request.field_invalid` (the sentence
8525
- names both words); `all` on a non-host lane (e2b / k8s / local-docker / ssh / adb / device / in-process) ⇒ 400
8526
- `request.field_invalid` "applies to the host lane only" (`scrub` still accepted); `all` with no authorizer (no session) ⇒
8527
- 400 `request.field_invalid`; hosted deployment (`REQUIRE_PRINCIPAL=true`) × `all` ⇒ 422 `request.host_posture_refused`
8644
+ names both words); `all` on a non-host lane (e2b / k8s / local-docker / ssh / adb / device / `none`; the no-execution-environment lane was `in-process` on servers <= 7.146.x) ⇒ 400
8645
+ `request.field_invalid` "applies to the host lane only" (`scrub` still accepted); hosted deployment (`REQUIRE_PRINCIPAL=true`) × `all` ⇒ 422 `request.host_posture_refused`
8528
8646
  (same code / status as the write-containment leg; reach = `hostPostureDeclarationsHonored`, NOT
8529
- `TASK_WRITE_FACE_ESCALATION`); resume legs replay the persisted body under the same three checks, folded into 409
8647
+ `TASK_WRITE_FACE_ESCALATION`); resume legs replay the persisted body under the same lane and hosted-deployment checks, folded into 409
8530
8648
  `resume_blocked_by_policy`; servers <= 7.105.0 ⇒ 400 `request.body_shape` (unknown key, `unknownKeys: ["inheritEnv"]`).
8531
8649
  READ `capabilities.projectContext` BEFOREHAND (host lane ∧ not hosted — equal to this key's lane + reach gates for every
8532
8650
  combination); `taskWriteFaceOpen` is NOT its reading. Residual (server S-908): the binding is keyed by SESSION and written
@@ -10390,6 +10508,34 @@ components:
10390
10508
  allOf: [{ $ref: '#/components/schemas/CredentialPlaneCapability' }]
10391
10509
  description: >-
10392
10510
  server >= 7.137.0 (config-dependent; the object is always present): the member git credential plane's one reading — see `CredentialPlaneCapability`. ABSENT = an older server: render "plane off, reason unknown".
10511
+ settingsContract:
10512
+ allOf: [{ $ref: '#/components/schemas/SettingsContractCapability' }]
10513
+ description: >-
10514
+ server >= 7.147.0 (a version bit: always present, does not vary with the deployment shape) — the embedded settings contract's version and, per hook entry type, the field names its reader carries; see `SettingsContractCapability`.
10515
+ Listed is not executed (`mcp_tool` is refused whole). ABSENT = server <= 7.146.x: no such table.
10516
+ projects:
10517
+ type: boolean
10518
+ description: >-
10519
+ server >= 7.147.0 (config-dependent): the project registry read face (`GET /v1/projects[?archived]` · `GET /v1/projects/{id}`) resolves. true iff a registry exists — it is published only by the configuration center
10520
+ (a center configured and not dry-run); false => both doors answer 501 `capability.unavailable`. Read-only: the bit does not cover write verbs (none exist; a write face gets its own bit). ABSENT = an older server (both doors 404).
10521
+ sessionRewindFiles:
10522
+ type: boolean
10523
+ description: >-
10524
+ server >= 7.147.0 (facility + config): `POST /v1/sessions/{id}/rewind-files` resolves on this deployment = file-history store ∧ session head read ∧ anchor store ∧ an execution lane with hands ∧ a workspace that survives one
10525
+ execution (multi-tenant host / local-docker / e2b / k8s are false) ∧ the session store is owned by this process (`DB_BACKEND=local`; mysql / pg are false). False => the door answers 501. `FILE_HISTORY_CAPTURE=false` does not affect it.
10526
+ Distinct from `rewindFilesTo` (rewind as part of a submit, running a run). ABSENT = an older server (the door 404s).
10527
+ sessionRewindFilesPreview:
10528
+ type: boolean
10529
+ description: >-
10530
+ server >= 7.147.0: the previous bit ∧ the store implements `diffStats` (local files: true; the SQL twins: false today). False is NOT "dryRun refused": dryRun is accepted and answers `preview: null`. ABSENT = an older server.
10531
+ adoptionImport:
10532
+ allOf: [{ $ref: '#/components/schemas/AdoptionImportCapability' }]
10533
+ description: >-
10534
+ server >= 7.146.0 (present-iff, per caller): the adoption batch import door is usable by THIS caller — deployment has the adoption log ∧ the session store has staged import ∧ the caller is, verbatim, the source principal of an adopted row.
10535
+ ABSENT = an older worker, or this caller has nothing to import today (same action: do not offer the import entry).
10536
+ engine:
10537
+ allOf: [{ $ref: '#/components/schemas/EngineCapability' }]
10538
+ description: 'server >= 7.146.0 (always present): the engine lifecycle face — see EngineCapability. ABSENT = an older worker (no handover lane).'
10393
10539
  inherit_env.own_credential_values_withheld:
10394
10540
  type: boolean
10395
10541
  description: >-
@@ -10945,6 +11091,7 @@ components:
10945
11091
  outputStyle: { type: boolean }
10946
11092
  env: { type: boolean, description: 'TRUE on the single-user host lane (server emits `cwdHonored(config)`). It is NOT hard-coded false any more — the old always-false value predated the per-task shellEnv seam and hid a live capability.' }
10947
11093
  hooks: { type: boolean, description: 'Single-user deployments only (`requirePrincipal !== true`).' }
11094
+ autoCompactEnabled: { type: boolean, description: 'server >= 7.146.0, constant true — the request key `settings.autoCompactEnabled` (boolean; handed verbatim to the engine''s auto-compaction seat `compaction.autoCompact`; absent = the deployment seat''s default, i.e. on) is accepted. ABSENT = an older server (the key answers 400 `request.body_shape`).' }
10948
11095
  pluginHooks: { type: boolean, description: 'server >= 7.133.0 — the request `settings.hooks[]` PLUGIN-CONTEXT keys (command entry `plugin { name, root, dataDir?, options? }` / exec-form `args`) are accepted; same predicate as `hooks` (single-user true, multi-tenant false). ABSENT or false = the keys are stripped silently — send only on sight of the bit.' }
10949
11096
  managedHookGroups: { type: boolean, description: 'server >= 7.133.0 — the request `settings.hooks[]` GROUP `source` key (managed lanes `managedPolicy` / `managedPlugin:<name>`) is accepted; same predicate as `hooks`. ABSENT or false = stripped silently (the managed-lane semantics do not apply, it is not a refusal).' }
10950
11097
  httpHookAllowlists: { type: boolean, description: 'server >= 7.142.0 — the request keys `settings.allowedHttpHookUrls` / `settings.httpHookAllowedEnvVars` (the settings-schema package''s two http-hook allowlists) are read and enforced at the dial-out point. The SAME predicate as `hooks` (true on the single-user lane; false where `settings.hooks` is ignored). ABSENT = server <= 7.141.x, which answers 400 `request.body_shape` for those keys — send only on sight of the bit.' }
@@ -11361,15 +11508,21 @@ components:
11361
11508
  conjunction (shell spawned it AND no remote URL AND `REMOTE_EXEC` in {unset, host}) — none of which
11362
11509
  the engine said, and which drifts the moment the shell talks to a remote engine (it reads ITS OWN
11363
11510
  box's env).
11364
- `provider` is the server's EIGHT-word `ExecutionLane` (`"in-process"` ∪ `RemoteExecProvider`; word table owner = release
11365
- bytes `dist/execution-lane-caps.js` `EXECUTION_LANE_WORDS`). 🔴 DEFAULT WORD (S-602, server >= 7.97.0, BREAKING value
11366
- shape): `REMOTE_EXEC` UNSET ⇒ `"in-process"` = this deployment has NO execution lane (no hands; core mounts its stub
11367
- env, `toolsOnThisHost:false`) — 7.86.0–7.96.x folded that shape into `"host"` / `true`. EXCEPTION: the single-machine
11368
- default `CONFIG_PROVIDER=local` with `REMOTE_EXEC` unset gets the config's implicit tail arm `"host"` (hands on this
11369
- box, NO OS sandbox). `in-process ⇒ no hands` always holds; the converse does not (a run can shed its hands on
11370
- `host`). Read the eight words exhaustively — an open-string reader silently drops `in-process` into its default arm.
11511
+ `provider` is the server's EIGHT-word `ExecutionLane` (the word table is settings-schema `EXECUTION_LANE_WORDS`; release
11512
+ bytes `dist/execution-lane-caps.js` `ALL_EXECUTION_LANES` is that table itself from server 7.147.0 on). 🔴 `none` (server
11513
+ >= 7.147.0) = this deployment DECLARED no execution environment for the agent's tools (`REMOTE_EXEC=none`: no hands — core
11514
+ mounts its stub env, `toolsOnThisHost:false`, `isolated` absent). Every deployment names its lane from 7.147.0 on — the
11515
+ declaration is env `REMOTE_EXEC` (under `CONFIG_PROVIDER=local`, `config.d/remote-exec.json` also declares it), and a
11516
+ deployment whose final lane has no declaration refuses to start — so there is no default word and no "unset" state. Servers <= 7.146.x differed:
11517
+ `REMOTE_EXEC` UNSET answered the word `in-process` at this position (7.97.0–7.146.x; 7.86.0–7.96.x folded that shape into
11518
+ `host` / `true`), and the single-machine default `CONFIG_PROVIDER=local` with `REMOTE_EXEC` unset got the implicit tail arm
11519
+ `host`; this contract no longer carries `in-process` (zero alias — a <= 7.146.x body with that word fails validation).
11520
+ `none ⇒ no hands` always holds; the converse does not (a run can shed its hands on `host`). Read the eight words
11521
+ exhaustively — an open-string reader silently drops `none` into its default arm. The same lane words ride three more
11522
+ places: `ExecutionPlacement.lane`, the top-level `boundLane` of the 409 `execution_lane.not_served` /
11523
+ `execution_lane.tree_bound` bodies, and the `lane` of the 403 `execution_lane_not_allowed` body.
11371
11524
  `isolated` (server >= 7.106.0 / S-281) — are the hands inside an OS-level isolation boundary; PRESENT-IFF this lane
11372
- has hands (`in-process` ⇒ absent, not `false`); absent on an older server too — read absence as UNKNOWN, never as
11525
+ has hands (`none` ⇒ absent, not `false`); absent on an older server too — read absence as UNKNOWN, never as
11373
11526
  `false`. `isolated === false ∧ toolsOnThisHost` is the "no sandbox" reading a shell renders.
11374
11527
  `toolsOnThisHost` is owned by `task-cwd.ts`'s `toolsRunOnThisHost` — the SAME FUNCTION that decides
11375
11528
  whether a self-scanned skill gets a `baseDir`.
@@ -11381,9 +11534,9 @@ components:
11381
11534
  An ABSENT key must NOT be read as either side — that is exactly the state this bit was minted to end.
11382
11535
  required: [provider, toolsOnThisHost]
11383
11536
  properties:
11384
- provider: { type: string, enum: [in-process, host, e2b, k8s, ssh, adb, local-docker, device], description: 'Eight words, the server''s `ExecutionLane`. `REMOTE_EXEC` unset ⇒ `in-process` (no hands; S-602, >= 7.97.0), except the single-machine default `CONFIG_PROVIDER=local` ⇒ implicit `host`.' }
11537
+ provider: { type: string, enum: [none, host, e2b, k8s, ssh, adb, local-docker, device], description: 'Eight words, the server''s `ExecutionLane`. `none` = the deployment declared no execution environment (no hands; server >= 7.147.0, `REMOTE_EXEC=none`); servers 7.97.0–7.146.x answered `in-process` at this position, which this contract no longer accepts.' }
11385
11538
  toolsOnThisHost: { type: boolean, description: 'The tools run on the process that answered this request (server-absolute paths mean something to the model''s tools).' }
11386
- isolated: { type: boolean, description: 'server >= 7.106.0 (S-281): the hands run inside an OS-level isolation boundary (value = the lane table''s `isolation` bit via the single boolean door `laneIsolated`). PRESENT-IFF this lane has hands — `in-process` ⇒ absent, not false.' }
11539
+ isolated: { type: boolean, description: 'server >= 7.106.0 (S-281): the hands run inside an OS-level isolation boundary (value = the lane table''s `isolation` bit via the single boolean door `laneIsolated`). PRESENT-IFF this lane has hands — `none` ⇒ absent, not false.' }
11387
11540
  taskWriteFaceOpen:
11388
11541
  type: boolean
11389
11542
  description: >
@@ -12877,9 +13030,269 @@ components:
12877
13030
  compat:
12878
13031
  $ref: '#/components/schemas/ModelCompat'
12879
13032
  description: >-
12880
- S-188 (server >=7.69.0, settings-schema >=1.10.0) — this row's wire-compatibility declaration for the
12881
- openai-completions lane. ABSENT = this model declared nothing; see ModelCompat for the two causes of
13033
+ S-188 (server >=7.69.0, settings-schema >=1.10.0) — this row's wire-compatibility declaration for ITS lane: five openai-completions keys, or (server >= 7.147.0) five anthropic-messages keys (before 7.147.0 that
13034
+ lane's declaration was dropped whole). ABSENT = this model declared nothing; see ModelCompat for the two causes of
12882
13035
  absence and why absence must NOT be rendered as "the operator did not write one".
13036
+ thinkingLevelMap:
13037
+ $ref: '#/components/schemas/ModelThinkingLevelMap'
13038
+ description: >-
13039
+ server >= 7.147.0 (present-iff the catalog entry declared it; `{}` is carried as declared) — the row's per-rung endpoint spelling of thinking. Read the SAME row's `supportsThinkingOff` / `supportedEffortLevels` (the engine's reading of this
13040
+ declaration), never derive "can it be turned off" or "which rungs" from this key. On an anthropic-messages row the current engine does not read it (the row still carries it). The env deployment has no such seat.
13041
+
13042
+ AdoptionImportCapability:
13043
+ type: object
13044
+ description: >-
13045
+ server >= 7.146.0 — `Capabilities.adoptionImport`: the adoption batch import door (`POST /v1/adoption/{id}/sessions`) is usable by THIS caller. `adoptionId` is the `:id` in that URL (the caller's own adopted row);
13046
+ `maxSessions` / `maxSessionBytes` are the effective values of `ADOPTION_IMPORT_MAX_SESSIONS` (default 100) / `ADOPTION_IMPORT_MAX_SESSION_BYTES` (default 6291456, range 1048576..8388593).
13047
+ additionalProperties: true
13048
+ required: [adoptionId, maxSessions, maxSessionBytes]
13049
+ properties:
13050
+ adoptionId: { type: string }
13051
+ maxSessions: { type: integer, minimum: 1 }
13052
+ maxSessionBytes: { type: integer, minimum: 1048576, maximum: 8388593 }
13053
+
13054
+ EngineCapability:
13055
+ type: object
13056
+ description: >-
13057
+ server >= 7.146.0 — `Capabilities.engine`, the engine lifecycle face. `handover` is true iff the two handover-lane doors (`POST /v1/engine/handover` · `POST /v1/engine/attach`) resolve on this deployment
13058
+ (attach-lease leg assembled ∧ not multi-tenant ∧ the leg still observing); otherwise those doors answer 501 `capability.engine_handover_unavailable`.
13059
+ additionalProperties: true
13060
+ required: [handover]
13061
+ properties:
13062
+ handover: { type: boolean }
13063
+
13064
+ ProjectContextItem:
13065
+ type: object
13066
+ description: 'One context entry of a project registration: `folder` / `file` = an absolute host path, `note` = free text.'
13067
+ additionalProperties: true
13068
+ required: [kind, value]
13069
+ properties:
13070
+ kind: { type: string, enum: [folder, file, note] }
13071
+ value: { type: string }
13072
+
13073
+ ProjectRow:
13074
+ type: object
13075
+ description: >-
13076
+ server >= 7.147.0 — one project registry row: `{ id, ...the settings contract's ProjectRegistration keys under their own names }` (the same projection for a `GET /v1/projects` list row and the `GET /v1/projects/{projectId}` body;
13077
+ no `name` / `repos` / `createdAt` aliases). Optional keys are absent when not registered — no empty values are minted. `id` is the registry key (a lower-case canonical UUID — the same value as the submit body's `projectId` and the session
13078
+ view's `projectId`). `archivedAt` present = archived.
13079
+ additionalProperties: true
13080
+ required: [id, displayName, gitRemotes, defaultScopes, registeredBy, registeredAt]
13081
+ properties:
13082
+ id: { type: string }
13083
+ displayName: { type: string }
13084
+ goal: { type: string }
13085
+ contextItems: { type: array, items: { $ref: '#/components/schemas/ProjectContextItem' } }
13086
+ gitRemotes: { type: array, items: { type: string } }
13087
+ defaultScopes: { type: array, items: { type: string } }
13088
+ notes: { type: string }
13089
+ icon: { type: string }
13090
+ color: { type: string }
13091
+ registeredBy: { type: string }
13092
+ registeredAt: { type: string, format: date-time }
13093
+ archivedAt: { type: string, format: date-time }
13094
+
13095
+ ProjectsPage:
13096
+ type: object
13097
+ description: 'server >= 7.147.0 — the `GET /v1/projects` body: the visible registrations (always present, possibly empty).'
13098
+ additionalProperties: true
13099
+ required: [projects]
13100
+ properties:
13101
+ projects: { type: array, items: { $ref: '#/components/schemas/ProjectRow' } }
13102
+
13103
+ SessionRewindFilesRequest:
13104
+ type: object
13105
+ description: >-
13106
+ `POST /v1/sessions/{sessionId}/rewind-files` body (server >= 7.147.0), CLOSED — shape before value. There is no `acceptPartialRestore` (a partial restore answers 200 with the ledger).
13107
+ additionalProperties: false
13108
+ required: [to]
13109
+ properties:
13110
+ to: { type: string, minLength: 1, maxLength: 255, description: 'A rewind handle this server minted (a prompt''s taskId, or a message''s eventId) — the same handle space and the same reader as the submit body''s `rewindFilesTo`. Unknown => 404 `rewind_files_to.unknown_event`.' }
13111
+ dryRun: { type: boolean, description: 'true => preview only; no file is written. Absent = false.' }
13112
+
13113
+ SessionRewindFilesDiffStats:
13114
+ type: object
13115
+ description: 'The files a rewind changed / would change (engine `FileHistoryDiffStats`); `filesChanged` paths are verbatim (never truncated). A preview is an UPPER BOUND.'
13116
+ additionalProperties: true
13117
+ required: [filesChanged, insertions, deletions]
13118
+ properties:
13119
+ filesChanged: { type: array, items: { type: string } }
13120
+ insertions: { type: integer, minimum: 0 }
13121
+ deletions: { type: integer, minimum: 0 }
13122
+
13123
+ SessionRewindLedger:
13124
+ type: object
13125
+ description: >-
13126
+ The per-file restore ledger (engine `FileHistoryRestoreResult`; `outcome` is only `complete` or `partial` here — `failed` is a thrown engine refusal answered as an error code). `partial` lists EVERY refused / failed file;
13127
+ per-file idempotent. Free-text leaves pass the egress seat (paths one line, unbounded; reasons one line, bounded to 500 code units; credential-shaped spans masked).
13128
+ additionalProperties: true
13129
+ required: [outcome, filesChanged, identicalSkipped, refused, failed]
13130
+ properties:
13131
+ outcome: { type: string, enum: [complete, partial] }
13132
+ filesChanged: { type: array, items: { type: string } }
13133
+ identicalSkipped: { type: array, items: { type: string } }
13134
+ refused:
13135
+ type: array
13136
+ items:
13137
+ type: object
13138
+ additionalProperties: true
13139
+ required: [path, reason, class]
13140
+ properties:
13141
+ path: { type: string }
13142
+ reason: { type: string }
13143
+ class: { type: string, description: 'The engine''s closed word (`link_safety` / `base_unavailable` / `key_unresolvable`); read as an open set.' }
13144
+ failed:
13145
+ type: array
13146
+ items:
13147
+ type: object
13148
+ additionalProperties: true
13149
+ required: [path, reason]
13150
+ properties:
13151
+ path: { type: string }
13152
+ reason: { type: string }
13153
+ modeNotPreserved: { type: integer, minimum: 0, description: 'Files whose recorded POSIX mode could not be re-applied (an environment without the optional mode face).' }
13154
+ error: { $ref: '#/components/schemas/SessionRewindLedgerError' }
13155
+
13156
+ SessionRewindLedgerError:
13157
+ type: object
13158
+ description: 'A store fault on the ledger (present iff the store answered one). The engine''s `code` member is `errorCode` on this wire; `permanence` verbatim (absent = the store did not judge).'
13159
+ additionalProperties: true
13160
+ required: [errorCode, message]
13161
+ properties:
13162
+ errorCode: { type: string }
13163
+ message: { type: string }
13164
+ permanence: { type: string, enum: [transient, terminal] }
13165
+
13166
+ SessionRewindFilesPreviewResult:
13167
+ type: object
13168
+ description: 'The `dryRun: true` 200 body: `preview` is the stats, or null = this deployment gives no stats (NOT "nothing would change").'
13169
+ additionalProperties: true
13170
+ required: [dryRun, preview]
13171
+ properties:
13172
+ dryRun: { const: true }
13173
+ preview:
13174
+ oneOf:
13175
+ - { $ref: '#/components/schemas/SessionRewindFilesDiffStats' }
13176
+ - { type: 'null' }
13177
+
13178
+ SessionRewindFilesRestoreResult:
13179
+ type: object
13180
+ description: 'The `dryRun: false` (default) 200 body: `restore` is the per-file ledger.'
13181
+ additionalProperties: true
13182
+ required: [dryRun, restore]
13183
+ properties:
13184
+ dryRun: { const: false }
13185
+ restore: { $ref: '#/components/schemas/SessionRewindLedger' }
13186
+
13187
+ SessionRewindFilesResult:
13188
+ description: 'server >= 7.147.0 — the engine''s `RewindFilesResult` verbatim, discriminated by `dryRun`.'
13189
+ oneOf:
13190
+ - { $ref: '#/components/schemas/SessionRewindFilesPreviewResult' }
13191
+ - { $ref: '#/components/schemas/SessionRewindFilesRestoreResult' }
13192
+
13193
+ ModelThinkingLevelMap:
13194
+ type: object
13195
+ description: >-
13196
+ server >= 7.147.0 — one row's per-rung endpoint spelling of thinking, the catalog entry's `thinkingLevelMap` verbatim: keys ⊆ `off|minimal|low|medium|high|xhigh|max`, values a non-empty string (what that rung sends to the endpoint)
13197
+ or `null` (the endpoint does not support that rung). `{}` = declared, no overrides.
13198
+ additionalProperties: false
13199
+ properties:
13200
+ off: { type: [string, 'null'], minLength: 1 }
13201
+ minimal: { type: [string, 'null'], minLength: 1 }
13202
+ low: { type: [string, 'null'], minLength: 1 }
13203
+ medium: { type: [string, 'null'], minLength: 1 }
13204
+ high: { type: [string, 'null'], minLength: 1 }
13205
+ xhigh: { type: [string, 'null'], minLength: 1 }
13206
+ max: { type: [string, 'null'], minLength: 1 }
13207
+
13208
+ PayloadTruncated:
13209
+ type: object
13210
+ description: >-
13211
+ server >= 7.147.0 — present iff a PARKED REDELIVERY frame (idle-time arrival, drained at the next stream open) exceeded the inbox byte budget (65,535 UTF-8 bytes of the serialized extension keys on the narrowest backend) and was
13212
+ replaced by its MINIMAL form: dedup-key positions + the attribution side-record (when it still fits) + `summary` + `injected:false` (`task_notification`) / `runId` `status` `summary` (`workflow_complete`). Every other key is absent. Presence = the frame is not the full form.
13213
+ additionalProperties: true
13214
+ required: [droppedKeys, bytes]
13215
+ properties:
13216
+ droppedKeys: { type: array, items: { type: string }, description: 'The dropped key names in the full form''s key order (the last one is `summary` when the side-record did not fit either).' }
13217
+ bytes: { type: integer, minimum: 0, description: 'The UTF-8 byte count of the full form''s extension keys.' }
13218
+
13219
+ SemaPeerNotice:
13220
+ type: object
13221
+ description: >-
13222
+ server >= 7.147.0 — the typed body of a receipt / idle card (`_sema_provenance.peerMeta.notice`). `state` is an OPEN string, verbatim (receipts `held` / `held_by_policy` / `denied` / `expired` / `delivered` / `refused` / `dropped`; idle
13223
+ `idle` / `exited` / `unavailable` / `expired`; out-of-vocabulary words pass through). `recipient` / `target` / `detail` / `dropReason` are redacted.
13224
+ additionalProperties: true
13225
+ required: [state]
13226
+ properties:
13227
+ state: { type: string }
13228
+ refSeq: { type: integer }
13229
+ recipient: { type: string }
13230
+ dropReason: { type: string }
13231
+ finishedAt: { type: number }
13232
+ detail: { type: string }
13233
+ target: { type: string }
13234
+
13235
+ SemaPeerMeta:
13236
+ type: object
13237
+ description: >-
13238
+ server >= 7.147.0 — the typed peer metadata of a session-inbox record (the engine's authoritative copy); identity / addressing strings verbatim. NEVER projected (credential / identity-token class): `senderKey`, `gateReceiptId`, `occupant`, `fromOccupant`.
13239
+ additionalProperties: true
13240
+ properties:
13241
+ fromSession: { type: string }
13242
+ fromRoot: { type: string }
13243
+ fromMode: { type: string, enum: [bypass, prompting] }
13244
+ kind: { type: string, description: 'Open set; today `peer_message` / `idle_notice` / `delivery_notice` / `idle_subscription` / `engine_frame`.' }
13245
+ fromScope: { type: string }
13246
+ notice: { $ref: '#/components/schemas/SemaPeerNotice' }
13247
+ urgent: { type: boolean }
13248
+
13249
+ SemaProvenance:
13250
+ type: object
13251
+ description: >-
13252
+ The `task_notification._sema_provenance` attribution side-record — typed attribution, never model text. `kind` is CLOSED (server passes all four core lane words; an out-of-vocabulary value drops the WHOLE key and counts
13253
+ `server.trace.projection-input-malformed`, which on the wire is the same as absent). Present together with its carrier (`agentMessage` / `crossSessionMessage` / `crossSessionNotice` / `inboxNotice`) on a full-form frame; the ONE exception is the minimal form of a parked redelivery frame (`payloadTruncated` present): the carrier is dropped whole and this side-record is kept (attribution travels with the text), so read the carrier only after checking it is there.
13254
+ additionalProperties: true
13255
+ required: [kind, from, taskId, seq]
13256
+ properties:
13257
+ kind: { type: string, enum: [agent_message, cross_session_message, cross_session_notice, inbox_notice] }
13258
+ from: { type: string }
13259
+ taskId: { type: string }
13260
+ seq: { type: integer }
13261
+ agentType: { type: string }
13262
+ peerMeta: { $ref: '#/components/schemas/SemaPeerMeta' }
13263
+
13264
+ TaskNotificationCrossSessionMessage:
13265
+ type: object
13266
+ description: 'server >= 7.147.0 — a message from a peer session. `from` (canonical encoded address), `fromSession`, `fromScope` verbatim; `fromName` and `body` (UNTRUSTED peer text) are redacted.'
13267
+ additionalProperties: true
13268
+ required: [from, body]
13269
+ properties:
13270
+ from: { type: string }
13271
+ fromSession: { type: string }
13272
+ fromName: { type: string }
13273
+ fromMode: { type: string, enum: [bypass, prompting] }
13274
+ fromScope: { type: string }
13275
+ body: { type: string }
13276
+
13277
+ TaskNotificationCrossSessionNotice:
13278
+ type: object
13279
+ description: 'server >= 7.147.0 — a delivery receipt / peer idle notice. `text` is the sentence the engine rendered for the MODEL (redacted); render the card from `_sema_provenance.peerMeta.notice`, do not parse `text`.'
13280
+ additionalProperties: true
13281
+ required: [kind, text]
13282
+ properties:
13283
+ kind: { type: string, enum: [delivery_notice, idle_notice] }
13284
+ text: { type: string }
13285
+
13286
+ TaskNotificationInboxNotice:
13287
+ type: object
13288
+ description: 'server >= 7.147.0 — an inbox count line: a drain stopped with letters still in the box. Non-negative integers; frame `task_id` = `inbox:<box>`, `seq` = the drain round (restarts at 1 per run).'
13289
+ additionalProperties: true
13290
+ required: [pending, delivered]
13291
+ properties:
13292
+ pending: { type: integer, minimum: 0 }
13293
+ delivered: { type: integer, minimum: 0 }
13294
+ urgent: { type: integer, minimum: 0 }
13295
+ resupplied: { type: integer, minimum: 0 }
12883
13296
 
12884
13297
  ModelCompat:
12885
13298
  # 新(8.9.0 / S-188):`ModelInfo.compat` 的形 = core `OpenAICompletionsCompat` 的逐字镜像。
@@ -12887,9 +13300,10 @@ components:
12887
13300
  # 所以这里写闭集 enum 是**如实**的,不是本仓自己加的一道门 —— 消费方不必再验一遍。
12888
13301
  type: object
12889
13302
  description: >
12890
- One model row's wire-compatibility declaration for the **openai-completions** lane (core
12891
- `OpenAICompletionsCompat`, mirrored key-for-key; server >= 7.69.0 / S-188). It says how THIS gateway takes
12892
- the thinking parameter and what the max-tokens field is called — no URL, no credential.
13303
+ One model row's wire-compatibility declaration for ITS lane. **openai-completions** rows carry five keys (core
13304
+ `OpenAICompletionsCompat`, mirrored key-for-key; server >= 7.69.0 / S-188): how THIS gateway takes the thinking parameter and what the max-tokens field is called.
13305
+ **anthropic-messages** rows carry five other keys (core `AnthropicMessagesCompat`; server >= 7.147.0; before that this lane's declaration was dropped whole): `thinkingMode`, `effortLevels`, `supportsTemperature`,
13306
+ `contextManagement`, `interleavedThinking`. A row carries only ITS lane's keys (a declaration holding another lane's key is dropped whole); the wire has no key naming the row's lane, so read by key. No URL, no credential.
12893
13307
  🔴 ABSENT has TWO indistinguishable causes: (a) the model genuinely declared nothing (the engine infers
12894
13308
  from baseUrl / model id), or (b) the operator wrote one and the server DROPPED IT WHOLE (shape / word /
12895
13309
  unknown key), logging a named warning and falling back to the engine's inference. So a panel must NOT
@@ -12920,6 +13334,15 @@ components:
12920
13334
  thinkingFormat:
12921
13335
  $ref: '#/components/schemas/ModelThinkingFormat'
12922
13336
  description: 'How this gateway takes the thinking on/off parameter. Absent => the engine infers (default `openai`, i.e. `reasoning_effort`).'
13337
+ thinkingMode: { type: string, enum: [budget, adaptive], description: 'anthropic-messages lane (server >= 7.147.0), present iff declared: how thinking is switched on — `budget` (token budget) or `adaptive` (the model''s thinking cannot be turned off; the same row''s `supportsThinkingOff` reads false).' }
13338
+ effortLevels:
13339
+ type: array
13340
+ minItems: 1
13341
+ items: { $ref: '#/components/schemas/ModelThinkingLevel' }
13342
+ description: 'anthropic-messages lane (server >= 7.147.0), present iff declared non-empty: the effort tiers this lane accepts (a subset of the six-rung ladder).'
13343
+ supportsTemperature: { type: boolean, description: 'anthropic-messages lane (server >= 7.147.0), present iff declared: does the endpoint accept `temperature`.' }
13344
+ contextManagement: { type: boolean, description: 'anthropic-messages lane (server >= 7.147.0), present iff declared: does the endpoint accept the context-management declaration.' }
13345
+ interleavedThinking: { type: boolean, description: 'anthropic-messages lane (server >= 7.147.0), present iff declared: does the endpoint accept interleaved thinking.' }
12923
13346
 
12924
13347
  ModelThinkingLevel:
12925
13348
  # 六档思考梯(core ThinkingLevel)。CLOSED:server 铸 Model 那一刻逐词判成员,出集词让整只 compat 被丢。
@@ -13155,6 +13578,8 @@ components:
13155
13578
  agentFailures: { type: integer, description: 'Count of agent-runs that ended failed — present only when > 0 (a "completed, with failures" flag without an N+1 get).' }
13156
13579
  parked: { type: boolean, enum: [true], description: 'server >= 7.135.0 (core 7.55.0 `runParkedOf`) — present, always the literal `true`, ONLY while the run is `running` AND at least one of its agents is parked at an approval gate; otherwise the key is ABSENT (never `false`). Read it as "the run is waiting on a person", not "failed". Older servers never send it.' }
13157
13580
  errorCode: { type: string, description: 'The run row''s machine code (open set; e.g. `workflow.agent_parked` for a drained parked terminal) — present only when the row has one. (Declared here in 26.1.0: the engine summary has emitted it since before 7.134.0.)' }
13581
+ budgetOvershoot: { $ref: '#/components/schemas/WorkflowBudgetOvershoot' }
13582
+ timeoutInterruption: { $ref: '#/components/schemas/WorkflowTimeoutInterruption' }
13158
13583
  currentPhase: { type: string, description: 'Title of the phase currently executing (absent once terminal).' }
13159
13584
  status: { $ref: '#/components/schemas/WorkflowRunStatus' }
13160
13585
  phaseCount: { type: integer, description: 'Phases recorded.' }
@@ -13164,6 +13589,39 @@ components:
13164
13589
  endedAt: { type: integer, description: 'End epoch ms (absent while running).' }
13165
13590
  createdAt: { type: integer, description: 'Record-creation epoch ms (listByScope sort key).' }
13166
13591
 
13592
+ WorkflowBudgetOvershoot:
13593
+ type: object
13594
+ description: >
13595
+ `WorkflowRunSummary.budgetOvershoot` — the run's TERMINAL token-budget overshoot (the engine's summary projection, passed through on the list face as a shallow copy).
13596
+ Present ONLY when the run actually spent MORE than its ceiling; absent on every run that stayed within one and on every run that set no budget. The overshoot is
13597
+ `spentTokens + unsettledTokens - budgetTokens`; a run whose overshoot rests ENTIRELY on `unsettledTokens` is a best-effort disclosure, not a measurement ("this run appears to
13598
+ have overrun, and here is what was seen") — `spentTokens` carries no such caveat (it is the gate's own settled figure). Lets a list row be flagged "completed, and over budget" without an N+1 `get`.
13599
+ The detail face (`GET /v1/workflows/:id`) does not carry it.
13600
+ required: [budgetTokens, spentTokens]
13601
+ additionalProperties: false
13602
+ properties:
13603
+ budgetTokens: { type: number, description: "The run's token ceiling." }
13604
+ spentTokens: { type: number, description: "Settled tokens." }
13605
+ unsettledTokens: { type: number, description: 'Unsettled (in-flight / not yet reported) token estimate; absent = no unsettled part.' }
13606
+
13607
+ WorkflowTimeoutInterruption:
13608
+ type: object
13609
+ description: >
13610
+ `WorkflowRunSummary.timeoutInterruption` — the run's TERMINAL total-timeout interruption (the engine's summary projection, passed through on the list face as a shallow copy).
13611
+ Present ONLY when the `totalTimeoutMs` deadline had fired by the time the run reached its terminal; absent on a run that finished inside its deadline, one that failed for its own
13612
+ reason first, and one that armed no deadline. Lets a row separate "this run was CUT SHORT, and here is what it had achieved" from "this run failed" (both read `status: failed`).
13613
+ The counts are a POINT-IN-TIME SNAPSHOT taken BEFORE the terminal fold that marks abandoned agents failed: `agentsFailed` here is NOT `WorkflowRunSummary.agentFailures`
13614
+ (the record's tally, which counts the abandoned ones) — swapping one for the other reports abandoned work as failed work. `agentsInFlight` includes calls still queued for a concurrency slot.
13615
+ The detail face (`GET /v1/workflows/:id`) does not carry it.
13616
+ required: [timeoutMs, agentsCompleted, agentsFailed, agentsInFlight]
13617
+ additionalProperties: false
13618
+ properties:
13619
+ timeoutMs: { type: number, description: "The deadline that fired (the run's configured `totalTimeoutMs`)." }
13620
+ agentsCompleted: { type: integer }
13621
+ agentsFailed: { type: integer, description: 'Agents that had failed on their own when the clock ran out (pre-abandonment).' }
13622
+ agentsInFlight: { type: integer, description: 'Agent records still running at that moment (including calls queued for a concurrency slot).' }
13623
+ approvalWaitedMs: { type: number, description: "The LARGEST single leg's human-approval wait in ms — a lower bound on how much of the window went on a person rather than on work, never a sum; absent = no leg reported one (NOT `0`)." }
13624
+
13167
13625
  WorkflowActivityBeat:
13168
13626
  # 新增(2026-07-25 回填批)—— workflow 监视面 "Activity · last N of M tool calls" 的一拍。
13169
13627
  type: object
@@ -14253,6 +14711,33 @@ components:
14253
14711
  boundCallId: { type: string, description: 'The current pending''s pendingAction.toolCallId — the D-1 anchor to echo back on the relocated decide.' }
14254
14712
  boundInputHash: { type: string, description: 'Server-minted; present only when the row has one. Echo verbatim, never recompute.' }
14255
14713
 
14714
+ SettingsContractCapability:
14715
+ type: object
14716
+ description: >-
14717
+ server >= 7.147.0 (a version bit: always present, does not vary with the deployment shape) — the `GET /v1/capabilities` `settingsContract` segment: which version of the embedded settings contract this server runs,
14718
+ and which field NAMES its reader carries for each hook entry type. Read it instead of keeping a "which server version knows which keys" table: it answers whether a key would be stripped as out-of-contract by this
14719
+ server's reader (resume replay) or refused 400 `request.body_shape` by the closed-key gate on a new submit.
14720
+ `version` = the installed `@sema-agent/settings-schema` package version (`X.Y.Z`). `hookEntryFields` = the contract's hook-entry field table projected per entry type — `{ command, prompt, agent, http, mcp_tool }`,
14721
+ one array of field NAMES each (names only, never the value types; the discriminator `type` is not in a column; column order = the key order of an entry the contract reader installs).
14722
+ 🔴 CARRIED is not EXECUTED: this server runs only `command` / `http` / `prompt` / `agent` entries (`mcp_tool` is refused whole), and a column can list a key the reader carries without executing it; whether the hooks bundle
14723
+ is adopted at all is `taskSettings.hooks`. Wire keys the server reads itself (a group's `source`, a command entry's `plugin`) are not contract fields and are not in a column.
14724
+ ABSENT = server <= 7.146.x: no such table to read — do not infer which keys that reader carries; the per-key facts for older servers live on the keys themselves (for example `args` of a command hook entry: server >= 7.133.0, probe `capabilities.taskSettings.pluginHooks`).
14725
+ Open on the read side: a later contract may add an entry type (one more key of the same shape), or this object another member.
14726
+ required: [version, hookEntryFields]
14727
+ additionalProperties: true
14728
+ properties:
14729
+ version: { type: string, description: 'The embedded `@sema-agent/settings-schema` package version, `X.Y.Z`.' }
14730
+ hookEntryFields:
14731
+ type: object
14732
+ description: 'Per hook entry type, the contract field NAMES the reader carries (names only; the discriminator `type` is not listed). Listed is not executed.'
14733
+ required: [command, prompt, agent, http, mcp_tool]
14734
+ properties:
14735
+ command: { type: array, items: { type: string } }
14736
+ prompt: { type: array, items: { type: string } }
14737
+ agent: { type: array, items: { type: string } }
14738
+ http: { type: array, items: { type: string } }
14739
+ mcp_tool: { type: array, items: { type: string } }
14740
+ additionalProperties: { type: array, items: { type: string } }
14256
14741
  CredentialPlaneCapability:
14257
14742
  type: object
14258
14743
  description: >-
@@ -14494,9 +14979,11 @@ components:
14494
14979
  assistant inbox row (`InboxRow.rowVerdict`). ONE JUDGE, TWO FACES: the first-stage resume / decide refusal (409, body carries `reason`) comes from the same judge, so a row
14495
14980
  listed with a non-`ok` verdict is refused for the same reason when decided — present it as NOT APPROVABLE; the way out is cancelling the run or leaving the row to a
14496
14981
  replica / version that can resume it. `ok` carries only `kind`; `lacking` / `damaged` carry `code` (the engine's checkpoint error code), `reason` (which arm of a multi-arm code), `requires` (capabilities the row needs and this engine lacks) and `sentence` (the engine's human line —
14497
- display only, never a match key); `code` / `reason` are open strings (owned by core). Match the two faces on `reason`, not on `code`: the refusal
14498
- face translates `checkpoint.invalid_outcome` (e.g. `requirements_damaged`) to `approval_binding_mismatch` on a `policy_ask` gate and to `resume_outcome_invalid` on other gates, and that
14499
- engine refusal carries no `detail.code` (so no `blockedBy`); `checkpoint.unsupported_version` passes through unchanged. The refusal body's `reason` is the verdict's `reason`. ABSENT IS NOT `ok`: the listing did not judge the row (it left
14982
+ display only, never a match key); `code` / `reason` are open strings (owned by core). server >= 7.147.0: the two faces match on `code` EQUALITY — every decision-class resume door (`/decide`, `/plan_review`, `/resume`, `/wake`)
14983
+ answers the row's OWN refusal with the engine's original code (`checkpoint.invalid_outcome`, e.g. `requirements_damaged`; `checkpoint.unsupported_version` likewise), the same judge's same code as this verdict's `code`, and the refusal's
14984
+ `error` starts with this verdict's `sentence`; a cause code (`approval_binding_mismatch` for a binding seat, `resume_outcome_invalid` for a body cell / content reject) is given only to a refusal that really has a cause, and that is not the row's own refusal.
14985
+ Servers <= 7.146.x translate by gate instead (`checkpoint.invalid_outcome` becomes `approval_binding_mismatch` on a `policy_ask` gate and `resume_outcome_invalid` on other gates, with no `blockedBy`): against those, match the two faces on `reason`, not on `code`.
14986
+ The refusal body's `reason` is the verdict's `reason`. ABSENT IS NOT `ok`: the listing did not judge the row (it left
14500
14987
  pending or its bytes changed between two reads, or an older server). server >= 7.145.0: on SQL backends a row whose stored body cannot be read as a checkpoint
14501
14988
  carries the verdict too (the judge answers on the raw bytes — always `damaged`) and is listed on both the operator queue and the assistant inbox (7.144.x
14502
14989
  listed it without this key and refused the whole inbox). An `ok` does not guarantee the decide succeeds: the judge does not inspect `pendingAction`, so a
@@ -14986,7 +15473,7 @@ components:
14986
15473
  # 新增(2026-07-25 回填批):§4b resume / §4c plan_review / §4d preempt 三条决策端点此前在本文件里都只声明
14987
15474
  # 了 `{status}` 一个字段——与 SDK 三批核查前的旧类型同样陈旧。下面的形按 server 源码逐字取证:
14988
15475
  # • resume / plan_review 200(共用 `driveResumeIntoRunLog`,`src/http/routes/approvals-assistant.ts`):
14989
- # `{ taskId, sessionId, status, errorCode?, errorMessage?, retriable? }`(后三个条件 spread ⇒ 缺则省键)
15476
+ # `{ taskId?, sessionId, status, errorCode?, errorMessage?, retriable? }`(后三个条件 spread ⇒ 缺则省键;`taskId` 在认领缺席的同步终局体上缺席)
14990
15477
  # • preempt 202(`src/http/routes/approvals-assistant.ts` 三个出口):`{ taskId, status, note }`
14991
15478
  # ⚠️ `status` 在 202 上**并非恒为 `"preempting"`**:两个 no-op 出口分别回 `run.status` 与
14992
15479
  # `now?.status ?? "failed"` —— 所以这里不能把它写成 const。
@@ -14995,7 +15482,7 @@ components:
14995
15482
  The response of the §4b/§4c/§4d decision endpoints (resume / plan_review / preempt). Union of the two
14996
15483
  real body shapes — `sessionId` appears only on resume/plan_review, `note` only on preempt; everything
14997
15484
  else is shared (absent keys are OMITTED, never null).
14998
- required: [taskId, status]
15485
+ required: [status]
14999
15486
  # 封闭(census 批2 第二段,2026-07-30):上面那段 2026-07-25 的取证已把两条腿的键集逐字列全 ——
15000
15487
  # 七个属性就是三个出口的并集,再多一个键就是没人登记过的新 wire 面,正是要红的形。
15001
15488
  additionalProperties: false
@@ -15005,7 +15492,14 @@ components:
15005
15492
  description: >
15006
15493
  [2400] HITL-12: present (true) on the resume/plan_review 200 (same casting point as the decide leg);
15007
15494
  absent on the preempt 202.
15008
- taskId: { type: string, description: 'always present (all three response bodies carry it).' }
15495
+ taskId:
15496
+ type: string
15497
+ description: >
15498
+ The run the continuation belongs to (resume / plan_review: the run row that holds the session claim; preempt: the run being yielded).
15499
+ The ACCEPTED form (`status: "resuming"`, the durable-deployment default) and the preempt 202 always carry it. ABSENT on a synchronous terminal
15500
+ resume / plan_review body when no run row holds the session claim (claim absent; the server's causes are not exhaustive): the server still drives
15501
+ the continuation (writes no ledger, flips no row) and answers `{ sessionId, status, ... }`. Absence means there is no run row to follow, NOT that
15502
+ nothing ran; do not backfill it from the path id. It tightens back to required once the server settles this form.
15009
15503
  decisionCommitted: { type: boolean, enum: [true], description: 'server >= 7.138.0 - SETTLEMENT EVIDENCE: `true` = the gate this request named was durably settled with THIS request''s decision (historical evidence, not the card''s current state). Always the literal `true`, never `false`. Absent = unprovable or deliberately omitted => read as "not committed" (fail-closed); do not infer it from the absence of `errorCode`. It coexists with `errorCode: cancelled` / `retriable: true`; `retriable: true` only says the run re-parked.' }
15010
15504
  checkpointId: { type: string, description: 'server >= 7.138.0 - only alongside `decisionCommitted`: the gate identity of the row selected before execution (same name and value as the operator queue / inbox row / park ledger row). Absent when the identity is unreadable or not applicable (an idempotent replay carries none); absence infers nothing.' }
15011
15505
  status:
@@ -15153,6 +15647,13 @@ components:
15153
15647
  the host store and has no tuple); the three members are each optional. 🔴 READ IT AS "WAS IT STORED", NEVER AS "IS IT A SUBAGENT": key PRESENT = a delegated subagent's transcript (even `{}` when the tuple held only a
15154
15648
  kind); key ABSENT has three causes — an older server (<= 7.132.x) / an ordinary session / a deployment whose store keeps no placement tuple (the local backend: the copy parked from the private short-TTL store is an
15155
15649
  ordinary session row). Absence is NOT "not a subagent": fall back to the identity the fleet row (`id`) / `GET /v1/agents/roster` (`handle`) already carry.
15650
+ projectId:
15651
+ type: string
15652
+ description: >-
15653
+ server >= 7.147.0, top-level additive key, PRESENT-IFF: the `project.id` of the last `workspace_changed` frame this session row recorded — the project the engine judged for the session's last OWN leg (from the `.sema/project` marker
15654
+ in the checkout, or, with no marker, the submit body's `projectId` declaration; which one is not on the wire). The same value domain as `ProjectRow.id`. This service neither judges projects nor reads markers. No capability bit.
15655
+ ABSENT reads "this server did not say", NEVER "belongs to no project": no leg has recorded a frame yet / that frame had no project / the deployment's session store keeps no such cell (memory store) / an older server.
15656
+ A forked session starts with no record. The session LIST row does not carry it and `GET /v1/sessions` has no `?projectId=` filter.
15156
15657
  userInputUndrained:
15157
15658
  type: array
15158
15659
  description: >-
@@ -15374,7 +15875,7 @@ components:
15374
15875
  ExecutionPlacement:
15375
15876
  description: >
15376
15877
  `GET /v1/sessions/{sessionId}/execution-placement` 200 body (server >= 7.139.0, contract section 23.1) — the execution placement of one ROOT session's current occupant on THIS deployment, discriminated by `role`:
15377
- `absent` (not yet executed here) · `writer` (this deployment is the writer; `lane` = the execution lane word, the `REMOTE_EXEC` value, `in-process` when unset; `device` only on the device lane once bound — `writer`
15878
+ `absent` (not yet executed here) · `writer` (this deployment is the writer; `lane` = the execution lane word, one of the eight words of `Capabilities.executionLane.provider` — the `REMOTE_EXEC` value, `none` for a deployment that declared no execution environment (servers <= 7.146.x answered `in-process` when it was unset); `device` only on the device lane once bound — `writer`
15378
15879
  without `device` there = a pre-upgrade session whose device is unknown) · `mirror` (a read-only copy imported from elsewhere; execution / rename / pin answer `409 conflict.session_mirror` with `forkPath`) ·
15379
15880
  `forking` (a keyed fork has not finished copying — `DB_BACKEND=local` crash middle state only). No `writer` ⇄ `mirror` and no `writer(L)` → `writer(L')` transition: to change, fork a new session. Closed set; the SDK reads it exhaustively.
15380
15881
  oneOf:
@@ -15772,6 +16273,27 @@ components:
15772
16273
  description: >-
15773
16274
  server >= 7.141.0 — THIS DEPLOYMENT's memory-sync park reading (a deployment fact: present <=> the deployment has a sync leg;
15774
16275
  independent of the session and of `?scope=`). `parked: []` = syncing. ABSENT = no sync leg, or an older server.
16276
+ writeHome:
16277
+ type: string
16278
+ description: >-
16279
+ server >= 7.146.0 — the session's memory write home (the engine's absolute directory, verbatim). PRESENT-IFF the engine answered it AND the single-user host lane (the same range predicate as the capability bit `projectContext`;
16280
+ hosted / sandbox / device / no-hands lanes: absent). With `?scope=` = the answer of the store that layer lives on; without it = the one session-level home the engine chose across the stores (the home of the newest store that names one; absent while any
16281
+ store's reading is unreadable, on a same-instant tie, or when no store names one). ABSENT is "this read cannot say", not "no home".
16282
+ planes:
16283
+ type: array
16284
+ description: >-
16285
+ server >= 7.146.0 — the per-store breakdown, PRESENT-IFF no `?scope=` AND the single-user host lane (the same predicate as `writeHome`): one row per store in the engine's store order, each row the engine's own answer for that store
16286
+ (`writeHome` verbatim, absent when that store names none); the engine row's other keys are not on the wire.
16287
+ items: { $ref: '#/components/schemas/SessionMemoryPlaneStatus' }
16288
+
16289
+ SessionMemoryPlaneStatus:
16290
+ type: object
16291
+ description: 'server >= 7.146.0 — one row of `SessionMemoryStatusResponse.planes`. A response projection: declared key by key and left open.'
16292
+ additionalProperties: true
16293
+ required: [plane]
16294
+ properties:
16295
+ plane: { type: string, description: 'The store''s seat: `project` or `personal` (read as an open set).' }
16296
+ writeHome: { type: string, description: 'The write home the engine answered for that store, verbatim; absent when that store names none.' }
15775
16297
 
15776
16298
  SessionMemorySync:
15777
16299
  type: object
@@ -16242,7 +16764,8 @@ components:
16242
16764
  Both families, and both status codes, first reached the wire with server 7.3.0's in-stream approval
16243
16765
  decision endpoint.) 🔴 server >= 7.139.0 also mints two 409 codes under a prefix that is NOT one of the fourteen:
16244
16766
  `execution_lane.not_served` / `execution_lane.tree_bound` (the session is placed on an execution lane this deployment no
16245
- longer runs / another lane of this deployment; top-level `boundLane`) — they fall through to the STATUS tail (409 ⇒
16767
+ longer runs / another lane of this deployment; top-level `boundLane`, a lane word of `Capabilities.executionLane.provider`:
16768
+ `none` from server 7.147.0, `in-process` on servers <= 7.146.x) — they fall through to the STATUS tail (409 ⇒
16246
16769
  `ConflictError`), so branch on the code, never on a prefix family. The SDK maps each family to a typed class, so a code this SDK has
16247
16770
  never seen still degrades INFORMATIVELY (e.g. a future `capability.xyz_required` already lands on
16248
16771
  CapabilityUnavailableError). Family examples not named elsewhere in this document:
@@ -16371,8 +16894,9 @@ components:
16371
16894
  `index`); server >= 7.132.0 widens that group to every tool-name list on the body, the agent definitions and the two host-path lists, and adds
16372
16895
  `too_long` (a text over its character cap; beside `count` + `cap`) — closed words `over_cap` / `too_long` / `bad_entry` (SDK `RequestFieldRefusalExtra`); server >= 7.133.0 adds `too_large` (a payload over its BYTE cap, only on 413 `request.payload_too_large`: `{ field: "body", reason: "too_large", cap }` — `count` ABSENT when the read stopped at the cap and cannot measure; a request body over 8 MiB is now always that 413) and the `request.invalid_json` reasons `not_json` | `not_object` (400, every JSON-body door; formerly `request.rejected`/`request.body_shape` by door).
16373
16896
  On 409 refusals of a resume (server >= 7.132.0) and on 422 `parked_resume.startup_failed` (server >= 7.134.0 — the parked background agent's pre-claim failure; absent when the engine gave none): the engine's `CheckpointErrorReason` arm (`detail.reason` passed through; see `blockedBy`). On 409 `conflict.checkpoint_ctx_unsealable` (server >= 7.134.0): why the request's credentials cannot be sealed into, or unsealed from, the stored resume context — a closed five-word set (SDK `CHECKPOINT_CTX_UNSEALABLE_REASONS`); which doors can answer which word is written once, in the SDK documentation of `CHECKPOINT_CTX_UNSEALABLE_REASONS`, not here: `no_key_store` (this server has no sealed-key store) / `key_not_held` (sealed with a key this server does not hold — another replica's, or a replaced sealed-key directory) / `unopenable` (the sealed value is damaged or belongs to another session) / `plaintext` (an older server stored it unsealed) / `unrecognized_seal` (a seal format this version does not know) — the way out depends on the door and the `reason`: `key_not_held` (a resume door) — have the operator restore the sealed-key directory that sealed it and restart that replica (it reads its keys only at startup), then resend the same request; `no_key_store` on the submit door — give the service a writable sealed-key directory (`<data root>/sealed-key/`, read at startup), or resubmit WITHOUT those credentials — resending the same submit body is refused again; `no_key_store` on a resume door — the same way out as `key_not_held`: restore the directory that sealed it and restart, then resend (a fresh empty directory does not help: it holds no such key, so the next read says `key_not_held`); `unopenable` / `plaintext` / `unrecognized_seal` — submit the work as a new task (cancel the still-suspended one first); never auto-retry, never match the sentence. A resume door's refusal decides nothing and starts no resume (the card stays pending; the known exception is a terminal run's steer race arm, which first opens a wake card and, when the second read fails for any of the five reasons, withdraws it and then answers 409 — if the withdrawal fails the server only logs it); a submit door's refusal lands before the task runs (nothing runs; a run row already opened for it is closed as `failed` and its idempotency key released, both best-effort — a failed step is only logged by the server and the answer is still the 409). On 400 `rules.inert_entry` (server >= 7.129.0): the engine's `ALLOW_ENTRY_INERT_REASONS` (`tool_name` / `wildcard_all` / `namespace_wildcard` / `content_unsupported` / `grammar` / `near_miss` / `earlier_grammar`). Out-of-vocabulary word ⇒ treat as unknown. (Other codes carry their own `reason` words.)
16374
- server >= 7.137.0: the THREE 400 `request.field_invalid` refusals of `inheritEnv` (a value outside the word set / a non-string / `"all"` on a non-host lane or a deployment with no authorizer session) carry `field: "inheritEnv"` and `reason` — one of
16375
- `unknown_word` / `not_a_string` / `lane_not_host` / `no_authorizer_session` (SDK `INHERIT_ENV_REFUSAL_REASONS`); sentence, code and status are unchanged.
16897
+ server >= 7.137.0: the 400 `request.field_invalid` refusals of `inheritEnv` (a value outside the word set / a non-string / `"all"` on a non-host lane) carry `field: "inheritEnv"` and `reason` — one of
16898
+ `unknown_word` / `not_a_string` / `lane_not_host` (SDK `INHERIT_ENV_REFUSAL_REASONS`); sentence, code and status are unchanged. The set is these three words and no more from server >= 7.147.0:
16899
+ a fourth word that earlier server sources declared for a case the HTTP face does not reach (the server's own record) is retired, and an out-of-vocabulary word from a server <= 7.146.x is read as unknown.
16376
16900
  thrownName:
16377
16901
  type: string
16378
16902
  minLength: 1
@@ -17777,6 +18301,7 @@ components:
17777
18301
  properties:
17778
18302
  type: { const: compacted }
17779
18303
  tokensBefore: { type: integer }
18304
+ summarizedCrossSessionMessages: { type: integer, minimum: 1, description: 'server >= 7.147.0: how many already-delivered cross-session messages (session-inbox `crossSessionMessage` carriers) this summary swallowed; present iff >= 1 (absent = none swallowed or an older server, not 0).' }
17780
18305
  trigger: { type: string, description: '开集(engine-shaped,别当闭合枚举):`auto`(逼近窗口上限)/ `manual`(`POST /v1/runs/:id/compact`,发在该 run 自己的流上)/ `forced`(core ≥5.16.0 的 prompt-too-long 恢复腿)。缺席按 auto 渲染;未知值也按 auto 渲染,别崩。' }
17781
18306
  preserved_segment:
17782
18307
  type: object
@@ -18770,10 +19295,13 @@ components:
18770
19295
  `permission.read_deny_unapplied` — a mode released a shell call whose reads the read station could not establish while a read-deny
18771
19296
  table is in force (none of its rows applied to what it reads), `{ mode, toolCallId, tiers, rows, rowCount, sessionId, runId }`,
18772
19297
  `tiers` = the built-in tiers in use, `rows` = the first eight non-built-in rule texts (`rowCount` = total); every such call. ·
18773
- `permission.rule_store_unavailable` — this person's persisted permission rules could not be READ, so the verdict that read served
18774
- SKIPPED them (no allow / ask / deny row took part — a deny row protected nothing) and no card was raised for it (C-R172; replaces
18775
- the approval frame's retired `ruleStoreUnreadable` seat), `{ at, sessionId, runId }`, `at` closed two words `prepare` / `call`;
18776
- once per run.
19298
+ `permission.rule_store_unavailable` — this person's persisted permission rules could not be READ (a read failure, a corrupt store, a read
19299
+ that did not answer in time), so the verdict that read served SKIPPED them (no allow / ask / deny row took part); replaces the approval frame's
19300
+ retired `ruleStoreUnreadable` seat, `{ at, sessionId, runId }`, `at` closed two words `prepare` (the path rows taken at run start: the run's file and
19301
+ shell checks lack them until the run ends, the next run reads again) / `call` (one call's own rule check; every later call reads again); once per run.
19302
+ FAIL-CLOSED from server >= 7.127.0 (core 7.50.0): at `call` the call asks a person (a deny row among the unreadable rows may forbid it; ask class
19303
+ `rule_unreadable`, which `bypassPermissions` asks too and a headless run refuses); at `prepare` only the run's path tables lack the rows.
19304
+ Server [7.106.0, 7.127.0): the same notice, but the unreadable read raised no card (a skipped deny row protected nothing; a mode released `rule_unreadable`).
18777
19305
  Starter whitelist (server 7.36): `memory.session_polluted` `{reason, sessionId?}` ·
18778
19306
  `memory.harvest_quarantined` `{count, moved, escalated, reason?}` — `moved` and `escalated` MUST NOT be
18779
19307
  subtracted from each other (an in-place tombstone counts as both) · `memory.delegation_static_mark_waived`
@@ -19225,6 +19753,29 @@ components:
19225
19753
  required: [path, edits]
19226
19754
  additionalProperties: true
19227
19755
  properties: { path: { type: string }, edits: { type: integer } }
19756
+ agentMessage:
19757
+ type: object
19758
+ description: 'A delegated subagent''s uplink message (`status: "event"`, `task_type: "background_agent"`): the render discriminator, always together with `_sema_provenance`. `body` is UNTRUSTED subagent text (egress-redacted).'
19759
+ additionalProperties: true
19760
+ required: [from, body]
19761
+ properties:
19762
+ from: { type: string }
19763
+ body: { type: string }
19764
+ crossSessionMessage:
19765
+ allOf: [{ $ref: '#/components/schemas/TaskNotificationCrossSessionMessage' }]
19766
+ description: 'server >= 7.147.0 — session-inbox carrier 1 of 3: a message from a peer session. At most one of the four carriers is present (core priority `agentMessage` -> `crossSessionMessage` -> `crossSessionNotice` -> `inboxNotice`); on <= 7.146.x the three inbox carriers are always absent.'
19767
+ crossSessionNotice:
19768
+ allOf: [{ $ref: '#/components/schemas/TaskNotificationCrossSessionNotice' }]
19769
+ description: 'server >= 7.147.0 — session-inbox carrier 2 of 3: a delivery receipt / peer idle notice.'
19770
+ inboxNotice:
19771
+ allOf: [{ $ref: '#/components/schemas/TaskNotificationInboxNotice' }]
19772
+ description: 'server >= 7.147.0 — session-inbox carrier 3 of 3: an inbox count line.'
19773
+ _sema_provenance:
19774
+ allOf: [{ $ref: '#/components/schemas/SemaProvenance' }]
19775
+ description: 'The attribution side-record, together with its carrier on a full-form frame (the minimal form `payloadTruncated` drops the carrier and keeps this); present-but-unreadable (bad shape / out-of-vocabulary word) => the whole key is absent.'
19776
+ payloadTruncated:
19777
+ allOf: [{ $ref: '#/components/schemas/PayloadTruncated' }]
19778
+ description: 'server >= 7.147.0 — present iff this PARKED REDELIVERY frame exceeded the inbox byte budget and is the minimal form (every other key absent). Live frames and durable ledger rows never carry it.'
19228
19779
  resumable: { type: boolean }
19229
19780
  result: { type: string, description: 'UNTRUSTED display text.' }
19230
19781
  output_file: { type: string }
@@ -19698,8 +20249,8 @@ components:
19698
20249
  frame and the inbox row; the `card_json` card deliberately does NOT carry it (it travels with `origin`,
19699
20250
  which is not on the card). Absence = `origin` is not that word — NOT an assertion that the rule store
19700
20251
  is healthy.
19701
- RETIRED: server >= 7.106.0 (core 7.34.0, BREAKING — wire) never mints this key on either face — an
19702
- unreadable rule store no longer raises a card; the signal moved to the session stream's user-facing
20252
+ RETIRED: server >= 7.106.0 (core 7.34.0, BREAKING — wire) never mints this key on either face; the
20253
+ signal moved to the session stream's user-facing
19703
20254
  `engine_notice` `permission.rule_store_unavailable` (`detail.at` = `prepare` / `call`; what the run does while the rules cannot be read is
19704
20255
  that notice's own text). Kept on the frame because servers 7.72–7.105 are inside the supported range and still send it, and the closed inbox row
19705
20256
  declares the same key; it goes with the next major once the support floor is >= 7.106.0 (`origin: rule_store_unavailable` itself stays).
@@ -21546,6 +22097,9 @@ components:
21546
22097
  server >= 7.135.0 — the idempotency anchor of this workflow completion: the SAME id rides every notification path of one completion (this frame / `task_notification` / fleet `bg_notification` / inbox replay) and
21547
22098
  is the dedup key ACROSS paths (the same value domain as `task_notification.completionId`). ABSENT when the engine gave none (an orphan the service terminated itself) — dedup on `runId` as before. The read faces
21548
22099
  (`GET /v1/workflows/{id}` etc.) deliberately never carry it. Older servers' re-delivered frames have no such key.
22100
+ payloadTruncated:
22101
+ allOf: [{ $ref: '#/components/schemas/PayloadTruncated' }]
22102
+ description: 'server >= 7.147.0 — present iff this parked redelivery frame exceeded the inbox byte budget: the minimal form is `runId` + `status` + `summary` + this key (`completionId` / `diagnostics` absent).'
21549
22103
  diagnostics:
21550
22104
  type: string
21551
22105
  maxLength: 4000
@@ -22651,7 +23205,7 @@ components:
22651
23205
  `false`), while `lane` arms on the manager / the hands / the opt-out and NOT on the mount — so
22652
23206
  `{mounted: false, lane: "diagnostics"}` is a REAL, REACHABLE state, not bad data. LANE REACH (server >= 7.127.0 / core 7.50.0):
22653
23207
  LSP mounts only on a lane that binds reads to the object it judged — today the host lane; on e2b / k8s (and ssh / adb / device /
22654
- local-docker / in-process) this section is always absent and the roster has no LSP tool (the server logs `lsp_not_mounted` at boot).
23208
+ local-docker / `none` — `in-process` on servers <= 7.146.x) this section is always absent and the roster has no LSP tool (the server logs `lsp_not_mounted` at boot).
22655
23209
  additionalProperties: false
22656
23210
  required: [mounted]
22657
23211
  properties:
@@ -23599,7 +24153,7 @@ components:
23599
24153
  goes through the EXISTING durable redemption leg (the same CAS as POST /v1/approvals/{sessionId}/decide) instead of the old 404 `tool_approval.not_pending`
23600
24154
  (`cause: unknown_or_other_replica`). Body = the redemption leg's receipt (ApprovalDecisionResult's keys — `status` / `taskId` / `sessionId` / ... as they come) plus the three keys
23601
24155
  this door adds: `approvalId` / `askId` (the same 64-hex value) and the discriminant `accepted`. `decision` is the two-word direction on the REPLAY form only (`allow` / `deny`,
23602
- `allow_session` folded to `allow`); `rememberApplied: false` appears only when this request asked `allow_session` (a parked redemption cannot remember a session grant);
24156
+ `allow_session` folded to `allow`); `rememberApplied` appears only when this request asked `allow_session` and this is the FIRST redemption (server >= 7.147.0: the leg's own boolean answer; <= 7.146.x always `false`; the replay form carries none);
23603
24157
  `rulePersisted` / `ruleRefusal` / `persistedRule*` are the `persistRule` outcome on the redemption leg (a rule that fails to store NEVER flips the verdict).
23604
24158
  `idempotent: true` appears only on the REPLAY (the same already-redeemed card answered again returns the first redemption's receipt).
23605
24159
  CLOSED like its two sibling arms (the census keeps this op's 200 body closed): the key set is ApprovalDecisionResult's own keys (one source per shape, by `$ref`) plus the added ones.
@@ -23621,7 +24175,7 @@ components:
23621
24175
  retriable: { $ref: '#/components/schemas/ApprovalDecisionResult/properties/retriable' }
23622
24176
  idempotent: { $ref: '#/components/schemas/ApprovalDecisionResult/properties/idempotent' }
23623
24177
  executionOutcome: { $ref: '#/components/schemas/ApprovalDecisionResult/properties/executionOutcome' }
23624
- rememberApplied: { type: boolean, enum: [false] }
24178
+ rememberApplied: { type: boolean, description: 'Present only when this request asked `allow_session` AND this is the FIRST redemption (not the replay form). server >= 7.147.0: the redemption leg''s own answer (true = it remembered the session grant, false = this once only); a server <= 7.146.x always answered false here ("a parked redemption cannot remember a session grant").' }
23625
24179
  rulePersisted: { $ref: '#/components/schemas/ToolApprovalRespondApplied/properties/rulePersisted' }
23626
24180
  ruleRefusal: { $ref: '#/components/schemas/ToolApprovalRespondApplied/properties/ruleRefusal' }
23627
24181
  persistedRule: { $ref: '#/components/schemas/ToolApprovalRespondApplied/properties/persistedRule' }
@@ -24042,27 +24596,34 @@ components:
24042
24596
 
24043
24597
  RuleImportMember:
24044
24598
  description: >
24045
- server >= 7.145.0 — one row of the redemption receipt (server `ImportOutcomeMember`), two arms on `outcome`:
24046
- `persisted` = written by this redemption; `no-op` = an equal rule was already in the store (the engine's `deduped`);
24047
- `refused` = RESERVED (known refused, known not written) — NOT minted by this server version: the engine's member refusal carries free
24048
- text only; the word appears once the engine gives the refusal arm a machine-readable verdict bit (that version adds its fields to this arm);
24049
- `indeterminate` = the engine refused this member and the cause is free text only — it is NOT KNOWN whether it landed: exactly then the row
24050
- carries `reason: store_refused` and `detail` (the engine's sentence verbatim). The four words are a closed set (the server's persisted
24051
- receipt schema reads the same table).
24599
+ server >= 7.145.0 — one row of the redemption receipt (server `ImportOutcomeMember`), three arms on `outcome`:
24600
+ `persisted` = written by this redemption; `no-op` = an equal rule was already in the store (the engine's `deduped`) — these two carry only `key` / `outcome`;
24601
+ `refused` = the engine refused this member and it is KNOWN not written (the engine answered `committed: "no"`) — carries `reason` (the engine's `RuleRefusalCode` verbatim, an open string,
24602
+ e.g. `unsupported.layer_root`) and `detail` (the engine's sentence verbatim); server >= 7.146.0 mints it (a 7.145.x server never does — it was described as RESERVED in the 36.0.0 contract text, corrected in 37.0.0);
24603
+ `indeterminate` = the engine refused this member and it is NOT KNOWN whether it landed (`committed` unknown; 7.145.0 minted EVERY engine member refusal as this arm with `reason: store_refused`) — carries `reason` and `detail` likewise.
24604
+ `reason` / `detail` are present iff `outcome` is `refused` | `indeterminate`. The four words are a closed set (the server's persisted receipt schema reads the same table).
24052
24605
  oneOf:
24053
24606
  - type: object
24054
24607
  additionalProperties: false
24055
24608
  required: [key, outcome]
24056
24609
  properties:
24057
24610
  key: { $ref: '#/components/schemas/RuleImportKey' }
24058
- outcome: { type: string, enum: [persisted, no-op, refused] }
24611
+ outcome: { type: string, enum: [persisted, no-op] }
24612
+ - type: object
24613
+ additionalProperties: false
24614
+ required: [key, outcome, reason, detail]
24615
+ properties:
24616
+ key: { $ref: '#/components/schemas/RuleImportKey' }
24617
+ outcome: { const: refused }
24618
+ reason: { type: string, minLength: 1 }
24619
+ detail: { type: string }
24059
24620
  - type: object
24060
24621
  additionalProperties: false
24061
24622
  required: [key, outcome, reason, detail]
24062
24623
  properties:
24063
24624
  key: { $ref: '#/components/schemas/RuleImportKey' }
24064
24625
  outcome: { const: indeterminate }
24065
- reason: { const: store_refused }
24626
+ reason: { type: string, minLength: 1 }
24066
24627
  detail: { type: string }
24067
24628
 
24068
24629
  RuleImportReceipt: