@sema-agent/sdk 31.0.0 → 33.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.
- package/README.md +136 -0
- package/dist/device/index.d.ts +2 -1
- package/dist/device/index.d.ts.map +1 -1
- package/dist/device/index.js +4 -2
- package/dist/device/index.js.map +1 -1
- package/dist/errors.d.ts +66 -14
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +41 -14
- package/dist/errors.js.map +1 -1
- package/dist/events.d.ts +82 -25
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +8 -0
- package/dist/events.js.map +1 -1
- package/dist/idempotency.d.ts +2 -1
- package/dist/idempotency.d.ts.map +1 -1
- package/dist/idempotency.js +2 -1
- package/dist/idempotency.js.map +1 -1
- package/dist/index.d.ts +24 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/normalize.d.ts +2 -2
- package/dist/normalize.d.ts.map +1 -1
- package/dist/normalize.js +0 -1
- package/dist/normalize.js.map +1 -1
- package/dist/resources/approvals.d.ts +68 -10
- package/dist/resources/approvals.d.ts.map +1 -1
- package/dist/resources/approvals.js +61 -3
- package/dist/resources/approvals.js.map +1 -1
- package/dist/resources/assistant.d.ts +9 -5
- package/dist/resources/assistant.d.ts.map +1 -1
- package/dist/resources/assistant.js +9 -4
- package/dist/resources/assistant.js.map +1 -1
- package/dist/resources/attachments.d.ts +7 -1
- package/dist/resources/attachments.d.ts.map +1 -1
- package/dist/resources/attachments.js +7 -1
- package/dist/resources/attachments.js.map +1 -1
- package/dist/resources/fleet.d.ts +7 -5
- package/dist/resources/fleet.d.ts.map +1 -1
- package/dist/resources/fleet.js.map +1 -1
- package/dist/resources/memory.d.ts +24 -10
- package/dist/resources/memory.d.ts.map +1 -1
- package/dist/resources/memory.js +24 -10
- package/dist/resources/memory.js.map +1 -1
- package/dist/resources/rules.d.ts +18 -11
- package/dist/resources/rules.d.ts.map +1 -1
- package/dist/resources/runs.d.ts +5 -1
- package/dist/resources/runs.d.ts.map +1 -1
- package/dist/resources/runs.js +3 -1
- package/dist/resources/runs.js.map +1 -1
- package/dist/resources/session-sync.d.ts +2 -2
- package/dist/resources/session-sync.js +2 -2
- package/dist/resources/sessions.d.ts +47 -10
- package/dist/resources/sessions.d.ts.map +1 -1
- package/dist/resources/sessions.js +46 -6
- package/dist/resources/sessions.js.map +1 -1
- package/dist/resources/side-query.d.ts +5 -2
- package/dist/resources/side-query.d.ts.map +1 -1
- package/dist/resources/side-query.js.map +1 -1
- package/dist/resources/tasks.d.ts +7 -6
- package/dist/resources/tasks.d.ts.map +1 -1
- package/dist/resources/tasks.js +7 -6
- package/dist/resources/tasks.js.map +1 -1
- package/dist/resources/tool-approvals.d.ts +69 -21
- package/dist/resources/tool-approvals.d.ts.map +1 -1
- package/dist/resources/tool-approvals.js +43 -10
- package/dist/resources/tool-approvals.js.map +1 -1
- package/dist/settings.d.ts +28 -11
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +3 -3
- package/dist/sse.d.ts +6 -4
- package/dist/sse.d.ts.map +1 -1
- package/dist/sse.js.map +1 -1
- package/dist/types.d.ts +339 -106
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +32 -0
- package/dist/types.js.map +1 -1
- package/openapi.yaml +640 -174
- package/package.json +1 -1
package/openapi.yaml
CHANGED
|
@@ -294,11 +294,19 @@ paths:
|
|
|
294
294
|
application/json:
|
|
295
295
|
schema: { $ref: '#/components/schemas/ErrorResponse' }
|
|
296
296
|
'429': { $ref: '#/components/responses/RateLimited' } # limit.rate_exceeded — 12/60s per identity, OR the replica-wide in-flight cap (32, ACROSS identities: one caller can be refused because of another). Retry-After and the body's `retryAfterSec` are the same value; the body's absence means no header either
|
|
297
|
+
'409':
|
|
298
|
+
description: >
|
|
299
|
+
server >= 7.143.0: errorCode `config.mcp_server_name_collision` — two declared MCP servers would mount under the same tool-namespace
|
|
300
|
+
prefix; the same code, status and sentence as the synchronous submit leg (which answered 200 + a `failed` body before). Fix the
|
|
301
|
+
deployment's declarations; retrying does not change it. (7.142.x and earlier answered this case with the codeless 500 below.)
|
|
302
|
+
content:
|
|
303
|
+
application/json:
|
|
304
|
+
schema: { $ref: '#/components/schemas/ErrorResponse' }
|
|
297
305
|
'500':
|
|
298
306
|
description: >
|
|
299
307
|
errorCode `internal.error` — the engine refused THIS DEPLOYMENT'S declaration SET as a whole (the one
|
|
300
|
-
documented cause: two servers would mount under the same tool-namespace prefix, refused BEFORE any
|
|
301
|
-
transport is touched). 🔴 WHOEVER WROTE THE DECLARATIONS OWNS THE ERROR: on this door they are the
|
|
308
|
+
documented cause on servers <= 7.142.x: two servers would mount under the same tool-namespace prefix, refused BEFORE any
|
|
309
|
+
transport is touched; server >= 7.143.0 answers that cause with the 409 above). 🔴 WHOEVER WROTE THE DECLARATIONS OWNS THE ERROR: on this door they are the
|
|
302
310
|
deployment's, so this machine's configuration is broken and a 5xx is the honest direction — folding it
|
|
303
311
|
into a 4xx would report an operator's mistake as the caller's. The cause is NOT echoed (it comes from
|
|
304
312
|
the declaration set itself); it is in this worker's logs. Retrying does not change it.
|
|
@@ -430,9 +438,11 @@ paths:
|
|
|
430
438
|
as 200 with a failed body (`terminal.code`; billed; a same-key resend replays). Multi-tier callers must read both
|
|
431
439
|
forms. On a park the 200 body is the result itself plus the three poll-receipt keys (`SyncSubmitResult`, S-173).
|
|
432
440
|
🔴 IDEMPOTENT REPLAY (server >= 7.125.0, contract §0.7): a same-key resubmit that finds the run row the key already built (another process, another
|
|
433
|
-
replica, a restart, or an original request that has since settled) does NOT run again
|
|
434
|
-
|
|
435
|
-
|
|
441
|
+
replica, a restart, or an original request that has since settled) does NOT run again. server >= 7.142.0 answers `200` with the FIRST ANSWER'S ENVELOPE plus
|
|
442
|
+
`replay: true` (`SyncSubmitOutcome`): the row holds an engine result ⇒ that result (a park adds the three receipt keys, as on a first answer); it holds none
|
|
443
|
+
(still running, or lost) ⇒ the three receipt keys `{taskId, sessionId, status}` (`SyncReceiptBody`; read the row at `GET /v1/runs/{taskId}`).
|
|
444
|
+
server 7.125.0–7.141.x answered the row's read face plus `replay: true` instead — that body has no `stats` and reads as the receipt arm.
|
|
445
|
+
`replay: true` says "this is a same-key replay", never which shape. A same-key duplicate that is still IN FLIGHT in the same process is merged
|
|
436
446
|
instead and gets the first answer's bytes (no `replay` key). Only a submit that builds a row can be replayed this way (a run store AND a `sessionId`);
|
|
437
447
|
otherwise a settled key re-runs. A key whose row the caller cannot read answers 409 `conflict.run_exists`.
|
|
438
448
|
🔴 SAME KEY = SAME BODY (server >= 7.126.0, contract §0.7): resubmitting the same `Idempotency-Key` with a DIFFERENT request body is 409
|
|
@@ -447,17 +457,12 @@ paths:
|
|
|
447
457
|
responses:
|
|
448
458
|
'200':
|
|
449
459
|
description: >-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
(server >= 7.
|
|
453
|
-
on >= 7.64; a server <= 7.63 answers the flat form instead (terminal word in `status`, no `terminal`) — see SyncSubmitResult.
|
|
454
|
-
(2) server >= 7.125.0, same-key replay: the existing run's read face with `replay: true` (`RunReplayRecord`) — NOT an engine result.
|
|
460
|
+
`SyncSubmitOutcome` — one rule: is there an engine result in hand? `stats` present ⇒ the engine result (`SyncSubmitResult`; a park adds the poll receipt;
|
|
461
|
+
a server <= 7.63 answers the flat `LegacyPlaneTaskResult`); `stats` absent ⇒ the run receipt `{taskId, sessionId, status}` (`SyncReceiptBody`). A same-key
|
|
462
|
+
replay (server >= 7.125.0) carries `replay: true` on whichever arm it is.
|
|
455
463
|
content:
|
|
456
464
|
application/json:
|
|
457
|
-
schema:
|
|
458
|
-
oneOf:
|
|
459
|
-
- $ref: '#/components/schemas/SyncSubmitResult'
|
|
460
|
-
- $ref: '#/components/schemas/RunReplayRecord'
|
|
465
|
+
schema: { $ref: '#/components/schemas/SyncSubmitOutcome' }
|
|
461
466
|
'400': { $ref: '#/components/responses/BadRequest' }
|
|
462
467
|
'401': { $ref: '#/components/responses/Unauthorized' }
|
|
463
468
|
'403': { $ref: '#/components/responses/Forbidden' } # (declared 2026-08-01) 带 `sessionId` 复用他人会话:归属不匹配 ⇒ 403(自公开快照起点即有,spec 此前漏登记)。server 3.15.0 起多一个触发条件:多租部署上 session store 无归属判别能力时,复用**任何** caller 自报的 sessionId 都 403(含本 worker 自己刚铸的 —— 无 register seam 时归属从未被记下)。core 2.11.0 起默认内存店自带该能力 ⇒ 该触发条件在默认部署上不再出现。 ⚠️ (declared 2026-08-05,server >=7.0.0)`memory.admission_denied` 也走本状态 —— 本状态的 producer 全清单与分支判据写在 `Forbidden` 组件的 description 里(**那段是被解析的**,本行注释只是指路,不复述以免两处漂移)。
|
|
@@ -2436,10 +2441,7 @@ paths:
|
|
|
2436
2441
|
required: false
|
|
2437
2442
|
content:
|
|
2438
2443
|
application/json:
|
|
2439
|
-
schema:
|
|
2440
|
-
type: object
|
|
2441
|
-
properties:
|
|
2442
|
-
message: { type: string, minLength: 1 }
|
|
2444
|
+
schema: { $ref: '#/components/schemas/SessionWakeRequest' }
|
|
2443
2445
|
responses:
|
|
2444
2446
|
'200':
|
|
2445
2447
|
# 🔴 census 批2 第三段(2026-07-30)spec 谎修正:此前这里写的是 **202** + required [taskId,…]。
|
|
@@ -3051,8 +3053,8 @@ paths:
|
|
|
3051
3053
|
there is no operator override arm), and the attestation's `select` echoes exactly that. The body is
|
|
3052
3054
|
`SessionMemoryEraseRequest` handed through as sent: no `select` (a body carrying one is a loud 400
|
|
3053
3055
|
`request.body_shape`, never silently ignored — while any OTHER unknown key IS silently ignored and not forwarded),
|
|
3054
|
-
`allowUnevidenced` NEVER INJECTED (the degraded lane is a human authorization statement).
|
|
3055
|
-
|
|
3056
|
+
`allowUnevidenced` NEVER INJECTED (the degraded lane is a human authorization statement). Server 7.140.0–7.142.x also read an optional layer seat
|
|
3057
|
+
`scope`; server >= 7.143.0 refuses a body carrying `scope` (any value) with a loud 400 `request.body_shape` — the erasure spans the whole deployment.
|
|
3056
3058
|
|
|
3057
3059
|
🔴 `requestId` IS THIS ERASURE'S IDEMPOTENCY IDENTITY — the same two-lane law as the operator face (read
|
|
3058
3060
|
`evidenceCapability`): `"journal"` ⇒ a resend with the SAME id reads back the anchor's pinned ids and never re-resolves
|
|
@@ -3063,13 +3065,12 @@ paths:
|
|
|
3063
3065
|
server 7.108.0 this face classifies it like the operator face does — <= 7.107.x answered 500 `internal.error`). 🔴 DO NOT put an
|
|
3064
3066
|
automatic retry policy on this endpoint.
|
|
3065
3067
|
|
|
3066
|
-
🔴 ERASURE
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
the engine's sentence goes to the operator log). 400 `request.memory_layer` here means the `scope` (or this deployment's configured layer) cannot be read.
|
|
3068
|
+
🔴 ERASURE ANSWERS THE WHOLE DEPLOYMENT (server >= 7.143.0; the engine's one deployment object): this session's share in EACH store is erased by that store and
|
|
3069
|
+
the attestations are merged into one; a `requestId` names one request across the whole deployment (the same id first executed in another store ⇒ 409
|
|
3070
|
+
`memory.erasure_selector_mismatch`, nothing erased or recorded). The 7.140.0–7.142.x body layer seat `scope` is retired (there is no "which store" to name):
|
|
3071
|
+
a body carrying it ⇒ 400 `request.body_shape`; the 7.140.0–7.142.x 409 code (erasure store unjudged) is retired with it (those requests now execute).
|
|
3072
|
+
`DB_BACKEND=local`: an owner that cannot be judged (no row fact and the archive unreadable) ⇒ 404 `not_found.session`, same code and sentence as non-owner.
|
|
3073
|
+
The audience is the session owner, so every refusal on this face is a FIXED sentence (layer keys and paths never ride the wire; the engine's sentence goes to the operator log).
|
|
3073
3074
|
|
|
3074
3075
|
GATE ORDER (release bytes): 503 destructive-session-write guard → 401 → 501 (no owner audit face — BEFORE the 404: a
|
|
3075
3076
|
deployment without one must not fake a 404) → 404 (unknown AND non-owner, SAME code SAME message) → 501 (compliance face
|
|
@@ -3090,12 +3091,12 @@ paths:
|
|
|
3090
3091
|
'400':
|
|
3091
3092
|
description: >
|
|
3092
3093
|
errorCode "request.body_shape" — the body is not a JSON object, or it carries `select` (the selector is fixed by the
|
|
3093
|
-
path; the operator face takes explicit selectors)
|
|
3094
|
+
path; the operator face takes explicit selectors), or (server >= 7.143.0) it carries `scope` (the retired layer seat: this face erases the
|
|
3095
|
+
session's contributions in every store of the deployment, so there is no layer to name). "request.request_id_required" — `requestId` missing / empty /
|
|
3094
3096
|
non-string. "request.field_invalid" — `allowUnevidenced` present but not a boolean. "request.path_malformed" — the
|
|
3095
3097
|
session id segment is not valid percent-encoding. "config.memory_erasure_request" — core's own selector verdict (the
|
|
3096
|
-
route keeps the arm; today the server's own gates answer first, so it is not reached). Server >= 7.140.0: "request.memory_layer" —
|
|
3097
|
-
|
|
3098
|
-
covers a `scope` that is present but not a non-empty string.
|
|
3098
|
+
route keeps the arm; today the server's own gates answer first, so it is not reached). Server >= 7.140.0: "request.memory_layer" — a
|
|
3099
|
+
memory layer this deployment keeps cannot be read (a FIXED sentence for the session owner; on 7.140.0–7.142.x also the body's `scope`).
|
|
3099
3100
|
content:
|
|
3100
3101
|
application/json:
|
|
3101
3102
|
schema: { $ref: '#/components/schemas/ErrorResponse' }
|
|
@@ -3109,9 +3110,7 @@ paths:
|
|
|
3109
3110
|
the operator to remove the link, then resend with the SAME `requestId`. Since server 7.108.0 the other classified refusals of the
|
|
3110
3111
|
operator face arrive here too, each with its own code and a FIXED sentence: "memory.erasure_selector_mismatch" /
|
|
3111
3112
|
"memory.erasure_evidence_unavailable" / "memory.erasure_census_incomplete"; "memory.scope_home_not_directory" (server >= 7.118.0, same
|
|
3112
|
-
reading as the link code).
|
|
3113
|
-
deployment's (a `scope` naming a personal-mount layer, or no `scope` and this session has contributions there / that store's ledger cannot be
|
|
3114
|
-
read): NOTHING erased; a transitional guard, do NOT retry.
|
|
3113
|
+
reading as the link code). The 7.140.0–7.142.x store guard code is retired at server 7.143.0 (erasure answers the whole deployment).
|
|
3115
3114
|
content:
|
|
3116
3115
|
application/json:
|
|
3117
3116
|
schema: { $ref: '#/components/schemas/ErrorResponse' }
|
|
@@ -3142,6 +3141,60 @@ paths:
|
|
|
3142
3141
|
# three-conjunct predicate was disproven in the field ([2024]) when a warm-cache wrapper store forwarded the
|
|
3143
3142
|
# other three and dropped the staging family, so caps said true while PUSH Phase A 501'd forever.
|
|
3144
3143
|
# Owner-gated like fork/delete (§9): a PULL 404s a non-owner; a PUSH is own-or-FRESH.
|
|
3144
|
+
/v1/sessions/{sessionId}/memory/sync:
|
|
3145
|
+
parameters:
|
|
3146
|
+
- $ref: '#/components/parameters/PrincipalHeader'
|
|
3147
|
+
- in: path
|
|
3148
|
+
name: sessionId
|
|
3149
|
+
required: true
|
|
3150
|
+
schema: { type: string }
|
|
3151
|
+
post:
|
|
3152
|
+
tags: [sessions]
|
|
3153
|
+
operationId: sessionsSyncMemory
|
|
3154
|
+
x-status: gated # server 7.142.0 `routes/session-memory-sync.js`; capability bit `sessionMemorySync` (501 without the facilities). SDK sessions.syncMemory.
|
|
3155
|
+
summary: Push the memory layers this session reads to the engine it is going to (local shell, before a fork to the cloud).
|
|
3156
|
+
description: >
|
|
3157
|
+
server >= 7.142.0. On the local shape (file memory engine + `MEMORY_SYNC_URL` + a durable run ledger) a shell calls this BEFORE forking the session to another
|
|
3158
|
+
engine. The body is exactly `{ "target": <that engine's GET /v1/capabilities memorySyncServe.identity, verbatim> }`. Gate order: 501 (no sync leg
|
|
3159
|
+
`feature.memory_sync_disabled` / no durable run store `capability.run_store_required` / no session-ownership face `capability.session_ownership_required`) →
|
|
3160
|
+
principal → rate limit → 404 `not_found.session` (unknown and foreign alike) → 400 `request.body_shape` (not exactly `{target}`) → 400 `request.field_invalid`
|
|
3161
|
+
(`field: "target"`, `reason` one of the seven sync-identity flaws; the value is never echoed) → 409 `conflict.session_memory_unobserved` (no read set: the session has no
|
|
3162
|
+
settled run with a memory observation; `activeTaskId` when a run is in flight) → 200 with the engine's sync report (`SessionMemorySyncReport`): a whole-round `refused`
|
|
3163
|
+
(`config.memory_sync_target_mismatch` — the target is not the engine this machine's sync leg reaches; `session_active` — a run is in flight, or the session moved after
|
|
3164
|
+
its read set was taken) or one outcome per layer. The read set is the memory observation of the session's latest settled run; each project layer of it the sync leg
|
|
3165
|
+
covers JOINS THIS PROCESS'S BACKGROUND SYNC SET PERMANENTLY (until the process exits: one more cursor, a few more round trips per round).
|
|
3166
|
+
requestBody:
|
|
3167
|
+
required: true
|
|
3168
|
+
content:
|
|
3169
|
+
application/json:
|
|
3170
|
+
schema: { $ref: '#/components/schemas/SessionMemorySyncRequest' }
|
|
3171
|
+
responses:
|
|
3172
|
+
'200':
|
|
3173
|
+
description: The engine's sync report.
|
|
3174
|
+
content:
|
|
3175
|
+
application/json:
|
|
3176
|
+
schema: { $ref: '#/components/schemas/SessionMemorySyncReport' }
|
|
3177
|
+
'400':
|
|
3178
|
+
description: '`request.path_malformed` · `request.body_shape` (the body is not exactly `{target}`) · `request.field_invalid` (`field: "target"`, `reason` = a sync-identity flaw: not-http-url / userinfo / query / fragment / credential / too-long / not-canonical).'
|
|
3179
|
+
content:
|
|
3180
|
+
application/json:
|
|
3181
|
+
schema: { $ref: '#/components/schemas/ErrorResponse' }
|
|
3182
|
+
'401': { $ref: '#/components/responses/Unauthorized' }
|
|
3183
|
+
'404': { description: 'errorCode "not_found.session" — unknown session AND another principal''s session, byte-identical (anti-enumeration).' }
|
|
3184
|
+
'409':
|
|
3185
|
+
description: >-
|
|
3186
|
+
`conflict.session_memory_unobserved` — no read set; carries `activeTaskId` when a run is in flight. server >= 7.143.0: the body ALWAYS carries
|
|
3187
|
+
`reason` (SessionMemoryUnobservedExtra; closed set, judged in this order) and the sentence follows it; a latest settled run whose memory was configured
|
|
3188
|
+
but did not mount (`memory_not_mounted`) answered 200 with an empty report on 7.142.x. Branch on `errorCode` + `reason`, never on the sentence;
|
|
3189
|
+
an unknown word reads as "no read set".
|
|
3190
|
+
content:
|
|
3191
|
+
application/json:
|
|
3192
|
+
schema:
|
|
3193
|
+
allOf:
|
|
3194
|
+
- { $ref: '#/components/schemas/ErrorResponse' }
|
|
3195
|
+
- { $ref: '#/components/schemas/SessionMemoryUnobservedExtra' }
|
|
3196
|
+
'500': { description: 'errorCode "internal.error" — the engine refused to mint the report.' }
|
|
3197
|
+
'501': { description: '`feature.memory_sync_disabled` (no local sync leg) · `capability.run_store_required` · `capability.session_ownership_required` — capability bit `sessionMemorySync` is false.' }
|
|
3145
3198
|
/v1/sessions/{sessionId}/sync/manifest:
|
|
3146
3199
|
parameters:
|
|
3147
3200
|
- $ref: '#/components/parameters/PrincipalHeader'
|
|
@@ -3621,6 +3674,7 @@ paths:
|
|
|
3621
3674
|
- in: path
|
|
3622
3675
|
name: sessionId
|
|
3623
3676
|
required: true
|
|
3677
|
+
description: 'The row''s door id: a `checkpoint` row''s `sessionId`, or a `peer_inbound` row''s `id` (server >= 7.143.0; opaque, `peer_inbound:` prefix — pass it back verbatim).'
|
|
3624
3678
|
schema: { type: string }
|
|
3625
3679
|
post:
|
|
3626
3680
|
tags: [approvals]
|
|
@@ -3632,11 +3686,19 @@ paths:
|
|
|
3632
3686
|
continues its durable stream (`/v1/runs/:id/events`). design/80 D-1: the decision SHOULD carry the
|
|
3633
3687
|
action binding (boundCallId + boundInputHash, read off the PendingCheckpoint) — the server resolves THAT
|
|
3634
3688
|
exact checkpoint, fail-closed on mismatch. (Path param stays `sessionId`; the binding travels in the body.)
|
|
3689
|
+
🔴 server >= 7.143.0 ONE DOOR, TWO FAMILIES (every `pending[]` row names its family in `kind`): a `checkpoint` row is decided at
|
|
3690
|
+
`:sessionId` with ApprovalDecision (the binding pair REQUIRED — 400 `decide_requires_binding` + `missingKeys`); a `peer_inbound`
|
|
3691
|
+
row is decided at its `id` with exactly `{ decision: "approve" | "deny" }` (any other key ⇒ 400 naming it) and answers
|
|
3692
|
+
`200 PeerInboundDecideResult` / `404 not_found.approval` / `503 state.peer_decision_unrecorded` (retriable: the decision was not
|
|
3693
|
+
recorded). Branch on the row's `kind` first; skip a row whose `kind` you do not know.
|
|
3635
3694
|
requestBody:
|
|
3636
3695
|
required: true
|
|
3637
3696
|
content:
|
|
3638
3697
|
application/json:
|
|
3639
|
-
schema:
|
|
3698
|
+
schema:
|
|
3699
|
+
oneOf:
|
|
3700
|
+
- { $ref: '#/components/schemas/ApprovalDecision' }
|
|
3701
|
+
- { $ref: '#/components/schemas/PeerInboundDecision' }
|
|
3640
3702
|
responses:
|
|
3641
3703
|
'200':
|
|
3642
3704
|
description: >-
|
|
@@ -3645,7 +3707,10 @@ paths:
|
|
|
3645
3707
|
(see `ParkedDecideAccepted`, `ApprovalDecisionResult`).
|
|
3646
3708
|
content:
|
|
3647
3709
|
application/json:
|
|
3648
|
-
schema:
|
|
3710
|
+
schema:
|
|
3711
|
+
oneOf:
|
|
3712
|
+
- { $ref: '#/components/schemas/ApprovalDecisionResult' }
|
|
3713
|
+
- { $ref: '#/components/schemas/PeerInboundDecideResult' }
|
|
3649
3714
|
'400':
|
|
3650
3715
|
description: >-
|
|
3651
3716
|
(declared 2026-07-31) `routes/approvals-assistant.ts` has 9+ distinct 400 sites on this verb, all
|
|
@@ -3662,7 +3727,11 @@ paths:
|
|
|
3662
3727
|
the proof's binding. A compliant client never sends it: this SDK deleted the field at 1.0.0)
|
|
3663
3728
|
· "request.field_invalid" ALSO covers an unrecognised key inside `answer` (server >= 7.87.0 /
|
|
3664
3729
|
S-452: the closed answer shape — the message names the key paths and the body carries `unknownKeys`)
|
|
3665
|
-
· "
|
|
3730
|
+
· "decide_requires_binding" (server >= 7.143.0: `boundCallId` or `boundInputHash` missing / empty on a checkpoint-family
|
|
3731
|
+
decide — judged after the gate-type guard, nothing driven, card still pending; body `missingKeys` (in the order
|
|
3732
|
+
boundCallId, boundInputHash) + `bindingEnforced`; it also replaces the retired remember-only binding code)
|
|
3733
|
+
· "decide.parked_restatement_unsupported" (server >= 7.143.0: `mcpServers` / `a2aPeers` restated on a card parked by a
|
|
3734
|
+
background child) · "restatement_not_in_proof" (the same two keys on a direct-door worker). PARKED variant (server 5.12.0, core 5.7.0 RB-459):
|
|
3666
3735
|
`decide.parked_answer_required` — the parked child's pending action is an AskUserQuestion and the
|
|
3667
3736
|
approve carried no `answer` (the ONLY pre-claim rejection left on that leg; the retired codes
|
|
3668
3737
|
`decide.parked_answer_unsupported` / `decide.parked_question_unsupported` are gone — an answer HAS
|
|
@@ -4078,9 +4147,15 @@ paths:
|
|
|
4078
4147
|
summary: Resume a resource_limit-suspended task (CONTINUE).
|
|
4079
4148
|
description: >
|
|
4080
4149
|
ASSISTANT-WIRE-CONTRACT §4b — resumes a task durably SUSPENDED on a `resource_limit` gate (scheduler
|
|
4081
|
-
preempt OR a budget/turns/walltime slice).
|
|
4150
|
+
preempt OR a budget/turns/walltime slice). 🔴 GATE-KIND GUARD: a `human`/`policy_ask`
|
|
4082
4151
|
gate → 409 `gate_not_resumable` (a "continue" must NEVER bypass a human approval — use `/decide`).
|
|
4083
4152
|
Owner-gated (NOT D-G); non-owner → 404. SDK → GateNotResumableError on the 409.
|
|
4153
|
+
Body: server >= 7.143.0 takes the resume restatement `mcpServers` / `a2aPeers` (see ApprovalDecision.mcpServers); older servers ignore a body.
|
|
4154
|
+
requestBody:
|
|
4155
|
+
required: false
|
|
4156
|
+
content:
|
|
4157
|
+
application/json:
|
|
4158
|
+
schema: { $ref: '#/components/schemas/ResumeRestatement' }
|
|
4084
4159
|
responses:
|
|
4085
4160
|
'200':
|
|
4086
4161
|
# 2026-07-25:此前只声明 `{status}`。真体(`src/http/routes/approvals-assistant.ts`,与 plan_review 共用
|
|
@@ -4692,6 +4767,9 @@ paths:
|
|
|
4692
4767
|
and a word outside the closed set are both 400 `request.body_shape`, refused BEFORE the decision (the card is
|
|
4693
4768
|
still open; answer it again with the same `approvalId`). 🔴 An older server (no `approvalDecidedBy`
|
|
4694
4769
|
capability bit) DROPS this key silently and answers 200 — probe the bit first.
|
|
4770
|
+
decidedVia:
|
|
4771
|
+
allOf: [{ $ref: '#/components/schemas/ApprovalDecidedVia' }]
|
|
4772
|
+
description: 'server >= 7.143.0 (capability `approvalDecidedVia`): see ApprovalDecision.decidedVia.'
|
|
4695
4773
|
note:
|
|
4696
4774
|
type: string
|
|
4697
4775
|
maxLength: 2048
|
|
@@ -4979,13 +5057,17 @@ paths:
|
|
|
4979
5057
|
boundary) -> 415 `attachment.mime_not_allowed` with the allowed set. Unreferenced uploads are
|
|
4980
5058
|
reaped after a TTL (default 24h) — submit soon after uploading. 501 without an attachment store
|
|
4981
5059
|
(local without backend / cloud backend without object storage configured).
|
|
5060
|
+
PROJECT BUNDLE (server >= 7.142.0): content-type `application/vnd.sema.project-bundle` (SDK `PROJECT_BUNDLE_MIME`) = a gzip POSIX tar whose top level is the
|
|
5061
|
+
work root — the seed of an isolated-lane session's workspace. It is read at upload: unreadable => 400 `attachment.bundle_invalid` with `reason` (seven-word closed set,
|
|
5062
|
+
SDK `PROJECT_BUNDLE_INVALID_REASONS`: not_archive / unsafe_path / entry_type / reserved_path / duplicate_path / expanded_too_large / too_many_entries) and `path`
|
|
5063
|
+
(present when readable and not an over-long path). A deployment with a mime allowlist must add this mime (else 415). An older server stores it as a plain attachment.
|
|
4982
5064
|
responses:
|
|
4983
5065
|
'201':
|
|
4984
5066
|
description: Uploaded.
|
|
4985
5067
|
content:
|
|
4986
5068
|
application/json:
|
|
4987
5069
|
schema: { $ref: '#/components/schemas/AttachmentInfo' }
|
|
4988
|
-
'400': { description: 'missing/unsafe name, malformed mime' }
|
|
5070
|
+
'400': { description: 'missing/unsafe name, malformed mime (`request.query_invalid`); server >= 7.142.0 `attachment.bundle_invalid` (`reason`, `path?`) for an unreadable project bundle' }
|
|
4989
5071
|
'401':
|
|
4990
5072
|
description: >-
|
|
4991
5073
|
(declared 2026-07-31) errorCode "auth.principal_required" — `routes/attachments.ts` requires a
|
|
@@ -5634,7 +5716,7 @@ paths:
|
|
|
5634
5716
|
'404': { $ref: '#/components/responses/NotFound' }
|
|
5635
5717
|
'501': { $ref: '#/components/responses/NotImplemented' }
|
|
5636
5718
|
|
|
5637
|
-
/
|
|
5719
|
+
/v2/memory/sync/{scope}:
|
|
5638
5720
|
parameters:
|
|
5639
5721
|
- $ref: '#/components/parameters/PrincipalHeader'
|
|
5640
5722
|
- in: path
|
|
@@ -5655,6 +5737,11 @@ paths:
|
|
|
5655
5737
|
`memory_sync_invalid_body`). A 500 after partial application is an HONEST signal: replaying with the
|
|
5656
5738
|
same baseRevs is idempotent self-healing (identical revs no-op throughout) — never silently swallowed.
|
|
5657
5739
|
Server >= 7.140.0: a `:scope` the engine cannot read as a layer key ⇒ 400 `request.memory_layer` (it was a 500 before).
|
|
5740
|
+
🔴 Server >= 7.143.0 (engine 7.61.0): the path is `/v2/memory/sync/{scope}`; `/v1/memory/sync/…` is unclaimed (404 `not_found.route`) — new clients
|
|
5741
|
+
and old centers answer each other 404 and write nothing until both ends run the same version. Each layer partition has an INCARNATION
|
|
5742
|
+
(born the first time the partition is synced, kept in the center database): the result always carries `cursor.incarnation`; the request's
|
|
5743
|
+
`peerIncarnation` is compared BEFORE any read or write — not this partition's, or a non-empty baseline without one ⇒ 200
|
|
5744
|
+
`{ refused: "baseline_incarnation", incarnation }` (an answer, zero reads and writes); the incarnation changed after the round's last write ⇒ 500.
|
|
5658
5745
|
requestBody:
|
|
5659
5746
|
required: true
|
|
5660
5747
|
content:
|
|
@@ -5662,10 +5749,13 @@ paths:
|
|
|
5662
5749
|
schema: { type: object, additionalProperties: true, description: 'The sync request (peer/baseRevs/patches — core reconcile contract).' }
|
|
5663
5750
|
responses:
|
|
5664
5751
|
'200':
|
|
5665
|
-
description: 'The sync outcome (core reconcile/nextSyncBaseline projection).'
|
|
5752
|
+
description: 'The sync outcome (core reconcile/nextSyncBaseline projection), or (server >= 7.143.0) the incarnation refusal — told apart by `refused`.'
|
|
5666
5753
|
content:
|
|
5667
5754
|
application/json:
|
|
5668
|
-
schema:
|
|
5755
|
+
schema:
|
|
5756
|
+
oneOf:
|
|
5757
|
+
- { $ref: '#/components/schemas/MemorySyncResponse' }
|
|
5758
|
+
- { $ref: '#/components/schemas/MemorySyncIncarnationRefusal' }
|
|
5669
5759
|
'400': { $ref: '#/components/responses/BadRequest' }
|
|
5670
5760
|
'401': { $ref: '#/components/responses/Unauthorized' }
|
|
5671
5761
|
'404': { $ref: '#/components/responses/NotFound' }
|
|
@@ -5765,13 +5855,14 @@ paths:
|
|
|
5765
5855
|
enumerating every id in the attestation). `residuals.propagation` is core's self-declared boundary:
|
|
5766
5856
|
deletion is a THIS-STORE fact, remote-peer convergence is the sync deployment's half to prove.
|
|
5767
5857
|
|
|
5768
|
-
🔴 LAYER SEAT (
|
|
5858
|
+
🔴 LAYER SEAT (contract §9 head): This face has NO top-level `scope` key (the body goes to the engine as sent): `select.scope` names the layer.
|
|
5769
5859
|
|
|
5770
|
-
🔴 ERASURE
|
|
5771
|
-
|
|
5772
|
-
|
|
5773
|
-
|
|
5774
|
-
|
|
5860
|
+
🔴 ERASURE ANSWERS THE WHOLE DEPLOYMENT (server >= 7.143.0; the engine's one deployment object): a `requestId` names one request across the whole deployment —
|
|
5861
|
+
every store's anchors are read before executing; the same id first used under another selector or executed in another store ⇒ 409
|
|
5862
|
+
`memory.erasure_selector_mismatch`, under another authorization set ⇒ 400 `config.memory_erasure_scope` (nothing erased or recorded); a personal-layer
|
|
5863
|
+
erasure executes normally; `select.ids` / `select.sessionId` without `expectedScopes` ⇒ each store erases its own share and the attestations are merged; an
|
|
5864
|
+
authorization set whose layers live in two stores ⇒ 400 `config.memory_erasure_scope`. The 7.140.0–7.142.x store guard code and the two-store
|
|
5865
|
+
400 `request.memory_layer` arms are retired at 7.143.0 (`request.memory_layer` remains only for a layer key the engine cannot read).
|
|
5775
5866
|
requestBody:
|
|
5776
5867
|
required: true
|
|
5777
5868
|
content:
|
|
@@ -5801,10 +5892,8 @@ paths:
|
|
|
5801
5892
|
'403': { description: 'errorCode "auth.operator_only" — provenance and erasure are operator-only deployment actions. With an EMPTY `OPERATOR_PRINCIPALS` the answer is instead 501 `capability.operator_principals_required` (server >= 7.116.0; any identity, ahead of authorization — branch on `errorCode`, not the status).' }
|
|
5802
5893
|
'409':
|
|
5803
5894
|
description: >
|
|
5804
|
-
Core-minted codes passed through verbatim
|
|
5805
|
-
|
|
5806
|
-
(the named layer lives on the personal mount, or the session has contributions there / that store's ledger cannot be read): NOTHING erased, nothing
|
|
5807
|
-
recorded; the request is legal; do NOT retry. "memory.erasure_evidence_unavailable": this backend has NO evidence face and the caller did not
|
|
5895
|
+
Core-minted codes passed through verbatim; branch on `errorCode` (the status cannot tell them apart). (The 7.140.0–7.142.x server-minted store
|
|
5896
|
+
guard code is retired at 7.143.0.) "memory.erasure_evidence_unavailable": this backend has NO evidence face and the caller did not
|
|
5808
5897
|
opt into the degraded lane — deliberately NOT 501, because the caller holds a real choice
|
|
5809
5898
|
(`allowUnevidenced: true`) and a 501 would send someone off to change a deployment that is fine.
|
|
5810
5899
|
"memory.erasure_selector_mismatch": this `requestId` was first executed under a DIFFERENT selector —
|
|
@@ -7889,6 +7978,10 @@ components:
|
|
|
7889
7978
|
objective gets an appended notice (names/mime/sizes only — content never enters the durable
|
|
7890
7979
|
stream). Unknown/foreign id -> 400 on a fresh submit. Named `attachmentIds` because `attachments`
|
|
7891
7980
|
is taken by the system-reminder attachment config key.
|
|
7981
|
+
server >= 7.142.0, three 409s on a fresh submit (body carries `id`, plus `lane` on the second): `attachment.bound_elsewhere` (an attachment, once bound,
|
|
7982
|
+
stays with that session — upload it again for this one), `attachment.bundle_lane_not_isolated` (a project bundle binds only into an isolated lane:
|
|
7983
|
+
e2b / k8s / local-docker), `attachment.bundle_seed_fixed` (a session takes one project bundle). One refused id => none of the body's attachments bind.
|
|
7984
|
+
A resume replay of a stored body skips the refused id instead (operator warn). On isolated lanes the attachments are placed by the restore point.
|
|
7892
7985
|
scratchpadDir:
|
|
7893
7986
|
type: string
|
|
7894
7987
|
description: >-
|
|
@@ -8116,11 +8209,13 @@ components:
|
|
|
8116
8209
|
`SEMA_CONFIG_DIR`, default `~/.sema`; sandbox lanes the forwarded `SEMA_CONFIG_DIR`, else `.sema` under the execution home;
|
|
8117
8210
|
unresolvable => whole-request 422 `request.unprocessable` with entry-problem reason `home_unresolvable`), every other layer
|
|
8118
8211
|
reads under the task root like a plain string; `~/`, `//` and relative forms read the same in every layer. `allow` takes
|
|
8119
|
-
|
|
8120
|
-
|
|
8212
|
+
the same layered form from server 7.143.0 (gate `capabilities.settings.permissions.layeredAllow`; a user-layer `/`-form allow reads
|
|
8213
|
+
at the execution environment's configuration root, `home_unresolvable` like the other buckets); 7.141.0–7.142.x refuse a layered
|
|
8214
|
+
allow entry (400 `bad_entry`). A malformed layered entry => 400 `bad_entry` + the first bad index. Up to 1000 entries per bucket, both forms counted.
|
|
8121
8215
|
🔴 ON THIS SUBMIT FACE THE KEY SET IS CLOSED (server >= 7.57.0 for the sub-tree): accepted top-level keys
|
|
8122
8216
|
are `env` / `hooks` / `model` / `outputStyle` / `permissions` / `skillListingBudgetFraction` /
|
|
8123
|
-
`skillListingMaxDescChars` / `ultracode` / `webSearch` (server >= 7.133.0 adds the three TIGHTEN-ONLY seats `complianceAdditionalDenies` / `readDenyPatterns` / `writeProtectedExtra`; server >= 7.134.0 adds `approvalFrameFamilies
|
|
8217
|
+
`skillListingMaxDescChars` / `ultracode` / `webSearch` (server >= 7.133.0 adds the three TIGHTEN-ONLY seats `complianceAdditionalDenies` / `readDenyPatterns` / `writeProtectedExtra`; server >= 7.134.0 adds `approvalFrameFamilies`;
|
|
8218
|
+
server >= 7.142.0 adds the two http-hook allowlists `allowedHttpHookUrls` / `httpHookAllowedEnvVars` — the SDK's `SemaSettings` named keys are that set, key for key), and accepted `permissions.*` keys are
|
|
8124
8219
|
`allow` / `ask` / `defaultMode` / `deny` / `disableAutoMode` (server >= 7.133.0 adds `neverAuto`); anything else is 400 `request.body_shape`
|
|
8125
8220
|
with the names in the refusal's `unknownKeys` / `unsupportedKeys` arrays (REFUSED, not dropped — a dropped
|
|
8126
8221
|
key reads as "in effect" to the caller). The object stays OPEN here because the same `SemaSettings`
|
|
@@ -8143,6 +8238,12 @@ components:
|
|
|
8143
8238
|
🔴 `settings.hooks[]` (server >= 7.133.0; probe `capabilities.taskSettings.pluginHooks` / `managedHookGroups` — an absent or false bit = the keys are STRIPPED SILENTLY): group key `source` (closed: `managedPolicy` / `user` / `project` / `local` / `flag` /
|
|
8144
8239
|
`managedPlugin:<name>` / `plugin:<name>`; absent = unmanaged; managed groups run in an independent lane after the unmanaged rewrites), command-entry keys `plugin { name, root, dataDir?, options? }` and exec-form `args`; a malformed one =>
|
|
8145
8240
|
400 `request.field_invalid` with `detail: { reason: "wire_key_invalid", key, path }`; the plugin context has one 8192-character budget.
|
|
8241
|
+
🔴 HTTP-HOOK ALLOWLISTS (server >= 7.142.0; send them only when `capabilities.taskSettings.httpHookAllowlists` is `true` — an older server answers 400 `request.body_shape`):
|
|
8242
|
+
`allowedHttpHookUrls` (string array of URL patterns, grammar owned by the settings-schema package) — present => every `type: "http"` entry of `settings.hooks` asks the
|
|
8243
|
+
package's judge BEFORE dialing out; a URL that does not match, an empty list `[]` or a malformed list => the hook sends ZERO bytes (rule word url / empty / malformed),
|
|
8244
|
+
an unmanaged group records `hook_non_blocking_failure{reason:"url_not_allowed"}`, a managed group fails closed (PreToolUse folds to ask) and also emits
|
|
8245
|
+
`hook_managed_unrun{reason:"url_not_allowed"}`; `httpHookAllowedEnvVars` (string array) — the header can interpolate only the entry's `allowedEnvVars` INTERSECTED with this list.
|
|
8246
|
+
Absent => unrestricted. The submit face accepts the key names only and does not judge the values; the multi-tenant lane ignores `settings.hooks` wholesale (bit false).
|
|
8146
8247
|
🔴 `skillListingBudgetFraction` (number in (0,1]) / `skillListingMaxDescChars` (positive integer),
|
|
8147
8248
|
server >= 7.78.1: the SKILL-LISTING RENDER BUDGET, passed to the engine with ZERO processing
|
|
8148
8249
|
(no clamping, no conversion, no folding) — ABSENT means the key is not written at all (the server does
|
|
@@ -8943,6 +9044,14 @@ components:
|
|
|
8943
9044
|
verdict: { type: string, enum: [PASS, FAIL, PARTIAL, unverified] }
|
|
8944
9045
|
rounds: { type: integer }
|
|
8945
9046
|
findings: { type: array, items: { type: string } }
|
|
9047
|
+
allowanceExhausted:
|
|
9048
|
+
type: object
|
|
9049
|
+
additionalProperties: false
|
|
9050
|
+
required: [axis]
|
|
9051
|
+
description: 'server >= 7.143.0 (core 7.61.0 `AllowanceExhausted`): the task''s caps bound the whole implementation side; one axis ran out, so no further repair round runs and the verdict stops at that FAIL. `remaining` present = the balance (0 when spent); a priced cap with an unpriced leg reads as no balance (`axis: "cost"`, no `remaining`). Absent = no axis ran out (or an older server).'
|
|
9052
|
+
properties:
|
|
9053
|
+
axis: { type: string, enum: [cost, tokens, turns] }
|
|
9054
|
+
remaining: { type: number }
|
|
8946
9055
|
cancelContext:
|
|
8947
9056
|
allOf: [{ $ref: '#/components/schemas/CancelContext' }]
|
|
8948
9057
|
description: >
|
|
@@ -9100,21 +9209,6 @@ components:
|
|
|
9100
9209
|
toolCallId: { type: string }
|
|
9101
9210
|
retryAfterMs: { type: integer }
|
|
9102
9211
|
|
|
9103
|
-
RunReplayRecord:
|
|
9104
|
-
description: >
|
|
9105
|
-
server >= 7.125.0 (contract §0.7). The idempotent-REPLAY body of a submit whose `Idempotency-Key` had already built a run row: `RunRecord` (the
|
|
9106
|
-
`GET /v1/runs/{taskId}` read face, same projection) plus `replay: true`. It answers `POST /v1/tasks` (200) and is the `done.result` of
|
|
9107
|
-
`POST /v1/tasks/stream`. 🔴 IT IS NOT A `TaskResult`: a synchronous first answer carries the engine result at the top level (`terminal`, `stats`, `result` as a
|
|
9108
|
-
string); a replay has only the row, so `result` is the NESTED `TaskResult` (or absent while the run has no result), there is no top-level `terminal` / `stats`, and
|
|
9109
|
-
`wiringManifest` / `notice` are absent (the wiring receipt is a live capture that is not stored on the row). `taskId` is the row's id — on the stream leg, when the
|
|
9110
|
-
replay is discovered only after the stream opened (another replica created the row first), the `x-task-id` header and `meta` frame carried an id this leg minted
|
|
9111
|
-
and never created: the id in this body is the real one. Narrow on `replay === true` (the two shapes cannot both match). A same-key duplicate still IN FLIGHT in the same
|
|
9112
|
-
process is merged instead and gets the first answer's bytes with no `replay` key.
|
|
9113
|
-
allOf:
|
|
9114
|
-
- $ref: '#/components/schemas/RunRecord'
|
|
9115
|
-
- type: object
|
|
9116
|
-
required: [replay]
|
|
9117
|
-
|
|
9118
9212
|
SubmitRefusalDoneResult:
|
|
9119
9213
|
type: object
|
|
9120
9214
|
description: >
|
|
@@ -9313,39 +9407,76 @@ components:
|
|
|
9313
9407
|
enum: [enforced, not-enforced, exhausted, unobserved]
|
|
9314
9408
|
description: '`enforced` (a live lease with budget) · `not-enforced` (center said "no lease" and the negative cache is live — render unlimited) · `exhausted` (with `retryAfterSec`) · `unobserved` (no entry / expired / exhausted-not-renewed / evicted / no principal — server ruling F-1: nobody is judging quota right now, NOT "the last state").'
|
|
9315
9409
|
retryAfterSec: { type: integer, minimum: 1, description: 'Only beside `exhausted`.' }
|
|
9316
|
-
|
|
9410
|
+
SyncRunReceipt:
|
|
9317
9411
|
type: object
|
|
9318
9412
|
description: >
|
|
9319
|
-
|
|
9320
|
-
|
|
9321
|
-
|
|
9322
|
-
its `RUN_STATUS_CLASS` table (the `parked` class).
|
|
9323
|
-
additionalProperties: false
|
|
9413
|
+
The three RUN-RECEIPT keys (server `SyncRunReceipt`, `http/sync-submit-body.ts`; key-for-key) — the one definition of these keys: `SyncParkReceipt`
|
|
9414
|
+
narrows `status` to the park words, `SyncReceiptBody` is the receipt-only arm of `SyncSubmitOutcome`. The server mints exactly these three keys; the
|
|
9415
|
+
schema stays open because the receipt arm also receives the 7.125.0–7.141.x replay that was the read face (a superset, see `SyncReceiptBody`).
|
|
9324
9416
|
required: [taskId, sessionId, status]
|
|
9325
9417
|
properties:
|
|
9326
9418
|
taskId: { type: string, description: 'The durable run id minted at submit — the `GET /v1/runs/{taskId}` poll key.' }
|
|
9327
9419
|
sessionId: { type: string }
|
|
9420
|
+
status: { $ref: '#/components/schemas/RunStatus' }
|
|
9421
|
+
SyncParkReceipt:
|
|
9422
|
+
type: object
|
|
9423
|
+
description: >
|
|
9424
|
+
K-24 (server >= 7.104.0 / S-173) — the three POLL-RECEIPT keys a synchronous `POST /v1/tasks` adds on a PARK (the
|
|
9425
|
+
whole park body before 7.104.0, values byte-identical), key-for-key the server's `http/sync-submit-body.ts`
|
|
9426
|
+
`SyncParkReceipt` (= `SyncRunReceipt` with `status` narrowed). `status` is the word on the `GET /v1/runs/{taskId}` row — the server derives the two
|
|
9427
|
+
words from its `RUN_STATUS_CLASS` table (the `parked` class).
|
|
9428
|
+
allOf:
|
|
9429
|
+
- $ref: '#/components/schemas/SyncRunReceipt'
|
|
9430
|
+
properties:
|
|
9328
9431
|
status: { type: string, enum: [suspended, needs_review] }
|
|
9329
9432
|
SyncSubmitResult:
|
|
9330
9433
|
description: >
|
|
9331
|
-
K-24 — the synchronous `POST /v1/tasks` 200 body (server name `SyncSubmitBody`, one mint `buildSyncSubmitBody`).
|
|
9332
|
-
|
|
9333
|
-
|
|
9334
|
-
|
|
9335
|
-
|
|
9336
|
-
|
|
9337
|
-
|
|
9338
|
-
(`LegacyPlaneTaskResult`: `status` is the terminal word — completed / failed / blocked or a park word — and there is
|
|
9339
|
-
no `terminal`); 7.64–7.103 answers the current `terminal` form on terminal bodies but a park with ONLY the three receipt
|
|
9340
|
-
keys (no `terminal`, no `stats`); >= 7.104 follows the rule above. Read `status` for "parked" first (all three carry
|
|
9341
|
-
a park word on a park), then tell the generations apart by whether `terminal` is present.
|
|
9434
|
+
K-24 — the ENGINE-RESULT arm of the synchronous `POST /v1/tasks` 200 body (server name `SyncSubmitBody`, one mint `buildSyncSubmitBody`).
|
|
9435
|
+
It is the result itself (the sealed + redacted engine result — `TaskResult`); when the run is parked (`terminal.kind === "paused"`) it
|
|
9436
|
+
additionally carries the `SyncParkReceipt` keys, so `status` appears ONLY on a park, and only as a park word (server >= 7.104.0). A park here
|
|
9437
|
+
is byte-identical to the same park on `/v1/tasks/stream`'s `done.result` except for the identity keys; the resume credential is never on it.
|
|
9438
|
+
server >= 7.142.0: a same-key replay of a run whose row holds a result answers exactly this envelope plus `replay: true`.
|
|
9439
|
+
The other generations are the other arms of `SyncSubmitOutcome`: a server <= 7.63 answers the flat `LegacyPlaneTaskResult`; a 7.64–7.103 park
|
|
9440
|
+
answered only the three receipt keys (`SyncReceiptBody`).
|
|
9342
9441
|
allOf:
|
|
9343
9442
|
- $ref: '#/components/schemas/TaskResult'
|
|
9344
9443
|
- type: object
|
|
9345
9444
|
properties:
|
|
9346
9445
|
status:
|
|
9347
|
-
|
|
9348
|
-
|
|
9446
|
+
type: string
|
|
9447
|
+
enum: [suspended, needs_review]
|
|
9448
|
+
description: 'The poll-receipt word on a park (`SyncParkReceipt.status`); absent on a terminal body.'
|
|
9449
|
+
replay:
|
|
9450
|
+
const: true
|
|
9451
|
+
description: 'server >= 7.125.0 — present only on a same-key replay (never `false`). It says "replayed", not which shape.'
|
|
9452
|
+
SyncReceiptBody:
|
|
9453
|
+
type: object
|
|
9454
|
+
description: >
|
|
9455
|
+
The RUN-RECEIPT arm of `SyncSubmitOutcome` — no engine result in hand, so the body is the three receipt keys `{taskId, sessionId, status}`
|
|
9456
|
+
(server `SyncRunReceipt`): read the run at `GET /v1/runs/{taskId}`. Three producers: a 7.64.0–7.103.x park (the whole park body then);
|
|
9457
|
+
server >= 7.142.0, a same-key replay of a row that holds no result (still running, or lost: a stale row's `status` reads `failed`);
|
|
9458
|
+
and server 7.125.0–7.141.x, whose same-key replay was the row's read face plus `replay: true` — a superset of these three keys with no
|
|
9459
|
+
`stats`, hence `additionalProperties: true` here (read the three keys, then the row).
|
|
9460
|
+
additionalProperties: true
|
|
9461
|
+
not: { required: [stats] }
|
|
9462
|
+
allOf:
|
|
9463
|
+
- $ref: '#/components/schemas/SyncRunReceipt'
|
|
9464
|
+
properties:
|
|
9465
|
+
replay:
|
|
9466
|
+
const: true
|
|
9467
|
+
description: 'server >= 7.125.0 — present only on a same-key replay (never `false`).'
|
|
9468
|
+
SyncSubmitOutcome:
|
|
9469
|
+
description: >
|
|
9470
|
+
The synchronous `POST /v1/tasks` 200 body, and the shape of `/v1/tasks/stream`'s `done.result` on a run. ONE RULE (server >= 7.142.0): is there an
|
|
9471
|
+
engine result in hand? `stats` present ⇒ the engine result (`SyncSubmitResult`; on a server <= 7.63 the flat `LegacyPlaneTaskResult`, told apart by
|
|
9472
|
+
`terminal`); `stats` absent ⇒ the run receipt (`SyncReceiptBody`) — read the row at `GET /v1/runs/{taskId}`. A same-key replay is the
|
|
9473
|
+
first answer's envelope plus `replay: true` (server >= 7.142.0; a row whose stored result is the <= 7.63 flat form replays as that flat form
|
|
9474
|
+
plus `replay: true`); `replay` says "replayed", never which shape. server 7.125.0–7.141.x
|
|
9475
|
+
answered a replay with the row's read face instead: it has no `stats` and falls in the receipt arm, which is the right reading of it.
|
|
9476
|
+
oneOf:
|
|
9477
|
+
- $ref: '#/components/schemas/SyncSubmitResult'
|
|
9478
|
+
- $ref: '#/components/schemas/LegacyPlaneTaskResult'
|
|
9479
|
+
- $ref: '#/components/schemas/SyncReceiptBody'
|
|
9349
9480
|
PermissionModeSwitchResult:
|
|
9350
9481
|
type: object
|
|
9351
9482
|
description: >-
|
|
@@ -9423,13 +9554,6 @@ components:
|
|
|
9423
9554
|
taskId: { type: string }
|
|
9424
9555
|
sessionId: { type: string }
|
|
9425
9556
|
status: { $ref: '#/components/schemas/RunStatus' }
|
|
9426
|
-
replay:
|
|
9427
|
-
const: true
|
|
9428
|
-
description: >
|
|
9429
|
-
server >= 7.125.0 (additive; contract §0.7). Present ONLY on the IDEMPOTENT-REPLAY body of a submit — `POST /v1/tasks` 200, and the same body as
|
|
9430
|
-
`done.result` on `POST /v1/tasks/stream` (see `RunReplayRecord`) — where it is always `true`: the submit's key had already built this run row, so the
|
|
9431
|
-
answer is the row's read face plus this marker, NOT the first answer's engine result. ABSENT on `GET /v1/runs/{taskId}` and
|
|
9432
|
-
`GET /v1/runs?idempotencyKey=` (those are the read face itself) and never `false`. Branch on `replay === true`; the outcome is in `result`.
|
|
9433
9557
|
msSinceLastActivity:
|
|
9434
9558
|
type: integer
|
|
9435
9559
|
description: >
|
|
@@ -10080,8 +10204,12 @@ components:
|
|
|
10080
10204
|
the request key `settings.approvalFrameFamilies` (which families this run's client renders).
|
|
10081
10205
|
ApprovalDecision:
|
|
10082
10206
|
type: object
|
|
10083
|
-
description:
|
|
10084
|
-
|
|
10207
|
+
description: >
|
|
10208
|
+
HITL decision (`POST /v1/approvals/:sessionId/decide`, checkpoint family). server >= 7.143.0: `boundCallId` and `boundInputHash`
|
|
10209
|
+
are BOTH required (echo the pair off the `pending[]` row / `pending` frame you showed the person); a missing or empty one ⇒
|
|
10210
|
+
400 `decide_requires_binding` with `missingKeys` naming the missing seats. A `peer_inbound` row is decided with
|
|
10211
|
+
`{ decision }` only (see the path).
|
|
10212
|
+
required: [decision, boundCallId, boundInputHash]
|
|
10085
10213
|
properties:
|
|
10086
10214
|
decision: { type: string, enum: [approve, deny] }
|
|
10087
10215
|
answer:
|
|
@@ -10114,11 +10242,11 @@ components:
|
|
|
10114
10242
|
reason: { type: string }
|
|
10115
10243
|
# design/80 D-1 — action binding (TOCTOU guard). Read the TWO off the PendingCheckpoint the human saw
|
|
10116
10244
|
# and echo VERBATIM; server resolves THAT exact checkpoint, fail-closed on mismatch (approval_binding_mismatch).
|
|
10117
|
-
#
|
|
10245
|
+
# server >= 7.143.0: both required (400 decide_requires_binding). boundInputHash is OPAQUE — never hashed/recomputed client-side.
|
|
10118
10246
|
# 🔴 `checkpointToken` REMOVED (SDK 1.0.0): §4a makes it server-INTERNAL and it is NEVER surfaced on a
|
|
10119
10247
|
# /v1/approvals row, so a compliant client has no way to obtain a correct value for it.
|
|
10120
|
-
boundCallId: { type: string, description: '= PendingCheckpoint.boundCallId (the bound pendingAction.toolCallId).' }
|
|
10121
|
-
boundInputHash: { type: string, description: 'Echo PendingCheckpoint.boundInputHash byte-for-byte; server-minted opaque, NEVER recompute.' }
|
|
10248
|
+
boundCallId: { type: string, minLength: 1, description: '= PendingCheckpoint.boundCallId (the bound pendingAction.toolCallId). An empty string reads as missing (400 decide_requires_binding).' }
|
|
10249
|
+
boundInputHash: { type: string, minLength: 1, description: 'Echo PendingCheckpoint.boundInputHash byte-for-byte; server-minted opaque, NEVER recompute. An empty string reads as missing (400 decide_requires_binding).' }
|
|
10122
10250
|
updatedInput:
|
|
10123
10251
|
description: >
|
|
10124
10252
|
Approve-with-edit (design/37 last-wins): operator's rewritten tool args, applied AFTER the binding
|
|
@@ -10132,8 +10260,8 @@ components:
|
|
|
10132
10260
|
`routes/approvals-assistant.ts` reads it; the SDK has typed it since the facade audit, the spec had
|
|
10133
10261
|
not). It is an approval MEMORY, not a policy loosen — a deny / neverAuto always outranks it.
|
|
10134
10262
|
Constraints (all server-enforced): only with `decision:"approve"` (else 400
|
|
10135
|
-
`request.field_conflict`);
|
|
10136
|
-
`
|
|
10263
|
+
`request.field_conflict`); the binding pair is required on every decide (server >= 7.143.0: 400
|
|
10264
|
+
`decide_requires_binding`, no separate remember-only gate); REFUSED on a direct-door worker (400 `remember_not_in_proof` — it is
|
|
10137
10265
|
not inside the HMAC payload, so accepting it unsigned would be tamperable); 501 without an exemption
|
|
10138
10266
|
store. On the parked-background-agent leg the grant lands on the child's ROOT/HOST session (the whole
|
|
10139
10267
|
session tree shares it). The 200 body echoes `rememberApplied` when a store is wired.
|
|
@@ -10156,6 +10284,42 @@ components:
|
|
|
10156
10284
|
carrying `<system-reminder>` ⇒ server >= 7.135.0 (engine 7.55.0): 409 `resume_outcome_invalid` + `field: "feedback"` + `retriable: true` (the engine's sentence naming `feedback`; refused before the CAS, the card stays pending — ask the person to change
|
|
10157
10285
|
or drop the words, do not auto-refetch and re-decide on the code); server 7.134.x: 409 `approval_binding_mismatch` (no `field`). The same door serves parked background-agent cards and workflow child cards; the live
|
|
10158
10286
|
`POST /v1/tool-approvals/{id}/respond` does NOT take it. Servers <= 7.133.x refuse the key (400 `request.body_shape`, `unknownKeys: ["feedback"]`).
|
|
10287
|
+
decidedVia:
|
|
10288
|
+
allOf: [{ $ref: '#/components/schemas/ApprovalDecidedVia' }]
|
|
10289
|
+
description: 'server >= 7.143.0 (capability `approvalDecidedVia`): which seat answered a `decidedBy: "policy"` decision. Only beside `decidedBy: "policy"`; `null` is not absence (400); any value on a direct-door worker ⇒ 400.'
|
|
10290
|
+
mcpServers: { $ref: '#/components/schemas/ResumeRestatement/properties/mcpServers' }
|
|
10291
|
+
a2aPeers: { $ref: '#/components/schemas/ResumeRestatement/properties/a2aPeers' }
|
|
10292
|
+
|
|
10293
|
+
ResumeRestatement:
|
|
10294
|
+
type: object
|
|
10295
|
+
description: >
|
|
10296
|
+
server >= 7.143.0 — the resume restatement the four resume doors take (`/decide`, `plan_review`, `/resume`, `/wake`): the submit body's
|
|
10297
|
+
`mcpServers` / `a2aPeers`. A key present (non-null) REPLACES the parked task's stored table of that name for this resume (and is written
|
|
10298
|
+
back with the resume input, so a later resume that sends nothing replays it); the value shape is judged like `POST /v1/tasks` (same code
|
|
10299
|
+
and sentence on a bad shape). A key absent or `null` ⇒ the FROZEN reading (the table stored at submit). The two keys are independent; an
|
|
10300
|
+
empty array is an empty table, not absence. A task parked on an MCP call whose target is not in the sent table is judged by the engine
|
|
10301
|
+
(`resume.tool_unavailable` / `resume.tool_contract_mismatch` reopen the card; `resume.target_moved` consumes the approval). `/decide` on a card
|
|
10302
|
+
parked by a background child ⇒ 400 `decide.parked_restatement_unsupported`; the two keys on a direct-door worker's `/decide` / `plan_review`
|
|
10303
|
+
⇒ 400 `restatement_not_in_proof`. Servers <= 7.142.x: `/decide` / `plan_review` refuse the keys (400), `/resume` / `/wake` ignore them.
|
|
10304
|
+
properties:
|
|
10305
|
+
mcpServers: { type: ['array', 'null'], maxItems: 32, items: { $ref: '#/components/schemas/McpServerSpec' }, description: 'Same element shape as `TaskRequest.mcpServers`.' }
|
|
10306
|
+
a2aPeers: { type: ['array', 'null'], maxItems: 32, items: { $ref: '#/components/schemas/A2aServerSpec' }, description: 'Same element shape as `TaskRequest.a2aPeers`.' }
|
|
10307
|
+
|
|
10308
|
+
SessionWakeRequest:
|
|
10309
|
+
type: object
|
|
10310
|
+
description: 'Body of `POST /v1/sessions/{sessionId}/wake`: an optional non-empty `message` (an empty string is 400) plus the resume restatement (server >= 7.143.0; see ResumeRestatement).'
|
|
10311
|
+
properties:
|
|
10312
|
+
message: { type: string, minLength: 1 }
|
|
10313
|
+
mcpServers: { $ref: '#/components/schemas/ResumeRestatement/properties/mcpServers' }
|
|
10314
|
+
a2aPeers: { $ref: '#/components/schemas/ResumeRestatement/properties/a2aPeers' }
|
|
10315
|
+
|
|
10316
|
+
ApprovalDecidedVia:
|
|
10317
|
+
type: string
|
|
10318
|
+
enum: [policy, permission_request_hook]
|
|
10319
|
+
description: >
|
|
10320
|
+
server >= 7.143.0 (engine `DECIDED_VIA`, verbatim and in order) — the seat a `decidedBy: "policy"` decision was answered from:
|
|
10321
|
+
`policy` = the deployment's own policy; `permission_request_hook` = a PermissionRequest hook answered the card (the model reads
|
|
10322
|
+
"a PermissionRequest hook refused this call", not the deployment-policy sentence). ABSENT = `policy`.
|
|
10159
10323
|
|
|
10160
10324
|
Capabilities:
|
|
10161
10325
|
type: object
|
|
@@ -10233,7 +10397,7 @@ components:
|
|
|
10233
10397
|
itself. The memory ENGINE that replaced it is model-facing skills over an injected memory dir and
|
|
10234
10398
|
has NO service HTTP verbs, so this flag is not its availability signal. The SDK removed the five
|
|
10235
10399
|
legacy verbs in 1.0.0; the live face is `client.memory.exportScope` / `.sync`
|
|
10236
|
-
(`GET /v1/memory/export`, `POST /
|
|
10400
|
+
(`GET /v1/memory/export`, `POST /v2/memory/sync/{scope}`), which this flag does NOT gate.
|
|
10237
10401
|
Kept on the wire so an older shell that still reads it honestly hides the dead affordances.
|
|
10238
10402
|
adoption:
|
|
10239
10403
|
type: boolean
|
|
@@ -10617,6 +10781,11 @@ components:
|
|
|
10617
10781
|
server >= 7.118.0, hardcoded true (a version bit): the three approval decision doors read `decidedBy` (ApprovalDecidedBy).
|
|
10618
10782
|
Send it only when this is present; absent = an older server (the durable doors and `plan_review` 400 it, the live
|
|
10619
10783
|
`respond` drops it silently and answers 200).
|
|
10784
|
+
approvalDecidedVia:
|
|
10785
|
+
type: boolean
|
|
10786
|
+
description: >-
|
|
10787
|
+
server >= 7.143.0, hardcoded true (a version bit): the four decision doors (live `respond`, durable ask `decision`, `/decide`,
|
|
10788
|
+
`plan_review`) read `decidedVia` (ApprovalDecidedVia) beside `decidedBy: "policy"`. Send it only when this is present.
|
|
10620
10789
|
sessionReadRedaction:
|
|
10621
10790
|
type: boolean
|
|
10622
10791
|
description: >-
|
|
@@ -10747,6 +10916,7 @@ components:
|
|
|
10747
10916
|
hooks: { type: boolean, description: 'Single-user deployments only (`requirePrincipal !== true`).' }
|
|
10748
10917
|
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.' }
|
|
10749
10918
|
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).' }
|
|
10919
|
+
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.' }
|
|
10750
10920
|
tightenOnlySeats: { type: boolean, description: 'server >= 7.133.0, constant true — the four tighten-only request seats `settings.readDenyPatterns` / `settings.writeProtectedExtra` / `settings.complianceAdditionalDenies` / `settings.permissions.neverAuto` are accepted (each seat = deployment table UNION request list, only ever growing; an empty array is the same as not sent). ABSENT = server <= 7.132.x, which answers 400 `request.body_shape` for those keys — send only on sight of the bit.' }
|
|
10751
10921
|
approvalFrameFamilies: { type: boolean, description: 'server >= 7.134.0, constant true — the request key `settings.approvalFrameFamilies` (which approval opening-frame families this run''s client renders) is accepted. THIS is the trigger bit for that key, NOT the top-level `approvalFrameFamilies`: servers <= 7.133.x already carry the top-level bit yet answer 400 `request.body_shape` (`unknownKeys: ["settings.approvalFrameFamilies"]`) for the key. ABSENT = do not send it.' }
|
|
10752
10922
|
settings:
|
|
@@ -10778,6 +10948,7 @@ components:
|
|
|
10778
10948
|
allowGrant: { type: boolean, description: 'Constant `true` on server >= 7.115.0: `settings.permissions.allow` is read as allow RULES, not as a list. The whole `settings` key being absent = an older server.' }
|
|
10779
10949
|
allowLayer: { type: boolean, description: 'Constant `true` on server >= 7.117.0 (core 7.42.0): the whole `settings.permissions.allow` list goes to the engine allow layer (listed calls are not asked; content forms accepted; entries read as nothing get an `engine_notice` `permission.allowed_tool_not_granted`). Absent = a server without it (7.115.0–7.116.x: allow is a statement; older: a list).' }
|
|
10780
10950
|
layers: { type: boolean, description: 'Constant `true` on server >= 7.141.0 (both deployment shapes): `settings.permissions.deny` / `ask` accept a layered entry `{ rule, layer }` beside a plain string (see `TaskRequest.settings`). Send layered entries only when this bit is `true`: an older server refuses them (a new submit 400, a resume 409) — loud, never silently dropped.' }
|
|
10951
|
+
layeredAllow: { type: boolean, description: 'Constant `true` on server >= 7.143.0: `settings.permissions.allow` entries accept the same layered form `{ rule, layer }` as `deny` / `ask` (a user-layer `/`-form allow reads at the execution environment''s config root). Send layered allow entries only when this bit is `true`.' }
|
|
10781
10952
|
callerTrust: { type: string, description: 'server >= 7.133.0 — THIS caller''s trust tier (per caller / per credential, NOT a version bit). Request rule tables that take effect without a person answering (`settings.permissions` buckets; a named-invoked skill''s `allowedTools` / `disallowedTools`) are admitted by it: `allow` loosens the no-ask surface and needs `global`; `deny` / `ask` only tighten and are admitted at any tier. Today `global` (single-user turnkey; multi-tenant with the deployment service credential; multi-tenant sign-in token whose scope role >= the governance write role) or `project` (everything else). Read OPEN: an unknown word is treated as `project` (fail-closed). A request below the floor is refused whole with 400 `request.field_invalid` (`detail.problems[].reason: below_trust_floor`, `detail.callerTrust`). ABSENT = server <= 7.132.x: no per-tier admission.' }
|
|
10782
10953
|
memoryWrite:
|
|
10783
10954
|
type: boolean
|
|
@@ -10955,6 +11126,28 @@ components:
|
|
|
10955
11126
|
memory-capture opt-out GRANT table admin (four routes under `/v1/admin/memory-optout`,
|
|
10956
11127
|
operator-only) — capabilities.ts:307. FALSE ⇒ **501** `capability.memory_optout_grant_required`
|
|
10957
11128
|
(change the deployment shape), as opposed to `memoryConsolidationDriver`'s 404 (turn the knob on).
|
|
11129
|
+
sessionMemorySync:
|
|
11130
|
+
type: boolean
|
|
11131
|
+
description: >
|
|
11132
|
+
server >= 7.142.0 — the session memory-sync trigger `POST /v1/sessions/{sessionId}/memory/sync` (SDK `sessions.syncMemory`) is served: it needs the
|
|
11133
|
+
local sync leg (file memory engine + `MEMORY_SYNC_URL`), a durable run store and the session-ownership face. FALSE => that route answers 501
|
|
11134
|
+
(`feature.memory_sync_disabled` / `capability.run_store_required` / `capability.session_ownership_required`, by what is missing). ABSENT = an older server (no route).
|
|
11135
|
+
memorySyncServe:
|
|
11136
|
+
description: >
|
|
11137
|
+
server >= 7.142.0 — the MEMORY-SYNC CENTER's identity bit: `{ identity }` iff this is a DB memory plane (`MEMORY_ENGINE_BACKEND=pg|mysql`) with the sync perform
|
|
11138
|
+
seat AND the operator declared `MEMORY_SYNC_SERVE_IDENTITY`; otherwise `false` (not a center, or no identity declared — then `POST /v2/memory/sync/{scope}` (server >= 7.143.0; `/v1` before) answers
|
|
11139
|
+
501 `feature.memory_sync_serve_disabled`). A composite bit (the server's composite-member table `memorySyncServe: ["identity"]`); there is no `true`.
|
|
11140
|
+
`identity` = the canonical base address clients reach this center's sync face at (lower-case scheme and host, no default port, no trailing slash, no query /
|
|
11141
|
+
fragment / credential), verbatim: a local shell passes it as the `target` of `POST /v1/sessions/{sessionId}/memory/sync`; the center compares an inbound `peer`
|
|
11142
|
+
to it as a string. ABSENT = an older server.
|
|
11143
|
+
oneOf:
|
|
11144
|
+
- { const: false }
|
|
11145
|
+
- $ref: '#/components/schemas/MemorySyncServeCapability'
|
|
11146
|
+
memoryExport:
|
|
11147
|
+
type: boolean
|
|
11148
|
+
description: >
|
|
11149
|
+
server >= 7.142.0 — the export read face `GET /v1/memory/export` (SDK `memory.exportScope`) is served (a DB memory plane has it). FALSE => that route answers
|
|
11150
|
+
501 `capability.memory_store_required` (which reads the capability fact from 7.142.0 on, no longer the backend word). ABSENT = an older server.
|
|
10958
11151
|
permissionModeAuto:
|
|
10959
11152
|
type: object
|
|
10960
11153
|
additionalProperties: true
|
|
@@ -11634,7 +11827,7 @@ components:
|
|
|
11634
11827
|
type: object
|
|
11635
11828
|
description: >
|
|
11636
11829
|
core `MemoryEntry` (@sema-agent/core memory-engine/types.d.ts) — one memory-engine (DB twins)
|
|
11637
|
-
note. Used verbatim by both GET /v1/memory/export's `entries` and POST /
|
|
11830
|
+
note. Used verbatim by both GET /v1/memory/export's `entries` and POST /v2/memory/sync/{scope}'s
|
|
11638
11831
|
`serverEntries` (server never re-shapes it — memory-policy.ts / memory-sync.ts pass the core
|
|
11639
11832
|
array straight to `sendJson`).
|
|
11640
11833
|
required: [id, slug, frontmatter, body, rev, scope]
|
|
@@ -11650,7 +11843,7 @@ components:
|
|
|
11650
11843
|
MemorySyncResponse:
|
|
11651
11844
|
type: object
|
|
11652
11845
|
description: >
|
|
11653
|
-
200 body of POST /
|
|
11846
|
+
200 body of POST /v2/memory/sync/{scope} (server >= 7.143.0; `/v1` before) — core `MemorySyncResponse` (server memory-sync.ts),
|
|
11654
11847
|
`sendJson`'d verbatim (memory-policy.ts). `pullTruncated` is OMIT-when-absent (present+`true`
|
|
11655
11848
|
only when `serverEntries` was cut by `?pull.limit`).
|
|
11656
11849
|
required: [applied, conflicts, serverEntries, serverDeletes, cursor]
|
|
@@ -11659,14 +11852,7 @@ components:
|
|
|
11659
11852
|
applied:
|
|
11660
11853
|
type: array
|
|
11661
11854
|
description: The center's own-round applied ops (backend `PatchReport.applied` verbatim; empty on an idempotent replay).
|
|
11662
|
-
items:
|
|
11663
|
-
type: object
|
|
11664
|
-
required: [op, id]
|
|
11665
|
-
additionalProperties: false
|
|
11666
|
-
properties:
|
|
11667
|
-
op: { type: string, enum: [add, update, delete] }
|
|
11668
|
-
id: { type: string }
|
|
11669
|
-
slug: { type: string }
|
|
11855
|
+
items: { $ref: '#/components/schemas/MemorySyncAppliedOp' }
|
|
11670
11856
|
conflicts:
|
|
11671
11857
|
type: array
|
|
11672
11858
|
items:
|
|
@@ -11693,14 +11879,27 @@ components:
|
|
|
11693
11879
|
baseRev: { type: string }
|
|
11694
11880
|
cursor:
|
|
11695
11881
|
type: object
|
|
11696
|
-
required: [peer, baseRevs, updatedAtMs]
|
|
11882
|
+
required: [peer, incarnation, baseRevs, updatedAtMs]
|
|
11697
11883
|
additionalProperties: false
|
|
11698
11884
|
properties:
|
|
11699
11885
|
peer: { type: string }
|
|
11886
|
+
incarnation: { type: string, description: 'server >= 7.143.0 (always present; only that version serves this path): the incarnation of the layer partition that answered — every write of this exchange committed under it; the next cursor carries it as its `peerIncarnation`.' }
|
|
11700
11887
|
baseRevs: { type: object, additionalProperties: { type: string } }
|
|
11701
11888
|
updatedAtMs: { type: integer }
|
|
11702
11889
|
pullTruncated: { type: boolean, enum: [true] }
|
|
11703
11890
|
|
|
11891
|
+
MemorySyncIncarnationRefusal:
|
|
11892
|
+
type: object
|
|
11893
|
+
description: >
|
|
11894
|
+
server >= 7.143.0 — the OTHER 200 answer of POST /v2/memory/sync/{scope}: the request's `peerIncarnation` is not this partition's, or the
|
|
11895
|
+
request carries a non-empty baseline and no incarnation claim. Judged before any read or write — nothing was read or written. `incarnation`
|
|
11896
|
+
= this partition's incarnation. It is an answer, not an error: branch on `refused`.
|
|
11897
|
+
required: [refused, incarnation]
|
|
11898
|
+
additionalProperties: false
|
|
11899
|
+
properties:
|
|
11900
|
+
refused: { const: baseline_incarnation }
|
|
11901
|
+
incarnation: { type: string }
|
|
11902
|
+
|
|
11704
11903
|
MemoryTransferEvidence:
|
|
11705
11904
|
type: object
|
|
11706
11905
|
description: >
|
|
@@ -11853,8 +12052,11 @@ components:
|
|
|
11853
12052
|
One memory request lands on ONE store: the store the named layer lives in (file backend: the typed personal layers `user:` / `userproj:` / `org:` live in a
|
|
11854
12053
|
SECOND store under the personal mount; the project layers and the un-typed layers, `local` included, live in the deployment's store). It rides the query string
|
|
11855
12054
|
(`GET /v1/memory/entries/{entryId}/provenance`, `GET /v1/memory/origin/clearances`, `GET /v1/sessions/{sessionId}/memory-status`) or the body
|
|
11856
|
-
(`MemoryOriginClearRequest
|
|
11857
|
-
|
|
12055
|
+
(`MemoryOriginClearRequest`); `POST /v1/memory/erase` has no such key (the layer comes from `select.scope` / `expectedScopes`), and the session self-service
|
|
12056
|
+
erase no longer has one (server >= 7.143.0: it erases across the whole deployment; 7.140.0–7.142.x read it from the body).
|
|
12057
|
+
Needed only on a TWO-STORE deployment for verbs that name no layer. Server >= 7.143.0 reads the deployment's store set FROM DISK: the personal mount counts
|
|
12058
|
+
once a store exists there (for instance after a personal-layer erasure wrote its anchor), whether or not the configuration names a personal layer;
|
|
12059
|
+
7.140.0–7.142.x derived it from the configured layers. A single-store deployment answers byte-for-byte as 7.139.x. This schema is open: it only
|
|
11858
12060
|
defines the key, and is embedded by property reference — it is not a request body of its own.
|
|
11859
12061
|
additionalProperties: true
|
|
11860
12062
|
properties:
|
|
@@ -11863,7 +12065,7 @@ components:
|
|
|
11863
12065
|
minLength: 1
|
|
11864
12066
|
description: >
|
|
11865
12067
|
The memory layer key (e.g. `user:alice`, `local`) whose store answers. Absent ⇒ no layer named: on a two-store deployment the verbs that name no layer
|
|
11866
|
-
answer 400 `request.memory_layer` (the session-id verbs
|
|
12068
|
+
answer 400 `request.memory_layer` (the session-id verbs need no seat: memory-status folds every store; the self-service erase spans the whole deployment, server >= 7.143.0); present but not a non-empty string ⇒ 400
|
|
11867
12069
|
`request.field_invalid` (sentence only); a layer key the engine cannot read ⇒ 400 `request.memory_layer`. It only decides WHICH store answers — it never
|
|
11868
12070
|
reaches the engine.
|
|
11869
12071
|
|
|
@@ -11897,34 +12099,149 @@ components:
|
|
|
11897
12099
|
description: >
|
|
11898
12100
|
The authorization set of this erasure (server >= 7.138.0; the judge is core): when present, the selector's own scope and the bound scope of EVERY
|
|
11899
12101
|
resolved id must lie in the set, else the whole request is refused 400 `config.memory_erasure_scope` (nothing erased or recorded; an id whose scope the
|
|
11900
|
-
store cannot attribute, or that never existed, counts as outside). The empty set authorizes no scope; absent = no narrowing. Server >= 7.
|
|
11901
|
-
|
|
11902
|
-
|
|
11903
|
-
|
|
12102
|
+
store cannot attribute, or that never existed, counts as outside). The empty set authorizes no scope; absent = no narrowing. Server >= 7.143.0: a set whose
|
|
12103
|
+
layers live in two stores ⇒ 400 `config.memory_erasure_scope`; without it, `select.ids` / `select.sessionId` erase each store's share (attestations merged).
|
|
12104
|
+
|
|
12105
|
+
SessionMemorySyncRequest:
|
|
12106
|
+
type: object
|
|
12107
|
+
description: 'server >= 7.142.0 — the body of `POST /v1/sessions/{sessionId}/memory/sync`: exactly one key.'
|
|
12108
|
+
additionalProperties: false
|
|
12109
|
+
required: [target]
|
|
12110
|
+
properties:
|
|
12111
|
+
target: { type: string, description: 'The sync identity of the engine the session goes to — that engine''s `GET /v1/capabilities` `memorySyncServe.identity`, verbatim.' }
|
|
12112
|
+
MemorySyncAppliedOp:
|
|
12113
|
+
type: object
|
|
12114
|
+
description: One applied op of a memory sync (the backend's `PatchReport.applied` item) — the one definition, used by `MemorySyncResponse.applied` and both halves of `MemorySyncLayerReport.applied`.
|
|
12115
|
+
additionalProperties: false
|
|
12116
|
+
required: [op, id]
|
|
12117
|
+
properties:
|
|
12118
|
+
op: { type: string, enum: [add, update, delete] }
|
|
12119
|
+
id: { type: string }
|
|
12120
|
+
slug: { type: string }
|
|
12121
|
+
MemorySyncConflict:
|
|
12122
|
+
type: object
|
|
12123
|
+
description: 'server >= 7.142.0 — one conflict of a session memory sync layer (`MemorySyncLayerReport.conflicts`): which half (`side`), the entry, why, and the two revisions when known.'
|
|
12124
|
+
additionalProperties: false
|
|
12125
|
+
required: [side, id, reason]
|
|
12126
|
+
properties:
|
|
12127
|
+
side: { type: string, enum: [server, local] }
|
|
12128
|
+
id: { type: string }
|
|
12129
|
+
reason: { type: string }
|
|
12130
|
+
baseRev: { type: string }
|
|
12131
|
+
currentRev: { type: string }
|
|
12132
|
+
MemorySyncServeCapability:
|
|
12133
|
+
type: object
|
|
12134
|
+
description: 'server >= 7.142.0 — the object arm of `Capabilities.memorySyncServe`: this center''s declared sync identity.'
|
|
12135
|
+
additionalProperties: false
|
|
12136
|
+
required: [identity]
|
|
12137
|
+
properties:
|
|
12138
|
+
identity: { type: string, description: 'The declared sync identity (`MEMORY_SYNC_SERVE_IDENTITY`, canonical form) — pass it verbatim as the `target` of `POST /v1/sessions/{sessionId}/memory/sync`.' }
|
|
12139
|
+
MemorySyncLayerReport:
|
|
12140
|
+
type: object
|
|
12141
|
+
description: >
|
|
12142
|
+
server >= 7.142.0 — ONE LAYER of a memory sync (the engine's `memorySyncReportOf`, passed through): one scope, one outcome, what all its calls landed. Branch on
|
|
12143
|
+
`outcome`: `synced` (the layer arrived — `applied` counts do not say so, the outcome does); `incomplete` (`why`: `conflicts` — the last call's conflicts listed in
|
|
12144
|
+
full — or `truncated`; `warnings` = the server answers the client refused); `refused` before any request (`code` `config.memory_sync_cursor_mismatch` with
|
|
12145
|
+
`detail {axis, found}` or `config.memory_sync_store`; `outs` = the two ways out the sentence names); `failed` (`error` = the message; one failed layer ends only itself).
|
|
12146
|
+
additionalProperties: false
|
|
12147
|
+
required: [scope, applied, outcome]
|
|
12148
|
+
properties:
|
|
12149
|
+
scope: { type: string }
|
|
12150
|
+
applied:
|
|
12151
|
+
type: object
|
|
12152
|
+
additionalProperties: false
|
|
12153
|
+
required: [server, local]
|
|
12154
|
+
properties:
|
|
12155
|
+
server: { type: array, items: { $ref: '#/components/schemas/MemorySyncAppliedOp' } }
|
|
12156
|
+
local: { type: array, items: { $ref: '#/components/schemas/MemorySyncAppliedOp' } }
|
|
12157
|
+
outcome: { type: string, enum: [synced, incomplete, refused, failed] }
|
|
12158
|
+
why: { type: string, enum: [conflicts, truncated] }
|
|
12159
|
+
conflicts: { type: array, items: { $ref: '#/components/schemas/MemorySyncConflict' } }
|
|
12160
|
+
warnings: { type: array, items: { type: string } }
|
|
12161
|
+
code: { type: string, enum: [config.memory_sync_cursor_mismatch, config.memory_sync_store] }
|
|
12162
|
+
detail:
|
|
12163
|
+
type: object
|
|
12164
|
+
additionalProperties: false
|
|
12165
|
+
required: [axis, found]
|
|
12166
|
+
properties:
|
|
12167
|
+
axis: { type: string, enum: [scope, peer, store, incarnation], description: 'server >= 7.143.0 adds `incarnation` (the center partition''s incarnation does not match: a center database rebuilt / restored, or a cursor written before the upgrade reads `absent`; the way out is the same — delete the cursor).' }
|
|
12168
|
+
found: { type: string, enum: [absent, other] }
|
|
12169
|
+
want: { type: string }
|
|
12170
|
+
outs: { type: array, minItems: 2, maxItems: 2, items: { type: string } }
|
|
12171
|
+
message: { type: string }
|
|
12172
|
+
error: { type: string }
|
|
12173
|
+
# each arm names the ONLY keys it carries (core `memorySyncReportOf` writes exactly these per outcome) — a key of another outcome is a violation
|
|
12174
|
+
oneOf:
|
|
12175
|
+
- properties: { outcome: { const: synced } }
|
|
12176
|
+
propertyNames: { enum: [scope, applied, outcome] }
|
|
12177
|
+
- properties: { outcome: { const: incomplete } }
|
|
12178
|
+
required: [why, conflicts]
|
|
12179
|
+
propertyNames: { enum: [scope, applied, outcome, why, conflicts, warnings] }
|
|
12180
|
+
- properties: { outcome: { const: refused } }
|
|
12181
|
+
required: [code, outs, message]
|
|
12182
|
+
propertyNames: { enum: [scope, applied, outcome, code, detail, outs, message] }
|
|
12183
|
+
- properties: { outcome: { const: failed } }
|
|
12184
|
+
required: [error]
|
|
12185
|
+
propertyNames: { enum: [scope, applied, outcome, error] }
|
|
12186
|
+
SessionMemorySyncReport:
|
|
12187
|
+
type: object
|
|
12188
|
+
description: >
|
|
12189
|
+
server >= 7.142.0 — the 200 body of `POST /v1/sessions/{sessionId}/memory/sync` (the engine's `MemorySyncRoundReport`, passed through). Two round arms, told
|
|
12190
|
+
apart by `refused` being present: `layers` (one outcome per layer; a scope of the read set with no layer was not synced) or `refused` (the whole round, zero
|
|
12191
|
+
requests: `config.memory_sync_target_mismatch` / `session_active`). Common keys: `target` (as given), `sourceRevision` (the session revision the sync ran
|
|
12192
|
+
against — the leaf of the session head; align a fork on it) and `scopes` (the session's read set, in its order).
|
|
12193
|
+
additionalProperties: false
|
|
12194
|
+
required: [target, sourceRevision, scopes]
|
|
12195
|
+
properties:
|
|
12196
|
+
target: { type: string }
|
|
12197
|
+
sourceRevision: { type: string }
|
|
12198
|
+
scopes: { type: array, items: { type: string } }
|
|
12199
|
+
layers: { type: array, items: { $ref: '#/components/schemas/MemorySyncLayerReport' } }
|
|
12200
|
+
refused:
|
|
12201
|
+
type: object
|
|
12202
|
+
additionalProperties: false
|
|
12203
|
+
required: [code, message]
|
|
12204
|
+
properties:
|
|
12205
|
+
code: { type: string, enum: [config.memory_sync_target_mismatch, session_active] }
|
|
12206
|
+
message: { type: string }
|
|
12207
|
+
oneOf:
|
|
12208
|
+
- required: [layers]
|
|
12209
|
+
- required: [refused]
|
|
12210
|
+
SessionMemoryUnobservedReason:
|
|
12211
|
+
type: string
|
|
12212
|
+
enum: [no_settled_run, run_result_missing, run_result_unobserved, memory_not_mounted, no_leaf]
|
|
12213
|
+
description: >
|
|
12214
|
+
server >= 7.143.0 — why the session memory sync has no read set, judged in this order: `no_settled_run` (no settled run); `run_result_missing` /
|
|
12215
|
+
`run_result_unobserved` (the latest settled run has no memory observation on record — an earlier run is never read in its place);
|
|
12216
|
+
`memory_not_mounted` (memory was configured for the latest settled run but did not mount, so which layers it reads is unknown); `no_leaf`
|
|
12217
|
+
(the session has no transcript yet, so there is no revision to sync from).
|
|
12218
|
+
|
|
12219
|
+
SessionMemoryUnobservedExtra:
|
|
12220
|
+
type: object
|
|
12221
|
+
description: 'server >= 7.143.0 — the machine-readable keys of 409 `conflict.session_memory_unobserved`.'
|
|
12222
|
+
required: [reason]
|
|
12223
|
+
properties:
|
|
12224
|
+
reason: { $ref: '#/components/schemas/SessionMemoryUnobservedReason' }
|
|
12225
|
+
activeTaskId: { type: string, description: 'Present when a run is in flight in the session.' }
|
|
11904
12226
|
|
|
11905
12227
|
SessionMemoryEraseRequest:
|
|
11906
12228
|
type: object
|
|
11907
12229
|
description: >
|
|
11908
12230
|
Request body of POST /v1/sessions/{sessionId}/memory/erase (contract §12.5; release bytes server 7.107.0
|
|
11909
|
-
`dist/http/routes/sessions.js:508-523
|
|
11910
|
-
carrying it is a loud 400 `request.body_shape`). Any OTHER unknown key is NOT refused — the route silently ignores it and
|
|
12231
|
+
`dist/http/routes/sessions.js:508-523`). Two NAMED keys. `select` is FORBIDDEN (the selector is minted by the path; a body
|
|
12232
|
+
carrying it is a loud 400 `request.body_shape`); so is `scope` from server 7.143.0 (the 7.140.0–7.142.x layer seat, retired — erasure answers the whole deployment). Any OTHER unknown key is NOT refused — the route silently ignores it and
|
|
11911
12233
|
forwards only `requestId` / `allowUnevidenced` (`:526`) — so this schema is open except for `select` (codex r1 F1: a closed
|
|
11912
12234
|
schema would make a strict consumer reject a body the server accepts). `requestId` has the SAME meaning as
|
|
11913
12235
|
`MemoryErasureRequest.requestId` (idempotency identity on the journal lane; a new request on the degraded lane) and is never
|
|
11914
12236
|
minted by the server or the engine.
|
|
11915
12237
|
required: [requestId]
|
|
11916
12238
|
additionalProperties: true
|
|
11917
|
-
not: { required: [select] }
|
|
12239
|
+
not: { anyOf: [{ required: [select] }, { required: [scope] }] }
|
|
11918
12240
|
properties:
|
|
11919
12241
|
requestId: { type: string, minLength: 1 }
|
|
11920
12242
|
allowUnevidenced:
|
|
11921
12243
|
type: boolean
|
|
11922
12244
|
description: "Opt-in to the evidence-capability-ABSENT degradation lane — a human signature; never injected. Non-boolean ⇒ 400 `request.field_invalid`."
|
|
11923
|
-
scope:
|
|
11924
|
-
# the one definition of the layer seat key: `components.schemas.MemoryLayerSeat`. On THIS face (server >= 7.140.0): a layer living in the deployment's store
|
|
11925
|
-
# (e.g. `local`) ⇒ the erasure runs there (200; the attestation covers that store only, the seat reaches neither the engine nor the attestation); a layer on the
|
|
11926
|
-
# personal mount ⇒ 409 `memory.erasure_store_unjudged`; unreadable ⇒ 400 `request.memory_layer`.
|
|
11927
|
-
$ref: '#/components/schemas/MemoryLayerSeat/properties/scope'
|
|
11928
12245
|
|
|
11929
12246
|
MemoryErasedBinding:
|
|
11930
12247
|
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)."
|
|
@@ -12342,6 +12659,7 @@ components:
|
|
|
12342
12659
|
catalog: { type: string, description: '`absent` | `adopted` | `refused` (open on read).' }
|
|
12343
12660
|
refusalCode: { type: string, description: '`config.model_route_endpoint_missing` | `config.gateway_fallback_without_primary` (open on read); ABSENT = the judge passed.' }
|
|
12344
12661
|
gap: { type: string, description: '`endpoint_missing` | `lane_credential_missing` (open on read); ABSENT = the judge passed.' }
|
|
12662
|
+
planeRefusalCode: { type: string, description: 'server >= 7.143.0: the code the model-plane group judge refused the LATEST ARRIVED catalog candidate with (present <=> that candidate was refused there; one of the settings-schema `MODEL_PLANE_REFUSAL_CODES`, open on read). `catalog: "refused"` with this key absent <=> the latest candidate was refused whole by the candidate judge (read `candidateRejected`). It names the latest candidate, `refusalCode` the table serving now.' }
|
|
12345
12663
|
ModelsResponse:
|
|
12346
12664
|
type: object
|
|
12347
12665
|
description: >
|
|
@@ -13721,7 +14039,14 @@ components:
|
|
|
13721
14039
|
properties:
|
|
13722
14040
|
pending:
|
|
13723
14041
|
type: array
|
|
13724
|
-
|
|
14042
|
+
description: >
|
|
14043
|
+
server >= 7.143.0: TWO families, every row names its own in `kind` — `checkpoint` (PendingCheckpoint; door id = `sessionId`)
|
|
14044
|
+
and `peer_inbound` (PeerInboundPendingRow; door id = `id`). Branch on `kind` before reading family keys; skip an unknown `kind`.
|
|
14045
|
+
Servers <= 7.142.x list checkpoint rows only, without `kind`.
|
|
14046
|
+
items:
|
|
14047
|
+
oneOf:
|
|
14048
|
+
- { $ref: '#/components/schemas/PendingCheckpoint' }
|
|
14049
|
+
- { $ref: '#/components/schemas/PeerInboundPendingRow' }
|
|
13725
14050
|
serverNowMs:
|
|
13726
14051
|
type: integer
|
|
13727
14052
|
description: >
|
|
@@ -13739,6 +14064,46 @@ components:
|
|
|
13739
14064
|
decide route, no run revival). Present iff the local-lane ask audit store is wired; `[]` = the face exists and nothing was converged;
|
|
13740
14065
|
absent = no such face on this deployment (or an older server).
|
|
13741
14066
|
|
|
14067
|
+
PeerInboundPendingRow:
|
|
14068
|
+
type: object
|
|
14069
|
+
description: >
|
|
14070
|
+
server >= 7.143.0 — a held cross-session message awaiting the RECIPIENT's review (`GET /v1/approvals` `pending[]` and the
|
|
14071
|
+
`/v1/approvals/stream` `pending` frame; server `PeerInboundPendingRow`, key-for-key). Held because the sender's permission mode
|
|
14072
|
+
does not match the recipient's. Decided at `POST /v1/approvals/{id}/decide` with `{ decision }`. A per-replica in-process
|
|
14073
|
+
projection (like `livePending`). Deliberately carries NO `sessionId` (in this array that name is the checkpoint door id).
|
|
14074
|
+
additionalProperties: false
|
|
14075
|
+
required: [kind, id, recipientSessionId, lane, cause, content, sentAt, heldAt]
|
|
14076
|
+
properties:
|
|
14077
|
+
kind: { const: peer_inbound }
|
|
14078
|
+
id: { type: string, description: 'The door id (opaque, `peer_inbound:` prefix) — pass back verbatim, never parse.' }
|
|
14079
|
+
recipientSessionId: { type: string }
|
|
14080
|
+
lane: { type: string, enum: [session, principal_inbox] }
|
|
14081
|
+
cause: { type: string, enum: [mode-mismatch, no-mode-asserted, invalid-mode-attestation] }
|
|
14082
|
+
content: { type: string }
|
|
14083
|
+
sentAt: { type: number, description: 'epoch ms.' }
|
|
14084
|
+
heldAt: { type: number, description: 'epoch ms.' }
|
|
14085
|
+
fromSession: { type: string }
|
|
14086
|
+
fromName: { type: string }
|
|
14087
|
+
fromScope: { type: string }
|
|
14088
|
+
|
|
14089
|
+
PeerInboundDecision:
|
|
14090
|
+
type: object
|
|
14091
|
+
description: 'server >= 7.143.0 — the `peer_inbound` family decide body: exactly `{ decision }` (any other key ⇒ 400 naming it).'
|
|
14092
|
+
additionalProperties: false
|
|
14093
|
+
required: [decision]
|
|
14094
|
+
properties:
|
|
14095
|
+
decision: { type: string, enum: [approve, deny] }
|
|
14096
|
+
|
|
14097
|
+
PeerInboundDecideResult:
|
|
14098
|
+
type: object
|
|
14099
|
+
description: 'server >= 7.143.0 — 200 body of a `peer_inbound` decide (server `PeerInboundDecideReply`): `outcome` = the engine''s settle answer (`gone` never reaches the wire, it answers 404).'
|
|
14100
|
+
additionalProperties: false
|
|
14101
|
+
required: [kind, id, outcome]
|
|
14102
|
+
properties:
|
|
14103
|
+
kind: { const: peer_inbound }
|
|
14104
|
+
id: { type: string }
|
|
14105
|
+
outcome: { type: string, enum: [delivered, released_pending, dropped, dropped_by_policy, denied, expired, decided_elsewhere] }
|
|
14106
|
+
|
|
13742
14107
|
CrashConvergedRow:
|
|
13743
14108
|
type: object
|
|
13744
14109
|
description: >
|
|
@@ -13819,6 +14184,9 @@ components:
|
|
|
13819
14184
|
approvalCard:
|
|
13820
14185
|
allOf: [{ $ref: '#/components/schemas/ToolApprovalCardWord' }]
|
|
13821
14186
|
description: 'server >= 7.126.0 (core 7.49.0 #1414): which card this ask renders on — the engine-minted card word, the SAME value as `frame.approvalCard` (the row reads the frame''s own seat, no second read), same layer and shape as the operator queue row''s `approvalCard`. It REPLACES `contentKind` (server <= 7.125.x derived it from the tool name; deleted at 7.126.0, no alias). ABSENT = the engine minted none. Display / triage only; it NEVER takes part in decision routing.'
|
|
14187
|
+
liveFactsUnknown:
|
|
14188
|
+
const: true
|
|
14189
|
+
description: 'server >= 7.143.0 — a row ADOPTED at boot from the ask ledger (see `consumerState`) whose ask was minted before this version: top-level `mandated` / `mandate` / `origin` are absent and this key says "unknown". The same fact as `frame.liveFactsUnknown`.'
|
|
13822
14190
|
frame:
|
|
13823
14191
|
oneOf:
|
|
13824
14192
|
- $ref: '#/components/schemas/ToolApprovalFrame'
|
|
@@ -14108,6 +14476,7 @@ components:
|
|
|
14108
14476
|
required: [sessionId, scope, createdAt]
|
|
14109
14477
|
additionalProperties: true
|
|
14110
14478
|
properties:
|
|
14479
|
+
kind: { const: checkpoint, description: 'server >= 7.143.0: the row family (always `checkpoint` on this schema); absent on servers <= 7.142.x, which list this family only.' }
|
|
14111
14480
|
checkpointId: { type: string, minLength: 1, maxLength: 128, description: 'server >= 7.133.0: the NON-SECRET stable identity of the pause this row parks on — the join key where the token cannot go; the SAME value as `PausedCause.checkpointId`. Carried on three durable read surfaces (GET /v1/approvals `pending[]` rows, the /v1/approvals/stream `pending` frame, GET /v1/assistant/inbox rows). A row whose value is unreadable or untrusted (non-string / empty / over 128 / contains the token / an old row / an older server) is STILL LISTED with the key ABSENT — read absence as "this row has no joinable identity", never as a required key.' }
|
|
14112
14481
|
sessionId: { type: string, description: 'The decide handle: POST /v1/approvals/:sessionId/decide.' }
|
|
14113
14482
|
scope: { type: string, description: 'Principal; "_" = submitted without one.' }
|
|
@@ -14243,6 +14612,10 @@ components:
|
|
|
14243
14612
|
minItems: 1
|
|
14244
14613
|
items: { $ref: '#/components/schemas/AskClass' }
|
|
14245
14614
|
description: 'server >= 7.109.0 (S-934 ②): every class this parked ask belongs to (non-empty, first member = `askClass`); read the whole set.'
|
|
14615
|
+
askReasons:
|
|
14616
|
+
type: array
|
|
14617
|
+
items: { $ref: '#/components/schemas/AskReason' }
|
|
14618
|
+
description: 'server >= 7.143.0 (core 7.61.0): WHO asked and WHY — the park-row twin seat, read through the same narrow read as the live frame and the card (same value). Absent = an older engine / row.'
|
|
14246
14619
|
hasBidiControls:
|
|
14247
14620
|
type: boolean
|
|
14248
14621
|
enum: [true]
|
|
@@ -14286,7 +14659,8 @@ components:
|
|
|
14286
14659
|
(they carry a RiskDescriptor); ABSENT for resource_limit/needs_review/plan_review — UI tolerates undefined.
|
|
14287
14660
|
spentMicroUsd: { type: number, description: 'cumulative spend on the suspend chain (when a resource ledger is attached).' }
|
|
14288
14661
|
deadline: { type: integer, description: 'awaiting-human SLA deadline (epoch ms).' }
|
|
14289
|
-
|
|
14662
|
+
sourceSessionId: { type: string, description: 'server >= 7.143.0 (core 7.61.0 rename of `sourceTaskId`, same value, no alias): the SESSION id of the leg that raised this ask — it names a session, not a task.' }
|
|
14663
|
+
agentId: { type: string, description: 'server >= 7.143.0: the agent id of the parked leg when it is a delegated child (a background child''s registry row id, otherwise its session id); absent on the host''s own row.' }
|
|
14290
14664
|
principal: { type: string, description: 'The submitting principal, when the deployment records one.' }
|
|
14291
14665
|
createdAt: { type: integer, description: 'Creation time, epoch ms (NOTE — SessionRecord.createdAt is an ISO string).' }
|
|
14292
14666
|
preview:
|
|
@@ -14645,6 +15019,11 @@ components:
|
|
|
14645
15019
|
versions are 401 in both directions.
|
|
14646
15020
|
⚠️ The key name is final: `permissionModeAfter` (the build brief once said `nextPermissionMode`,
|
|
14647
15021
|
which never shipped — zero aliases).
|
|
15022
|
+
decidedVia:
|
|
15023
|
+
allOf: [{ $ref: '#/components/schemas/ApprovalDecidedVia' }]
|
|
15024
|
+
description: 'server >= 7.143.0 (capability `approvalDecidedVia`): see ApprovalDecision.decidedVia.'
|
|
15025
|
+
mcpServers: { $ref: '#/components/schemas/ResumeRestatement/properties/mcpServers' }
|
|
15026
|
+
a2aPeers: { $ref: '#/components/schemas/ResumeRestatement/properties/a2aPeers' }
|
|
14648
15027
|
|
|
14649
15028
|
SessionAgent:
|
|
14650
15029
|
type: object
|
|
@@ -14827,7 +15206,21 @@ components:
|
|
|
14827
15206
|
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.
|
|
14828
15207
|
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.
|
|
14829
15208
|
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.
|
|
15209
|
+
unreadable: { $ref: '#/components/schemas/SessionUnreadable' }
|
|
14830
15210
|
|
|
15211
|
+
SessionUnreadable:
|
|
15212
|
+
type: object
|
|
15213
|
+
additionalProperties: false
|
|
15214
|
+
required: [errorCode]
|
|
15215
|
+
description: >
|
|
15216
|
+
server >= 7.142.0 (additive; contract section 17.2 corrected) — THIS SESSION'S ARCHIVE CANNOT BE READ. Present-iff the leaf of the session head
|
|
15217
|
+
cannot be read; the key set is closed (the server's self-minted `sessionsListRowUnreadableKey`). Only on the file backend (`DB_BACKEND=local`):
|
|
15218
|
+
a broken / truncated session head => `corrupt_session`; an I/O-level failure (permissions, disk) => `internal.error` — the code the read faces answer
|
|
15219
|
+
for that session (`GET /v1/sessions/{sessionId}` and `.../head` answer 500 with it). Before 7.142.0 such sessions vanished from the list. The rest of
|
|
15220
|
+
the row reads like a good row, with `objectivePreview: null` (a `?q=` search does not hit it). Branch on presence (grey out / say unreadable / offer delete
|
|
15221
|
+
only); `DELETE /v1/sessions/{sessionId}` deletes it for its owner as usual. SQL backends never carry it.
|
|
15222
|
+
properties:
|
|
15223
|
+
errorCode: { type: string, description: '`corrupt_session` or `internal.error` — the code the read faces answer for this session. Branch on the code.' }
|
|
14831
15224
|
SessionPatchBody:
|
|
14832
15225
|
type: object
|
|
14833
15226
|
description: >
|
|
@@ -17325,6 +17718,9 @@ components:
|
|
|
17325
17718
|
summaryMs: { type: integer }
|
|
17326
17719
|
persistMs: { type: integer }
|
|
17327
17720
|
ptlRetries: { type: integer }
|
|
17721
|
+
requestedBy:
|
|
17722
|
+
allOf: [{ $ref: '#/components/schemas/ExtensionRequester' }]
|
|
17723
|
+
description: 'server >= 7.143.0 (core 7.61.0): this compaction was requested by an extension registration through `$.session.compact`. Absent = a host / manual request, or an automatic compaction.'
|
|
17328
17724
|
pass:
|
|
17329
17725
|
type: string
|
|
17330
17726
|
description: 'server >= 7.132.0 (core 7.53.0 #2008): the id of the compaction pass that LANDED — the same opaque value its `compaction_started.pass` carried. Pair the start with its end on `pass`, not on "the next `compacted`" (legs interleave on one stream). Absent = an older server / a pass that never announced a start.'
|
|
@@ -18213,9 +18609,16 @@ components:
|
|
|
18213
18609
|
own submit-time image pre-check (ops-log line `images_omitted_no_vision_model` and counter `images_omitted_total`, both retired in 7.137.0: the engine mints the fact at the moment it really replaces the image);
|
|
18214
18610
|
a reasoning knob the model declares off is not reported here (that is `effectiveReasoning.dropped`).
|
|
18215
18611
|
server 7.138.0 adds two codes to the user whitelist (appendix D.3 44 -> 46; both audience `user` in core's register), described here because their `detail` is not self-evident:
|
|
18216
|
-
|
|
18217
|
-
|
|
18218
|
-
|
|
18612
|
+
the image-removal code (core 7.59.0; RENAMED at server 7.143.0 / core 7.61.0 to `context.media_removed`, no alias — the old code no longer appears). `context.media_removed`
|
|
18613
|
+
(server >= 7.143.0) — media (images / documents) left a request the model saw; the session transcript keeps the originals; each block's place reads `[<image|document> N removed: <why>]`.
|
|
18614
|
+
`{ reason, images, documents, sessionId, runId }`: `reason` is `rejected_by_provider` (the provider could not process an image in this turn — the failed turn's `errorKind` is `image_unprocessable` — so the
|
|
18615
|
+
images of the NEWEST message still carrying any were taken out and the turn re-sent; every later request of the session reads the same removal; `documents` is 0; once per run per refusal) or
|
|
18616
|
+
`media_budget` (the request's media went over the block cap / the deployment's base64 budget: the oldest blocks were left out; `images` / `documents` count the blocks this notice is the first to report). No body text.
|
|
18617
|
+
The way out for `rejected_by_provider` is another image format (admission separately refuses png / jpeg / gif / webp images whose header is incomplete, without this code).
|
|
18618
|
+
server 7.143.0 also adds `classifier.seat_rate_limited` (`{ model, to, rung, consecutive, sessionId?, runId? }`: the classifier seat hit the provider's rate limit `consecutive` times in a row, so for the rest
|
|
18619
|
+
of the run every gated call is judged from `to` on — the seat left the ladder; once per run per seat) and `context.tool_schema_removed` (`{ tool, sessionId, runId }`: the provider refused the request because of one
|
|
18620
|
+
tool's input schema and named it — the failed turn's `errorKind` is `tool_schema_refused` — so that tool's parameters are sent as an empty object schema from then on for this transcript (MCP and A2A tools only,
|
|
18621
|
+
at most 8 per transcript; the model can still call the tool); once per refusal). All three audience `user`.
|
|
18219
18622
|
`mcp.authorization_required` (core 7.59.0) — an MCP server the user must authorize before it serves them: the leg's dial failed `unauthorized`, or a request was refused that way and that refusal is its answer (a repeat-safe call refused with 401
|
|
18220
18623
|
and sent once more on a renewed credential announces only if that send is refused too). The leg does not park on it. `{ server, reason, authorizeUrl?, principal?, sessionId, runId }` — `reason` is `rejected` (401) / `scope` (403
|
|
18221
18624
|
`insufficient_scope`) / `none` (the authorization seat holds no authorization for this user), the engine's closed set, echoed by the server (read OPEN); `authorizeUrl` only ever comes from the deployment's authorization seat (this deployment
|
|
@@ -18313,6 +18716,13 @@ components:
|
|
|
18313
18716
|
description: 'Machine-readable facts (per code). Redacted + bounded server-side; open set of keys.'
|
|
18314
18717
|
sessionId: { type: string, description: 'Owning session — this frame only ever appears on that session stream.' }
|
|
18315
18718
|
ts: { type: integer, format: int64, description: 'SERVER observation time (ms epoch), NOT the engine mint time.' }
|
|
18719
|
+
eventId:
|
|
18720
|
+
type: string
|
|
18721
|
+
description: >-
|
|
18722
|
+
server >= 7.142.0 — the identity of THIS delivery (a uuidv7 the server mints when it delivers the notice), the same identity seat as
|
|
18723
|
+
`EventIdentity.eventId` on content events; the live frame also carries an SSE `id:` line with this value. Use it to DEDUP (a reconnect or a
|
|
18724
|
+
switch from the live leg to `GET /v1/runs/{taskId}/events` can bring the same notice again). It is NOT a durable cursor (the events lane reads
|
|
18725
|
+
`Last-Event-ID` as a row `seq`; a uuidv7 does not read as a number, so that lane replays from 0). ABSENT on older servers and on ledger rows written before it.
|
|
18316
18726
|
Event_workspace_changed:
|
|
18317
18727
|
type: object
|
|
18318
18728
|
description: >
|
|
@@ -19009,9 +19419,16 @@ components:
|
|
|
19009
19419
|
type: boolean
|
|
19010
19420
|
enum: [true]
|
|
19011
19421
|
description: 'Present ⇔ the ask comes from a DELEGATED background/nested child — the EXPLICIT discriminator (trusted engine fact).'
|
|
19012
|
-
|
|
19422
|
+
sourceSessionId:
|
|
19013
19423
|
type: string
|
|
19014
|
-
description: '
|
|
19424
|
+
description: 'server >= 7.143.0 (core 7.61.0 BREAKING rename of `sourceTaskId`, same value, no alias): the delegated child''s core SESSION id — row-join value. Read attribution off `fromSubagent`, not off this key''s presence.'
|
|
19425
|
+
agentId:
|
|
19426
|
+
type: string
|
|
19427
|
+
description: 'server >= 7.143.0: the agent id of the leg that raised the ask (a background child''s registry row id `a…`, a foreground child''s session id); a directly started workflow''s agent carries it WITHOUT `fromSubagent`; absent on the host''s own ask.'
|
|
19428
|
+
askReasons:
|
|
19429
|
+
type: array
|
|
19430
|
+
items: { $ref: '#/components/schemas/AskReason' }
|
|
19431
|
+
description: 'server >= 7.143.0 (core 7.61.0): WHO asked and WHY — one entry per asker with its own words. Structured approval UIs render reason lines from this, not from `message`. Words are credential-redacted and length-capped; any malformed entry ⇒ the whole seat is withheld. Absent = an older engine / the engine''s generic question.'
|
|
19015
19432
|
sourceAgentName: { type: string, description: 'Display name of the child agent, redacted. UNTRUSTED.' }
|
|
19016
19433
|
delegation:
|
|
19017
19434
|
type: object
|
|
@@ -19309,6 +19726,9 @@ components:
|
|
|
19309
19726
|
readRootCandidate: { $ref: '#/components/schemas/ToolApprovalFrame/properties/readRootCandidate' }
|
|
19310
19727
|
probeReason: { $ref: '#/components/schemas/ToolApprovalFrame/properties/probeReason' }
|
|
19311
19728
|
requestedBy: { $ref: '#/components/schemas/ToolApprovalFrame/properties/requestedBy' }
|
|
19729
|
+
liveFactsUnknown:
|
|
19730
|
+
const: true
|
|
19731
|
+
description: 'server >= 7.143.0 — ONLY on a disconnect-replay frame: the row was minted before this version (its card envelope has no live-facts seat) or that seat cannot be read, so the top-level live facts are all absent and this key says "unknown" (not "none"). Absent = the live facts on this frame are verbatim (a live frame, or a replay frame whose envelope carries the seat).'
|
|
19312
19732
|
|
|
19313
19733
|
ApprovalCard:
|
|
19314
19734
|
type: object
|
|
@@ -19362,7 +19782,12 @@ components:
|
|
|
19362
19782
|
the ABSENT != "you have no rule" clause and the separation from `governanceForced` are stated verbatim on ToolApprovalFrame.allowRuleShadowed
|
|
19363
19783
|
— the live frame, the stored `card_json`, the replayed frame and the `approval_request` card carry the SAME material.
|
|
19364
19784
|
fromSubagent: { type: boolean, enum: [true], description: 'Present ⇔ the ask comes from a DELEGATED child — the explicit discriminator (a worker cannot forge it).' }
|
|
19365
|
-
|
|
19785
|
+
sourceSessionId: { type: string, description: 'server >= 7.143.0 (rename of `sourceTaskId`, same value, no alias): the child''s core session id — same as ToolApprovalFrame.sourceSessionId.' }
|
|
19786
|
+
agentId: { type: string, description: 'server >= 7.143.0: same as ToolApprovalFrame.agentId.' }
|
|
19787
|
+
askReasons:
|
|
19788
|
+
type: array
|
|
19789
|
+
items: { $ref: '#/components/schemas/AskReason' }
|
|
19790
|
+
description: 'server >= 7.143.0: same value as ToolApprovalFrame.askReasons (one narrow read for frame, card and queue row).'
|
|
19366
19791
|
sourceAgentName: { type: string, description: 'The child agent''s display name, redacted. UNTRUSTED.' }
|
|
19367
19792
|
# A-057.④(#314):三键 server 早已随卡投出(与 tool_approval 帧同一窄读函数 ⇒ 帧与 card 同值),
|
|
19368
19793
|
# 但本 schema 只在帧上公示过 —— 按 spec 生成的卡消费方拿不到。定义与帧上同构段逐字同源,
|
|
@@ -20305,6 +20730,9 @@ components:
|
|
|
20305
20730
|
not move): a `policy` allow on a person-required card ⇒ 400 `request.field_conflict`; outside the closed set ⇒
|
|
20306
20731
|
400 `request.field_invalid`; any value on a direct-door worker ⇒ 400 `decided_by_not_in_proof`. An older server
|
|
20307
20732
|
(no `approvalDecidedBy` bit) has a strict body here ⇒ 400 `request.body_shape`, nothing decided.
|
|
20733
|
+
decidedVia:
|
|
20734
|
+
allOf: [{ $ref: '#/components/schemas/ApprovalDecidedVia' }]
|
|
20735
|
+
description: 'server >= 7.143.0 (capability `approvalDecidedVia`): see ApprovalDecision.decidedVia.'
|
|
20308
20736
|
|
|
20309
20737
|
ApprovalDecideGateKind:
|
|
20310
20738
|
type: string
|
|
@@ -20322,6 +20750,31 @@ components:
|
|
|
20322
20750
|
description: >
|
|
20323
20751
|
server >= 7.126.0 (sdk 21.1.0 `PLAN_REVIEW_GATE_KINDS`) — the parked gate kind the plan-review door
|
|
20324
20752
|
`POST /v1/assistant/tasks/{taskId}/plan_review` accepts (3-state approve | edit | reject).
|
|
20753
|
+
AskReason:
|
|
20754
|
+
description: >
|
|
20755
|
+
server >= 7.143.0 (core 7.61.0) — one asker and its own words. Two arms: a hook / extension question `{ by: "hook", cause, registration?, words? }`
|
|
20756
|
+
(`cause` = engine `HOOK_QUESTION_CAUSES`), or a policy-chain question `{ by, words }` (`by` = the AskOrigin words minus `hook`).
|
|
20757
|
+
oneOf:
|
|
20758
|
+
- type: object
|
|
20759
|
+
additionalProperties: false
|
|
20760
|
+
required: [by, cause]
|
|
20761
|
+
properties:
|
|
20762
|
+
by: { const: hook }
|
|
20763
|
+
cause: { $ref: '#/components/schemas/HookQuestionCause' }
|
|
20764
|
+
registration: { type: string }
|
|
20765
|
+
words: { type: string }
|
|
20766
|
+
- type: object
|
|
20767
|
+
additionalProperties: false
|
|
20768
|
+
required: [by, words]
|
|
20769
|
+
properties:
|
|
20770
|
+
by: { type: string, enum: [content_question, plan_review, ancestor_marked, org_unavailable, org_rule, rule_store_unavailable, ask_rule, denial_limit_fallback, shell_gate_tighten, safety_tighten, policy], description: 'AskOrigin words minus `hook` (the server card schema''s table; an entry outside it withholds the whole seat).' }
|
|
20771
|
+
words: { type: string }
|
|
20772
|
+
|
|
20773
|
+
HookQuestionCause:
|
|
20774
|
+
type: string
|
|
20775
|
+
enum: [asked, verdict_unreadable, verdict_unfinished]
|
|
20776
|
+
description: 'server >= 7.143.0 (engine `HOOK_QUESTION_CAUSES`, verbatim and in order): why a hook / extension question asks — `asked` (it answered "ask"), `verdict_unreadable` (its verdict could not be read), `verdict_unfinished` (it did not finish in time). Only on the hook arm of AskReason.'
|
|
20777
|
+
|
|
20325
20778
|
ApprovalDecidedBy:
|
|
20326
20779
|
type: string
|
|
20327
20780
|
enum: [person, policy]
|
|
@@ -20534,35 +20987,28 @@ components:
|
|
|
20534
20987
|
description: >
|
|
20535
20988
|
The stream's terminal frame. `result` is a DISCRIMINATED UNION of real shapes (契约调和车1 E,
|
|
20536
20989
|
2026-08-02) — do NOT assume the full TaskResult:
|
|
20537
|
-
· `
|
|
20990
|
+
· `SyncSubmitOutcome` — a run's outcome, the same three arms as the synchronous `POST /v1/tasks` 200 body: the engine result (`SyncSubmitResult`,
|
|
20991
|
+
service Drift 4), the flat `LegacyPlaneTaskResult` an older generation left in the durable ledger (a REPLAYED frame on an upgraded deployment
|
|
20992
|
+
can be that shape), or the run receipt `SyncReceiptBody`. A same-key replay (server >= 7.125.0, contract §0.7) is, on server >= 7.142.0, the FIRST
|
|
20993
|
+
ANSWER'S ENVELOPE plus `replay: true` (the engine result when the row holds one, else the receipt); server 7.125.0–7.141.x sent the row's read face
|
|
20994
|
+
plus `replay: true`, which has no `stats` and reads as the receipt arm. The frame carries `replay: true` as well;
|
|
20538
20995
|
· `ActiveRunConflictDoneResult` — the SSE lane's REJECTION terminal: when the session already has an
|
|
20539
20996
|
active run, the submit's 409 is encoded as this done frame (`src/http/routes/tasks.ts`), and it
|
|
20540
20997
|
carries NO `taskId` / `sessionId` / `stats`;
|
|
20541
|
-
· `RunReplayRecord` (server >= 7.125.0, contract §0.7) — the IDEMPOTENT-REPLAY terminal of `POST /v1/tasks/stream`: the submit's key had already built a run row, so
|
|
20542
|
-
`result` is that row's read face plus `replay: true` — NOT an engine result (no top-level `terminal` / `stats`; the outcome is the nested `result`). The frame carries
|
|
20543
|
-
`replay: true` as well. (A same-key duplicate still in flight in the same process is merged instead: the frame has `replay: true` but `result` is the first answer's
|
|
20544
|
-
`TaskResult` verbatim — so the FRAME's `replay` does not tell the shapes apart; `result.replay` does.)
|
|
20545
20998
|
· `SubmitRefusalDoneResult` — a submit refused after the stream was already open, as `{status:"failed", errorCode, errorMessage}` (server >= 7.125.0: `conflict.run_exists` when
|
|
20546
20999
|
the replay is discovered at row-creation time and the caller cannot read that row; also the device-placement refusal). Not an engine result; carries no `taskId` / `stats`.
|
|
20547
|
-
Narrow
|
|
20548
|
-
`
|
|
20549
|
-
(the
|
|
20550
|
-
the
|
|
20551
|
-
🔴 server >= 7.64.0 — the two arms are now told apart by their KEYS, not by a shared word: the normal
|
|
20552
|
-
terminal carries `terminal` (the tagged cause) and NO `status`; the conflict shape carries the flat
|
|
20553
|
-
`status: "failed"` + `errorCode` because it is the SERVICE's own rejection envelope, not an engine
|
|
20554
|
-
result, and it did not change. `status` therefore appears on exactly one arm — but keep narrowing on
|
|
20555
|
-
`stats` / `errorCode`, which are the discriminants the service pins.
|
|
21000
|
+
Narrow on KEYS: `stats` present ⇒ an engine result (then `terminal` present ⇒ the current cause form, absent ⇒ `LegacyPlaneTaskResult`);
|
|
21001
|
+
else `activeTaskId` present ⇒ the session-occupied refusal; else `taskId` present ⇒ the run receipt; else the refusal triple.
|
|
21002
|
+
🔴 server >= 7.64.0 — the normal terminal carries `terminal` (the tagged cause) and `status` only as a park word; the refusal shapes carry the flat
|
|
21003
|
+
`status: "failed"` + `errorCode` because they are the SERVICE's own rejection envelopes, not engine results. Branch on `errorCode`, never on the sentence.
|
|
20556
21004
|
additionalProperties: false # 封闭:帧本身只有 {type,result,replay?};`result` 内部按臂各自裁定(TaskResult 开集,冲突形封闭)
|
|
20557
21005
|
required: [type, result]
|
|
20558
21006
|
properties:
|
|
20559
21007
|
type: { const: done }
|
|
20560
21008
|
result:
|
|
20561
21009
|
oneOf:
|
|
20562
|
-
- $ref: '#/components/schemas/
|
|
21010
|
+
- $ref: '#/components/schemas/SyncSubmitOutcome'
|
|
20563
21011
|
- $ref: '#/components/schemas/ActiveRunConflictDoneResult'
|
|
20564
|
-
- $ref: '#/components/schemas/LegacyPlaneTaskResult'
|
|
20565
|
-
- $ref: '#/components/schemas/RunReplayRecord'
|
|
20566
21012
|
- $ref: '#/components/schemas/SubmitRefusalDoneResult'
|
|
20567
21013
|
replay:
|
|
20568
21014
|
type: boolean
|
|
@@ -20571,8 +21017,8 @@ components:
|
|
|
20571
21017
|
marks the IDEMPOTENT-REPLAY leg: this terminal was NOT produced by a live run of your submit. Either
|
|
20572
21018
|
your call was deduplicated into a concurrent identical submit still in flight in the same process (then `result` is the original
|
|
20573
21019
|
run's terminal, verbatim, and you received no live events at all), or — server >= 7.125.0 — the `Idempotency-Key` had already built a run
|
|
20574
|
-
row and `result` is
|
|
20575
|
-
|
|
21020
|
+
row and `result` is the first answer's envelope plus `replay: true` (server >= 7.142.0; 7.125.0–7.141.x sent the row's read face). Read
|
|
21021
|
+
`result` by its keys (`stats` ⇒ engine result, else the receipt); neither flag names the shape. ABSENT on every live leg (never `false`) — a UI can use it to say "replayed"
|
|
20576
21022
|
instead of implying the work just ran twice.
|
|
20577
21023
|
|
|
20578
21024
|
ActiveRunConflictDoneResult:
|
|
@@ -20735,6 +21181,9 @@ components:
|
|
|
20735
21181
|
so only on `failed` / `mooted` (a pass that ran its summary and did not land, or was cut while it ran — `mooted` with `reason: "task_ending"` = the task's
|
|
20736
21182
|
own end cut the running summary, a form this frame closes since core 7.53.0). `blocked` / `suppressed` / `disabled` / `noop` and a manual request no
|
|
20737
21183
|
boundary served carry none (those passes never started).
|
|
21184
|
+
requestedBy:
|
|
21185
|
+
allOf: [{ $ref: '#/components/schemas/ExtensionRequester' }]
|
|
21186
|
+
description: 'server >= 7.143.0 (core 7.61.0): the compaction was requested by an extension registration through `$.session.compact` (carried here when that requested pass did not land; same as `compacted.requestedBy`).'
|
|
20738
21187
|
eventId: { type: string }
|
|
20739
21188
|
parentToolCallId: { type: string }
|
|
20740
21189
|
Event_compaction_started:
|
|
@@ -21145,7 +21594,13 @@ components:
|
|
|
21145
21594
|
type:
|
|
21146
21595
|
type: string
|
|
21147
21596
|
description: 'Open on read. Known values: pending / resolved / synced / heartbeat / meta / error.'
|
|
21148
|
-
|
|
21597
|
+
kind: { type: string, enum: [checkpoint, peer_inbound], description: 'server >= 7.143.0, `pending` / `resolved` frames: the row family. A `pending` frame spreads that family''s row (PendingCheckpoint or PeerInboundPendingRow); a `resolved` frame carries `sessionId` + `toolCallId` (checkpoint) or `id` (peer_inbound). Branch on it before settling a card; absent on servers <= 7.142.x.' }
|
|
21598
|
+
id: { type: string, description: 'server >= 7.143.0, `peer_inbound` `pending` / `resolved` frames: the door id (PeerInboundPendingRow.id).' }
|
|
21599
|
+
askReasons:
|
|
21600
|
+
type: array
|
|
21601
|
+
items: { $ref: '#/components/schemas/AskReason' }
|
|
21602
|
+
description: '`pending` frames only (server >= 7.143.0) — see PendingCheckpoint.askReasons.'
|
|
21603
|
+
sessionId: { type: string, description: '`resolved` frames (checkpoint family): which pending settled.' }
|
|
21149
21604
|
toolCallId: { type: string, description: '`resolved` frames: the settled pending''s bound tool-call id (absent when the pending carried none).' }
|
|
21150
21605
|
count: { type: integer, description: '`synced` frames: how many pendings the connect-time snapshot carried.' }
|
|
21151
21606
|
checkpointId: { type: string, description: '`pending` frames only (server >= 7.133.0): the spread PendingCheckpoint row''s `checkpointId` (key absent when the row has no trusted value — read as "no joinable identity").' }
|
|
@@ -21350,7 +21805,7 @@ components:
|
|
|
21350
21805
|
reason:
|
|
21351
21806
|
# 🔴 NO `enum` — same open-on-read ruling as kind 1 (SDK type is `... | (string & {})`).
|
|
21352
21807
|
type: string
|
|
21353
|
-
description: 'Machine-branchable failure shape. CLOSED server-side, OPEN ON READ — KNOWN WORDS TODAY: exit_nonzero | timeout | spawn_failed | bad_json | matcher_over_budget (server >= 7.133.0: the group matcher / the entry `if` name part did not finish evaluating within its 1000 ms budget on this name — NOT a broken hook script but an unevaluable selection condition; the server treats it as selected, the entry still runs; ONE frame per group, `if` one per entry, no exitCode / stderr).'
|
|
21808
|
+
description: 'Machine-branchable failure shape. CLOSED server-side, OPEN ON READ — KNOWN WORDS TODAY: exit_nonzero | timeout | spawn_failed | bad_json | matcher_over_budget (server >= 7.133.0: the group matcher / the entry `if` name part did not finish evaluating within its 1000 ms budget on this name — NOT a broken hook script but an unevaluable selection condition; the server treats it as selected, the entry still runs; ONE frame per group, `if` one per entry, no exitCode / stderr) | url_not_allowed (server >= 7.142.0: NOT a broken endpoint — the http entry was withheld by the request''s `settings.allowedHttpHookUrls` and sent zero bytes; `detail` names `settings.hooks.<event>`, the list and the judge''s rule word url / empty / malformed).'
|
|
21354
21809
|
hookName: { type: string, description: 'Hook identity (statusMessage, else command/URL/prompt; redacted + bounded, http entries stripped of query/fragment). Always sent.' }
|
|
21355
21810
|
entryType: { type: string, description: 'command | http | prompt | agent — without it, hookName''s nature is a guess. Closed server-side, open on read. Always sent.' }
|
|
21356
21811
|
exitCode: { type: integer, description: 'Absent for timeout/spawn_failed (no exit code exists — the server never mints a legit-looking 0).' }
|
|
@@ -21374,8 +21829,9 @@ components:
|
|
|
21374
21829
|
# NO `enum` — same open-on-read ruling as kinds 1 and 2.
|
|
21375
21830
|
type: string
|
|
21376
21831
|
description: >-
|
|
21377
|
-
Why it did not complete. CLOSED on the server (
|
|
21378
|
-
spawn_failed | timeout | exit_nonzero | bad_json | decision_out_of_set | evidence_unavailable | rewrite_unsettled
|
|
21832
|
+
Why it did not complete. CLOSED on the server (fourteen words), OPEN ON READ — KNOWN WORDS TODAY: matcher_invalid | llm_carrier_unavailable | llm_cap | powershell_unsupported | if_unevaluable | budget_exhausted |
|
|
21833
|
+
spawn_failed | timeout | exit_nonzero | bad_json | decision_out_of_set | evidence_unavailable | rewrite_unsettled | url_not_allowed (server >= 7.142.0: a managed http entry withheld by
|
|
21834
|
+
`settings.allowedHttpHookUrls` — fail-closed). `input_truncated` / `matcher_over_budget` are NOT in this kind (they belong to kind 4).
|
|
21379
21835
|
source: { type: string, description: 'The group''s source word (`managedPolicy` or `managedPlugin:<name>`; the name is trace only, never a criterion).' }
|
|
21380
21836
|
hookName: { type: string, description: 'Hook identity (same rule as kind 2); redacted + bounded.' }
|
|
21381
21837
|
entryType: { type: string, description: 'command | http | prompt | agent — closed server-side, open on read.' }
|
|
@@ -22629,8 +23085,8 @@ components:
|
|
|
22629
23085
|
`http` / `stream_torn` / `refusal` / `length_empty`). ABSENT on success and on older servers.
|
|
22630
23086
|
errorKind:
|
|
22631
23087
|
type: string
|
|
22632
|
-
enum: [input_too_long, degenerate, length_empty, image_unprocessable]
|
|
22633
|
-
description: 'server >= 7.135.0 (failure only): the STRUCTURAL failure kind the reply carried, forwarded as is — `input_too_long` (the provider refused the request as over its window), `degenerate`, `length_empty`; server >= 7.138.0 (engine 7.59.0) also `image_unprocessable` (the provider could not process an image in the request). Absent when the reply carried none. Closed (the engine''s
|
|
23088
|
+
enum: [input_too_long, degenerate, length_empty, image_unprocessable, tool_schema_refused]
|
|
23089
|
+
description: 'server >= 7.135.0 (failure only): the STRUCTURAL failure kind the reply carried, forwarded as is — `input_too_long` (the provider refused the request as over its window), `degenerate`, `length_empty`; server >= 7.138.0 (engine 7.59.0) also `image_unprocessable` (the provider could not process an image in the request); server >= 7.143.0 (engine 7.61.0) also `tool_schema_refused` (the provider refused the request over one tool''s input schema — the side query does not carry the tool name; read `errorMessage` for display). Absent when the reply carried none. Closed (the engine''s five words): adding a word is an output-type widening.'
|
|
22634
23090
|
account:
|
|
22635
23091
|
allOf: [{ $ref: '#/components/schemas/SideQueryAccountRow' }]
|
|
22636
23092
|
description: 'server >= 7.138.0 (engine 7.59.0; always present on newer servers, absent on older ones): this side query''s line in the session''s account — see `SideQueryAccountRow`. This server mints no session total.'
|
|
@@ -23378,21 +23834,31 @@ components:
|
|
|
23378
23834
|
cloud deployment has no access to the user's filesystem — that is the deployment shape, not a bypass:
|
|
23379
23835
|
what is read is still only the allow bucket.
|
|
23380
23836
|
|
|
23381
|
-
🔴
|
|
23382
|
-
`
|
|
23383
|
-
|
|
23384
|
-
|
|
23837
|
+
🔴 TWO ARMS BY `layer` (server >= 7.143.0 / engine 7.61.0, BREAKING, no alias): a `userSettings` layer is `{ layer, path, content }` and carries
|
|
23838
|
+
NO `root` (a body sending one ⇒ 400 `request.body_shape`; its `/`-rooted path rules stay in the settings file, reported as
|
|
23839
|
+
`unsupported.layer_root:` candidates); a `projectSettings` / `localSettings` layer is `{ layer, path, root, content }`.
|
|
23840
|
+
`root` follows the RuleScope rule (server >= 7.120.0: a complete absolute path; otherwise 400 `request.body_shape` and no ticket minted — the `error` is
|
|
23841
|
+
"layers[<i>].root must be an absolute path" on server >= 7.121.0, naming the first refused layer).
|
|
23385
23842
|
Its TRUTHFULNESS is deliberately NOT validated: the server has no such tree to check against, and pretending
|
|
23386
23843
|
to validate would be a lie. It is the user's own label for "which cwds should this rule be live under".
|
|
23387
23844
|
# 封闭:server 侧 zod 是 `.strict()`(把 `content` 拼成 `contents` 的客户端应当场 400,而不是拿到
|
|
23388
23845
|
# 一份「零候选」的预览去纳闷)。
|
|
23389
|
-
|
|
23390
|
-
|
|
23391
|
-
|
|
23392
|
-
|
|
23393
|
-
|
|
23394
|
-
|
|
23395
|
-
|
|
23846
|
+
oneOf:
|
|
23847
|
+
- type: object
|
|
23848
|
+
additionalProperties: false
|
|
23849
|
+
required: [layer, path, content]
|
|
23850
|
+
properties:
|
|
23851
|
+
layer: { const: userSettings }
|
|
23852
|
+
path: { type: string, minLength: 1, maxLength: 1024 }
|
|
23853
|
+
content: { type: string, maxLength: 16384, description: 'The layer file''s raw JSON text (16 KiB cap — a settings file is hand-written, not a dataset; the cap keeps this from becoming an upload channel).' }
|
|
23854
|
+
- type: object
|
|
23855
|
+
additionalProperties: false
|
|
23856
|
+
required: [layer, path, root, content]
|
|
23857
|
+
properties:
|
|
23858
|
+
layer: { type: string, enum: [projectSettings, localSettings] }
|
|
23859
|
+
path: { type: string, minLength: 1, maxLength: 1024 }
|
|
23860
|
+
root: { type: string, minLength: 1, maxLength: 1024 }
|
|
23861
|
+
content: { type: string, maxLength: 16384 }
|
|
23396
23862
|
|
|
23397
23863
|
CcImportPreview:
|
|
23398
23864
|
type: object
|