@sema-agent/sdk 28.1.0 → 30.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 (56) hide show
  1. package/README.md +138 -3
  2. package/dist/client.d.ts +2 -2
  3. package/dist/client.js +2 -2
  4. package/dist/errors.d.ts +76 -12
  5. package/dist/errors.d.ts.map +1 -1
  6. package/dist/errors.js +30 -11
  7. package/dist/errors.js.map +1 -1
  8. package/dist/events.d.ts +17 -10
  9. package/dist/events.d.ts.map +1 -1
  10. package/dist/events.js.map +1 -1
  11. package/dist/index.d.ts +11 -3
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +3 -1
  14. package/dist/index.js.map +1 -1
  15. package/dist/model-route-env/index.d.ts +9 -5
  16. package/dist/model-route-env/index.d.ts.map +1 -1
  17. package/dist/model-route-env/index.js +16 -7
  18. package/dist/model-route-env/index.js.map +1 -1
  19. package/dist/resources/approvals.d.ts +2 -0
  20. package/dist/resources/approvals.d.ts.map +1 -1
  21. package/dist/resources/approvals.js.map +1 -1
  22. package/dist/resources/devices.d.ts +16 -21
  23. package/dist/resources/devices.d.ts.map +1 -1
  24. package/dist/resources/devices.js +2 -15
  25. package/dist/resources/devices.js.map +1 -1
  26. package/dist/resources/memory.d.ts +2 -2
  27. package/dist/resources/memory.js +2 -2
  28. package/dist/resources/rules.d.ts +8 -15
  29. package/dist/resources/rules.d.ts.map +1 -1
  30. package/dist/resources/rules.js.map +1 -1
  31. package/dist/resources/runs.d.ts +2 -1
  32. package/dist/resources/runs.d.ts.map +1 -1
  33. package/dist/resources/runs.js +2 -1
  34. package/dist/resources/runs.js.map +1 -1
  35. package/dist/resources/session-sync.d.ts +9 -0
  36. package/dist/resources/session-sync.d.ts.map +1 -1
  37. package/dist/resources/session-sync.js +9 -0
  38. package/dist/resources/session-sync.js.map +1 -1
  39. package/dist/resources/sessions.d.ts +104 -8
  40. package/dist/resources/sessions.d.ts.map +1 -1
  41. package/dist/resources/sessions.js +61 -3
  42. package/dist/resources/sessions.js.map +1 -1
  43. package/dist/resources/side-query.d.ts +5 -1
  44. package/dist/resources/side-query.d.ts.map +1 -1
  45. package/dist/resources/side-query.js +5 -1
  46. package/dist/resources/side-query.js.map +1 -1
  47. package/dist/resources/tool-approvals.d.ts +22 -15
  48. package/dist/resources/tool-approvals.d.ts.map +1 -1
  49. package/dist/resources/tool-approvals.js +28 -13
  50. package/dist/resources/tool-approvals.js.map +1 -1
  51. package/dist/types.d.ts +103 -66
  52. package/dist/types.d.ts.map +1 -1
  53. package/dist/types.js +7 -0
  54. package/dist/types.js.map +1 -1
  55. package/openapi.yaml +411 -139
  56. package/package.json +2 -2
package/openapi.yaml CHANGED
@@ -1881,6 +1881,11 @@ paths:
1881
1881
  the row can write it, never wider; an operator / service token gets no extra reach; a stranger and "no such session" answer byte-identical
1882
1882
  `404 not_found.session`, no existence oracle) -> body (400) -> the store's one write door -> read back and answer with the list row.
1883
1883
  Only rows on the LIST face are writable: a placed (delegation-transcript) session is not in the list, so a PATCH on it answers 404.
1884
+ server >= 7.139.0 (contract section 20, "conditional write"): the body may carry `expectedRowTag` (the `rowTag` of the list row you read) — "write only if the row is still that one", judged and written under one row lock.
1885
+ Still that row ⇒ `200`, the row carrying the tag AFTER the write (the tag is a function of the writable bits' VALUES and of the session itself, NOT a write counter: it changes when a value actually changed; writing the value the row already holds — `pinned: false` on an unpinned row — returns the SAME tag); no longer ⇒ `409 conflict.session_row_changed`, NOT ONE BYTE written, body `currentRow` = the row as it stands now (the same projection as the 200 row, with the new `rowTag`) —
1886
+ decide again, then send ITS `rowTag`; never resend verbatim. EVERY miss is a 409 (no "the row already holds the value you want" exemption: `currentRow` already equal to what you wanted ⇒ treat it as synced). A session that is a
1887
+ read-only MIRROR here (execution placement `mirror`) ⇒ `409 conflict.session_mirror` with `forkPath` — with or without `expectedRowTag` (an unconditional PATCH on a mirror used to write). A session whose owner changed after the
1888
+ ownership gate read ⇒ `404 not_found.session`, nothing written. A client that auto-replays pending writes MUST send `expectedRowTag`.
1884
1889
  requestBody:
1885
1890
  required: true
1886
1891
  content:
@@ -1896,13 +1901,23 @@ paths:
1896
1901
  description: >-
1897
1902
  Malformed body, told apart by `errorCode` (branch on the code, never the sentence). `request.body_shape` — not a JSON object / empty body /
1898
1903
  a key outside the closed set `{ title, pinned }` / `title: ""` (the only spelling of "clear" is `null`). `request.field_invalid` — `title`
1899
- neither a string nor `null`, longer than 120 characters, or with leading / trailing whitespace; `pinned` not a boolean. Invalid JSON answers
1904
+ neither a string nor `null`, longer than 120 characters, or with leading / trailing whitespace; `pinned` not a boolean; (server >= 7.139.0) `expectedRowTag` not a 43-character `[A-Za-z0-9_-]` string.
1905
+ Server >= 7.139.0: `expectedRowTag` ALONE (no `title` / `pinned`) is `request.body_shape` too; a server <= 7.138.x answers `request.body_shape` for the key itself — fail-closed, do not drop it and resend. Invalid JSON answers
1900
1906
  like every other JSON-body route (`request.invalid_json`). The row is untouched on any 400.
1901
1907
  content:
1902
1908
  application/json:
1903
1909
  schema: { $ref: '#/components/schemas/ErrorResponse' }
1904
1910
  '401': { $ref: '#/components/responses/Unauthorized' }
1905
1911
  '404': { $ref: '#/components/responses/NotFound' }
1912
+ '409':
1913
+ description: >-
1914
+ server >= 7.139.0, told apart by `errorCode` (both `ConflictError`, `activeTaskId` absent): `conflict.session_row_changed` — the body carried `expectedRowTag` and the row is no longer that one; NOTHING was written;
1915
+ top-level `currentRow` = the list row as it stands now (same projection as the 200 row, with the new `rowTag`) — treat it as synced if its writable bits already equal what you wanted, else decide again and send ITS `rowTag`
1916
+ (never resend verbatim). `conflict.session_mirror` — this session is a read-only MIRROR of a session whose writer is elsewhere (execution placement `mirror`), it cannot be renamed or pinned here, with or without
1917
+ `expectedRowTag`; top-level `forkPath` (`/v1/sessions/{id}/fork`): fork it to continue here; nothing was written.
1918
+ content:
1919
+ application/json:
1920
+ schema: { $ref: '#/components/schemas/ErrorResponse' }
1906
1921
  '501': { $ref: '#/components/responses/NotImplemented' }
1907
1922
  delete:
1908
1923
  tags: [sessions]
@@ -1977,21 +1992,38 @@ paths:
1977
1992
  regenerate-from-here). Owner-scoped (non-owner → 404; the fork is owned by the caller). 400 `request.id_invalid` on an id that is not
1978
1993
  a canonical uuid — ANY uuid version passes since server >= 7.125.0 (the ONE shape gate shared with sync / policy / delete; <= 7.124.x accepted only
1979
1994
  uuidv7 here, so a shell-preset v4 id was creatable and syncable but not forkable). 501 without a durable session store.
1995
+ server >= 7.139.0 (contract section 23.4): the OPTIONAL body `{ forkId, forkNonce }` makes the fork keyed and RETRYABLE (together or not at all) — first `200 { sessionId }` (= `forkId`), a same-key retry
1996
+ `200 { sessionId, replayed: true }`; `forkId` already another session of yours ⇒ `409 conflict.fork_id_taken` (final: pick new keys); someone else's session ⇒ `404 not_found.session`; two collisions with another writer
1997
+ on the same target ⇒ `503 state.fork_target_unsettled` (`permanence: "transient"`, retry the same keys). Reconcile with `GET /v1/sessions/{forkId}/execution-placement` (`absent` / `writer` ⇒ forked; `forking` ⇒ a
1998
+ `DB_BACKEND=local` copy did not finish, retry the same keys; 404 ⇒ not forked). A fork's new session is `absent` and first executes on the CURRENT lane. The route now PARSES the body (it ignored it up to 7.138.x).
1999
+ requestBody:
2000
+ required: false
2001
+ content:
2002
+ application/json:
2003
+ schema: { $ref: '#/components/schemas/SessionForkBody' }
1980
2004
  responses:
1981
2005
  '200':
1982
- description: The new branched session id.
2006
+ description: 'The new branched session id (`replayed: true` on a same-key retry of a keyed fork, server >= 7.139.0).'
1983
2007
  content:
1984
2008
  application/json:
1985
- schema:
1986
- type: object
1987
- # 封闭:铸造点 `routes/sessions.ts` 是单键字面量 `{ sessionId: newId }`。
1988
- additionalProperties: false
1989
- required: [sessionId]
1990
- properties:
1991
- sessionId: { type: string }
2009
+ schema: { $ref: '#/components/schemas/SessionForkResult' }
1992
2010
  '400': { $ref: '#/components/responses/BadRequest' }
1993
2011
  '401': { $ref: '#/components/responses/Unauthorized' }
1994
2012
  '404': { $ref: '#/components/responses/NotFound' }
2013
+ '409':
2014
+ description: >-
2015
+ `conflict.fork_id_taken` (server >= 7.139.0, keyed fork): `forkId` already names ANOTHER session of yours (a different fork, or a session this fork request did not create); nothing was forked; top-level `forkId`.
2016
+ FINAL — pick a new `forkId` and `forkNonce`. (Someone else's session answers `404 not_found.session`, byte-identical to an unknown source.)
2017
+ content:
2018
+ application/json:
2019
+ schema: { $ref: '#/components/schemas/ErrorResponse' }
2020
+ '503':
2021
+ description: >-
2022
+ `state.fork_target_unsettled` (server >= 7.139.0, keyed fork): two attempts both collided with another writer on the same target id and neither could read the target back — the server does not guess; body
2023
+ `permanence: "transient"`. Retry the SAME `forkId` / `forkNonce` verbatim. (`ServiceStateError`; the SDK does not retry a fork for you.)
2024
+ content:
2025
+ application/json:
2026
+ schema: { $ref: '#/components/schemas/ErrorResponse' }
1995
2027
  '500':
1996
2028
  description: >-
1997
2029
  server >= 7.137.0: `invalid_session` — this route has no error mapping of its own; a session error it raises reaches the server's top-level catch, which maps it through the shared table: an `invalid_session` error
@@ -2002,6 +2034,84 @@ paths:
2002
2034
  schema: { $ref: '#/components/schemas/ErrorResponse' }
2003
2035
  '501': { $ref: '#/components/responses/NotImplemented' }
2004
2036
 
2037
+ /v1/sessions/{sessionId}/execution-placement:
2038
+ parameters:
2039
+ - $ref: '#/components/parameters/PrincipalHeader'
2040
+ - in: path
2041
+ name: sessionId
2042
+ required: true
2043
+ schema: { type: string }
2044
+ get:
2045
+ tags: [sessions]
2046
+ operationId: sessionsExecutionPlacement
2047
+ x-status: live # server >= 7.139.0 (contract section 23.1); no capability bit (an older server answers route-level 404 `not_found.route`).
2048
+ summary: Read one root session's execution placement on this deployment (absent / writer / mirror / forking).
2049
+ description: >
2050
+ server >= 7.139.0 (contract section 23.1) — the execution placement of one ROOT session's current occupant on THIS deployment (see `ExecutionPlacement`). Its documented uses: the SOURCE of the rebind verb's `expectedRev`
2051
+ (`device.rev` on the `writer` arm — it replaces the retired `GET /v1/devices/sessions/{rootSessionId}`), "is this deployment the writer?" before a session-sync push (`writer` ⇒ do not push, pull or fork instead), and reconciling a keyed fork.
2052
+ Visibility = the session's owner OR an explicit operator (an operator reads any session); a stranger and an unknown session answer the SAME `404 not_found.session` (anti-enumeration); a delegated child's partition row is not a root
2053
+ session (404). A malformed percent-encoded id segment ⇒ `400 request.path_malformed`. A session store without the execution seat (the engine's in-memory default) ⇒ `501 capability.session_store_required` — such a deployment does
2054
+ not record placement, and answering `absent` would say "not placed yet" for "not recorded". Inside the no-credential write gate (this GET too): no service credential and `ALLOW_UNAUTHED_WRITES` off ⇒ `503 auth.service_token_required`.
2055
+ A read, not a lock: the placement can change right after (a concurrent first execution / import).
2056
+ responses:
2057
+ '200':
2058
+ description: The placement.
2059
+ content:
2060
+ application/json:
2061
+ schema: { $ref: '#/components/schemas/ExecutionPlacement' }
2062
+ '400': { $ref: '#/components/responses/BadRequest' }
2063
+ '401': { $ref: '#/components/responses/Unauthorized' }
2064
+ '404': { $ref: '#/components/responses/NotFound' }
2065
+ '501': { $ref: '#/components/responses/NotImplemented' }
2066
+ '503':
2067
+ description: '`auth.service_token_required` — the no-credential write gate (no service credential configured and `ALLOW_UNAUTHED_WRITES` off).'
2068
+ content:
2069
+ application/json:
2070
+ schema: { $ref: '#/components/schemas/ErrorResponse' }
2071
+
2072
+ /v1/sessions/{sessionId}/children/retire:
2073
+ parameters:
2074
+ - $ref: '#/components/parameters/PrincipalHeader'
2075
+ - in: path
2076
+ name: sessionId
2077
+ required: true
2078
+ schema: { type: string }
2079
+ post:
2080
+ tags: [sessions]
2081
+ operationId: sessionsChildrenRetire
2082
+ x-status: live # server >= 7.139.0 (contract section 23.5); no capability bit (an older server answers route-level 404 `not_found.route`).
2083
+ summary: Retire every background child rooted at this session (no body).
2084
+ description: >
2085
+ server >= 7.139.0 (contract section 23.5) — the SAME coordinator as the retirement `DELETE /v1/sessions/{sessionId}` runs first: running children are stopped, parked ones have their card voided and are driven to a terminal
2086
+ state, then the roster is re-enumerated until none is live. Use it BEFORE a rebind or a session-sync push: `409 device.rebind_active_run` / `409 session_active` bodies of the shape `{ children, retirePath }` name this
2087
+ path as `retirePath`. `POST /v1/sessions/{sessionId}/background/stop` keeps its meaning (stops running background agents / workflows and reaps shells; parked children and their pending cards stay) — "stop everything" = the stop verb
2088
+ plus this one. Auth, rate limit and the no-credential write gate are the stop verb's (session owner OR explicit operator; a stranger and an unknown session answer the same `404 not_found.session`; no session-ownership face ⇒
2089
+ `501 capability.session_ownership_required`). It does NOT judge the root run: a live root run may spawn children again after the retirement — that shape is caught by the claim read inside the rebind / push write transaction.
2090
+ Children dispatched after the observation, and children registered under another principal than the session owner, are invisible to the observation and absent from the receipt.
2091
+ responses:
2092
+ '200':
2093
+ description: The children that were observed and are now retired (an empty array when there were none).
2094
+ content:
2095
+ application/json:
2096
+ schema: { $ref: '#/components/schemas/SessionChildrenRetireResult' }
2097
+ '401': { $ref: '#/components/responses/Unauthorized' }
2098
+ '404': { $ref: '#/components/responses/NotFound' }
2099
+ '409':
2100
+ description: >-
2101
+ `conflict.session_children_alive`: some children cannot be ended from THIS replica (running on another replica, or parked on approval with no durable approval store here); NOTHING was moved; top-level `remaining` = their
2102
+ ids (the same strings as `GET /v1/agents/roster`) — same code, same projection as the delete gate. Wait for them or stop them where they run, then retry verbatim. A retirement that cannot finish stopping answers the
2103
+ delete gate's failure shape (500; an idempotent retry converges).
2104
+ content:
2105
+ application/json:
2106
+ schema: { $ref: '#/components/schemas/ErrorResponse' }
2107
+ '429': { $ref: '#/components/responses/RateLimited' }
2108
+ '501': { $ref: '#/components/responses/NotImplemented' }
2109
+ '503':
2110
+ description: '`auth.service_token_required` — the no-credential write gate (no service credential configured and `ALLOW_UNAUTHED_WRITES` off).'
2111
+ content:
2112
+ application/json:
2113
+ schema: { $ref: '#/components/schemas/ErrorResponse' }
2114
+
2005
2115
  /v1/sessions/{sessionId}/head:
2006
2116
  parameters:
2007
2117
  - $ref: '#/components/parameters/PrincipalHeader'
@@ -3591,6 +3701,9 @@ paths:
3591
3701
  by pointing at deny), but DENY answers `200 { taskId, status: "failed", decision: "deny" }`: the card is voided under its own scope CAS and leaves the pending queue and the
3592
3702
  `/v1/approvals/stream` snapshot, the child ends `failed`, the gated tool never runs, no `remember` is granted; a lost void CAS is the existing 409 `decide.gate_moved`. Branch on
3593
3703
  `status` / `errorCode`, not on the sentence.
3704
+ server >= 7.138.0 — only the no-root-session-anchor form remains: the engine names every new row (an unnamed call gets `agent-<12 hex>`) and reads an older unnamed row
3705
+ under the same derived name, so an unnamed child's card revives (approve runs the action, deny reaches the child as a refusal); the void receipt also carries
3706
+ `decisionCommitted: true` (plus `checkpointId` when the selected gate has one).
3594
3707
  content:
3595
3708
  application/json:
3596
3709
  schema: { $ref: '#/components/schemas/ResumeLegConflictError' }
@@ -6760,23 +6873,20 @@ paths:
6760
6873
  get:
6761
6874
  tags: [devices]
6762
6875
  operationId: devicesSessionBinding
6763
- x-status: gated # server routes/devices.ts;同族 501 谓词。SDK devices.sessionBinding() 消费。
6764
- summary: Read one root session's device binding (all the material a shell's rebind UX needs).
6765
- description: >
6766
- `boundDevice.rev` is exactly the prior state the rebind verb's `expectedRev` must echo — READ THIS FIRST,
6767
- then rebind. Unbound / not yours ⇒ 404 `not_found.device`, SAME code SAME string (anti-enumeration: "no
6768
- visible binding" is one answer; it does not tell you whether the session exists).
6876
+ x-status: retired # server 7.139.0 (MIGRATION 7.139.0 item 15) deleted the route (global 404 `not_found.route`); sdk 30.0.0 deleted the verb `devices.sessionBinding()` (zero alias).
6877
+ summary: RETIRED (server 7.139.0) — read one root session's device binding; read GET /v1/sessions/{sessionId}/execution-placement instead.
6878
+ description: >
6879
+ RETIRED since server 7.139.0: this route no longer exists — the old path answers the global `404 not_found.route`. A device binding is now the device inside the `writer` placement of the root session row; read
6880
+ `GET /v1/sessions/{sessionId}/execution-placement`. Key mapping: the old body's `boundDevice.deviceId` / `boundDevice.rev` ⇒ the new `device.deviceId` / `device.rev` (`rev` is still what the rebind verb's `expectedRev` must echo);
6881
+ `boundAt` is gone; the old body's `rootSessionId` is the path id. "No binding" used to be `404 not_found.device` and is now a 200 (the role is not `writer`, or there is no `device` key); a stranger's and an unknown session answer the same
6882
+ `404 not_found.session` (it used to be `not_found.device`). The visibility gate changed too: the old read judged by device domain (a tenant claim and the same owner as the binding, else 403 / 404; operators exempt), the new one by session
6883
+ (the session-face owner predicate OR an explicit operator). Servers 7.88.0–7.138.x still serve this route; this spec keeps the entry as a tombstone (the SDK support floor is below 7.139.0) and the SDK carries no verb for it any more: against server >= 7.139.0 read `GET /v1/sessions/{sessionId}/execution-placement`; a deployment that still reads the binding on a server below 7.139.0 stays on sdk 29.x.
6769
6884
  responses:
6770
- '200':
6771
- description: The binding.
6885
+ '404':
6886
+ description: 'Server >= 7.139.0: the global `not_found.route` — the route is gone.'
6772
6887
  content:
6773
6888
  application/json:
6774
- schema: { $ref: '#/components/schemas/DeviceSessionBinding' }
6775
- '400': { $ref: '#/components/responses/BadRequest' } # request.path_malformed / request.id_invalid
6776
- '401': { $ref: '#/components/responses/Unauthorized' }
6777
- '403': { $ref: '#/components/responses/Forbidden' } # auth.forbidden
6778
- '404': { $ref: '#/components/responses/NotFound' } # not_found.device — unbound OR not yours, byte-identical
6779
- '501': { $ref: '#/components/responses/NotImplemented' } # capability.device_lane_required
6889
+ schema: { $ref: '#/components/schemas/ErrorResponse' }
6780
6890
 
6781
6891
  /v1/devices/sessions/{rootSessionId}/rebind:
6782
6892
  parameters:
@@ -6788,15 +6898,16 @@ paths:
6788
6898
  x-status: gated # server routes/devices.ts;同族 501 谓词 + 无活跃 run 门需 run store(501 capability.run_store_required)。SDK devices.rebind() 消费。
6789
6899
  summary: Explicitly rebind a root session to another device (v1 has no implicit rebind).
6790
6900
  description: >
6791
- `expectedRev` IS REQUIRED and must be the rev read from `GET /v1/devices/sessions/{rootSessionId}`: an
6792
- explicit prior state, so two concurrent operators cannot silently stomp each other. Door order (frozen,
6901
+ `expectedRev` IS REQUIRED and must be the rev read from `GET /v1/sessions/{rootSessionId}/execution-placement` (`device.rev` on the `writer` arm; server >= 7.139.0 — before it, `boundDevice.rev` of the retired
6902
+ `GET /v1/devices/sessions/{rootSessionId}`): an explicit prior state, so two concurrent operators cannot silently stomp each other. Door order (frozen,
6793
6903
  five steps server-side):
6794
6904
  (1) owner door — a non-owner gets 404, SAME bytes;
6795
6905
  (2) target-device door — `toDeviceId` must exist, belong to THE BINDING'S domain (an operator may not
6796
6906
  rebind across tenants) and not be revoked; otherwise 404, SAME bytes;
6797
6907
  (3) NO-ACTIVE-RUN door, judged BEFORE the CAS, with the durable criterion = the run store's session claim
6798
6908
  (parked runs included) ⇒ 409 `device.rebind_active_run` carrying `activeTaskId`; no run store wired ⇒ 501
6799
- `capability.run_store_required` (a door with no criterion refuses);
6909
+ `capability.run_store_required` (a door with no criterion refuses). server >= 7.139.0: live BACKGROUND CHILDREN rooted at the session (running, or parked on approval) are refused at this door too, with the body
6910
+ `{ children, retirePath }` instead of `{ activeTaskId }` (branch on the key) — `POST <retirePath>` (`/v1/sessions/{id}/children/retire`) retires them, then retry;
6800
6911
  (4) prior-state CAS in one store transaction plus a `session_rebound` audit row ⇒ rev mismatch is 409
6801
6912
  `device.rebind_rev_conflict` carrying `currentRev`. 🔴 The SAME `toDeviceId` with a WRONG rev is still a
6802
6913
  409 — a wrong prior state is wrong;
@@ -7433,8 +7544,7 @@ components:
7433
7544
  type: string
7434
7545
  description: >
7435
7546
  CC Rewind parity (E18). Fork the conversation FROM this user-message SessionTreeEntry.id (non-destructive
7436
- branch via setLeafId). With `restoreFiles: true` ⇒ "both" (also restore the working tree — the retired spelling
7437
- `rewindFiles` still rides the wire but its restore sense is core's typed migration rejection naming `restoreFiles`). Alone ⇒
7547
+ branch via setLeafId). With `restoreFiles: true` ⇒ "both" (also restore the working tree). Alone ⇒
7438
7548
  "conversation". HONORED only where the deployment wired a resume-anchor store + the session head read `headOf` (<= 7.134.x: `getLeafId`) (capabilities.resumeAt);
7439
7549
  unknown anchor ⇒ 4xx, capability-off ⇒ 501. Cannot combine with a durable resume.
7440
7550
  resumeAtMode:
@@ -7450,15 +7560,6 @@ components:
7450
7560
  session), `rewind_snapshot.unresolvable` (with a file restore, `restoreFiles`: the target has no file-history boundary of its
7451
7561
  own — a "before" restore only trusts the target's OWN boundary and never crosses into an earlier turn).
7452
7562
  Only meaningful WITH `resumeAt` — sent alone it is a 400 (fail-loud, not a silent no-op).
7453
- rewindFiles:
7454
- type: boolean
7455
- description: >
7456
- RETIRED SPELLING (the whole-tree snapshot epoch; S-15 / design/381, server >= 7.52 — note corrected in sdk
7457
- 11.4.0, the same stale-note family as `rewindFilesTo`, board [8437] U3). Server `src/http/wire-types.ts`: still
7458
- accepted on the wire — its capture sense (true, no resumeAt) is a tolerated no-op with a deprecation disclosure;
7459
- its restore sense (true + resumeAt) is core's TYPED migration rejection naming `restoreFiles` (restore semantics
7460
- really changed: whole tree ⇒ tracked set; the server never remaps it silently). Send `restoreFiles` (probe
7461
- `capabilities.restoreFiles`); this key stays declared only for <= 7.51 servers.
7462
7563
  rewindFilesTo:
7463
7564
  type: string
7464
7565
  description: >
@@ -7484,9 +7585,10 @@ components:
7484
7585
  codex review R1-[medium]: `capabilities.restoreFiles` told clients to send this key while neither
7485
7586
  this schema nor the SDK type could express it). With `resumeAt`: restore the TRACKED SET (files
7486
7587
  this session edited) to that boundary on fork — S-15 narrowed restore whole-tree ⇒ tracked-set and
7487
- moved the request key off `rewindFiles` (the old `rewindFiles`+`resumeAt` spelling gets core's
7488
- typed migration rejection on ≥7.52). Probe `capabilities.restoreFiles` first: bit absent = older
7489
- server, send the old spelling; never send both spellings.
7588
+ moved the request key off the old spelling `rewindFiles`. 🔴 The old spelling `rewindFiles` is RETIRED outright
7589
+ (server 7.139.0, MIGRATION item 2; sdk 30.0.0 deleted the key, zero alias): a new submit that carries it is
7590
+ `400 request.body_shape` with `unknownKeys: ["rewindFiles"]` and creates no run (the durable-resume replay of an OLD stored body
7591
+ ignores it). Probe `capabilities.restoreFiles` first; send `restoreFiles` (+ `resumeAt`) or `rewindFilesTo`.
7490
7592
  acceptPartialRestore:
7491
7593
  type: boolean
7492
7594
  description: >-
@@ -7506,7 +7608,7 @@ components:
7506
7608
  word. ONE word, `disabled`: this run takes no first-touch backup of an edited file and mints no turn boundaries
7507
7609
  (delegates inherit it); absent = the deployment's setting (there is no `enabled` spelling). Any other value ⇒ 400
7508
7610
  `request.field_invalid` ("fileHistory must be the string 'disabled' when present …"), fresh and resume legs alike.
7509
- 🔴 Riding together with ANY restore key (`restoreFiles` / `rewindFilesTo` / the retired `rewindFiles`) ⇒ 400
7611
+ 🔴 Riding together with ANY restore key (`restoreFiles` / `rewindFilesTo`) ⇒ 400
7510
7612
  `request.field_conflict` AT ADMISSION ("fileHistory: 'disabled' cannot ride with a file restore …"), session and
7511
7613
  files untouched — drop it to restore. The leg's own verdict is `wiring_manifest.fileHistory`; whether to render a
7512
7614
  "don't capture this session" switch is `capabilities.fileHistoryCapture === "on-optional"` (the switch = send this
@@ -7523,7 +7625,8 @@ components:
7523
7625
  `acceptEdits` (in-workspace writes do not ask) or `bypassPermissions` (422 `request.host_posture_refused` on hosted
7524
7626
  deployments) for the old no-ask posture. `auto` arms iff `permissionMode === "auto"` ∧ a classifier seat is mounted ∧
7525
7627
  `caps.autoMode !== false` (one polarity); when the requested mode does not take effect the stream gets `engine_notice`
7526
- `config.permission_mode_unavailable`. `bypassPermissions` RELEASES the releasable ask classes (nine on every face from server >= 7.127.0; ten on
7628
+ `config.permission_mode_unavailable`. `bypassPermissions` RELEASES the releasable ask classes (ten on every face from server >= 7.138.0, the tenth being `write_protection_on_disk`; nine on every face on
7629
+ server 7.127.0–7.137.x; ten on
7527
7630
  server 7.115.0–7.126.x, where the extra one is `rule_unreadable`; `unstated`, a server-tool call nobody stated, is releasable from server >= 7.115.0)
7528
7631
  and DISCLOSES each (`tool_end.gate.disposition.released` + one `engine_notice` `permission.ask_released_by_mode` per (mode, class) per run);
7529
7632
  immune classes (deployment-authored, ask / org rules, hooks, ancestors, questions …) still ask; a write whose protection
@@ -9996,7 +10099,7 @@ components:
9996
10099
  diagnostics, never as vocabulary). Empty array = honest "nothing usable here" (e.g. multi-tenant
9997
10100
  with no explicit allowlist); ABSENT = an older server (degrade to not teaching, not validating).
9998
10101
  resumeAt: { type: boolean, description: "E18 resume-at-message anchors are resolvable." }
9999
- rewindFiles: { type: boolean, description: "E19 working-tree snapshot/restore is wired." }
10102
+ rewindFiles: { type: boolean, description: "E19 file-history store present (the file-restore legs `restoreFiles` / `rewindFilesTo` can take effect). The bit's NAME is a historical spelling: the same-named REQUEST key `rewindFiles` is retired (server 7.139.0 ⇒ 400 `request.body_shape`), the bit itself is still minted." }
10000
10103
  rewindFilesTo:
10001
10104
  type: boolean
10002
10105
  description: >-
@@ -10014,10 +10117,9 @@ components:
10014
10117
  description: >-
10015
10118
  S-15 epoch discriminator (server ≥7.52, `Boolean(fileHistoryStore)`): this server understands the
10016
10119
  `restoreFiles` REQUEST KEY / tracked-set restore semantics (design/381 — restore narrowed
10017
- whole-tree ⇒ tracked set; the retired `rewindFiles`+`resumeAt` spelling gets core's typed
10018
- migration rejection there). New clients negotiate on THIS bit and send `restoreFiles` (+
10019
- `resumeAt`); absent ⇒ an older server, send the old spelling. `rewindFiles` keeps its name (same
10020
- affordance — "rewind can move files"); this bit is what tells the two epochs apart.
10120
+ whole-tree ⇒ tracked set). New clients negotiate on THIS bit and send `restoreFiles` (+
10121
+ `resumeAt`); absent ⇒ a server below the SDK's support floor. The capability bit `rewindFiles` keeps its
10122
+ name (same affordance — "rewind can move files"); the old REQUEST key of that name is retired (server 7.139.0).
10021
10123
  manualCompact: { type: boolean, description: "`POST /v1/runs/:id/compact` (needs a run store)." }
10022
10124
  configCatalog:
10023
10125
  type: boolean
@@ -11491,38 +11593,70 @@ components:
11491
11593
  description: "Opt-in to the evidence-capability-ABSENT degradation lane — a human signature; never injected. Non-boolean ⇒ 400 `request.field_invalid`."
11492
11594
 
11493
11595
  MemoryErasedBinding:
11494
- description: "core `ErasedBinding` — one erased row's coordinates (the snapshot's tagged binding law, without the account-trace extras)."
11596
+ description: "core `ErasedBinding` — one erased row's coordinates: the scope it was bound in, NEVER its file name (a model-chosen name can restate the content being erased; attestation v2)."
11495
11597
  oneOf:
11496
11598
  - type: object
11497
- required: [state, scope, slug]
11599
+ required: [state, scope]
11498
11600
  additionalProperties: true
11499
11601
  properties:
11500
11602
  state: { type: string, enum: [bound] }
11501
11603
  scope: { type: string }
11502
- slug: { type: string }
11503
11604
  - type: object
11504
11605
  required: [state]
11505
11606
  additionalProperties: true
11506
11607
  properties:
11507
11608
  state: { type: string, enum: [unbound] }
11508
11609
 
11610
+ MemoryErasureCarrierAnswer:
11611
+ description: >
11612
+ core `ErasureCarrierAnswer` — one carrier class's answer: what this call removed and what is known to remain, or
11613
+ `unverified` when the answering lane cannot read that class (which never reads as clean).
11614
+ oneOf:
11615
+ - type: object
11616
+ required: [removed, remaining]
11617
+ additionalProperties: true
11618
+ properties:
11619
+ removed: { type: integer, minimum: 0 }
11620
+ remaining: { type: integer, minimum: 0 }
11621
+ - type: object
11622
+ required: [unverified]
11623
+ additionalProperties: true
11624
+ properties:
11625
+ unverified: { type: boolean, enum: [true] }
11626
+
11627
+ MemoryErasureCountAnswer:
11628
+ description: "core `ErasureCountAnswer` — a store-level count that does not decide `status`; `unverified` when the lane cannot count."
11629
+ oneOf:
11630
+ - type: object
11631
+ required: [count]
11632
+ additionalProperties: true
11633
+ properties:
11634
+ count: { type: integer, minimum: 0 }
11635
+ - type: object
11636
+ required: [unverified]
11637
+ additionalProperties: true
11638
+ properties:
11639
+ unverified: { type: boolean, enum: [true] }
11640
+
11509
11641
  MemoryErasureAttestation:
11510
11642
  type: object
11511
11643
  description: >
11512
11644
  200 body of POST /v1/memory/erase — core `MemoryErasureAttestation` ITSELF, the deliverable a compliance
11513
- caller archives. Every claim is black-box re-checkable.
11645
+ caller archives; this schema describes version 2 ONLY (server >= 7.138.0). Every claim is black-box re-checkable,
11646
+ and it names ids, scopes, revs, sessions and counts — never a file name or entry text. A server <= 7.137.x answers
11647
+ the previous generation (`v: 1`), which this schema does not describe: read `v` and refuse anything but 2.
11514
11648
  🔴 READ `evidenceCapability` BEFORE DECIDING WHETHER A RETRY IS SAFE — the two legs have different
11515
- contracts (see the endpoint description). OPEN for the same reason as `EntryProvenanceAccount`.
11649
+ contracts (see the endpoint description; `residuals.replay` says the same). OPEN for the same reason as `EntryProvenanceAccount`.
11516
11650
  required: [v, requestId, at, status, evidenceCapability, custodyState, select, selectHash, resolvedIds, erased, notFound, conflicts, residuals]
11517
11651
  additionalProperties: true
11518
11652
  properties:
11519
- v: { type: integer, enum: [1], description: 'Version envelope — a consumer reading `v > 1` must refuse, never reinterpret.' }
11653
+ v: { type: integer, enum: [2], description: 'Version envelope — this schema describes `v: 2` only; a consumer reading any other value must refuse, never reinterpret.' }
11520
11654
  requestId: { type: string }
11521
11655
  at: { type: integer }
11522
11656
  status:
11523
11657
  type: string
11524
11658
  enum: [complete, partial]
11525
- description: '`complete` ⇔ conflicts empty ∧ every pinned id ∈ erased ∪ erasedPreviously ∪ (notFound with `custodyState === "complete"`). Everything else is `partial` (a replay converges it).'
11659
+ description: '`complete` ⇔ conflicts empty ∧ every pinned id ∈ erased ∪ erasedPreviously ∪ (notFound with `custodyState === "complete"`) ∧ every `residuals.carriers` class answers `remaining: 0` (one predicate for both lanes). Its reach is THIS store and the selected ids (an entry restating an erased one is counted on `residuals.derivedEntries` and does not decide it). Everything else is `partial`; a replay converges the classes the lane can clear and says when it cannot (`unverified`, or `evidenceBinding.remaining`).'
11526
11660
  evidenceCapability:
11527
11661
  type: string
11528
11662
  enum: [journal, none]
@@ -11562,7 +11696,7 @@ components:
11562
11696
  historyUnknown: { type: boolean, enum: [true] }
11563
11697
  erasedPreviously:
11564
11698
  type: array
11565
- description: 'Chain-read rows: an origin-ABSENT delete row carrying THIS requestId. Present only when non-empty; never produced in `none` mode or over a damaged chain.'
11699
+ description: 'Chain-read rows: an origin-ABSENT delete row carrying THIS requestId (another request''s delete of the id answers notFound, never a claim). Present only when non-empty; never produced in `none` mode or over a damaged chain. Version 2 carries no `from` — locate erased entries by your own requestId.'
11566
11700
  items:
11567
11701
  type: object
11568
11702
  required: [id, ev, at]
@@ -11571,13 +11705,6 @@ components:
11571
11705
  id: { type: string }
11572
11706
  ev: { type: string }
11573
11707
  at: { type: integer }
11574
- from:
11575
- type: object
11576
- required: [scope, slug]
11577
- additionalProperties: true
11578
- properties:
11579
- scope: { type: string }
11580
- slug: { type: string }
11581
11708
  conflicts:
11582
11709
  type: array
11583
11710
  description: 'Per-id PLANNING-stage faults (io/plan errors under the lock — there is no CAS loser inside a single lock span). Non-fatal; a replay converges them.'
@@ -11590,12 +11717,39 @@ components:
11590
11717
  reason: { type: string }
11591
11718
  residuals:
11592
11719
  type: object
11593
- required: [quarantineHits, quarantineOpaque, propagation]
11720
+ required: [carriers, quarantineUnattributed, derivedEntries, replay, propagation]
11594
11721
  additionalProperties: true
11595
11722
  properties:
11596
- quarantineHits: { type: array, items: { type: string }, description: 'Quarantine files whose frontmatter id is in the pinned set (PRESERVE-NOT-DELETE: the attestation enumerates, an explicit second action clears).' }
11597
- quarantineOpaque: { type: integer, description: 'Quarantine files that could not be attributed (fragments / non-entry shapes) — the honest BOUND of the enumeration.' }
11598
- indexUncleared: { type: array, items: { type: string }, description: 'Derived MEMORY.md index files that may STILL carry a line naming an erased entry (the erase-time sweep could not read or rewrite them). Present only when non-empty.' }
11723
+ carriers:
11724
+ type: object
11725
+ description: >
11726
+ Every carrier class of core `ERASURE_CARRIER_CLASSES`, each answered (`projection` — the entry's files under its scope home;
11727
+ `shadow` — the control plane's committed copy; `indexLine` — MEMORY.md lines naming a deleted projection path, answered by the
11728
+ engine's sweep; `quarantineCopy` — quarantine files whose frontmatter id is the erased id; `planArchive` / `planWorkbook` — the
11729
+ consolidation plane's mint archive and plan workbook; `evidenceBinding` — evidence-chain rows that still spell the entry's file
11730
+ name, which the append-only chain keeps, so they keep the request `partial` and a replay cannot clear them; `backendDerived` —
11731
+ anything a backend derives privately).
11732
+ required: [projection, shadow, indexLine, quarantineCopy, planArchive, planWorkbook, evidenceBinding, backendDerived]
11733
+ additionalProperties: true
11734
+ properties:
11735
+ projection: { $ref: '#/components/schemas/MemoryErasureCarrierAnswer' }
11736
+ shadow: { $ref: '#/components/schemas/MemoryErasureCarrierAnswer' }
11737
+ indexLine: { $ref: '#/components/schemas/MemoryErasureCarrierAnswer' }
11738
+ quarantineCopy: { $ref: '#/components/schemas/MemoryErasureCarrierAnswer' }
11739
+ planArchive: { $ref: '#/components/schemas/MemoryErasureCarrierAnswer' }
11740
+ planWorkbook: { $ref: '#/components/schemas/MemoryErasureCarrierAnswer' }
11741
+ evidenceBinding: { $ref: '#/components/schemas/MemoryErasureCarrierAnswer' }
11742
+ backendDerived: { $ref: '#/components/schemas/MemoryErasureCarrierAnswer' }
11743
+ quarantineUnattributed:
11744
+ allOf: [{ $ref: '#/components/schemas/MemoryErasureCountAnswer' }]
11745
+ description: 'Quarantine files no id could be read from (fragments / non-entry shapes) — the honest bound of the quarantine read; does not decide `status`.'
11746
+ derivedEntries:
11747
+ allOf: [{ $ref: '#/components/schemas/MemoryErasureCountAnswer' }]
11748
+ description: "Committed entries outside the selection whose consolidation lineage names an erased id (they may restate it) — counted, not erased; their closure is the caller's to compute."
11749
+ replay:
11750
+ type: string
11751
+ enum: [converges, unsupported]
11752
+ description: '`converges` = the evidence lane (a replay of the same requestId converges); `unsupported` = the degraded lane (a re-send is a new request).'
11599
11753
  propagation:
11600
11754
  type: string
11601
11755
  enum: [local-store-only]
@@ -14319,11 +14473,23 @@ components:
14319
14473
  >= 7.125.0 (a session's state, not a capability — NOT present-iff); a lister face with no session metadata (the in-memory run-store
14320
14474
  aggregate) always answers `false`. ABSENT = an older server (<= 7.124.x) — read as "not pinned". Not in `required` for that reason only.
14321
14475
  The list order is unchanged (recency by `lastActivityAt`); the client groups the pinned section. Renaming / pinning does not move `lastActivityAt`.
14476
+ rowTag:
14477
+ type: string
14478
+ pattern: '^[A-Za-z0-9_-]{43}$'
14479
+ description: >
14480
+ server >= 7.139.0 (contract section 20, "conditional write"): the ROW TAG — an opaque string (43 characters of `[A-Za-z0-9_-]`) to be echoed back verbatim as
14481
+ `PATCH /v1/sessions/{sessionId}` `expectedRowTag`: "write only if the row is still the one I read". It changes when one of the row's WRITABLE bits (today `title` / `pinned`)
14482
+ or the session ITSELF changes (deleted and re-created under the same id; a changed owner); a new run, the activity time and the preview do NOT change it; a value that was changed and
14483
+ changed back is unchanged (no value-judging round trip). The `PATCH` 200 row and the `currentRow` of a `409 conflict.session_row_changed` are the SAME projection and carry it too.
14484
+ PRESENT-IFF the row can be written conditionally (all three durable session backends); a lister face with no session metadata (the in-memory run-store aggregate) does not carry it.
14485
+ ABSENT = an older server (<= 7.138.x) or such a face — read as "no tag, unconditional write only". Never parse it, compare its order or use it across sessions. Not an ETag, no capability bit.
14322
14486
 
14323
14487
  SessionPatchBody:
14324
14488
  type: object
14325
14489
  description: >
14326
- `PATCH /v1/sessions/{sessionId}` body (server >= 7.125.0, contract section 20) — a CLOSED set of two keys, at least one: any other key, an empty body or a
14490
+ `PATCH /v1/sessions/{sessionId}` body (server >= 7.125.0, contract section 20) — a CLOSED set: the two writable bits `title` / `pinned` (at least one) plus, from server >= 7.139.0, the optional PRECONDITION
14491
+ `expectedRowTag` (the `rowTag` of the list row you read: "write only if the row is still that one"; stale ⇒ `409 conflict.session_row_changed`, nothing written; a key that is not a 43-character `[A-Za-z0-9_-]`
14492
+ string ⇒ `400 request.field_invalid`; `expectedRowTag` ALONE — no writable bit — ⇒ `400 request.body_shape`; a server <= 7.138.x answers `400 request.body_shape` for the unknown key: fail-closed, do NOT drop the key and resend). Any other key, an empty body or a
14327
14493
  non-object is `400 request.body_shape`. `title`: a string renames (1..120 CHARACTERS counted as Unicode characters = the storage column width, no leading /
14328
14494
  trailing whitespace, stored verbatim — not rewritten, not redacted); `null` CLEARS it back to the automatic title (the next submit lets the auto-titler fill
14329
14495
  it again). `""` is NOT a clear — it is `400 request.body_shape`. A string of the wrong form / a non-string-non-null `title` / a non-boolean `pinned` is
@@ -14331,7 +14497,9 @@ components:
14331
14497
  usable-name normalization) is `400 request.field_invalid` too (`title must contain at least one visible character`; the session-sync 2c import's `title` reads the same rule). Such titles written before
14332
14498
  7.136.0 are not migrated.
14333
14499
  additionalProperties: false
14334
- minProperties: 1
14500
+ anyOf:
14501
+ - required: [title]
14502
+ - required: [pinned]
14335
14503
  properties:
14336
14504
  title:
14337
14505
  type: [string, 'null']
@@ -14340,6 +14508,84 @@ components:
14340
14508
  pattern: '^\S([\s\S]*\S)?$'
14341
14509
  description: 'A string = rename (1..120 characters, no leading / trailing whitespace); `null` = clear back to the automatic title; `""` is a 400 (the only spelling of "clear" is `null`).'
14342
14510
  pinned: { type: boolean, description: 'The pin (default `false` on a row that never set it).' }
14511
+ expectedRowTag:
14512
+ type: string
14513
+ pattern: '^[A-Za-z0-9_-]{43}$'
14514
+ description: 'server >= 7.139.0 — the PRECONDITION (not a writable bit): the `rowTag` of the list row you read. Still that row ⇒ the write happens (the 200 row carries the tag after the write — it changes only if a value actually changed; a write of the value already held returns the same tag); not any more ⇒ `409 conflict.session_row_changed` with `currentRow`, nothing written. Never resend verbatim after a 409.'
14515
+ SessionForkBody:
14516
+ type: object
14517
+ description: >
14518
+ `POST /v1/sessions/{sessionId}/fork` OPTIONAL body (server >= 7.139.0, contract section 23.4) — the keyed, retryable fork: `forkId` (the caller-minted canonical uuid that BECOMES the new session's id; not the source) and
14519
+ `forkNonce` (a non-empty string of at most 255 UTF-16 code units, i.e. JavaScript `String.length` — the server compares exactly that; a retry sends the SAME one). TOGETHER OR NEITHER: only one ⇒
14520
+ `400 request.field_conflict` (`detail.kind: "fork_target"`, `fields: ["forkId", "forkNonce"]`); neither (an empty object, or no body at all) = the previous form (the server mints the id). The server reads only these two keys
14521
+ and IGNORES any other key (the object is not key-closed). Note the route now PARSES the body (it ignored it up to 7.138.x): malformed JSON ⇒ `400 request.invalid_json`, over the 8 MiB cap ⇒ `413`, a JSON array or scalar ⇒ `400 request.field_invalid`.
14522
+ additionalProperties: true
14523
+ oneOf:
14524
+ - required: [forkId, forkNonce]
14525
+ - allOf:
14526
+ - not: { required: [forkId] }
14527
+ - not: { required: [forkNonce] }
14528
+ properties:
14529
+ forkId: { type: string, description: 'A canonical uuid (any version) naming the NEW session; not the source id (`400 request.field_invalid`), not a canonical uuid (`400 request.id_invalid`).' }
14530
+ forkNonce: { type: string, minLength: 1, maxLength: 255, description: 'The caller''s key for this fork request: non-empty, at most 255 UTF-16 code units (JavaScript `String.length`; JSON Schema `maxLength` counts code points, so it is only a necessary bound for text outside the BMP — the server refuses 256+ code units). A retry sends the same one. Not such a string ⇒ `400 request.field_invalid`.' }
14531
+ SessionForkResult:
14532
+ type: object
14533
+ description: >
14534
+ `POST /v1/sessions/{sessionId}/fork` 200 body: `sessionId` = the NEW branched session (= `forkId` on a keyed fork); `replayed: true` (server >= 7.139.0, keyed form only) = a retry by the same owner, same source and same
14535
+ nonce hit the earlier result. The key is ABSENT on a first fork and on every older server.
14536
+ additionalProperties: false
14537
+ required: [sessionId]
14538
+ properties:
14539
+ sessionId: { type: string }
14540
+ replayed: { type: boolean, enum: [true], description: 'Present only (and always `true`) on a same-key retry.' }
14541
+ SessionChildrenRetireResult:
14542
+ type: object
14543
+ description: >
14544
+ `POST /v1/sessions/{sessionId}/children/retire` 200 body (server >= 7.139.0, contract section 23.5): `children` = the background children the first observation found AND that are now all retired
14545
+ (an empty array when there were none); each item is the same string as the `GET /v1/agents/roster` row id.
14546
+ additionalProperties: false
14547
+ required: [children]
14548
+ properties:
14549
+ children: { type: array, items: { type: string } }
14550
+ ExecutionPlacementDevice:
14551
+ type: object
14552
+ description: >
14553
+ The device a `writer` placement on the device lane is bound to (`ExecutionPlacement`, server >= 7.139.0): `deviceId` + `rev` — `rev` is exactly what
14554
+ `POST /v1/devices/sessions/{rootSessionId}/rebind` `expectedRev` must echo. The device owner and the binding time do not ride the wire.
14555
+ additionalProperties: false
14556
+ required: [deviceId, rev]
14557
+ properties:
14558
+ deviceId: { type: string, minLength: 1 }
14559
+ rev: { type: integer, minimum: 0 }
14560
+ ExecutionPlacement:
14561
+ description: >
14562
+ `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`:
14563
+ `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`
14564
+ 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`) ·
14565
+ `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.
14566
+ oneOf:
14567
+ - type: object
14568
+ additionalProperties: false
14569
+ required: [role]
14570
+ properties:
14571
+ role: { const: absent }
14572
+ - type: object
14573
+ additionalProperties: false
14574
+ required: [role, lane]
14575
+ properties:
14576
+ role: { const: writer }
14577
+ lane: { type: string, minLength: 1 }
14578
+ device: { $ref: '#/components/schemas/ExecutionPlacementDevice' }
14579
+ - type: object
14580
+ additionalProperties: false
14581
+ required: [role]
14582
+ properties:
14583
+ role: { const: mirror }
14584
+ - type: object
14585
+ additionalProperties: false
14586
+ required: [role]
14587
+ properties:
14588
+ role: { const: forking }
14343
14589
 
14344
14590
  SessionWindow:
14345
14591
  type: object
@@ -14716,14 +14962,14 @@ components:
14716
14962
  face adds `errorCode` / `httpStatus` / `delivered` / `transportClosed`. Folding them would make the
14717
14963
  panel's consumers wait for four keys that never come.
14718
14964
  🔴 BRANCH ON THE MACHINE FIELDS, NEVER PARSE `reason`: `errorCode` is core's `McpFailureKind` word
14719
- (owner is the engine — switch with a default arm, do not narrow), `httpStatus` 401 is a re-authorize
14720
- door, `spawn_failed` is a missing binary.
14965
+ (owner is the engine — switch with a default arm, do not narrow), `unauthorized` is a re-authorize
14966
+ door (server >= 7.138.0; on older servers `http_status` with `httpStatus` 401), `spawn_failed` is a missing binary.
14721
14967
  required: [name, status]
14722
14968
  properties:
14723
14969
  name: { type: string }
14724
14970
  status: { type: string, description: 'connected | failed (open set — the word table owner is the engine).' }
14725
14971
  errorCode: { type: string, description: 'core `McpFailureKind`. Open set; switch with a default arm.' }
14726
- httpStatus: { type: integer, description: 'Only alongside errorCode `http_status` (401/403 = re-authorize; 5xx = that end is down). ABSENT rather than 0.' }
14972
+ httpStatus: { type: integer, description: 'Only alongside errorCode `http_status` (5xx = that end is down; from server >= 7.138.0 a 401, and a 403 with an `insufficient_scope` challenge, are errorCode `unauthorized` without this key). ABSENT rather than 0.' }
14727
14973
  delivered: { type: string, enum: [yes, no, unknown], description: 'Did the request reach that server — read together with errorCode.' }
14728
14974
  serverInfo:
14729
14975
  type: object
@@ -14796,6 +15042,11 @@ components:
14796
15042
  core's retain predicate (env declaration / task lane / row mark — any ⇒ kept) — present ONLY when true,
14797
15043
  never minted as false, and only ever on a shell row (`background_bash` / `monitor`; core `list()` row
14798
15044
  doc). Present = "keeps running" on the exit sheet; absent = an `includeRetained:false` stop WILL stop it.
15045
+ sessionId:
15046
+ type: string
15047
+ description: >-
15048
+ server >= 7.139.0 (MIGRATION 7.139.0 item 7): present-iff the background agent row is bound to a CHILD session — jump to that session with it (it still passes the session face's owner gate). ABSENT = none yet,
15049
+ or an older server. Only ever on a `background_agent` row.
14799
15050
  SessionBackgroundList:
14800
15051
  type: object
14801
15052
  description: '`GET /v1/sessions/{sessionId}/background` 200 body (contract §16). An idle session answers `{ rows: [] }`.'
@@ -15138,7 +15389,10 @@ components:
15138
15389
  budget): this code says nothing about the caller's quota. (`gone.` = 410, "the channel closed, switch
15139
15390
  channels"; `parking.` = 425, "intermediate state — you retry to learn the landing, not to re-submit".
15140
15391
  Both families, and both status codes, first reached the wire with server 7.3.0's in-stream approval
15141
- decision endpoint.) The SDK maps each family to a typed class, so a code this SDK has
15392
+ decision endpoint.) 🔴 server >= 7.139.0 also mints two 409 codes under a prefix that is NOT one of the fourteen:
15393
+ `execution_lane.not_served` / `execution_lane.tree_bound` (the session is placed on an execution lane this deployment no
15394
+ longer runs / another lane of this deployment; top-level `boundLane`) — they fall through to the STATUS tail (409 ⇒
15395
+ `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
15142
15396
  never seen still degrades INFORMATIVELY (e.g. a future `capability.xyz_required` already lands on
15143
15397
  CapabilityUnavailableError). Family examples not named elsewhere in this document:
15144
15398
  `request.payload_too_large` (413 — a field or the whole body is over the server cap; shorten and
@@ -15835,7 +16089,9 @@ components:
15835
16089
  type: { const: tool_start }
15836
16090
  toolCallId: { type: string }
15837
16091
  toolName: { type: string }
15838
- requestedBy: { type: object, additionalProperties: false, required: [kind, name], properties: { kind: { type: string, enum: [extension] }, name: { type: string } }, description: 'server >= 7.138.0 (core 7.56.0 `ExtensionRequester`): this call was initiated by an extension registration through `$.tool.call` (appears only when the deployment seat mounted operator-declared packages); `name` = that registration (registrant text, UNTRUSTED-for-display). Absent = model-initiated.' }
16092
+ requestedBy:
16093
+ allOf: [{ $ref: '#/components/schemas/ExtensionRequester' }]
16094
+ description: 'server >= 7.138.0: this call was initiated by an extension registration through `$.tool.call` (appears only when the deployment seat mounted operator-declared packages). Absent = model-initiated.'
15839
16095
  # 🔴 census 轴一(2026-07-30)回填:server 白名单 builder `toolStartEventData`(trace/project.ts)
15840
16096
  # 真发 `label`(core 展示名,与 tool_end 同待遇),spec 此前漏声明 —— 封闭前必须先补,否则真帧变假红。
15841
16097
  label: { type: string, description: 'core 展示名(缺席 ⇒ 用 toolName 渲染)。' }
@@ -15886,10 +16142,10 @@ components:
15886
16142
  # 每只闭集 = 引擎今天的词 ∪ 引擎退役词表里那一集。这五张 enum 与引擎 `RETIRED_MEMBERS` 逐集逐词同(由 `server-7129-wire` 对拍);卡面 / 队列行 / 请求面的同名闭集只取今天的词。
15887
16143
  GateRecordAskClass:
15888
16144
  type: string
15889
- enum: [content_question, hook, ancestor, dangerous_delete, unverifiable_delete, unverifiable_shell_text, transcript_write, org_rule, rule_unreadable, ask_rule, denial_limit_fallback, classifier_no_ruling, requires_user_interaction, cross_boundary, operator_forced, shell_floor, target_unresolved, probe, write_protection, tool_marks_mcp, tool_marks_a2a, policy_rra, artifact_shared_read, mode, unstated, ordinary, write_protection_unresolved, governance_unavailable]
16145
+ enum: [content_question, hook, ancestor, dangerous_delete, unverifiable_delete, unverifiable_shell_text, transcript_write, org_rule, rule_unreadable, ask_rule, denial_limit_fallback, classifier_no_ruling, requires_user_interaction, cross_boundary, operator_forced, shell_floor, target_unresolved, probe, write_protection_on_disk, write_protection, tool_marks_mcp, tool_marks_a2a, policy_rra, artifact_shared_read, mode, unstated, ordinary, write_protection_unresolved, governance_unavailable]
15890
16146
  description: >-
15891
16147
  The class word on a GATE RECORD (`tool_end.gate.disposition.askClass` / `.classes` on the mode-refusal arm, `ModeRelease.askClass` / `.classes`) — server >= 7.129.0 reads the record as an ARCHIVE:
15892
- today's `AskClass` set (twenty-six words; `cross_boundary` from server >= 7.134.0) PLUS the words the engine retired (`write_protection_unresolved`, retired in core 7.49.0 — renamed `target_unresolved`; `governance_unavailable`,
16148
+ today's `AskClass` set (twenty-seven words; `write_protection_on_disk` from server >= 7.138.0, `cross_boundary` from server >= 7.134.0) PLUS the words the engine retired (`write_protection_unresolved`, retired in core 7.49.0 — renamed `target_unresolved`; `governance_unavailable`,
15893
16149
  retired in core 7.51.0 — merged into `rule_unreadable`). A record the previous engine generation legally wrote is replayed byte for byte (a 7.50.x mode refusal can carry `governance_unavailable`);
15894
16150
  a word NO engine generation ever minted (a case variant, the empty string, a future word) withholds the whole `gate` and counts `server.trace.gate-outcome-defective`.
15895
16151
  Render a known archive word normally and an unknown one generically; never drop the record because the word is not in today's set.
@@ -16146,9 +16402,10 @@ components:
16146
16402
  `UNATTENDED_PERMISSION_MODE=dontAsk`).
16147
16403
  AskClass:
16148
16404
  type: string
16149
- enum: [content_question, hook, ancestor, dangerous_delete, unverifiable_delete, unverifiable_shell_text, transcript_write, org_rule, rule_unreadable, ask_rule, denial_limit_fallback, classifier_no_ruling, requires_user_interaction, cross_boundary, operator_forced, shell_floor, target_unresolved, probe, write_protection, tool_marks_mcp, tool_marks_a2a, policy_rra, artifact_shared_read, mode, unstated, ordinary]
16405
+ enum: [content_question, hook, ancestor, dangerous_delete, unverifiable_delete, unverifiable_shell_text, transcript_write, org_rule, rule_unreadable, ask_rule, denial_limit_fallback, classifier_no_ruling, requires_user_interaction, cross_boundary, operator_forced, shell_floor, target_unresolved, probe, write_protection_on_disk, write_protection, tool_marks_mcp, tool_marks_a2a, policy_rra, artifact_shared_read, mode, unstated, ordinary]
16150
16406
  description: >
16151
- core `ASK_CLASSES` (TWENTY-SIX words as of core 7.54.0 / server >= 7.134.0: `cross_boundary` joined after `requires_user_interaction` — the device lane's
16407
+ core `ASK_CLASSES` (TWENTY-SEVEN words as of core 7.58.0 / server >= 7.138.0: `write_protection_on_disk` joined after `probe`, before `write_protection` — see below;
16408
+ TWENTY-SIX as of core 7.54.0 / server >= 7.134.0: `cross_boundary` joined after `requires_user_interaction` — the device lane's
16152
16409
  cross-boundary confirmation, see below; TWENTY-FIVE as of core 7.51.0 / server >= 7.129.0: `governance_unavailable` was merged into `rule_unreadable`, no alias — sdk 23.0.0; a stored card / parked row written by server <= 7.128.x is rewritten once by the server at boot. The gate record reads the ARCHIVE form, see `GateRecordAskClass`. History: twenty-two words as of core 7.40.0, twenty-three as of core 7.41.0, twenty-four as of core 7.43.0, twenty-five as of core 7.45.0, twenty-six as of core 7.49.0 — 7.34.0 minted twenty; `unverifiable_shell_text` joined in 7.49.0 #1505 and rides server >= 7.126.0, where the
16153
16410
  unresolved-write-target class was also RENAMED to `target_unresolved` (#955; zero alias — the previous spelling is in the SDK README's 22.0.0 migration table); `shell_floor` joined in 7.39.0 #1260 and rides
16154
16411
  server >= 7.113.0; `unstated` joined in 7.40.0 and rides server >= 7.115.0; `requires_user_interaction` joined in 7.41.0 and rides
@@ -16186,11 +16443,19 @@ components:
16186
16443
  but it has not been granted yet.`), and with no approval surface the call is refused. It is clearable (a RELEASABLE
16187
16444
  class: an allow rule — `settings.permissions.allow` / operator `APPROVAL_GRANT` — an explicit hook `permissionDecision: "allow"`, the auto-mode
16188
16445
  classifier or `bypassPermissions` clears it); under `plan` only READ-ONLY server tools raise it.
16446
+ `write_protection_on_disk` (core 7.58.0, server >= 7.138.0) = a write whose target reaches the write-protection table only where its path RESOLVES ON DISK — the path as
16447
+ written names no row, its real target or a link on the way does (an innocent spelling the disk carries onto a guarded path). It and `write_protection` (the path as written
16448
+ names a row) are the two readings of one table hit, judged per written target and never both for one target; a command writing several targets may carry both. Its
16449
+ arbitration row is `write_protection`'s save the classifier column: the auto-mode classifier does NOT answer it (a person does); `bypassPermissions` releases it (a
16450
+ RELEASABLE class), `dontAsk` refuses it, and no standing allow rule clears it — confirming this call does.
16189
16451
  `shell_floor` = the operator's `shellGate: "always"` floor on a shell-running seat (the question the `operator_always` mandate
16190
16452
  word discloses), a class of its own so a set that holds another forced question still holds it; like `operator_forced` it is
16191
16453
  bypass-IMMUNE (not releasable).
16192
- CLOSED: the card / queue-row / request faces carry exactly today's twenty-five words; the GATE RECORD (`tool_end.gate` and the replay faces) carries today's words PLUS the engine's retired words (`GateRecordAskClass`). `bypassPermissions` releases only the RELEASABLE classes (core
16193
- `releasableAskClassesFor(face)`). Server >= 7.127.0 (core 7.50.0): nine on every face (`transcript_write` / `probe` / `write_protection` /
16454
+ CLOSED: the card / queue-row / request faces carry exactly today's twenty-seven words; the GATE RECORD (`tool_end.gate` and the replay faces) carries today's words PLUS the engine's retired words (`GateRecordAskClass`). `bypassPermissions` releases only the RELEASABLE classes (core
16455
+ `releasableAskClassesFor(face)`). Server >= 7.138.0 (core 7.58.0): ten on every face (`transcript_write` / `probe` / `write_protection_on_disk` / `write_protection` /
16456
+ `tool_marks_mcp` / `tool_marks_a2a` / `artifact_shared_read` / `mode` / `unstated` / `ordinary` — one more than the generation before, `write_protection_on_disk`) plus an
16457
+ eleventh on the SHELL face only, `target_unresolved` (shell 11, other faces 10 again, with a different tenth class than 7.122.0–7.126.x).
16458
+ Server 7.127.0–7.137.x (core 7.50.0–7.56.x): nine on every face (`transcript_write` / `probe` / `write_protection` /
16194
16459
  `tool_marks_mcp` / `tool_marks_a2a` / `artifact_shared_read` / `mode` / `unstated` / `ordinary`) plus a tenth on the SHELL face only,
16195
16460
  `target_unresolved` (shell 10, other faces 9; on the file tools that class is refused, `deniedBy: mode`); `rule_unreadable` is no longer released
16196
16461
  by any mode (bypass asks too, and the run gets one `permission.rule_store_unavailable` notice). Server 7.122.0–7.126.x (core 7.47.0–7.49.x) also
@@ -16454,7 +16719,9 @@ components:
16454
16719
  type: { const: tool_end }
16455
16720
  toolCallId: { type: string }
16456
16721
  toolName: { type: string }
16457
- requestedBy: { type: object, additionalProperties: false, required: [kind, name], properties: { kind: { type: string, enum: [extension] }, name: { type: string } }, description: 'server >= 7.138.0 (core 7.56.0 `ExtensionRequester`): this call was initiated by an extension registration through `$.tool.call` (appears only when the deployment seat mounted operator-declared packages); `name` = that registration (registrant text, UNTRUSTED-for-display). Absent = model-initiated.' }
16722
+ requestedBy:
16723
+ allOf: [{ $ref: '#/components/schemas/ExtensionRequester' }]
16724
+ description: 'server >= 7.138.0: this call was initiated by an extension registration through `$.tool.call` (appears only when the deployment seat mounted operator-declared packages). Absent = model-initiated.'
16458
16725
  answeredBy: { type: string, description: 'server >= 7.138.0 (core 7.56.0): the registration that stood in for the tool body at the `tool.call` station with its own result or refusal (always beside `notExecuted: true`). Absent = no extension answered for the call.' }
16459
16726
  # 🔴 census 轴一(2026-07-30)回填:`toolEndEventData`(trace/project.ts)真发 `label` 与
16460
16727
  # `structured`,spec 此前两者都漏 —— SDK 的 events.ts 早已声明,漂移只在 spec 这一侧。
@@ -16549,8 +16816,9 @@ components:
16549
16816
  `errorCode` and `structured.type`. It is an IN-ROOT question, not an out-of-root read (a read certainly outside the roots
16550
16817
  stays `readonly_out_of_root`).
16551
16818
  🔴 core >= 7.6.0 — the MCP family within this open set is now the CLOSED `McpFailureKind` word list
16552
- (`connect_refused` / `connection_failed` / `connection_closed` / `http_status` / `not_mcp_response` /
16553
- `spawn_failed` / `timeout` / `protocol` / `invalid_config` / `unknown`); the retired
16819
+ (`connect_refused` / `connection_failed` / `connection_closed` / `unauthorized` / `http_status` / `not_mcp_response` /
16820
+ `spawn_failed` / `timeout` / `protocol` / `invalid_config` / `credential_unavailable` / `host_refused` / `unknown` — `credential_unavailable` from core 7.58.0 and
16821
+ `unauthorized` from core 7.59.0, server >= 7.138.0; `host_refused` from core 7.60.0, server >= 7.139.0); the retired
16554
16822
  `MCP_FAILURE_CODES` spellings — including `network` and the `http_<status>` encoding — are gone,
16555
16823
  and an HTTP status now rides the structured `httpStatus` seat on `wiring_manifest.mcp[]` instead of
16556
16824
  being baked into the code. The set as a WHOLE stays open (a tool owns its own codes).
@@ -16699,6 +16967,7 @@ components:
16699
16967
  maxRetries: { type: number, description: "retry budget of the lane in force (refused-connect short lane = 2)" }
16700
16968
  retryInMs: { type: number, description: "same number as retryInSec at ms precision (countdown rendering)" }
16701
16969
  errClass: { type: string, description: "connect_refused | transport | stall | rate_limit | server | http | output_cap (core's seven words since core 7.14.0 — `stall` = this process's own stall watchdog cancelled the request) — retry-wait frames ONLY; never inferred from phase" }
16970
+ seat: { type: string, description: "server >= 7.139.0 (core 7.60.0 `BrainStatus.seat`, minted only when a non-empty string, passed through verbatim): WHOSE model call this frame is about, on EVERY phase — `classifier` = a call made for the auto-mode classifier lane (the classifier seat's model, or the main model standing in behind it): a side call beside the person's turn. ABSENT = the run's own turn (read as the main loop, never as unknown) and every older server. Open on read (a newer engine may name another seat)." }
16702
16971
  providerCondition: { type: string, description: "server >= 7.126.0 (core 7.49.0 #1454, passed through verbatim): what the provider said about the account / capacity — core's closed `PROVIDER_CONDITIONS`; a retry frame carries only the three retryable words `throttled | overloaded | unknown` (`quota_exhausted` / `stop_other` do not retry and ride the terminal `detail.providerCondition`). Presence law as `errorStatus`; read as an OPEN set (keep a default arm). ABSENT = not judged, read the same as `unknown` (back off, do not assert quota). Moves with `providerConditionSource`." }
16703
16972
  providerConditionSource: { type: string, description: "server >= 7.126.0 (core 7.49.0 #1454): the evidence the `providerCondition` verdict rests on — `unified_header | provider_code | status`; present exactly when `providerCondition` is; read as an OPEN set." }
16704
16973
  retryAtMs: { type: number, description: "server >= 7.52.0 (core 7.0.0): the WALL-CLOCK end of the wait = `Date.now() + retryInMs` at emit, on the emitting process's clock (not monotonic — never compare it with a local monotonic timer). `retryInMs` stays the authoritative RELATIVE amount; this is the producer's absolute note (a reader several hops away recomputing it would reset the countdown on every replay). Moves with `retryInMs`; absent ⇒ not minted." }
@@ -16837,9 +17106,10 @@ components:
16837
17106
  description: >
16838
17107
  Stable per-input id (also the durable steering queue idempotency key). server >= 7.113.0 (wire VALUE change): for a LIVE steer
16839
17108
  it is the receipt's `messageId` verbatim — keyless steers included (<= 7.112.0: an engine-minted uuid whenever no
16840
- `Idempotency-Key` was sent); with a key it is `idem-<sha256[:32]>` on both the live and the parked leg. 🚧 A keyless PARKED
16841
- steer is the exception (contract §19): the server passes no `inputId` with the parked entry, so this id does not join the
16842
- receipt's `messageId`.
17109
+ `Idempotency-Key` was sent); with a key it is `idem-<sha256[:32]>` on both the live and the parked leg. A keyless PARKED steer
17110
+ carries the receipt's `messageId` too from server >= 7.138.0 (the parked entry's `inputId` is that fresh uuidv7). 🚧 On server
17111
+ 7.113.0–7.137.x a keyless parked steer is the exception (contract §19): the server passes no `inputId` with the parked entry, so
17112
+ this id does not join the receipt's `messageId`.
16843
17113
  sessionSeq: { type: integer, description: 'Leg-scoped monotone sequence of human inputs.' }
16844
17114
  carrier: { type: string, description: 'Which carrier delivered it (steer / objective / a source word). Open on read.' }
16845
17115
  source: { type: string, description: 'objective | steer | next_turn | wake | external | system. Open on read.' }
@@ -18067,6 +18337,21 @@ components:
18067
18337
  source: { type: string }
18068
18338
  isNew: { type: boolean }
18069
18339
 
18340
+ ExtensionRequester:
18341
+ type: object
18342
+ additionalProperties: false
18343
+ required: [kind, name]
18344
+ description: >
18345
+ core `ExtensionRequester` (server >= 7.138.0) — who asked for a tool call no model message carried: an extension registration's own call
18346
+ (`$.tool.call`), by its registration name. A display and audit fact only: the call runs under the run's principal, rules, mode and approver,
18347
+ and the name decides nothing. One reading on every face that carries it (`tool_start` / `tool_end`, the live `tool_approval` frame and the
18348
+ presented `approval_request` frame's top level): the server passes the registration name through the registrant-text egress discipline, so the
18349
+ faces carry the same bytes; a malformed value is dropped, never repaired. `kind` is `extension` today (a new requester class is an engine
18350
+ release plus a new member here).
18351
+ properties:
18352
+ kind: { type: string, enum: [extension] }
18353
+ name: { type: string, minLength: 1, description: 'The registration name (registrant text, UNTRUSTED-for-display).' }
18354
+
18070
18355
  ToolApprovalFrame:
18071
18356
  type: object
18072
18357
  description: >
@@ -18215,6 +18500,14 @@ components:
18215
18500
  (absent != "no reason"). PRESENT ONLY WHEN IT HAS A VALUE (never an empty string) and ONLY ON THE LIVE card frame —
18216
18501
  the presented frame (`approval_request`) and the durable card (`card_json`) do NOT carry it (the durable twin is
18217
18502
  `gate.riskDescriptor.probeReason` on the parked row). Display / triage metadata, never an adjudication input; never in `message`.
18503
+ requestedBy:
18504
+ allOf: [{ $ref: '#/components/schemas/ExtensionRequester' }]
18505
+ description: >
18506
+ server >= 7.138.0, ADDITIVE, "tool_approval" only: the call this ask is about was initiated by an extension registration itself
18507
+ (`$.tool.call`; core `AskRequest.requestedBy`) — the provenance of the card's "extension X wants to run …" line. Same reading as the
18508
+ key of the same name on `tool_start` / `tool_end`. Absent on calls a model message carried; reachable once the deployment seat mounts
18509
+ operator-declared packages. Display fact, never an adjudication input. The presented frame (`approval_request`) carries it on its top
18510
+ level with the same value (one of its off-card live facts); the durable card (`card_json`) does not, and a disconnect-replay frame never does.
18218
18511
  ruleEvidence:
18219
18512
  type: object
18220
18513
  description: >
@@ -18565,7 +18858,7 @@ components:
18565
18858
  The id of POST /v1/tool-approvals/{id}/respond and GET /v1/tool-approvals/{id}. server >= 7.133.0: ALWAYS EQUAL TO `askId` (the row's key is the ask's one wire
18566
18859
  identity; a 64-character lowercase hexadecimal string — treat it as an OPAQUE string, never parse it as a uuid); the matching close frame `approval_complete` carries it too.
18567
18860
  On server <= 7.132.x it is the legacy bridge / dedupe key (a uuid, the same value as the parallel tool_approval frame).
18568
- # ── server >= 7.133.0: the TEN off-card LIVE facts on the opening frame's top level (one frame family per leg) ──────────────────────────
18861
+ # ── server >= 7.133.0: the off-card LIVE facts on the opening frame's top level (ELEVEN from server >= 7.138.0 — `requestedBy` joined; ten on 7.133.0–7.137.x) (one frame family per leg) ──────────────────────────
18569
18862
  # Same keys, same shapes, same values as on the legacy `tool_approval` frame (each is a `$ref` into ToolApprovalFrame's own property — one
18570
18863
  # source per shape). Only the frame minted LIVE carries them (and what the durable ledger recorded of that frame): a disconnect-replay frame
18571
18864
  # (rebuilt from `card_json`) never does. Absence means "this frame does not carry it", not "there is none". See APPROVAL_REQUEST_LIVE_FACT_KEYS (sdk) / the server's twin.
@@ -18579,6 +18872,7 @@ components:
18579
18872
  approvalCard: { $ref: '#/components/schemas/ToolApprovalFrame/properties/approvalCard' }
18580
18873
  readRootCandidate: { $ref: '#/components/schemas/ToolApprovalFrame/properties/readRootCandidate' }
18581
18874
  probeReason: { $ref: '#/components/schemas/ToolApprovalFrame/properties/probeReason' }
18875
+ requestedBy: { $ref: '#/components/schemas/ToolApprovalFrame/properties/requestedBy' }
18582
18876
 
18583
18877
  ApprovalCard:
18584
18878
  type: object
@@ -18910,13 +19204,16 @@ components:
18910
19204
  `subdomain` (server >= 7.126.0 / core 7.49.0 #1365) = the `WebFetch` domain grammar: `WebFetch(domain:<host>)` one exact
18911
19205
  host, `WebFetch(domain:*.<domain>)` every host under that domain — ALLOW rows only; the server's `Bash` card edit face
18912
19206
  always refuses these two words (no network grant is minted through a card). A replica rolled back to 7.125.x reads such a
18913
- row as a damaged row.
19207
+ row as a damaged row. `tool` (server >= 7.138.0 / core 7.57.0) = the WHOLE-TOOL form: a rule with no content (`SendUserFile`,
19208
+ `Bash`, `mcp__srv__get_issue`), `command` is the empty string, and it reaches every call that answers to the name it spells. A card
19209
+ offers it as `{ kind: single, rule: <tool name>, match: tool, command: "" }` on a tool no rule grammar speaks for (the service's own
19210
+ host tools, MCP tools) — render it as "don't ask again for this tool"; the card's edit face never mints a whole-tool rule.
18914
19211
 
18915
- 🔴 TEN MEMBERS, closed (server >= 7.135.0 / core 7.55.0 added `pattern`, between `wildcard` and `subpath` — the engine's order): the server validates the member on both faces. A consumer type narrower than the
19212
+ 🔴 ELEVEN MEMBERS, closed (server >= 7.135.0 / core 7.55.0 added `pattern`, between `wildcard` and `subpath`; server >= 7.138.0 added `tool`, last — the engine's order): the server validates the member on both faces. A consumer type narrower than the
18916
19213
  mint point is a lie — it lets a `switch` claim exhaustiveness the wire does not honour (SDK <= 16 declared
18917
19214
  four here, so a `path` offer and every 7.118.0 skill-card offer were dropped as malformed; SDK <= 21 declared
18918
- seven, so every domain grant row on `GET /v1/rules` was dropped the same way).
18919
- enum: [exact, prefix, wildcard, pattern, subpath, path, name, name_prefix, host, subdomain]
19215
+ seven, so every domain grant row on `GET /v1/rules` was dropped the same way; SDK <= 28 declared ten, so every 7.138.0 whole-tool offer was).
19216
+ enum: [exact, prefix, wildcard, pattern, subpath, path, name, name_prefix, host, subdomain, tool]
18920
19217
 
18921
19218
  RuleOfferUncoveredReason:
18922
19219
  type: string
@@ -19644,9 +19941,10 @@ components:
19644
19941
 
19645
19942
  SteerReplayFacet:
19646
19943
  type: string
19647
- enum: [text, trusted, priority, actor]
19944
+ enum: [text, trusted, priority, actor, runOrigin]
19648
19945
  description: >
19649
- core 7.44.0 #1374 `STEER_REPLAY_FACETS`, verbatim and in order — the facets on which a replayed steering input id differs from the
19946
+ core 7.44.0 #1374 `STEER_REPLAY_FACETS` (`runOrigin` joined in core 7.58.0 — the run origin the caller declared for the input; server 7.138.0 hands the engine
19947
+ no run origin, so that facet does not arrive from it), verbatim and in order — the facets on which a replayed steering input id differs from the
19650
19948
  accepted one. Carried as `detail.differs` (a non-empty subset, the engine's order) on 409 `steering.duplicate_input_id` (server >= 7.118.0):
19651
19949
  contains `text` ⇒ a different instruction, reissue with a fresh key; no `text` ⇒ the SAME instruction — do NOT change the key (it
19652
19950
  would queue twice), replay with the original values.
@@ -21375,8 +21673,13 @@ components:
21375
21673
  type: string
21376
21674
  description: >
21377
21675
  core >= 7.6.0 — the `McpFailureKind` word (`connect_refused` / `connection_failed` /
21378
- `connection_closed` / `http_status` / `not_mcp_response` / `spawn_failed` / `timeout` /
21379
- `protocol` / `invalid_config` / `unknown`). The retired 7.5.0 spellings — `network` and the
21676
+ `connection_closed` / `unauthorized` / `http_status` / `not_mcp_response` / `spawn_failed` / `timeout` /
21677
+ `protocol` / `invalid_config` / `credential_unavailable` / `host_refused` / `unknown`; server >= 7.139.0 (core 7.60.0): `host_refused` = the host seat of a host-supplied transport did not hand the request to the remote (nothing was
21678
+ sent; no deployment of this server mounts one today, the word is the engine's); server >= 7.138.0: `unauthorized` = the principal must authorize this server
21679
+ first — the endpoint answered 401 (after the deployment's peer seat was asked once more) or a 403 with an `insufficient_scope` challenge, or the peer
21680
+ seat answered that the principal is not authorized here; earlier servers sent the first two as `http_status`; `credential_unavailable` = the
21681
+ deployment's peer seat did not furnish the request (it threw, did not answer in time, or answered something the engine cannot carry), so the
21682
+ request was not sent — a deployment fault, not a server outage). The retired 7.5.0 spellings — `network` and the
21380
21683
  `http_<status>` encoding — are GONE; an HTTP status now rides `httpStatus`.
21381
21684
  Deliberately NOT enumerated here: the vocabulary's single owner is the engine, and mirroring
21382
21685
  it would swallow a newly minted word as a violation. Switch with a `default` arm.
@@ -21387,8 +21690,9 @@ components:
21387
21690
  type: integer
21388
21691
  description: >
21389
21692
  core >= 7.6.0 (S6-B) — the status the endpoint answered with; rides ONLY with
21390
- `errorCode === "http_status"` (401/403 = re-authorize, 5xx = that end is down). ABSENT rather
21391
- than 0.
21693
+ `errorCode === "http_status"` (5xx = that end is down). ABSENT rather than 0. From server >= 7.138.0 (core 7.59.0) a 401, and a 403
21694
+ with an `insufficient_scope` challenge, are `errorCode: "unauthorized"` without this key — a reader that branched on `http_status` + 401
21695
+ to re-authorize reads `unauthorized` instead.
21392
21696
  liveness:
21393
21697
  allOf: [{ $ref: '#/components/schemas/McpServerLiveness' }]
21394
21698
  description: >
@@ -21596,7 +21900,8 @@ components:
21596
21900
  so a keyless live steer's `human_input.inputId` was an engine-minted uuid that never joined this receipt). So the
21597
21901
  `human_input` frame of that steer (`delivery: "applied"` / `"queued"`) carries `inputId === messageId`, and the user-input
21598
21902
  acceptance ledger (`userInputUndrained[].messageId`) is keyed by the same value. The PARKED legs: with a key,
21599
- `inputId === messageId` as before; 🚧 a KEYLESS parked steer (`delivery: "queued"` / `"parked_for_wake"`) is the documented
21903
+ `inputId === messageId` as before; a KEYLESS parked steer (`delivery: "queued"` / `"parked_for_wake"`) joins too from server
21904
+ >= 7.138.0 (the parked entry's `inputId` is this `messageId`). 🚧 On server 7.113.0–7.137.x the keyless parked steer is the documented
21600
21905
  exception (contract §19) — the server passes no `inputId` with the parked queue entry, so this `messageId` is never that entry's
21601
21906
  `inputId` and the later `human_input` frame does NOT join it.
21602
21907
  priority: { $ref: '#/components/schemas/SteerPriority' }
@@ -22590,8 +22895,12 @@ components:
22590
22895
  in place"; now every candidate carries its own `behavior` and that seat is GONE — an entry that did not
22591
22896
  become a candidate is in `skipped` with its reason. A consumer rendering `uncovered.denyAskBuckets` reads
22592
22897
  `candidates[].behavior` instead.
22898
+
22899
+ 🔴 server >= 7.139.0 (core 7.60.0; MIGRATION 7.139.0 item 6) — THE KEY `translated` IS GONE (read-side BREAKING): core deleted the always-empty compatibility array and the server forwards the preview verbatim. This schema
22900
+ describes only that generation (CLOSED: a 7.139.0 body has no `translated`; a body from a server <= 7.138.x still carries `translated: []` and does not match this closed schema — the SDK's own readers ignore it). A reader that
22901
+ rendered a "rewritten spellings" column reads nothing for it (the array was always empty).
22593
22902
  additionalProperties: false
22594
- required: [candidates, skipped, translated, layers, uncovered]
22903
+ required: [candidates, skipped, layers, uncovered]
22595
22904
  properties:
22596
22905
  candidates:
22597
22906
  type: array
@@ -22601,25 +22910,6 @@ components:
22601
22910
  type: array
22602
22911
  items: { $ref: '#/components/schemas/CcImportSkippedRule' }
22603
22912
  description: 'Entries that did not become candidates. `reason` is PROSE, not a code — see the schema.'
22604
- translated:
22605
- type: array
22606
- description: >
22607
- ALWAYS EMPTY in this version — a compatibility seat core keeps on the wire shape (core
22608
- `ImportPreview.translated`, verbatim). It once carried entries whose MATCH FORM was rewritten on the
22609
- way in (the other product's space-star suggestion form translated to this lane's colon-star). That
22610
- translation is retired: space-star is now a first-class match form of this lane's own grammar, so an
22611
- entry's match form imports as the file states it and nothing is ever pushed here. A reader rendering a
22612
- "rewritten spellings" column from this seat renders an empty column, correctly.
22613
- ⚠️ Declared here from SDK 8.8.0 on: core has always emitted the key, so a closed schema without it
22614
- judged every real 200 body a violation (a staleness fix, not a behavior change).
22615
- items:
22616
- type: object
22617
- additionalProperties: false
22618
- required: [from, to, scope]
22619
- properties:
22620
- from: { type: string }
22621
- to: { type: string }
22622
- scope: { $ref: '#/components/schemas/RuleScope' }
22623
22913
  layers:
22624
22914
  type: array
22625
22915
  items: { $ref: '#/components/schemas/CcImportLayerReport' }
@@ -22779,9 +23069,10 @@ components:
22779
23069
  match:
22780
23070
  allOf: [{ $ref: '#/components/schemas/RuleOfferMatch' }]
22781
23071
  description: >
22782
- The match form — the same ten-member vocabulary as a card's rule offer (`RuleOfferMatch`, the server's
23072
+ The match form — the same eleven-member vocabulary as a card's rule offer (`RuleOfferMatch`, the server's
22783
23073
  `PERSISTED_RULE_MATCHES`): `exact` / `prefix` / `wildcard` / `pattern` (server >= 7.135.0: the mid-star command form) / `subpath` / `path`, and from server >= 7.118.0
22784
- `name` / `name_prefix` (a `Skill(<name>)` / `Skill(<prefix>:*)` rule).
23074
+ `name` / `name_prefix` (a `Skill(<name>)` / `Skill(<prefix>:*)` rule), from server >= 7.126.0 `host` / `subdomain` (a `WebFetch(domain:…)` allow row),
23075
+ from server >= 7.138.0 `tool` (a whole-tool row: no content, empty `command`, every call of that tool).
22785
23076
  command: { type: string, description: 'What the matcher actually compares against, parsed out of `rule` at mint time and stored so no consumer re-parses. Trust this + `match`, not your own parse of `rule`.' }
22786
23077
  adds:
22787
23078
  type: array
@@ -23289,25 +23580,6 @@ components:
23289
23580
  type: array
23290
23581
  items: { $ref: '#/components/schemas/DeviceSummary' }
23291
23582
 
23292
- DeviceBinding:
23293
- type: object
23294
- description: 'One session↔device binding (server `boundDeviceOf`; frozen key set).'
23295
- additionalProperties: false
23296
- required: [deviceId, rev, boundAt]
23297
- properties:
23298
- deviceId: { type: string, minLength: 1 }
23299
- rev: { type: integer, minimum: 0, description: 'The prior-state version — this is exactly what the rebind verb''s `expectedRev` must echo (an explicit prior state, so two concurrent operators cannot silently stomp each other).' }
23300
- boundAt: { type: string, format: date-time, description: 'ISO-8601.' }
23301
-
23302
- DeviceSessionBinding:
23303
- type: object
23304
- description: 'The `GET /v1/devices/sessions/{rootSessionId}` 200 body (all the material a shell''s rebind UX needs).'
23305
- additionalProperties: false
23306
- required: [rootSessionId, boundDevice]
23307
- properties:
23308
- rootSessionId: { type: string, minLength: 1 }
23309
- boundDevice: { $ref: '#/components/schemas/DeviceBinding' }
23310
-
23311
23583
  DeviceRebindRequest:
23312
23584
  type: object
23313
23585
  description: 'The `POST /v1/devices/sessions/{rootSessionId}/rebind` body. NOTE: server 7.88.2 does NOT key-close this one body (unknown keys are dropped silently, unlike enroll/revoke which answer 400 request.body_shape); a server-side ticket tracks closing it. This SDK never sends extra keys.'
@@ -23319,7 +23591,7 @@ components:
23319
23591
  type: integer
23320
23592
  minimum: 0
23321
23593
  description: >
23322
- REQUIRED — the rev read from `GET /v1/devices/sessions/{rootSessionId}`. 🔴 The same `toDeviceId` with a
23594
+ REQUIRED — the rev read from `GET /v1/sessions/{rootSessionId}/execution-placement` (`device.rev` on the `writer` arm; server >= 7.139.0). 🔴 The same `toDeviceId` with a
23323
23595
  WRONG rev is STILL a 409 `device.rebind_rev_conflict`: a wrong prior state is wrong. Not a non-negative
23324
23596
  integer ⇒ 400 request.field_invalid.
23325
23597