{"openapi":"3.1.0","info":{"title":"Assure","version":"0.1.0","description":"The system of record for validation cases, approvals, runs, reports, defects and release gates. A session does the work; Assure holds the record and refuses what should not happen. Assure reads no repositories, writes no cases and executes no tests.\n\nConventions that hold everywhere:\n\n- Everything is under `/v1/orgs/{orgId}`. The organisation in the path must match the `orgId` claim in the bearer token; a mismatch is 403, not 404, because the caller does have an organisation — just not that one.\n- Access is scoped to the organisation, not to the application. An application one engineer created is not private to them: testing is a shared record, and an application only one person can see is a record nobody can check.\n- A token carrying an RFC 8693 `act` claim is delegated. Nothing is withheld from it — the rule reserving approval, retirement, security authorisation and release signing for a person was removed (D4). What still applies is scope: a route whose scope the token does not carry answers 403 `scope-not-granted`. The `act` claim survives because the audit trail uses it to say a tool acted, while the approval itself names the person.\n- Errors are the Cortena envelope: `{ ok: false, status, code, message, details? }`. `code` is stable and safe to branch on and carries the same identifiers the RFC 9457 `type` slugs did — `not-found`, `case-refused`, `scope-not-granted`. A validation failure is a 400 whose `message` is `field: reason` and whose `details.fieldErrors` carries the rest.\n- There is no ingestion endpoint, no webhook receiver and no schedule resource, and Assure executes nothing and holds no queue (D1, D11). The one runner-facing route is `automation/trigger`: it asks a runner this deployment is configured with to execute a suite, and returns at once (D11a). The runner records its results through this same API."},"servers":[{"url":"https://test.assure.ascendenceai.com"}],"x-cortena":{"id":"assure","icon":"shield-check","mcpUrl":"https://test.assure.ascendenceai.com/mcp","mcpApps":{"exempt":[{"route":"/health","reason":"a liveness probe is not a screen"},{"route":"/v1/orgs/{orgId}/audit","reason":"an append-only log is read and quoted, not drawn — and the rows an agent needs are the three it filtered to, not a grid"},{"route":"/v1/orgs/{orgId}/runs/{runId}/report","reason":"a report is prose the chat host already renders; drawing it would be a second, worse copy of the same words"},{"route":"/v1/orgs/{orgId}/access-grants","reason":"nothing about a bearer token belongs on a chat surface, drawn or otherwise"},{"route":"/v1/orgs/{orgId}/applications/{applicationId}/cases","reason":"the SPA’s own grid contract, and a hundred-row table is not a chat-sized surface; an agent quotes the cases it is talking about"}]}},"security":[{"cortenaAuth":[]}],"paths":{"/health":{"get":{"operationId":"assure_health_get","summary":"Liveness and readiness probe.","x-cortena-access":"read","x-cortena-when-to-use":"Use from a readiness or liveness probe, or to check that the API — rather than the SPA — is answering.","x-cortena-examples":[{"name":"alive","summary":"The API is answering","request":{},"response":{"ok":true,"service":"assure","delegationEnforced":false}}],"responses":{"200":{"description":"Liveness and readiness probe.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true,"description":"The API is answering."},"service":{"const":"assure","description":"Which service answered."},"delegationEnforced":{"type":"boolean","description":"Whether Assure can currently prove a request came from software rather than a person (AR-1)."}},"required":["ok","service","delegationEnforced"],"description":"The liveness probe."},"examples":{"alive":{"value":{"ok":true,"service":"assure","delegationEnforced":false}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"Unauthenticated and cheap, and mounted before the SPA catch-all so a wrong path can never be masked by the catch-all answering 200 with HTML. `delegationEnforced` is AR-1: false means Assure cannot yet prove a request came from software rather than a person, and records written in that state say so.","tags":["platform"],"security":[],"x-cortena-tool-exempt-reason":"a liveness probe is not a capability: it exists for Kubernetes and the HealthCheckPolicy, and an agent that could call it would learn nothing it can act on (§5, §32.1)."}},"/v1/orgs/{orgId}/access-grants":{"get":{"operationId":"assure_access_grant_list","summary":"The headless tokens this organisation has issued, and whether each is still live.","x-cortena-access":"read","x-cortena-when-to-use":"Use to answer \"what can reach Assure without a person\" — before issuing another one, or when auditing what is still outstanding.","x-cortena-examples":[{"name":"outstanding","summary":"What holds a headless credential","request":{"orgId":"00000000-0000-0000-0000-000000000001"},"response":{"items":[{"id":"a1b2c3d4-5e6f-4071-8829-0a1b2c3d4e5f","label":"Nightly regression runner","subjectUserId":"u-1042","actorKind":"ci","scopes":["run:execute","run:read"],"issuedAt":"2026-09-01T09:00:00.000Z","expiresAt":"2026-12-01T09:00:00.000Z","lastUsedAt":"2026-09-12T02:14:00.000Z","state":"live"}]}}],"responses":{"200":{"description":"The headless tokens this organisation has issued, and whether each is still live.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The grant uuid."},"label":{"type":"string","description":"What it is for."},"subjectUserId":{"type":"string","description":"The person it acts for."},"actorKind":{"type":"string","description":"claude_code, ci or other."},"scopes":{"type":"array","items":{"type":"string"},"description":"What it carries."},"issuedAt":{"type":"string","format":"date-time","description":"When it was issued."},"expiresAt":{"type":"string","format":"date-time","description":"When it lapses."},"lastUsedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When it was last used, or null if never — which is what makes a stale grant visible."},"state":{"type":"string","description":"live, unused or expired."}},"required":["id","label","subjectUserId","actorKind","scopes","issuedAt","expiresAt","lastUsedAt","state"],"description":"A headless token, as the list shows it. The token itself is shown once at creation and never stored."},"description":"Every grant this organisation has issued that has not been revoked."}},"required":["items"],"description":"Every grant this organisation has issued that has not been revoked."},"examples":{"outstanding":{"value":{"items":[{"id":"a1b2c3d4-5e6f-4071-8829-0a1b2c3d4e5f","label":"Nightly regression runner","subjectUserId":"u-1042","actorKind":"ci","scopes":["run:execute","run:read"],"issuedAt":"2026-09-01T09:00:00.000Z","expiresAt":"2026-12-01T09:00:00.000Z","lastUsedAt":"2026-09-12T02:14:00.000Z","state":"live"}]}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"`state` is derived rather than stored: `expired` past its expiry, `live` once something has used it, `unused` when nothing ever has. A grant nobody has used is the one worth asking about.","tags":["access"],"x-cortena-tool":"assure_access_grant_list","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"}]},"post":{"operationId":"assure_access_grant_create","summary":"Issue a headless token, shown once.","x-cortena-access":"write","x-cortena-when-to-use":"Use when something with no person behind it — a CI job, a scheduled runner — needs to reach Assure. For a session a person started, /sessions/delegate is the right door.","x-cortena-examples":[{"name":"ci runner","summary":"A token for a nightly job","request":{"orgId":"00000000-0000-0000-0000-000000000001","label":"Nightly regression runner","actorKind":"ci","scopes":["run:execute","run:read"],"expiresAt":"2026-12-01T09:00:00.000Z"},"response":{"id":"a1b2c3d4-5e6f-4071-8829-0a1b2c3d4e5f","orgId":"00000000-0000-0000-0000-000000000001","subjectUserId":"u-1042","actorKind":"ci","label":"Nightly regression runner","scopes":["run:execute","run:read"],"tokenHash":"9f2c…","issuedByUserId":"u-1042","issuedAt":"2026-09-01T09:00:00.000Z","expiresAt":"2026-12-01T09:00:00.000Z","lastUsedAt":null,"revokedAt":null,"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.…"}}],"responses":{"201":{"description":"Issue a headless token, shown once.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The grant uuid."},"orgId":{"type":"string","description":"The organisation."},"subjectUserId":{"type":"string","description":"The person it acts for."},"actorKind":{"type":"string","description":"claude_code, ci or other."},"label":{"type":"string","description":"What it is for."},"scopes":{"type":"array","items":{"type":"string"},"description":"What it carries."},"tokenHash":{"type":"string","description":"sha256 of the token. Only the hash is kept."},"issuedByUserId":{"type":"string","description":"Who issued it."},"issuedAt":{"type":"string","format":"date-time","description":"When."},"expiresAt":{"type":"string","format":"date-time","description":"When it lapses."},"lastUsedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Null until it is used."},"revokedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Null until it is revoked."},"token":{"type":"string","description":"The bearer itself. Shown once and never stored — copy it now."}},"required":["id","orgId","subjectUserId","actorKind","label","scopes","tokenHash","issuedByUserId","issuedAt","expiresAt","lastUsedAt","revokedAt","token"],"description":"A newly issued headless token. This is the only time the token is returned."},"examples":{"ci runner":{"value":{"id":"a1b2c3d4-5e6f-4071-8829-0a1b2c3d4e5f","orgId":"00000000-0000-0000-0000-000000000001","subjectUserId":"u-1042","actorKind":"ci","label":"Nightly regression runner","scopes":["run:execute","run:read"],"tokenHash":"9f2c…","issuedByUserId":"u-1042","issuedAt":"2026-09-01T09:00:00.000Z","expiresAt":"2026-12-01T09:00:00.000Z","lastUsedAt":null,"revokedAt":null,"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.…"}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"Only the hash is stored, so the token in the response is the only copy that will ever exist. An unrecognised scope is refused rather than stored — a grant carrying a scope Assure has never heard of grants nothing, silently.","tags":["access"],"x-cortena-tool-exempt-reason":"the response carries a bearer token that is shown once and never stored. Issuing a standing credential for an unattended job is an administrative act a person does in the interface, where they can copy it somewhere safe — not a tool call whose result lands in a model’s context window (§5).","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","minLength":1,"description":"What this token is for. It is what somebody will read when deciding whether to revoke it."},"actorKind":{"type":"string","enum":["claude_code","ci","other"],"default":"claude_code","description":"What kind of thing will hold it."},"scopes":{"type":"array","items":{"type":"string"},"minItems":1,"description":"Exactly what it may do. An unrecognised scope is refused."},"expiresAt":{"type":"string","format":"date-time","description":"When it lapses. There is no perpetual grant."}},"required":["label","scopes","expiresAt"]},"examples":{"ci runner":{"value":{"label":"Nightly regression runner","actorKind":"ci","scopes":["run:execute","run:read"],"expiresAt":"2026-12-01T09:00:00.000Z"}}}}}}}},"/v1/orgs/{orgId}/access-grants/{grantId}":{"delete":{"operationId":"assure_access_grant_revoke","summary":"Revoke a headless token.","x-cortena-access":"write","x-cortena-when-to-use":"Use when a job is retired, a token is suspected, or a grant has been sitting unused since it was issued.","x-cortena-examples":[{"name":"revoked","summary":"Retire a token","request":{"orgId":"00000000-0000-0000-0000-000000000001","grantId":"a1b2c3d4-5e6f-4071-8829-0a1b2c3d4e5f"}}],"responses":{"204":{"description":"Revoke a headless token."},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"The row is marked revoked rather than deleted, so the record still says the grant existed and when it stopped. Answers 204 with no body.","tags":["access"],"x-cortena-tool-exempt-reason":"credential lifecycle is an administrator action in the Assure UI, not an agent capability; there is no delegable scope for it (DESIGN-D6).","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"grantId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The access grant uuid, from assure_access_grant_list."},"description":"The access grant uuid, from assure_access_grant_list.","example":"a1b2c3d4-5e6f-4071-8829-0a1b2c3d4e5f"}]}},"/v1/orgs/{orgId}/applications":{"get":{"operationId":"assure_application_list","summary":"Every active application in the organisation, with its counts.","x-cortena-access":"read","x-cortena-when-to-use":"Use to find the application id everything else in Assure needs, or to answer \"what are we validating and how far along is it\".","x-cortena-examples":[{"name":"the portfolio","summary":"What this organisation is validating","request":{"orgId":"00000000-0000-0000-0000-000000000001"},"response":{"items":[{"id":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","key":"PAY","name":"Payments","assetCount":42,"approvedCaseCount":118,"waitingCaseCount":9,"sessionConnected":false,"status":"active","ownerUserId":"u-1042","createdBy":"R. Mehta","createdAt":"2026-08-01T09:00:00.000Z","yours":true}]}}],"responses":{"200":{"description":"Every active application in the organisation, with its counts.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The application uuid."},"key":{"type":"string","description":"The short permanent key."},"name":{"type":"string","description":"The display name."},"assetCount":{"type":"number","description":"How many assets Assure knows about — what cases have declared, not a census."},"approvedCaseCount":{"type":"number","description":"Cases with a live approval."},"waitingCaseCount":{"type":"number","description":"Cases waiting for review."},"sessionConnected":{"type":"boolean","description":"True while a run is open on this application."},"status":{"type":"string","description":"active or archived."},"ownerUserId":{"type":"string","description":"Who is recorded as the owner."},"createdBy":{"type":"string","description":"Who created it, from the audit trail. Falls back to the owner id."},"createdAt":{"type":"string","format":"date-time","description":"When it was created."},"yours":{"type":"boolean","description":"True when the caller owns it. Everybody in the organisation can still read it."}},"required":["id","key","name","assetCount","approvedCaseCount","waitingCaseCount","sessionConnected","status","ownerUserId","createdBy","createdAt","yours"],"description":"One row of the application list, with the counts the interface shows beside it."},"description":"Every active application in the organisation."}},"required":["items"],"description":"Every active application in the organisation."},"examples":{"the portfolio":{"value":{"items":[{"id":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","key":"PAY","name":"Payments","assetCount":42,"approvedCaseCount":118,"waitingCaseCount":9,"sessionConnected":false,"status":"active","ownerUserId":"u-1042","createdBy":"R. Mehta","createdAt":"2026-08-01T09:00:00.000Z","yours":true}]}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"Not only the ones the caller created: the organisation is the boundary, so everybody in it sees every application. `createdBy` comes from the audit trail rather than the application row, because the append-only record is the more trustworthy of the two.","tags":["applications"],"x-cortena-tool":"assure_application_list","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"}]},"post":{"operationId":"assure_application_create","summary":"Register an application to validate.","x-cortena-access":"write","x-cortena-when-to-use":"Use once per system under test, before any case is written. If one already exists for this codebase, use it rather than creating a second — case identifiers are per application and two applications split the record in half.","x-cortena-examples":[{"name":"a new system","summary":"Start validating Payments","request":{"orgId":"00000000-0000-0000-0000-000000000001","key":"PAY","name":"Payments","description":"The transfer and settlement service."},"response":{"id":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","orgId":"00000000-0000-0000-0000-000000000001","key":"PAY","name":"Payments","description":"The transfer and settlement service.","ownerUserId":"u-1042","defaultEnvironmentId":null,"segmentsEnabled":["screen","api","database","security","performance"],"allowExternalDrafts":false,"defaultViewports":[375,768,1440],"defaultThemes":["light","dark"],"status":"active","createdAt":"2026-08-01T09:00:00.000Z","updatedAt":"2026-09-09T12:00:00.000Z"}}],"responses":{"201":{"description":"Register an application to validate.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The application uuid."},"orgId":{"type":"string","description":"The organisation that owns it."},"key":{"type":"string","description":"Short and permanent. The stem of every case identifier in this application."},"name":{"type":"string","description":"The display name."},"description":{"type":"string","description":"What this application is, in a sentence or two."},"ownerUserId":{"type":"string","description":"Who is recorded as the owner. Since D5 this decides attribution, not who may read."},"defaultEnvironmentId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The environment a run defaults to, or null."},"segmentsEnabled":{"type":"array","items":{"type":"string"},"description":"Which segments cases may be written in."},"allowExternalDrafts":{"type":"boolean","description":"Whether a session whose model sits outside the network may write here."},"defaultViewports":{"type":"array","items":{"type":"number"},"description":"Screen-case viewport widths, so a session need not restate them."},"defaultThemes":{"type":"array","items":{"type":"string"},"description":"Screen-case themes, so a session need not restate them."},"status":{"type":"string","description":"active or archived."},"createdAt":{"type":"string","format":"date-time","description":"When the application was created."},"updatedAt":{"type":"string","format":"date-time","description":"When it was last changed."}},"required":["id","orgId","key","name","description","ownerUserId","defaultEnvironmentId","segmentsEnabled","allowExternalDrafts","defaultViewports","defaultThemes","status","createdAt","updatedAt"],"description":"One application under test: the unit everything else in Assure hangs off."},"examples":{"a new system":{"value":{"id":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","orgId":"00000000-0000-0000-0000-000000000001","key":"PAY","name":"Payments","description":"The transfer and settlement service.","ownerUserId":"u-1042","defaultEnvironmentId":null,"segmentsEnabled":["screen","api","database","security","performance"],"allowExternalDrafts":false,"defaultViewports":[375,768,1440],"defaultThemes":["light","dark"],"status":"active","createdAt":"2026-08-01T09:00:00.000Z","updatedAt":"2026-09-09T12:00:00.000Z"}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"The key stems every case identifier in the application and can never be changed, so choose it as you would a ticket prefix. The segment and screen defaults can all be changed later.","tags":["applications"],"x-cortena-tool":"assure_application_create","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","pattern":"^[A-Z][A-Z0-9]{1,7}$","description":"2–8 uppercase characters, starting with a letter. Permanent: it stems every case id here."},"name":{"type":"string","minLength":1,"description":"The display name."},"description":{"type":"string","description":"What this application is, in a sentence or two."},"segmentsEnabled":{"type":"array","items":{"type":"string","enum":["screen","api","database","security","performance"],"description":"Which kind of thing is being asserted: screen, api, database, security or performance."},"description":"Which segments cases may be written in. Defaults to all five."},"allowExternalDrafts":{"type":"boolean","description":"Whether a session whose model sits outside the network may write here."},"defaultViewports":{"type":"array","items":{"type":"number"},"description":"Screen-case viewport widths. Defaults to 375, 768 and 1440."},"defaultThemes":{"type":"array","items":{"type":"string"},"description":"Screen-case themes. Defaults to light and dark."}},"required":["key","name"]},"examples":{"a new system":{"value":{"key":"PAY","name":"Payments","description":"The transfer and settlement service."}}}}}}}},"/v1/orgs/{orgId}/applications/{applicationId}":{"get":{"operationId":"assure_application_get","summary":"One application with its repositories, roster, enabled segments and screen-case defaults.","x-cortena-access":"read","x-cortena-when-to-use":"Use before writing cases, to learn which segments are enabled and which viewports and themes a screen case should default to — and to find the repositories this application already knows about.","x-cortena-examples":[{"name":"the application page","summary":"Everything about one application","request":{"orgId":"00000000-0000-0000-0000-000000000001","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071"},"response":{"id":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","orgId":"00000000-0000-0000-0000-000000000001","key":"PAY","name":"Payments","description":"The transfer and settlement service.","ownerUserId":"u-1042","defaultEnvironmentId":null,"segmentsEnabled":["screen","api","database","security","performance"],"allowExternalDrafts":false,"defaultViewports":[375,768,1440],"defaultThemes":["light","dark"],"status":"active","createdAt":"2026-08-01T09:00:00.000Z","updatedAt":"2026-09-09T12:00:00.000Z","createdBy":"R. Mehta","yours":true,"assetCount":42,"approvedCaseCount":118,"waitingCaseCount":9,"sessionConnected":false,"mcpServerUrl":"https://assure.example/mcp","repos":[],"members":[]}}],"responses":{"200":{"description":"One application with its repositories, roster, enabled segments and screen-case defaults.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The application uuid."},"orgId":{"type":"string","description":"The organisation that owns it."},"key":{"type":"string","description":"Short and permanent. The stem of every case identifier in this application."},"name":{"type":"string","description":"The display name."},"description":{"type":"string","description":"What this application is, in a sentence or two."},"ownerUserId":{"type":"string","description":"Who is recorded as the owner. Since D5 this decides attribution, not who may read."},"defaultEnvironmentId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The environment a run defaults to, or null."},"segmentsEnabled":{"type":"array","items":{"type":"string"},"description":"Which segments cases may be written in."},"allowExternalDrafts":{"type":"boolean","description":"Whether a session whose model sits outside the network may write here."},"defaultViewports":{"type":"array","items":{"type":"number"},"description":"Screen-case viewport widths, so a session need not restate them."},"defaultThemes":{"type":"array","items":{"type":"string"},"description":"Screen-case themes, so a session need not restate them."},"status":{"type":"string","description":"active or archived."},"createdAt":{"type":"string","format":"date-time","description":"When the application was created."},"updatedAt":{"type":"string","format":"date-time","description":"When it was last changed."},"createdBy":{"type":"string","description":"Who created it, from the audit trail. Falls back to the owner id."},"yours":{"type":"boolean","description":"True when the caller owns it."},"assetCount":{"type":"number","description":"How many assets Assure knows about."},"approvedCaseCount":{"type":"number","description":"Cases with a live approval."},"waitingCaseCount":{"type":"number","description":"Cases waiting for review."},"sessionConnected":{"type":"boolean","description":"True while a run is open on this application."},"mcpServerUrl":{"type":"string","description":"Where a session connects its MCP client. Empty when ASSURE_PUBLIC_URL is unset."},"repos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The repository reference uuid."},"applicationId":{"type":"string","description":"The application it belongs to."},"owner":{"type":"string","description":"The repository owner or organisation."},"name":{"type":"string","description":"The repository name."},"roleHint":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"backend, screens, database, jobs or mixed — or null."},"segmentsAllowed":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Segments this repository may source cases for, or null for all."},"lastSeenSha":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The most recent commit a session reported. Assure is told; it does not look."},"lastSeenAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When that commit was reported."},"createdAt":{"type":"string","format":"date-time","description":"When the reference was registered."}},"required":["id","applicationId","owner","name","roleHint","segmentsAllowed","lastSeenSha","lastSeenAt","createdAt"],"description":"A reference to a repository, not a connection. Assure never reaches a repository."},"description":"The repositories cases in this application cite."},"members":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The roster row uuid."},"applicationId":{"type":"string","description":"The application."},"principalType":{"type":"string","description":"user or group."},"principalId":{"type":"string","description":"The Cortena user or group id."},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The name to show, when one was given."},"addedBy":{"type":"string","description":"Who added them."},"addedAt":{"type":"string","format":"date-time","description":"When they were added."},"approvalsGiven":{"type":"number","description":"How many live approvals this person has given here. Attribution, surfaced where people look."}},"required":["id","applicationId","principalType","principalId","displayName","addedBy","addedAt","approvalsGiven"],"description":"A name on the application roster. Flat — per D5 there are no roles."},"description":"The roster, with each member’s approval count beside them."}},"required":["id","orgId","key","name","description","ownerUserId","defaultEnvironmentId","segmentsEnabled","allowExternalDrafts","defaultViewports","defaultThemes","status","createdAt","updatedAt","createdBy","yours","assetCount","approvedCaseCount","waitingCaseCount","sessionConnected","mcpServerUrl","repos","members"],"description":"One application with everything the interface shows on its page."},"examples":{"the application page":{"value":{"id":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","orgId":"00000000-0000-0000-0000-000000000001","key":"PAY","name":"Payments","description":"The transfer and settlement service.","ownerUserId":"u-1042","defaultEnvironmentId":null,"segmentsEnabled":["screen","api","database","security","performance"],"allowExternalDrafts":false,"defaultViewports":[375,768,1440],"defaultThemes":["light","dark"],"status":"active","createdAt":"2026-08-01T09:00:00.000Z","updatedAt":"2026-09-09T12:00:00.000Z","createdBy":"R. Mehta","yours":true,"assetCount":42,"approvedCaseCount":118,"waitingCaseCount":9,"sessionConnected":false,"mcpServerUrl":"https://assure.example/mcp","repos":[],"members":[]}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"Carries the same computed counts the list returns: without them a client reading one application shows zeroes beside a table that plainly has rows.","tags":["applications"],"x-cortena-tool":"assure_application_get","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"applicationId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The application uuid, from assure_application_list or assure_whoami."},"description":"The application uuid, from assure_application_list or assure_whoami.","example":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071"}]},"patch":{"operationId":"assure_application_update","summary":"Change an application’s settings.","x-cortena-access":"write","x-cortena-when-to-use":"Use to hand an application over to a new owner, to widen or narrow the segments cases may be written in, or to allow drafts from a model outside the network.","x-cortena-examples":[{"name":"hand over","summary":"Record a new owner","request":{"orgId":"00000000-0000-0000-0000-000000000001","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","ownerUserId":"u-2087"},"response":{"id":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","orgId":"00000000-0000-0000-0000-000000000001","key":"PAY","name":"Payments","description":"The transfer and settlement service.","ownerUserId":"u-2087","defaultEnvironmentId":null,"segmentsEnabled":["screen","api","database","security","performance"],"allowExternalDrafts":false,"defaultViewports":[375,768,1440],"defaultThemes":["light","dark"],"status":"active","createdAt":"2026-08-01T09:00:00.000Z","updatedAt":"2026-09-09T12:00:00.000Z"}}],"responses":{"200":{"description":"Change an application’s settings.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The application uuid."},"orgId":{"type":"string","description":"The organisation that owns it."},"key":{"type":"string","description":"Short and permanent. The stem of every case identifier in this application."},"name":{"type":"string","description":"The display name."},"description":{"type":"string","description":"What this application is, in a sentence or two."},"ownerUserId":{"type":"string","description":"Who is recorded as the owner. Since D5 this decides attribution, not who may read."},"defaultEnvironmentId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The environment a run defaults to, or null."},"segmentsEnabled":{"type":"array","items":{"type":"string"},"description":"Which segments cases may be written in."},"allowExternalDrafts":{"type":"boolean","description":"Whether a session whose model sits outside the network may write here."},"defaultViewports":{"type":"array","items":{"type":"number"},"description":"Screen-case viewport widths, so a session need not restate them."},"defaultThemes":{"type":"array","items":{"type":"string"},"description":"Screen-case themes, so a session need not restate them."},"status":{"type":"string","description":"active or archived."},"createdAt":{"type":"string","format":"date-time","description":"When the application was created."},"updatedAt":{"type":"string","format":"date-time","description":"When it was last changed."}},"required":["id","orgId","key","name","description","ownerUserId","defaultEnvironmentId","segmentsEnabled","allowExternalDrafts","defaultViewports","defaultThemes","status","createdAt","updatedAt"],"description":"One application under test: the unit everything else in Assure hangs off."},"examples":{"hand over":{"value":{"id":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","orgId":"00000000-0000-0000-0000-000000000001","key":"PAY","name":"Payments","description":"The transfer and settlement service.","ownerUserId":"u-2087","defaultEnvironmentId":null,"segmentsEnabled":["screen","api","database","security","performance"],"allowExternalDrafts":false,"defaultViewports":[375,768,1440],"defaultThemes":["light","dark"],"status":"active","createdAt":"2026-08-01T09:00:00.000Z","updatedAt":"2026-09-09T12:00:00.000Z"}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"Every change is audited with its before and after, because turning external routing on is a decision somebody should be able to point at later. `key` is deliberately absent: it stems every case identifier in the application, so changing it would silently orphan the lot. Narrowing the enabled segments does not touch cases already written in a segment being switched off — they stay, and stay executable; only new ones are refused.","tags":["applications"],"x-cortena-tool":"assure_application_update","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"applicationId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The application uuid, from assure_application_list or assure_whoami."},"description":"The application uuid, from assure_application_list or assure_whoami.","example":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The display name."},"description":{"type":"string","description":"What this application is."},"segmentsEnabled":{"type":"array","items":{"type":"string","enum":["screen","api","database","security","performance"],"description":"Which kind of thing is being asserted: screen, api, database, security or performance."},"minItems":1,"description":"Which segments new cases may be written in."},"allowExternalDrafts":{"type":"boolean","description":"Whether a session whose model sits outside the network may write here."},"defaultViewports":{"type":"array","items":{"type":"integer","exclusiveMinimum":0},"minItems":1,"description":"Screen-case viewport widths."},"defaultThemes":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"description":"Screen-case themes."},"defaultEnvironmentId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"The environment a run defaults to, or null for none."},"ownerUserId":{"type":"string","minLength":1,"description":"Who is recorded as the owner. Since D5 this decides attribution and the walkthrough roster, not who may read."}}},"examples":{"hand over":{"value":{"ownerUserId":"u-2087"}}}}}}}},"/v1/orgs/{orgId}/applications/{applicationId}/assets":{"get":{"operationId":"assure_catalog_search","summary":"What is already covered, asset by asset.","x-cortena-access":"read","x-cortena-when-to-use":"Ask this before writing anything, so you write what is missing rather than the two hundredth version of a case that already exists.","x-cortena-examples":[{"name":"the gaps","summary":"Assets nothing has been approved about","request":{"orgId":"00000000-0000-0000-0000-000000000001","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","uncoveredOnly":true},"response":{"items":[{"id":"5a6b7c8d-9e0f-4102-8334-4556677889aa","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","repoId":null,"parentId":null,"kind":"api","key":"api:POST /v1/transfers","name":"POST /v1/transfers","path":"src/routes/transfers.ts","symbol":null,"criticality":"normal","status":"active","metadata":{},"firstSeenSha":"8f3c1a","lastSeenSha":"8f3c1a","firstSeenAt":"2026-08-20T10:00:00.000Z","lastSeenAt":"2026-08-20T10:00:00.000Z","caseCount":0}],"note":"Assembled from what cases declare."}}],"responses":{"200":{"description":"What is already covered, asset by asset.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The asset uuid."},"applicationId":{"type":"string","description":"The application."},"repoId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The repository it was first seen in, or null."},"parentId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The asset this one sits under, or null."},"kind":{"type":"string","description":"screen, api, procedure and the like."},"key":{"type":"string","description":"Stable identity across sessions — `api:POST /v1/transfers`."},"name":{"type":"string","description":"The display name."},"path":{"type":"string","description":"Where it lives in the repository."},"symbol":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The function or procedure name, when there is one."},"criticality":{"type":"string","description":"normal or critical."},"status":{"type":"string","description":"active or retired."},"metadata":{"type":"object","additionalProperties":{},"description":"Whatever the declaring session recorded about it."},"firstSeenSha":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The commit it was first declared at."},"lastSeenSha":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The most recent commit it was declared at."},"firstSeenAt":{"type":"string","format":"date-time","description":"When it was first declared."},"lastSeenAt":{"type":"string","format":"date-time","description":"When it was last declared."},"caseCount":{"type":"number","description":"How many cases assert something about this asset, retired ones excluded."}},"required":["id","applicationId","repoId","parentId","kind","key","name","path","symbol","criticality","status","metadata","firstSeenSha","lastSeenSha","firstSeenAt","lastSeenAt","caseCount"],"description":"Something a case can be written about. The catalogue is what has been thought about, not a census."}},"note":{"type":"string","description":"What this catalogue is and is not, so a reader does not mistake it for a census."}},"required":["items","note"],"description":"The catalogue: what cases have declared, not what exists in the codebase."},"examples":{"the gaps":{"value":{"items":[{"id":"5a6b7c8d-9e0f-4102-8334-4556677889aa","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","repoId":null,"parentId":null,"kind":"api","key":"api:POST /v1/transfers","name":"POST /v1/transfers","path":"src/routes/transfers.ts","symbol":null,"criticality":"normal","status":"active","metadata":{},"firstSeenSha":"8f3c1a","lastSeenSha":"8f3c1a","firstSeenAt":"2026-08-20T10:00:00.000Z","lastSeenAt":"2026-08-20T10:00:00.000Z","caseCount":0}],"note":"Assembled from what cases declare."}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"Assembled from what cases declare. There is no discovery pass, so this is what has been thought about, not a census of the codebase — and the response says so in `note` rather than leaving a reader to assume otherwise.","tags":["catalog"],"x-cortena-tool":"assure_catalog_search","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"applicationId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The application uuid, from assure_application_list or assure_whoami."},"description":"The application uuid, from assure_application_list or assure_whoami.","example":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071"},{"name":"uncoveredOnly","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["true","false","1","0"]}],"description":"Only assets with no approved case. This is the gap to write into."},"description":"Only assets with no approved case. This is the gap to write into.","example":true},{"name":"uncoveredSegments","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["true","false","1","0"]}],"description":"Deprecated spelling of uncoveredOnly, still accepted."},"description":"Deprecated spelling of uncoveredOnly, still accepted."}]}},"/v1/orgs/{orgId}/applications/{applicationId}/automation/trigger":{"post":{"operationId":"assure_automation_trigger","summary":"Ask the automation runner to execute an application’s automated suite.","x-cortena-access":"write","x-cortena-when-to-use":"Use when a person asks for the automated Playwright suite to be run against an environment. Trigger it and stop: do not open a run yourself first (a run you hold open would block the runner’s), and do not post results — the runner records them. To follow progress, list the application’s runs.","x-cortena-examples":[{"name":"the whole suite","summary":"Run everything against the test environment","request":{"orgId":"00000000-0000-0000-0000-000000000001","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","environmentId":"4d5e6f70-8192-43a4-8b5c-6d7e8f901234"},"response":{"jobId":"job-20261016-0001","status":"accepted","suite":"all","application":"PAY","environment":"QA-2","note":"The runner has accepted the suite. Assure executes nothing: the run appears under Runs as the runner opens it, and each result is recorded as its test finishes."}},{"name":"just the browser tests","summary":"Run only the UI suite","request":{"orgId":"00000000-0000-0000-0000-000000000001","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","environmentId":"4d5e6f70-8192-43a4-8b5c-6d7e8f901234","suite":"ui"},"response":{"jobId":"job-20261016-0002","status":"accepted","suite":"ui","application":"PAY","environment":"QA-2","note":"The runner has accepted the suite. Assure executes nothing: the run appears under Runs as the runner opens it, and each result is recorded as its test finishes."}}],"responses":{"202":{"description":"Ask the automation runner to execute an application’s automated suite.","content":{"application/json":{"schema":{"type":"object","properties":{"jobId":{"type":"string","description":"The runner’s own identifier for this request. It is not a run id: the run is opened by the runner and appears under Runs."},"status":{"const":"accepted","description":"The runner accepted the request. Nothing about the outcome is known yet."},"suite":{"type":"string","description":"Which suite was asked for."},"application":{"type":"string","description":"The application key."},"environment":{"type":"string","description":"The environment the suite runs against."},"note":{"type":"string","description":"What happens next, in a sentence."}},"required":["jobId","status","suite","application","environment","note"]},"examples":{"the whole suite":{"value":{"jobId":"job-20261016-0001","status":"accepted","suite":"all","application":"PAY","environment":"QA-2","note":"The runner has accepted the suite. Assure executes nothing: the run appears under Runs as the runner opens it, and each result is recorded as its test finishes."}},"just the browser tests":{"value":{"jobId":"job-20261016-0002","status":"accepted","suite":"ui","application":"PAY","environment":"QA-2","note":"The runner has accepted the suite. Assure executes nothing: the run appears under Runs as the runner opens it, and each result is recorded as its test finishes."}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"Assure executes nothing. This sends one request to the runner this deployment is configured with and returns at once, with what the runner accepted. The runner is sent a short-lived token for the caller, scoped to what its reporter needs and never more than the caller holds (403 `scope-not-granted` otherwise); it opens its own run through the ordinary API and each result is recorded as its test finishes, attributed to the runner acting for the caller. The outcome is read from Runs, not from this response. Refused outright against a production environment, when no runner is configured (503), when the runner is already busy (409) and when it cannot be reached (502).","tags":["automation"],"x-cortena-tool":"assure_automation_trigger","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"applicationId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The application uuid, from assure_application_list or assure_whoami."},"description":"The application uuid, from assure_application_list or assure_whoami.","example":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"environmentId":{"type":"string","format":"uuid","description":"The environment the suite runs against. It must not be a production environment."},"suite":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,39}$","description":"Which suite the runner should execute, as the runner names it — typically `api`, `ui` or `all`. Omitted, `all`."}},"required":["environmentId"]},"examples":{"the whole suite":{"value":{"environmentId":"4d5e6f70-8192-43a4-8b5c-6d7e8f901234"}},"just the browser tests":{"value":{"environmentId":"4d5e6f70-8192-43a4-8b5c-6d7e8f901234","suite":"ui"}}}}}}}},"/v1/orgs/{orgId}/applications/{applicationId}/batches":{"post":{"operationId":"assure_batch_open","summary":"Open a batch for this session.","x-cortena-access":"write","x-cortena-when-to-use":"Use before writing the first case of a session, so every case you write carries the commit it was read at.","x-cortena-examples":[{"name":"a session","summary":"Open a batch against a commit","request":{"orgId":"00000000-0000-0000-0000-000000000001","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","label":"claude-code","repoOwner":"acme","repoName":"payments-api","repoSha":"8f3c1a9"},"response":{"id":"9a8b7c6d-5e4f-4302-8a1b-0c9d8e7f6051","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","openedByUserId":"u-1042","actor":{"kind":"agent","tool":"claude-code","onBehalfOf":"u-1042","displayName":"R. Mehta"},"repoId":null,"repoSha":"8f3c1a9","label":"claude-code","status":"open","counts":{"written":0,"refusedAtSubmission":0,"accepted":0,"approvedSoFar":0,"sentBackSoFar":0},"refusalReasons":{},"openedAt":"2026-09-09T10:00:00.000Z","submittedAt":null}}],"responses":{"201":{"description":"Open a batch for this session.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The batch uuid."},"applicationId":{"type":"string","description":"The application."},"openedByUserId":{"type":"string","description":"The person whose session opened it."},"actor":{"type":"object","properties":{"kind":{"type":"string","description":"human, agent or system."},"userId":{"type":"string","description":"The Cortena user id, when a person was acting directly."},"displayName":{"type":"string","description":"The name to show. For an agent, the person it acted for."},"tool":{"type":"string","description":"The software holding the token — \"claude-code\" and the like."},"model":{"type":"string","description":"The model behind the tool, when it named one."},"externallyRouted":{"type":"boolean","description":"True when the model sits outside the customer network."},"onBehalfOf":{"type":"string","description":"The user id an agent was acting for."}},"required":["kind"],"description":"Who opened it — a session, and the person it acted for."},"repoId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The repository reference, registered on the spot when the application had never seen it."},"repoSha":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The commit the session said it was reading."},"label":{"type":"string","description":"A short name for the batch, so a reviewer can tell two apart."},"status":{"type":"string","description":"open or submitted."},"counts":{"type":"object","properties":{"written":{"type":"number","description":"Cases offered to this batch, accepted or not."},"refusedAtSubmission":{"type":"number","description":"Cases refused on arrival for not meeting the conventions."},"accepted":{"type":"number","description":"Cases written into the record."},"approvedSoFar":{"type":"number","description":"How many of them have since been approved."},"sentBackSoFar":{"type":"number","description":"How many have since been sent back."}},"required":["written","refusedAtSubmission","accepted","approvedSoFar","sentBackSoFar"],"description":"What this batch produced. Assure keeps the arithmetic; the session does not state it."},"refusalReasons":{"type":"object","additionalProperties":{"type":"number"},"description":"How many cases each refusal reason accounted for, so a session can correct itself."},"openedAt":{"type":"string","format":"date-time","description":"When the batch was opened."},"submittedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When it was submitted, or null while it is open."}},"required":["id","applicationId","openedByUserId","actor","repoId","repoSha","label","status","counts","refusalReasons","openedAt","submittedAt"],"description":"One session’s cases, reviewed as one submission carrying their provenance."},"examples":{"a session":{"value":{"id":"9a8b7c6d-5e4f-4302-8a1b-0c9d8e7f6051","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","openedByUserId":"u-1042","actor":{"kind":"agent","tool":"claude-code","onBehalfOf":"u-1042","displayName":"R. Mehta"},"repoId":null,"repoSha":"8f3c1a9","label":"claude-code","status":"open","counts":{"written":0,"refusedAtSubmission":0,"accepted":0,"approvedSoFar":0,"sentBackSoFar":0},"refusalReasons":{},"openedAt":"2026-09-09T10:00:00.000Z","submittedAt":null}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"A session’s cases are reviewed as one submission carrying their provenance, rather than as two hundred orphans. Several batches may be open at once — one-at-a-time made a second session on the same application fail rather than start, which is friction with no matching risk. A repository the session names is registered on the spot if the application has never seen it: it used to have to exist already, and the failure was silent, so the batch recorded a commit attached to nothing. `externallyRouted` is recorded and never enforced.","tags":["batches"],"x-cortena-tool":"assure_batch_open","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"applicationId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The application uuid, from assure_application_list or assure_whoami."},"description":"The application uuid, from assure_application_list or assure_whoami.","example":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","description":"A short name, so a reviewer can tell two batches apart. Defaults to \"session\"."},"repoOwner":{"type":"string","description":"The repository owner you are reading."},"repoName":{"type":"string","description":"The repository name you are reading."},"repoSha":{"type":"string","description":"The commit you are reading. Assure records it; it does not look."},"externallyRouted":{"type":"boolean","description":"True if your model sits outside the customer network. Recorded, never enforced."}}},"examples":{"a session":{"value":{"label":"claude-code","repoOwner":"acme","repoName":"payments-api","repoSha":"8f3c1a9"}}}}}}}},"/v1/orgs/{orgId}/applications/{applicationId}/cases":{"get":{"operationId":"assure_case_list","summary":"Cases on this application, filtered.","x-cortena-access":"read","x-cortena-when-to-use":"Use to see what an asset already asserts before writing about it, and to find the case ids a run or a defect will name.","x-cortena-examples":[{"name":"waiting","summary":"What is queued for review","request":{"orgId":"00000000-0000-0000-0000-000000000001","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","status":"waiting"},"response":{"items":[{"id":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","assetId":"5a6b7c8d-9e0f-4102-8334-4556677889aa","publicId":"PAY-014","segment":"api","securityClass":null,"checkKind":"behavioural","priority":"high","status":"waiting","currentVersionId":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","approvedVersionId":null,"batchId":"9a8b7c6d-5e4f-4302-8a1b-0c9d8e7f6051","createdAt":"2026-09-09T10:05:00.000Z","retiredAt":null,"title":"Rejects a transfer that would breach the daily limit","notes":"The limit check reads the running total before the write but does not lock it.","authoredBy":{"kind":"agent","tool":"claude-code","onBehalfOf":"u-1042"},"assetName":"POST /v1/transfers"}],"counts":{"screen":0,"api":1,"database":0,"security":0,"performance":0}}}],"responses":{"200":{"description":"Cases on this application, filtered.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The case uuid."},"applicationId":{"type":"string","description":"The application."},"assetId":{"type":"string","description":"What the case is about."},"publicId":{"type":"string","description":"Permanent and never renumbered — quote this to a person."},"segment":{"type":"string","description":"screen, api, database, security or performance."},"securityClass":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"For a security case, which class. Null otherwise."},"checkKind":{"type":"string","description":"behavioural, measured or judged."},"priority":{"type":"string","description":"high, medium or low."},"status":{"type":"string","description":"waiting, approved, changes_requested or retired."},"currentVersionId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The version as it stands now."},"approvedVersionId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The version a counted run may execute. Null unless approved."},"batchId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The batch it was written in."},"createdAt":{"type":"string","format":"date-time","description":"When it was written."},"retiredAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When it was retired, or null."},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The current version’s title, joined in so a list is readable."},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The current version’s notes."},"authoredBy":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","description":"human, agent or system."},"userId":{"type":"string","description":"The Cortena user id, when a person was acting directly."},"displayName":{"type":"string","description":"The name to show. For an agent, the person it acted for."},"tool":{"type":"string","description":"The software holding the token — \"claude-code\" and the like."},"model":{"type":"string","description":"The model behind the tool, when it named one."},"externallyRouted":{"type":"boolean","description":"True when the model sits outside the customer network."},"onBehalfOf":{"type":"string","description":"The user id an agent was acting for."}},"required":["kind"],"description":"Who caused this. `kind: \"agent\"` is a session; `onBehalfOf` names the person whose session it was."},{"type":"null"}],"description":"Who wrote the current version."},"assetName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The asset’s display name."}},"required":["id","applicationId","assetId","publicId","segment","securityClass","checkKind","priority","status","currentVersionId","approvedVersionId","batchId","createdAt","retiredAt","title","notes","authoredBy","assetName"],"description":"A case as the list returns it: the row, plus the fields a reader needs to recognise it."},"description":"The cases, oldest public id first."},"counts":{"type":"object","properties":{"screen":{"type":"number","description":"How many are screen cases."},"api":{"type":"number","description":"How many are api cases."},"database":{"type":"number","description":"How many are database cases."},"security":{"type":"number","description":"How many are security cases."},"performance":{"type":"number","description":"How many are performance cases."}},"required":["screen","api","database","security","performance"],"description":"The same filter, tallied by segment — so a reader sees the shape of the coverage, not only the page."}},"required":["items","counts"],"description":"Cases on an application, filtered, with a per-segment tally beside them."},"examples":{"waiting":{"value":{"items":[{"id":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","assetId":"5a6b7c8d-9e0f-4102-8334-4556677889aa","publicId":"PAY-014","segment":"api","securityClass":null,"checkKind":"behavioural","priority":"high","status":"waiting","currentVersionId":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","approvedVersionId":null,"batchId":"9a8b7c6d-5e4f-4302-8a1b-0c9d8e7f6051","createdAt":"2026-09-09T10:05:00.000Z","retiredAt":null,"title":"Rejects a transfer that would breach the daily limit","notes":"The limit check reads the running total before the write but does not lock it.","authoredBy":{"kind":"agent","tool":"claude-code","onBehalfOf":"u-1042"},"assetName":"POST /v1/transfers"}],"counts":{"screen":0,"api":1,"database":0,"security":0,"performance":0}}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"The per-segment counts are computed over the same filter as the items, so they describe the selection rather than the whole application.","tags":["cases"],"x-cortena-tool":"assure_case_list","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"applicationId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The application uuid, from assure_application_list or assure_whoami."},"description":"The application uuid, from assure_application_list or assure_whoami.","example":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071"},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["draft","waiting","approved","changes_requested","retired"],"description":"Only cases in this state."},"description":"Only cases in this state.","example":"waiting"},{"name":"segment","in":"query","required":false,"schema":{"type":"string","enum":["screen","api","database","security","performance"],"description":"Which kind of thing is being asserted: screen, api, database, security or performance."},"description":"Only cases in this segment."},{"name":"batchId","in":"query","required":false,"schema":{"type":"string","format":"uuid","description":"Only cases written in this batch."},"description":"Only cases written in this batch."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":1000,"description":"How many to return. Defaults to 200."},"description":"How many to return. Defaults to 200."}]}},"/v1/orgs/{orgId}/applications/{applicationId}/cases/approve":{"post":{"operationId":"assure_case_approve_many","summary":"Approve several cases at once, reporting partial success honestly.","x-cortena-access":"write","x-cortena-when-to-use":"Use after a reviewer has worked through a list and agreed to the lot. For one case, assure_case_approve is the plainer call.","x-cortena-examples":[{"name":"a reviewed list","summary":"Approve what was agreed, refuse what moved","request":{"orgId":"00000000-0000-0000-0000-000000000001","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","items":[{"caseId":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","caseVersionId":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d"}]},"response":{"approved":1,"approvedIds":["PAY-014"],"failed":[]}}],"responses":{"200":{"description":"Approve several cases at once, reporting partial success honestly.","content":{"application/json":{"schema":{"type":"object","properties":{"approved":{"type":"number","description":"How many were approved."},"approvedIds":{"type":"array","items":{"type":"string"},"description":"Their public ids."},"failed":{"type":"array","items":{"type":"object","properties":{"caseId":{"type":"string","description":"The case that was not approved."},"publicId":{"type":"string","description":"Its public id, when it could be resolved."},"reason":{"type":"string","description":"Why it was refused — usually that it moved since the list was drawn."},"detail":{"type":"string","description":"What to do about it."}},"required":["caseId","reason"]},"description":"Each case that was not approved, with its own reason. The rest still went through."},"note":{"type":"string","description":"Present only when something failed."}},"required":["approved","approvedIds","failed"],"description":"Partial success, reported as one: each case pins its own version, so one that moved is refused while the rest go through."},"examples":{"a reviewed list":{"value":{"approved":1,"approvedIds":["PAY-014"],"failed":[]}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"Each case still pins its own version, so a case somebody edited between the list rendering and this call is refused while the rest go through. Failing the whole request would punish a reviewer for a race they did not cause; silently approving the moved case would break D6. One approval row per case, each with its own attribution — \"who approved this\" has to be answerable per case, not per click.","tags":["cases"],"x-cortena-tool":"assure_case_approve_many","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"applicationId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The application uuid, from assure_application_list or assure_whoami."},"description":"The application uuid, from assure_application_list or assure_whoami.","example":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"caseId":{"type":"string","format":"uuid","description":"The case."},"caseVersionId":{"type":"string","format":"uuid","description":"The version that was read."}},"required":["caseId","caseVersionId"]},"minItems":1,"maxItems":500,"description":"One entry per case, each pinning the version that was read."},"note":{"type":"string","description":"Applied to every approval in the batch."}},"required":["items"]},"examples":{"a reviewed list":{"value":{"items":[{"caseId":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","caseVersionId":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d"}]}}}}}}}},"/v1/orgs/{orgId}/applications/{applicationId}/coverage":{"get":{"operationId":"assure_coverage_get","summary":"Coverage by segment, against the assets Assure knows about.","x-cortena-access":"read","x-cortena-when-to-use":"Use to answer \"how much of this is covered\", and be sure to quote the note with the number.","x-cortena-examples":[{"name":"by segment","summary":"How much is covered","request":{"orgId":"00000000-0000-0000-0000-000000000001","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071"},"response":{"denominatorNote":"The denominator is the assets Assure knows about.","groups":[{"key":"api","assets":12,"assetsCovered":9,"percent":75,"approvedCases":41}],"evaluatedAt":"2026-09-10T10:20:00.000Z"}}],"responses":{"200":{"description":"Coverage by segment, against the assets Assure knows about.","content":{"application/json":{"schema":{"type":"object","properties":{"denominatorNote":{"type":"string","description":"What the denominator is, so a reader does not mistake it for completeness."},"groups":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"The segment."},"assets":{"type":"number","description":"Assets Assure knows about in this segment."},"assetsCovered":{"type":"number","description":"How many have at least one approved case."},"percent":{"type":"number","description":"The ratio of the two, as a percentage."},"approvedCases":{"type":"number","description":"Approved cases in this segment."}},"required":["key","assets","assetsCovered","percent","approvedCases"]},"description":"One row per segment."},"evaluatedAt":{"type":"string","description":"When this was computed, as ISO-8601."}},"required":["denominatorNote","groups","evaluatedAt"],"description":"Coverage against the assets Assure knows about — not a census of the codebase, and it says so."},"examples":{"by segment":{"value":{"denominatorNote":"The denominator is the assets Assure knows about.","groups":[{"key":"api","assets":12,"assetsCovered":9,"percent":75,"approvedCases":41}],"evaluatedAt":"2026-09-10T10:20:00.000Z"}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"The denominator is what cases have declared, not a census of the codebase — coverage against a denominator Assure cannot establish would be a fiction, and `denominatorNote` says so in the response rather than leaving a reader to assume otherwise.","tags":["reports"],"x-cortena-tool":"assure_coverage_get","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"applicationId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The application uuid, from assure_application_list or assure_whoami."},"description":"The application uuid, from assure_application_list or assure_whoami.","example":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071"}]}},"/v1/orgs/{orgId}/applications/{applicationId}/defects":{"get":{"operationId":"assure_defect_list","summary":"Defects on this application, newest first.","x-cortena-access":"read","x-cortena-when-to-use":"Use to answer \"what is open against this application\", and before deciding whether a release can go.","x-cortena-examples":[{"name":"open defects","summary":"What is blocking","request":{"orgId":"00000000-0000-0000-0000-000000000001","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","status":"open"},"response":{"items":[{"id":"bc23de45-f067-489a-8b1c-2d3e4f506172","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","publicId":"PAY-D003","title":"Daily transfer limit is not enforced under concurrency","detail":"The limit is read before the write and never locked, so two concurrent transfers both pass the check.","severity":"high","status":"open","assetIds":["5a6b7c8d-9e0f-4102-8334-4556677889aa"],"resultIds":["6f708192-a3b4-45c6-8d7e-8f9012345678"],"raisedBy":{"kind":"agent","tool":"claude-code","onBehalfOf":"u-1042"},"confirmedByUserId":null,"externalKey":null,"externalUrl":null,"syncState":"local","openedAt":"2026-09-10T10:15:00.000Z","closedAt":null}]}}],"responses":{"200":{"description":"Defects on this application, newest first.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The defect uuid."},"applicationId":{"type":"string","description":"The application."},"publicId":{"type":"string","description":"Permanent — quote this one."},"title":{"type":"string","description":"What is wrong, in one line."},"detail":{"type":"string","description":"What was observed, and why it is the code rather than the case."},"severity":{"type":"string","description":"critical, high, medium or low."},"status":{"type":"string","description":"open, in_progress, fixed, wont_fix or closed."},"assetIds":{"type":"array","items":{"type":"string"},"description":"What it blocks. This is what connects a defect to a release gate."},"resultIds":{"type":"array","items":{"type":"string"},"description":"The failures it was raised from."},"raisedBy":{"type":"object","properties":{"kind":{"type":"string","description":"human, agent or system."},"userId":{"type":"string","description":"The Cortena user id, when a person was acting directly."},"displayName":{"type":"string","description":"The name to show. For an agent, the person it acted for."},"tool":{"type":"string","description":"The software holding the token — \"claude-code\" and the like."},"model":{"type":"string","description":"The model behind the tool, when it named one."},"externallyRouted":{"type":"boolean","description":"True when the model sits outside the customer network."},"onBehalfOf":{"type":"string","description":"The user id an agent was acting for."}},"required":["kind"],"description":"Who raised it."},"confirmedByUserId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Who confirmed it. Not required for it to block a gate."},"externalKey":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The id in an external tracker, when it has been pushed."},"externalUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Where it lives in that tracker."},"syncState":{"type":"string","description":"local or synced."},"openedAt":{"type":"string","format":"date-time","description":"When it was raised."},"closedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When it was closed, or null."}},"required":["id","applicationId","publicId","title","detail","severity","status","assetIds","resultIds","raisedBy","confirmedByUserId","externalKey","externalUrl","syncState","openedAt","closedAt"],"description":"A defect. It blocks a gate whether or not anybody has confirmed it."},"description":"The defects, newest first."}},"required":["items"],"description":"The defects, newest first."},"examples":{"open defects":{"value":{"items":[{"id":"bc23de45-f067-489a-8b1c-2d3e4f506172","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","publicId":"PAY-D003","title":"Daily transfer limit is not enforced under concurrency","detail":"The limit is read before the write and never locked, so two concurrent transfers both pass the check.","severity":"high","status":"open","assetIds":["5a6b7c8d-9e0f-4102-8334-4556677889aa"],"resultIds":["6f708192-a3b4-45c6-8d7e-8f9012345678"],"raisedBy":{"kind":"agent","tool":"claude-code","onBehalfOf":"u-1042"},"confirmedByUserId":null,"externalKey":null,"externalUrl":null,"syncState":"local","openedAt":"2026-09-10T10:15:00.000Z","closedAt":null}]}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"An unconfirmed defect is in here and blocks a gate exactly like a confirmed one — the alternative is a release passing because nobody got round to looking.","tags":["defects"],"x-cortena-tool":"assure_defect_list","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"applicationId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The application uuid, from assure_application_list or assure_whoami."},"description":"The application uuid, from assure_application_list or assure_whoami.","example":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071"},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["open","in_progress","fixed","wont_fix","closed"],"description":"Only defects in this state."},"description":"Only defects in this state.","example":"open"}]},"post":{"operationId":"assure_defect_create","summary":"Raise a defect from one or more failures.","x-cortena-access":"write","x-cortena-when-to-use":"Use when a failure is the code rather than the case. If the case is wrong, edit or retire the case instead; raising a defect against a stale case buries the real ones.","x-cortena-examples":[{"name":"a real defect","summary":"Raise it from the failure that showed it","request":{"orgId":"00000000-0000-0000-0000-000000000001","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","title":"Daily transfer limit is not enforced under concurrency","detail":"The limit is read before the write and never locked, so two concurrent transfers both pass the check.","severity":"high","resultIds":["6f708192-a3b4-45c6-8d7e-8f9012345678"]},"response":{"id":"bc23de45-f067-489a-8b1c-2d3e4f506172","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","publicId":"PAY-D003","title":"Daily transfer limit is not enforced under concurrency","detail":"The limit is read before the write and never locked, so two concurrent transfers both pass the check.","severity":"high","status":"open","assetIds":["5a6b7c8d-9e0f-4102-8334-4556677889aa"],"resultIds":["6f708192-a3b4-45c6-8d7e-8f9012345678"],"raisedBy":{"kind":"agent","tool":"claude-code","onBehalfOf":"u-1042"},"confirmedByUserId":null,"externalKey":null,"externalUrl":null,"syncState":"local","openedAt":"2026-09-10T10:15:00.000Z","closedAt":null}}],"responses":{"201":{"description":"Raise a defect from one or more failures.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The defect uuid."},"applicationId":{"type":"string","description":"The application."},"publicId":{"type":"string","description":"Permanent — quote this one."},"title":{"type":"string","description":"What is wrong, in one line."},"detail":{"type":"string","description":"What was observed, and why it is the code rather than the case."},"severity":{"type":"string","description":"critical, high, medium or low."},"status":{"type":"string","description":"open, in_progress, fixed, wont_fix or closed."},"assetIds":{"type":"array","items":{"type":"string"},"description":"What it blocks. This is what connects a defect to a release gate."},"resultIds":{"type":"array","items":{"type":"string"},"description":"The failures it was raised from."},"raisedBy":{"type":"object","properties":{"kind":{"type":"string","description":"human, agent or system."},"userId":{"type":"string","description":"The Cortena user id, when a person was acting directly."},"displayName":{"type":"string","description":"The name to show. For an agent, the person it acted for."},"tool":{"type":"string","description":"The software holding the token — \"claude-code\" and the like."},"model":{"type":"string","description":"The model behind the tool, when it named one."},"externallyRouted":{"type":"boolean","description":"True when the model sits outside the customer network."},"onBehalfOf":{"type":"string","description":"The user id an agent was acting for."}},"required":["kind"],"description":"Who raised it."},"confirmedByUserId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Who confirmed it. Not required for it to block a gate."},"externalKey":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The id in an external tracker, when it has been pushed."},"externalUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Where it lives in that tracker."},"syncState":{"type":"string","description":"local or synced."},"openedAt":{"type":"string","format":"date-time","description":"When it was raised."},"closedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When it was closed, or null."}},"required":["id","applicationId","publicId","title","detail","severity","status","assetIds","resultIds","raisedBy","confirmedByUserId","externalKey","externalUrl","syncState","openedAt","closedAt"],"description":"A defect. It blocks a gate whether or not anybody has confirmed it."},"examples":{"a real defect":{"value":{"id":"bc23de45-f067-489a-8b1c-2d3e4f506172","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","publicId":"PAY-D003","title":"Daily transfer limit is not enforced under concurrency","detail":"The limit is read before the write and never locked, so two concurrent transfers both pass the check.","severity":"high","status":"open","assetIds":["5a6b7c8d-9e0f-4102-8334-4556677889aa"],"resultIds":["6f708192-a3b4-45c6-8d7e-8f9012345678"],"raisedBy":{"kind":"agent","tool":"claude-code","onBehalfOf":"u-1042"},"confirmedByUserId":null,"externalKey":null,"externalUrl":null,"syncState":"local","openedAt":"2026-09-10T10:15:00.000Z","closedAt":null}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"It blocks a gate whether or not anybody has confirmed it. The blocked assets are derived from the failures when you do not say — which is what connects a defect to a release gate, so leaving them out is usually right.","tags":["defects"],"x-cortena-tool":"assure_defect_create","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"applicationId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The application uuid, from assure_application_list or assure_whoami."},"description":"The application uuid, from assure_application_list or assure_whoami.","example":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"description":"What is wrong, in one line."},"detail":{"type":"string","minLength":1,"description":"What was observed, and why it is the code rather than the case."},"severity":{"type":"string","enum":["critical","high","medium","low"],"description":"critical, high, medium or low."},"resultIds":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1,"description":"The failures this was raised from. At least one."},"assetIds":{"type":"array","items":{"type":"string","format":"uuid"},"description":"What it blocks. Derived from the failures when omitted."}},"required":["title","detail","severity","resultIds"]},"examples":{"a real defect":{"value":{"title":"Daily transfer limit is not enforced under concurrency","detail":"The limit is read before the write and never locked, so two concurrent transfers both pass the check.","severity":"high","resultIds":["6f708192-a3b4-45c6-8d7e-8f9012345678"]}}}}}}}},"/v1/orgs/{orgId}/applications/{applicationId}/members":{"get":{"operationId":"assure_member_list","summary":"The application’s roster.","x-cortena-access":"read","x-cortena-when-to-use":"Use before a walkthrough, to find the user id of the person who will be reviewing.","x-cortena-examples":[{"name":"the roster","summary":"Who works on this application","request":{"orgId":"00000000-0000-0000-0000-000000000001","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071"},"response":{"items":[{"id":"3c4d5e6f-7081-4923-8a4b-5c6d7e8f9001","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","principalType":"user","principalId":"u-2087","displayName":"S. Nair","addedBy":"u-1042","addedAt":"2026-08-14T11:00:00.000Z"}]}}],"responses":{"200":{"description":"The application’s roster.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The roster row uuid."},"applicationId":{"type":"string","description":"The application."},"principalType":{"type":"string","description":"user or group."},"principalId":{"type":"string","description":"The Cortena user or group id."},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The name to show, when one was given."},"addedBy":{"type":"string","description":"Who added them."},"addedAt":{"type":"string","format":"date-time","description":"When they were added."}},"required":["id","applicationId","principalType","principalId","displayName","addedBy","addedAt"],"description":"A name on the application roster. Flat — per D5 there are no roles."},"description":"Everybody on this application’s roster."}},"required":["items"],"description":"Everybody on this application’s roster."},"examples":{"the roster":{"value":{"items":[{"id":"3c4d5e6f-7081-4923-8a4b-5c6d7e8f9001","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","principalType":"user","principalId":"u-2087","displayName":"S. Nair","addedBy":"u-1042","addedAt":"2026-08-14T11:00:00.000Z"}]}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"Flat — per D5 there are no roles. The roster names who works on an application and whose approvals are counted; it is not a gate, because everybody in the organisation can already read everything.","tags":["applications"],"x-cortena-tool":"assure_member_list","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"applicationId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The application uuid, from assure_application_list or assure_whoami."},"description":"The application uuid, from assure_application_list or assure_whoami.","example":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071"}]},"post":{"operationId":"assure_member_add","summary":"Put somebody on the application’s roster.","x-cortena-access":"write","x-cortena-when-to-use":"Use when a person starts working on an application and their approvals should be counted against it.","x-cortena-examples":[{"name":"a new reviewer","summary":"Add somebody to the roster","request":{"orgId":"00000000-0000-0000-0000-000000000001","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","principalType":"user","principalId":"u-2087","displayName":"S. Nair"},"response":{"id":"3c4d5e6f-7081-4923-8a4b-5c6d7e8f9001","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","principalType":"user","principalId":"u-2087","displayName":"S. Nair","addedBy":"u-1042","addedAt":"2026-08-14T11:00:00.000Z"}}],"responses":{"201":{"description":"Put somebody on the application’s roster.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The roster row uuid."},"applicationId":{"type":"string","description":"The application."},"principalType":{"type":"string","description":"user or group."},"principalId":{"type":"string","description":"The Cortena user or group id."},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The name to show, when one was given."},"addedBy":{"type":"string","description":"Who added them."},"addedAt":{"type":"string","format":"date-time","description":"When they were added."}},"required":["id","applicationId","principalType","principalId","displayName","addedBy","addedAt"],"description":"A name on the application roster. Flat — per D5 there are no roles."},"examples":{"a new reviewer":{"value":{"id":"3c4d5e6f-7081-4923-8a4b-5c6d7e8f9001","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","principalType":"user","principalId":"u-2087","displayName":"S. Nair","addedBy":"u-1042","addedAt":"2026-08-14T11:00:00.000Z"}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"Adding somebody grants nothing they did not already have — the organisation is the boundary. What it does is put their name where attribution and the walkthrough roster read it.","tags":["applications"],"x-cortena-tool":"assure_member_add","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"applicationId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The application uuid, from assure_application_list or assure_whoami."},"description":"The application uuid, from assure_application_list or assure_whoami.","example":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"principalType":{"type":"string","enum":["user","group"],"description":"user or group."},"principalId":{"type":"string","minLength":1,"description":"The Cortena user or group id — not a name typed in chat."},"displayName":{"type":"string","description":"The name to show."}},"required":["principalType","principalId"]},"examples":{"a new reviewer":{"value":{"principalType":"user","principalId":"u-2087","displayName":"S. Nair"}}}}}}}},"/v1/orgs/{orgId}/applications/{applicationId}/releases":{"get":{"operationId":"assure_release_list","summary":"Releases on this application, newest first.","x-cortena-access":"read","x-cortena-when-to-use":"Use to find the release id a verdict or a sign-off refers to, and to see what has been signed.","x-cortena-examples":[{"name":"recent releases","summary":"What is in flight","request":{"orgId":"00000000-0000-0000-0000-000000000001","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071"},"response":{"items":[{"id":"cd34ef56-0178-49ab-8c2d-3e4f50617283","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","environmentId":"4d5e6f70-8192-43a4-8b5c-6d7e8f901234","name":"4.3.0","scope":{"minimumPriority":"high"},"status":"held","conditions":[{"key":"all_approved","state":"met","description":"Every case in scope at or above the minimum priority has a live approval","detail":{"inScope":12,"unapproved":0,"examples":[]}},{"key":"all_passed","state":"unmet","description":"One completed run covers the scope and everything in it passed","detail":{"reason":"One case failed"}},{"key":"no_open_defects","state":"unmet","description":"No open defect blocks an asset in scope","detail":{"open":1}},{"key":"security_current","state":"met","description":"Security testing is current and its authorisation has not lapsed","detail":{"authorisation":"live","ageDays":2,"limitDays":7}}],"advisory":{"judgedResults":0,"inconsistentCases":0},"satisfyingRunId":null,"evaluatedAt":"2026-09-10T11:00:00.000Z","createdBy":"u-1042","createdAt":"2026-09-10T10:55:00.000Z"}]}}],"responses":{"200":{"description":"Releases on this application, newest first.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The release uuid."},"applicationId":{"type":"string","description":"The application."},"environmentId":{"type":"string","description":"The environment the gate is evaluated against."},"name":{"type":"string","description":"What this release is called."},"scope":{"type":"object","properties":{"assetIds":{"type":"array","items":{"type":"string"},"description":"Only cases on these assets."},"minimumPriority":{"type":"string","description":"Only cases at or above this priority. Defaults to high."}},"description":"What the gate covers."},"status":{"type":"string","description":"open, held, met or signed."},"conditions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"all_approved, all_passed, no_open_defects or security_current."},"state":{"type":"string","description":"met, unmet or not_evaluated."},"description":{"type":"string","description":"What the condition says, in a sentence."},"detail":{"type":"object","additionalProperties":{},"description":"The numbers behind it — what is unapproved, which run satisfied it, what is open."}},"required":["key","state","description","detail"],"description":"One condition of a release gate, evaluated from the record."},"description":"The four conditions and whether each holds."},"advisory":{"type":"object","properties":{"judgedResults":{"type":"number","description":"Judged results in scope. Not gating, but the signer should see it."},"inconsistentCases":{"type":"number","description":"Cases that have flipped between pass and fail. A release over forty flapping cases is a different proposition."}},"required":["judgedResults","inconsistentCases"],"description":"What does not gate but the signer should still read."},"satisfyingRunId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The completed run that satisfies the scope, or null."},"evaluatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the gate was last evaluated."},"createdBy":{"type":"string","description":"Who created it."},"createdAt":{"type":"string","format":"date-time","description":"When it was created."}},"required":["id","applicationId","environmentId","name","scope","status","conditions","advisory","satisfyingRunId","evaluatedAt","createdBy","createdAt"],"description":"A release and the state of its gate. Evaluated from the record, never asserted."},"description":"Releases on this application, newest first."}},"required":["items"],"description":"Releases on this application, newest first."},"examples":{"recent releases":{"value":{"items":[{"id":"cd34ef56-0178-49ab-8c2d-3e4f50617283","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","environmentId":"4d5e6f70-8192-43a4-8b5c-6d7e8f901234","name":"4.3.0","scope":{"minimumPriority":"high"},"status":"held","conditions":[{"key":"all_approved","state":"met","description":"Every case in scope at or above the minimum priority has a live approval","detail":{"inScope":12,"unapproved":0,"examples":[]}},{"key":"all_passed","state":"unmet","description":"One completed run covers the scope and everything in it passed","detail":{"reason":"One case failed"}},{"key":"no_open_defects","state":"unmet","description":"No open defect blocks an asset in scope","detail":{"open":1}},{"key":"security_current","state":"met","description":"Security testing is current and its authorisation has not lapsed","detail":{"authorisation":"live","ageDays":2,"limitDays":7}}],"advisory":{"judgedResults":0,"inconsistentCases":0},"satisfyingRunId":null,"evaluatedAt":"2026-09-10T11:00:00.000Z","createdBy":"u-1042","createdAt":"2026-09-10T10:55:00.000Z"}]}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"`conditions` is the state as of the last evaluation. Re-evaluate before acting on an old one.","tags":["releases"],"x-cortena-tool":"assure_release_list","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"applicationId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The application uuid, from assure_application_list or assure_whoami."},"description":"The application uuid, from assure_application_list or assure_whoami.","example":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071"}]},"post":{"operationId":"assure_release_create","summary":"Create a release and evaluate its gate.","x-cortena-access":"write","x-cortena-when-to-use":"Use when a release is being prepared, early enough that an unmet condition is still something somebody can act on.","x-cortena-examples":[{"name":"a release","summary":"Open a gate on 4.3.0","request":{"orgId":"00000000-0000-0000-0000-000000000001","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","name":"4.3.0","environmentId":"4d5e6f70-8192-43a4-8b5c-6d7e8f901234"},"response":{"id":"cd34ef56-0178-49ab-8c2d-3e4f50617283","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","environmentId":"4d5e6f70-8192-43a4-8b5c-6d7e8f901234","name":"4.3.0","scope":{"minimumPriority":"high"},"status":"held","conditions":[{"key":"all_approved","state":"met","description":"Every case in scope at or above the minimum priority has a live approval","detail":{"inScope":12,"unapproved":0,"examples":[]}},{"key":"all_passed","state":"unmet","description":"One completed run covers the scope and everything in it passed","detail":{"reason":"One case failed"}},{"key":"no_open_defects","state":"unmet","description":"No open defect blocks an asset in scope","detail":{"open":1}},{"key":"security_current","state":"met","description":"Security testing is current and its authorisation has not lapsed","detail":{"authorisation":"live","ageDays":2,"limitDays":7}}],"advisory":{"judgedResults":0,"inconsistentCases":0},"satisfyingRunId":null,"evaluatedAt":"2026-09-10T11:00:00.000Z","createdBy":"u-1042","createdAt":"2026-09-10T10:55:00.000Z"}}],"responses":{"201":{"description":"Create a release and evaluate its gate.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The release uuid."},"applicationId":{"type":"string","description":"The application."},"environmentId":{"type":"string","description":"The environment the gate is evaluated against."},"name":{"type":"string","description":"What this release is called."},"scope":{"type":"object","properties":{"assetIds":{"type":"array","items":{"type":"string"},"description":"Only cases on these assets."},"minimumPriority":{"type":"string","description":"Only cases at or above this priority. Defaults to high."}},"description":"What the gate covers."},"status":{"type":"string","description":"open, held, met or signed."},"conditions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"all_approved, all_passed, no_open_defects or security_current."},"state":{"type":"string","description":"met, unmet or not_evaluated."},"description":{"type":"string","description":"What the condition says, in a sentence."},"detail":{"type":"object","additionalProperties":{},"description":"The numbers behind it — what is unapproved, which run satisfied it, what is open."}},"required":["key","state","description","detail"],"description":"One condition of a release gate, evaluated from the record."},"description":"The four conditions and whether each holds."},"advisory":{"type":"object","properties":{"judgedResults":{"type":"number","description":"Judged results in scope. Not gating, but the signer should see it."},"inconsistentCases":{"type":"number","description":"Cases that have flipped between pass and fail. A release over forty flapping cases is a different proposition."}},"required":["judgedResults","inconsistentCases"],"description":"What does not gate but the signer should still read."},"satisfyingRunId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The completed run that satisfies the scope, or null."},"evaluatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the gate was last evaluated."},"createdBy":{"type":"string","description":"Who created it."},"createdAt":{"type":"string","format":"date-time","description":"When it was created."}},"required":["id","applicationId","environmentId","name","scope","status","conditions","advisory","satisfyingRunId","evaluatedAt","createdBy","createdAt"],"description":"A release and the state of its gate. Evaluated from the record, never asserted."},"examples":{"a release":{"value":{"id":"cd34ef56-0178-49ab-8c2d-3e4f50617283","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","environmentId":"4d5e6f70-8192-43a4-8b5c-6d7e8f901234","name":"4.3.0","scope":{"minimumPriority":"high"},"status":"held","conditions":[{"key":"all_approved","state":"met","description":"Every case in scope at or above the minimum priority has a live approval","detail":{"inScope":12,"unapproved":0,"examples":[]}},{"key":"all_passed","state":"unmet","description":"One completed run covers the scope and everything in it passed","detail":{"reason":"One case failed"}},{"key":"no_open_defects","state":"unmet","description":"No open defect blocks an asset in scope","detail":{"open":1}},{"key":"security_current","state":"met","description":"Security testing is current and its authorisation has not lapsed","detail":{"authorisation":"live","ageDays":2,"limitDays":7}}],"advisory":{"judgedResults":0,"inconsistentCases":0},"satisfyingRunId":null,"evaluatedAt":"2026-09-10T11:00:00.000Z","createdBy":"u-1042","createdAt":"2026-09-10T10:55:00.000Z"}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"The gate is evaluated immediately, so the response already carries the four conditions and whether each holds. `minimumPriority` defaults to high: a release gate that waited on every low-priority case would never go green and would therefore be ignored.","tags":["releases"],"x-cortena-tool":"assure_release_create","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"applicationId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The application uuid, from assure_application_list or assure_whoami."},"description":"The application uuid, from assure_application_list or assure_whoami.","example":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"What this release is called — a version, a date, a tag."},"environmentId":{"type":"string","format":"uuid","description":"The environment the gate is evaluated against."},"scope":{"type":"object","properties":{"assetIds":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Only cases on these assets."},"minimumPriority":{"type":"string","enum":["high","medium","low"],"description":"high, medium or low."}},"default":{},"description":"What the gate covers."}},"required":["name","environmentId"]},"examples":{"a release":{"value":{"name":"4.3.0","environmentId":"4d5e6f70-8192-43a4-8b5c-6d7e8f901234"}}}}}}}},"/v1/orgs/{orgId}/applications/{applicationId}/repos":{"post":{"operationId":"assure_repo_add","summary":"Register a repository this application’s cases cite.","x-cortena-access":"write","x-cortena-when-to-use":"Use to record a repository ahead of a session, or to attach a role hint so a reader can tell the screens repository from the backend one.","x-cortena-examples":[{"name":"the backend","summary":"Record where the API lives","request":{"orgId":"00000000-0000-0000-0000-000000000001","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","owner":"acme","name":"payments-api","roleHint":"backend"},"response":{"id":"7b8c9d0e-1f20-4314-8556-6a7b8c9d0e1f","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","owner":"acme","name":"payments-api","roleHint":"backend","segmentsAllowed":null,"lastSeenSha":null,"lastSeenAt":null,"createdAt":"2026-09-01T09:00:00.000Z"}}],"responses":{"201":{"description":"Register a repository this application’s cases cite.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The repository reference uuid."},"applicationId":{"type":"string","description":"The application it belongs to."},"owner":{"type":"string","description":"The repository owner or organisation."},"name":{"type":"string","description":"The repository name."},"roleHint":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"backend, screens, database, jobs or mixed — or null."},"segmentsAllowed":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Segments this repository may source cases for, or null for all."},"lastSeenSha":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The most recent commit a session reported. Assure is told; it does not look."},"lastSeenAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When that commit was reported."},"createdAt":{"type":"string","format":"date-time","description":"When the reference was registered."}},"required":["id","applicationId","owner","name","roleHint","segmentsAllowed","lastSeenSha","lastSeenAt","createdAt"],"description":"A reference to a repository, not a connection. Assure never reaches a repository."},"examples":{"the backend":{"value":{"id":"7b8c9d0e-1f20-4314-8556-6a7b8c9d0e1f","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","owner":"acme","name":"payments-api","roleHint":"backend","segmentsAllowed":null,"lastSeenSha":null,"lastSeenAt":null,"createdAt":"2026-09-01T09:00:00.000Z"}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"A reference, not a connection: Assure never reaches a repository. The row exists so a case can record where its claim came from. Opening a batch that names an unregistered repository registers it on the spot, so this is rarely needed by hand.","tags":["applications"],"x-cortena-tool":"assure_repo_add","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"applicationId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The application uuid, from assure_application_list or assure_whoami."},"description":"The application uuid, from assure_application_list or assure_whoami.","example":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"owner":{"type":"string","minLength":1,"description":"The repository owner or organisation."},"name":{"type":"string","minLength":1,"description":"The repository name."},"roleHint":{"type":"string","enum":["backend","screens","database","jobs","mixed"],"description":"What this repository is, so a reader can tell two apart."},"segmentsAllowed":{"type":"array","items":{"type":"string","enum":["screen","api","database","security","performance"],"description":"Which kind of thing is being asserted: screen, api, database, security or performance."},"description":"Segments this repository may source cases for. Omitted means all."}},"required":["owner","name"]},"examples":{"the backend":{"value":{"owner":"acme","name":"payments-api","roleHint":"backend"}}}}}}}},"/v1/orgs/{orgId}/applications/{applicationId}/review/next":{"get":{"operationId":"assure_review_next","summary":"The next case awaiting review, with what is needed to explain it.","x-cortena-access":"read","x-cortena-when-to-use":"Use to drive a walkthrough, one case at a time. Relay the reviewer’s answer with assure_case_present.","x-cortena-examples":[{"name":"next up","summary":"One case to explain","request":{"orgId":"00000000-0000-0000-0000-000000000001","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071"},"response":{"case":{"id":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","assetId":"5a6b7c8d-9e0f-4102-8334-4556677889aa","publicId":"PAY-014","segment":"api","securityClass":null,"checkKind":"behavioural","priority":"high","status":"waiting","currentVersionId":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","approvedVersionId":null,"batchId":"9a8b7c6d-5e4f-4302-8a1b-0c9d8e7f6051","createdAt":"2026-09-09T10:05:00.000Z","retiredAt":null,"asset":{"id":"5a6b7c8d-9e0f-4102-8334-4556677889aa","key":"api:POST /v1/transfers","name":"POST /v1/transfers","path":"src/routes/transfers.ts"},"currentVersion":{"id":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","caseId":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","version":1,"title":"Rejects a transfer that would breach the daily limit","preconditions":["A teller account with a daily allowance already part-used"],"steps":["Sign in as a teller","Post a transfer above the remaining daily allowance"],"expected":"The call returns status 422 and the transfer is not created. The daily total is unchanged.","notes":"The limit check reads the running total before the write but does not lock it.","evidenceRefs":[{"path":"src/routes/transfers.ts","line":88,"sha":"8f3c1a"}],"viewports":null,"themes":null,"thresholdSourced":null,"authoredBy":{"kind":"agent","tool":"claude-code","onBehalfOf":"u-1042"},"createdAt":"2026-09-09T10:05:00.000Z","supersededAt":null},"approval":null,"approvedVia":null,"inconsistencyRate":null},"siblingCases":[],"remaining":9,"done":false}},{"name":"nothing waiting","summary":"The queue is empty","request":{"orgId":"00000000-0000-0000-0000-000000000001","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071"},"response":{"remaining":0,"done":true}}],"responses":{"200":{"description":"The next case awaiting review, with what is needed to explain it.","content":{"application/json":{"schema":{"type":"object","properties":{"case":{"type":"object","properties":{"id":{"type":"string","description":"The case uuid."},"applicationId":{"type":"string","description":"The application."},"assetId":{"type":"string","description":"What the case is about."},"publicId":{"type":"string","description":"Permanent and never renumbered — quote this to a person."},"segment":{"type":"string","description":"screen, api, database, security or performance."},"securityClass":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"For a security case, which class. Null otherwise."},"checkKind":{"type":"string","description":"behavioural, measured or judged."},"priority":{"type":"string","description":"high, medium or low."},"status":{"type":"string","description":"waiting, approved, changes_requested or retired."},"currentVersionId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The version as it stands now."},"approvedVersionId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The version a counted run may execute. Null unless approved."},"batchId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The batch it was written in."},"createdAt":{"type":"string","format":"date-time","description":"When it was written."},"retiredAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When it was retired, or null."},"asset":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","description":"The asset uuid."},"key":{"type":"string","description":"The stable asset key."},"name":{"type":"string","description":"The display name."},"path":{"type":"string","description":"Where it lives."}},"required":["id","key","name","path"]},{"type":"null"}],"description":"What the case is about."},"currentVersion":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","description":"The version uuid — this is what an approval pins."},"caseId":{"type":"string","description":"The case."},"version":{"type":"number","description":"1, 2, 3 … Every edit mints a new one."},"title":{"type":"string","description":"What the case asserts, in one line."},"preconditions":{"type":"array","items":{"type":"string"},"description":"What must already be true before the steps make sense."},"steps":{"type":"array","items":{"type":"string"},"description":"What to do, in order."},"expected":{"type":"string","description":"The truth source: the statement that decides pass from fail."},"notes":{"type":"string","description":"Why this case exists, in terms of the code."},"evidenceRefs":{"type":"array","items":{"type":"object","properties":{"repo":{"type":"string","description":"The repository, when the case spans more than one."},"path":{"type":"string","minLength":1,"description":"The file the claim was read from."},"line":{"type":"integer","minimum":0,"description":"The line number in that file."},"sha":{"type":"string","minLength":1,"description":"The commit the file was read at."}},"required":["path","line","sha"],"description":"Where a claim came from. Required on every case — a case with no evidence reference is refused."},"description":"Where the claim came from."},"viewports":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Screen cases: the viewport widths to run at."},"themes":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Screen cases: the themes to run under."},"thresholdSourced":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Performance: false means the session found no basis in the repository for the number."},"authoredBy":{"type":"object","properties":{"kind":{"type":"string","description":"human, agent or system."},"userId":{"type":"string","description":"The Cortena user id, when a person was acting directly."},"displayName":{"type":"string","description":"The name to show. For an agent, the person it acted for."},"tool":{"type":"string","description":"The software holding the token — \"claude-code\" and the like."},"model":{"type":"string","description":"The model behind the tool, when it named one."},"externallyRouted":{"type":"boolean","description":"True when the model sits outside the customer network."},"onBehalfOf":{"type":"string","description":"The user id an agent was acting for."}},"required":["kind"],"description":"Who wrote this version."},"createdAt":{"type":"string","format":"date-time","description":"When it was written."},"supersededAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When a later version replaced it, or null while it is current."}},"required":["id","caseId","version","title","preconditions","steps","expected","notes","evidenceRefs","viewports","themes","thresholdSourced","authoredBy","createdAt","supersededAt"],"description":"The English a person reads and approves. Immutable once superseded."},{"type":"null"}],"description":"The version as it stands — read this before approving."},"approval":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","description":"The approval uuid."},"caseId":{"type":"string","description":"The case."},"caseVersionId":{"type":"string","description":"The version that was approved. An approval pins a version, never a case."},"approvedByUserId":{"type":"string","description":"The person it is recorded against."},"approvedByName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Their name, suffixed with the tool when software held the token."},"approvedAt":{"type":"string","format":"date-time","description":"When it was approved."},"via":{"type":"string","description":"interface when somebody clicked, walkthrough when an agent presented it to them."},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why it was approved."},"revokedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the approval was revoked, or null while it stands."},"revokedReason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"case_edited or withdrawn."}},"required":["id","caseId","caseVersionId","approvedByUserId","approvedByName","approvedAt","via","note","revokedAt","revokedReason"],"description":"The attribution of D5 and the pin of D6. Append-only: a revoked approval is marked, never deleted."},{"type":"null"}],"description":"The live approval, or null."},"approvedVia":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"interface or walkthrough, from the live approval."},"inconsistencyRate":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"How often this case has flipped between pass and fail over its recent history, or null when there is too little history."}},"required":["id","applicationId","assetId","publicId","segment","securityClass","checkKind","priority","status","currentVersionId","approvedVersionId","batchId","createdAt","retiredAt","asset","currentVersion","approval","approvedVia","inconsistencyRate"],"description":"One case with everything needed to read it, approve it or explain it."},"siblingCases":{"type":"array","items":{"type":"object","properties":{"publicId":{"type":"string","description":"The sibling case’s public id."},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"What it asserts."}},"required":["publicId","title"]},"description":"Cases already approved on the same asset, so you can explain this one rather than read it aloud."},"remaining":{"type":"number","description":"How many are still waiting, this one included."},"done":{"type":"boolean","description":"True when nothing is waiting."}},"required":["remaining","done"],"description":"The next case to walk somebody through, with the context needed to explain it."},"examples":{"next up":{"value":{"case":{"id":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","assetId":"5a6b7c8d-9e0f-4102-8334-4556677889aa","publicId":"PAY-014","segment":"api","securityClass":null,"checkKind":"behavioural","priority":"high","status":"waiting","currentVersionId":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","approvedVersionId":null,"batchId":"9a8b7c6d-5e4f-4302-8a1b-0c9d8e7f6051","createdAt":"2026-09-09T10:05:00.000Z","retiredAt":null,"asset":{"id":"5a6b7c8d-9e0f-4102-8334-4556677889aa","key":"api:POST /v1/transfers","name":"POST /v1/transfers","path":"src/routes/transfers.ts"},"currentVersion":{"id":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","caseId":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","version":1,"title":"Rejects a transfer that would breach the daily limit","preconditions":["A teller account with a daily allowance already part-used"],"steps":["Sign in as a teller","Post a transfer above the remaining daily allowance"],"expected":"The call returns status 422 and the transfer is not created. The daily total is unchanged.","notes":"The limit check reads the running total before the write but does not lock it.","evidenceRefs":[{"path":"src/routes/transfers.ts","line":88,"sha":"8f3c1a"}],"viewports":null,"themes":null,"thresholdSourced":null,"authoredBy":{"kind":"agent","tool":"claude-code","onBehalfOf":"u-1042"},"createdAt":"2026-09-09T10:05:00.000Z","supersededAt":null},"approval":null,"approvedVia":null,"inconsistencyRate":null},"siblingCases":[],"remaining":9,"done":false}},"nothing waiting":{"value":{"remaining":0,"done":true}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"Comes back with the cases already approved on the same asset, so a reviewer hears how this one fits rather than having it read aloud at them.","tags":["review"],"x-cortena-tool":"assure_review_next","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"applicationId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The application uuid, from assure_application_list or assure_whoami."},"description":"The application uuid, from assure_application_list or assure_whoami.","example":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071"},{"name":"segment","in":"query","required":false,"schema":{"type":"string","enum":["screen","api","database","security","performance"],"description":"Which kind of thing is being asserted: screen, api, database, security or performance."},"description":"Walk one segment at a time."},{"name":"batchId","in":"query","required":false,"schema":{"type":"string","format":"uuid","description":"Walk one session’s cases at a time."},"description":"Walk one session’s cases at a time."}]}},"/v1/orgs/{orgId}/applications/{applicationId}/runs":{"get":{"operationId":"assure_run_list","summary":"The fifty most recent runs on this application, newest first.","x-cortena-access":"read","x-cortena-when-to-use":"Use to answer \"when did we last run this, and what happened\", and to find the run id a report or a verdict refers to.","x-cortena-examples":[{"name":"history","summary":"What has been run lately","request":{"orgId":"00000000-0000-0000-0000-000000000001","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071"},"response":{"items":[{"id":"1a2b3c4d-5e6f-4718-8920-a1b2c3d4e5f6","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","environmentId":"4d5e6f70-8192-43a4-8b5c-6d7e8f901234","publicId":"RUN-0007","openedByUserId":"u-1042","actor":{"kind":"agent","tool":"claude-code","onBehalfOf":"u-1042"},"scope":{"minimumPriority":"high"},"includeDrafts":false,"fullEvidence":false,"status":"open","counts":{"total":12,"passed":0,"failed":0,"skipped":0,"errored":0,"refused":0,"judged":0,"remaining":12},"queue":[{"caseId":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80"}],"cursor":0,"openedAt":"2026-09-10T09:00:00.000Z","closedAt":null,"heartbeatAt":"2026-09-10T09:00:00.000Z"}]}}],"responses":{"200":{"description":"The fifty most recent runs on this application, newest first.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The run uuid."},"applicationId":{"type":"string","description":"The application."},"environmentId":{"type":"string","description":"Where it is being executed."},"publicId":{"type":"string","description":"RUN-0007 and the like — quote this to a person."},"openedByUserId":{"type":"string","description":"The person whose session opened it."},"actor":{"type":"object","properties":{"kind":{"type":"string","description":"human, agent or system."},"userId":{"type":"string","description":"The Cortena user id, when a person was acting directly."},"displayName":{"type":"string","description":"The name to show. For an agent, the person it acted for."},"tool":{"type":"string","description":"The software holding the token — \"claude-code\" and the like."},"model":{"type":"string","description":"The model behind the tool, when it named one."},"externallyRouted":{"type":"boolean","description":"True when the model sits outside the customer network."},"onBehalfOf":{"type":"string","description":"The user id an agent was acting for."}},"required":["kind"],"description":"Who opened it."},"scope":{"type":"object","properties":{"whole":{"type":"boolean","description":"Everything in the application."},"assetIds":{"type":"array","items":{"type":"string"},"description":"Only cases on these assets."},"caseIds":{"type":"array","items":{"type":"string"},"description":"Only these cases."},"segments":{"type":"array","items":{"type":"string"},"description":"Only these segments."},"minimumPriority":{"type":"string","description":"Only cases at or above this priority."}},"description":"What the run covers, as it was asked for."},"includeDrafts":{"type":"boolean","description":"True means unapproved cases are executed too. Their results never count toward coverage or a gate."},"fullEvidence":{"type":"boolean","description":"True asks the session for evidence on every result, not only failures."},"status":{"type":"string","description":"open, completed or abandoned."},"counts":{"type":"object","properties":{"total":{"type":"number","description":"How many entries the work list held when the run opened."},"passed":{"type":"number","description":"Results the session reported as passed."},"failed":{"type":"number","description":"Results the session reported as failed."},"skipped":{"type":"number","description":"Results the session skipped, with a reason."},"errored":{"type":"number","description":"Results that could not be executed."},"refused":{"type":"number","description":"Cases Assure declined to hand over. Counted separately — a run that refused 400 cases is not a passing run."},"judged":{"type":"number","description":"Judged screen results. Reported, never counted toward a gate."},"remaining":{"type":"number","description":"How much of the work list is left."}},"required":["total","passed","failed","skipped","errored","refused","judged","remaining"],"description":"What this run has produced so far. Assure owns these figures."},"queue":{"type":"array","items":{"type":"object","properties":{"caseId":{"type":"string","description":"The case."},"variant":{"type":"object","properties":{"viewport":{"type":"number","description":"The viewport width this execution covers."},"theme":{"type":"string","description":"The theme this execution covers."}},"description":"For a screen case, the viewport and theme one execution covers."}},"required":["caseId"]},"description":"The ordered work list, minted at open. One entry is one case at one variant."},"cursor":{"type":"number","description":"How far through the work list the session has been handed."},"openedAt":{"type":"string","format":"date-time","description":"When the run opened."},"closedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When it closed, or null while it is open."},"heartbeatAt":{"type":"string","format":"date-time","description":"The last sign of life. A run that goes quiet is marked abandoned and keeps its results."}},"required":["id","applicationId","environmentId","publicId","openedByUserId","actor","scope","includeDrafts","fullEvidence","status","counts","queue","cursor","openedAt","closedAt","heartbeatAt"],"description":"One session working through a list. There is no queue service and no dispatcher — Assure executes nothing."},"description":"The fifty most recent runs, newest first."}},"required":["items"],"description":"The fifty most recent runs, newest first."},"examples":{"history":{"value":{"items":[{"id":"1a2b3c4d-5e6f-4718-8920-a1b2c3d4e5f6","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","environmentId":"4d5e6f70-8192-43a4-8b5c-6d7e8f901234","publicId":"RUN-0007","openedByUserId":"u-1042","actor":{"kind":"agent","tool":"claude-code","onBehalfOf":"u-1042"},"scope":{"minimumPriority":"high"},"includeDrafts":false,"fullEvidence":false,"status":"open","counts":{"total":12,"passed":0,"failed":0,"skipped":0,"errored":0,"refused":0,"judged":0,"remaining":12},"queue":[{"caseId":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80"}],"cursor":0,"openedAt":"2026-09-10T09:00:00.000Z","closedAt":null,"heartbeatAt":"2026-09-10T09:00:00.000Z"}]}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"An abandoned run is in here too. A session that dies mid-run keeps its results — six hundred results are not thrown away because a laptop closed — and the run is marked abandoned so it satisfies no gate but still shows in history.","tags":["runs"],"x-cortena-tool":"assure_run_list","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"applicationId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The application uuid, from assure_application_list or assure_whoami."},"description":"The application uuid, from assure_application_list or assure_whoami.","example":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071"}]},"post":{"operationId":"assure_run_open","summary":"Open a run against an environment.","x-cortena-access":"write","x-cortena-when-to-use":"Use once per execution session, after the cases you intend to run have been approved. Include drafts only when you are deliberately running unapproved work — those results never count toward coverage or a gate.","x-cortena-examples":[{"name":"a release run","summary":"Run the high-priority cases against staging","request":{"orgId":"00000000-0000-0000-0000-000000000001","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","environmentId":"4d5e6f70-8192-43a4-8b5c-6d7e8f901234","scope":{"minimumPriority":"high"}},"response":{"id":"1a2b3c4d-5e6f-4718-8920-a1b2c3d4e5f6","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","environmentId":"4d5e6f70-8192-43a4-8b5c-6d7e8f901234","publicId":"RUN-0007","openedByUserId":"u-1042","actor":{"kind":"agent","tool":"claude-code","onBehalfOf":"u-1042"},"scope":{"minimumPriority":"high"},"includeDrafts":false,"fullEvidence":false,"status":"open","counts":{"total":12,"passed":0,"failed":0,"skipped":0,"errored":0,"refused":0,"judged":0,"remaining":12},"queue":[{"caseId":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80"}],"cursor":0,"openedAt":"2026-09-10T09:00:00.000Z","closedAt":null,"heartbeatAt":"2026-09-10T09:00:00.000Z"}}],"responses":{"201":{"description":"Open a run against an environment.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The run uuid."},"applicationId":{"type":"string","description":"The application."},"environmentId":{"type":"string","description":"Where it is being executed."},"publicId":{"type":"string","description":"RUN-0007 and the like — quote this to a person."},"openedByUserId":{"type":"string","description":"The person whose session opened it."},"actor":{"type":"object","properties":{"kind":{"type":"string","description":"human, agent or system."},"userId":{"type":"string","description":"The Cortena user id, when a person was acting directly."},"displayName":{"type":"string","description":"The name to show. For an agent, the person it acted for."},"tool":{"type":"string","description":"The software holding the token — \"claude-code\" and the like."},"model":{"type":"string","description":"The model behind the tool, when it named one."},"externallyRouted":{"type":"boolean","description":"True when the model sits outside the customer network."},"onBehalfOf":{"type":"string","description":"The user id an agent was acting for."}},"required":["kind"],"description":"Who opened it."},"scope":{"type":"object","properties":{"whole":{"type":"boolean","description":"Everything in the application."},"assetIds":{"type":"array","items":{"type":"string"},"description":"Only cases on these assets."},"caseIds":{"type":"array","items":{"type":"string"},"description":"Only these cases."},"segments":{"type":"array","items":{"type":"string"},"description":"Only these segments."},"minimumPriority":{"type":"string","description":"Only cases at or above this priority."}},"description":"What the run covers, as it was asked for."},"includeDrafts":{"type":"boolean","description":"True means unapproved cases are executed too. Their results never count toward coverage or a gate."},"fullEvidence":{"type":"boolean","description":"True asks the session for evidence on every result, not only failures."},"status":{"type":"string","description":"open, completed or abandoned."},"counts":{"type":"object","properties":{"total":{"type":"number","description":"How many entries the work list held when the run opened."},"passed":{"type":"number","description":"Results the session reported as passed."},"failed":{"type":"number","description":"Results the session reported as failed."},"skipped":{"type":"number","description":"Results the session skipped, with a reason."},"errored":{"type":"number","description":"Results that could not be executed."},"refused":{"type":"number","description":"Cases Assure declined to hand over. Counted separately — a run that refused 400 cases is not a passing run."},"judged":{"type":"number","description":"Judged screen results. Reported, never counted toward a gate."},"remaining":{"type":"number","description":"How much of the work list is left."}},"required":["total","passed","failed","skipped","errored","refused","judged","remaining"],"description":"What this run has produced so far. Assure owns these figures."},"queue":{"type":"array","items":{"type":"object","properties":{"caseId":{"type":"string","description":"The case."},"variant":{"type":"object","properties":{"viewport":{"type":"number","description":"The viewport width this execution covers."},"theme":{"type":"string","description":"The theme this execution covers."}},"description":"For a screen case, the viewport and theme one execution covers."}},"required":["caseId"]},"description":"The ordered work list, minted at open. One entry is one case at one variant."},"cursor":{"type":"number","description":"How far through the work list the session has been handed."},"openedAt":{"type":"string","format":"date-time","description":"When the run opened."},"closedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When it closed, or null while it is open."},"heartbeatAt":{"type":"string","format":"date-time","description":"The last sign of life. A run that goes quiet is marked abandoned and keeps its results."}},"required":["id","applicationId","environmentId","publicId","openedByUserId","actor","scope","includeDrafts","fullEvidence","status","counts","queue","cursor","openedAt","closedAt","heartbeatAt"],"description":"One session working through a list. There is no queue service and no dispatcher — Assure executes nothing."},"examples":{"a release run":{"value":{"id":"1a2b3c4d-5e6f-4718-8920-a1b2c3d4e5f6","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","environmentId":"4d5e6f70-8192-43a4-8b5c-6d7e8f901234","publicId":"RUN-0007","openedByUserId":"u-1042","actor":{"kind":"agent","tool":"claude-code","onBehalfOf":"u-1042"},"scope":{"minimumPriority":"high"},"includeDrafts":false,"fullEvidence":false,"status":"open","counts":{"total":12,"passed":0,"failed":0,"skipped":0,"errored":0,"refused":0,"judged":0,"remaining":12},"queue":[{"caseId":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80"}],"cursor":0,"openedAt":"2026-09-10T09:00:00.000Z","closedAt":null,"heartbeatAt":"2026-09-10T09:00:00.000Z"}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"The work list is minted here, so a run has a knowable scope even if the session dies half way through it. A screen case is enqueued once per viewport per theme — which is how \"is it responsive\" becomes six answerable questions instead of one unanswerable one. One open run per person per application: a second is refused with the first one’s id.","tags":["runs"],"x-cortena-tool":"assure_run_open","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"applicationId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The application uuid, from assure_application_list or assure_whoami."},"description":"The application uuid, from assure_application_list or assure_whoami.","example":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"environmentId":{"type":"string","format":"uuid","description":"Where the cases will be executed."},"scope":{"type":"object","properties":{"whole":{"type":"boolean","description":"Everything in the application."},"assetIds":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Only cases on these assets."},"caseIds":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Only these cases."},"segments":{"type":"array","items":{"type":"string"},"description":"Only these segments."},"minimumPriority":{"type":"string","enum":["high","medium","low"],"description":"high, medium or low."}},"default":{},"description":"What to run. Omitted, the run covers every approved case in the application."},"includeDrafts":{"type":"boolean","description":"Unapproved cases too. Their results are recorded and shown, and never count toward coverage or a gate."},"fullEvidence":{"type":"boolean","description":"Ask for evidence on every result, not only failures."}},"required":["environmentId"]},"examples":{"a release run":{"value":{"environmentId":"4d5e6f70-8192-43a4-8b5c-6d7e8f901234","scope":{"minimumPriority":"high"}}}}}}}}},"/v1/orgs/{orgId}/applications/{applicationId}/security/findings":{"get":{"operationId":"assure_security_finding_list","summary":"Security findings on this application, newest first.","x-cortena-access":"read","x-cortena-when-to-use":"Use before a release, and whenever somebody asks what security work is outstanding.","x-cortena-examples":[{"name":"outstanding","summary":"What security work is open","request":{"orgId":"00000000-0000-0000-0000-000000000001","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071"},"response":{"items":[{"id":"de45f067-1289-4abc-8d3e-4f5061728394","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","assetId":null,"class":"exposure","severity":"medium","title":"Account numbers appear in the transfer error response","detail":"A 422 from POST /v1/transfers echoes the full account number.","status":"open","acceptedUntil":null,"acceptedByUserId":null,"acceptedReason":null,"defectId":null,"firstSeenRunId":null,"lastSeenRunId":null,"createdAt":"2026-09-05T14:00:00.000Z"}]}}],"responses":{"200":{"description":"Security findings on this application, newest first.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The finding uuid."},"applicationId":{"type":"string","description":"The application."},"assetId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"What it was found on, when that is known."},"class":{"type":"string","description":"The security class."},"severity":{"type":"string","description":"critical, high, medium or low."},"title":{"type":"string","description":"What was found, in one line."},"detail":{"type":"string","description":"What was observed, and why it matters."},"status":{"type":"string","description":"open, accepted or closed."},"acceptedUntil":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Acceptance expires; on expiry the finding returns to open."},"acceptedByUserId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Who accepted it."},"acceptedReason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why it was accepted."},"defectId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The defect raised from it, when there is one."},"firstSeenRunId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The run it first appeared in."},"lastSeenRunId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The run it was last seen in."},"createdAt":{"type":"string","format":"date-time","description":"When it was recorded."}},"required":["id","applicationId","assetId","class","severity","title","detail","status","acceptedUntil","acceptedByUserId","acceptedReason","defectId","firstSeenRunId","lastSeenRunId","createdAt"],"description":"A security finding. Accepting one expires; it does not close it."},"description":"Every security finding on this application, newest first."}},"required":["items"],"description":"Every security finding on this application, newest first."},"examples":{"outstanding":{"value":{"items":[{"id":"de45f067-1289-4abc-8d3e-4f5061728394","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","assetId":null,"class":"exposure","severity":"medium","title":"Account numbers appear in the transfer error response","detail":"A 422 from POST /v1/transfers echoes the full account number.","status":"open","acceptedUntil":null,"acceptedByUserId":null,"acceptedReason":null,"defectId":null,"firstSeenRunId":null,"lastSeenRunId":null,"createdAt":"2026-09-05T14:00:00.000Z"}]}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"Accepting a finding expires; it does not close it. On expiry the finding returns to open, which is why `acceptedUntil` is on every row.","tags":["security"],"x-cortena-tool":"assure_security_finding_list","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"applicationId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The application uuid, from assure_application_list or assure_whoami."},"description":"The application uuid, from assure_application_list or assure_whoami.","example":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071"}]}},"/v1/orgs/{orgId}/audit":{"get":{"operationId":"assure_audit_list","summary":"The append-only record of what happened, newest first.","x-cortena-access":"read","x-cortena-when-to-use":"Use to answer \"who did this and when\", and to tell an agent’s work from a person’s — filter by `actorKind` for exactly that.","x-cortena-examples":[{"name":"what an agent did","summary":"Separate a session’s work from a person’s","request":{"orgId":"00000000-0000-0000-0000-000000000001","actorKind":"agent","limit":50},"response":{"items":[{"id":4821,"orgId":"00000000-0000-0000-0000-000000000001","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","at":"2026-09-10T10:15:00.000Z","actor":{"kind":"agent","tool":"claude-code","onBehalfOf":"u-1042"},"action":"defect.raised","subject":{"type":"defect","id":"bc23de45-f067-489a-8b1c-2d3e4f506172","publicId":"PAY-D003"},"detail":{"severity":"high","results":1}}]}}],"responses":{"200":{"description":"The append-only record of what happened, newest first.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number","description":"The event id, monotonically increasing."},"orgId":{"type":"string","description":"The organisation."},"applicationId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The application, when the event had one."},"at":{"type":"string","format":"date-time","description":"When it happened."},"actor":{"type":"object","properties":{"kind":{"type":"string","description":"human, agent or system."},"userId":{"type":"string","description":"The Cortena user id, when a person was acting directly."},"displayName":{"type":"string","description":"The name to show. For an agent, the person it acted for."},"tool":{"type":"string","description":"The software holding the token — \"claude-code\" and the like."},"model":{"type":"string","description":"The model behind the tool, when it named one."},"externallyRouted":{"type":"boolean","description":"True when the model sits outside the customer network."},"onBehalfOf":{"type":"string","description":"The user id an agent was acting for."}},"required":["kind"],"description":"Who caused it."},"action":{"type":"string","description":"case.approved, run.closed, release.signed and the like."},"subject":{"type":"object","properties":{"type":{"type":"string","description":"What kind of thing it was about."},"id":{"type":"string","description":"Its uuid."},"publicId":{"type":"string","description":"Its public id, when it has one."}},"required":["type"],"description":"What the event was about."},"detail":{"type":"object","additionalProperties":{},"description":"Whatever the event recorded."}},"required":["id","orgId","applicationId","at","actor","action","subject","detail"],"description":"One entry in the append-only record a sign-off is drawn from."},"description":"The matching events, newest first."}},"required":["items"],"description":"The matching events, newest first."},"examples":{"what an agent did":{"value":{"items":[{"id":4821,"orgId":"00000000-0000-0000-0000-000000000001","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","at":"2026-09-10T10:15:00.000Z","actor":{"kind":"agent","tool":"claude-code","onBehalfOf":"u-1042"},"action":"defect.raised","subject":{"type":"defect","id":"bc23de45-f067-489a-8b1c-2d3e4f506172","publicId":"PAY-D003"},"detail":{"severity":"high","results":1}}]}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"Every state change by a person, a session or the system. This is what a sign-off is drawn from, which is why it is never updated inside the retention window.","tags":["audit"],"x-cortena-tool":"assure_audit_list","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"applicationId","in":"query","required":false,"schema":{"type":"string","format":"uuid","description":"Only events about this application."},"description":"Only events about this application."},{"name":"action","in":"query","required":false,"schema":{"type":"string","description":"Only this action — case.approved, run.closed, release.signed and the like."},"description":"Only this action — case.approved, run.closed, release.signed and the like."},{"name":"actorKind","in":"query","required":false,"schema":{"type":"string","enum":["human","agent","system"],"description":"Only events caused by this kind of actor."},"description":"Only events caused by this kind of actor.","example":"agent"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":1000,"description":"How many to return. Defaults to 200."},"description":"How many to return. Defaults to 200.","example":50}]}},"/v1/orgs/{orgId}/authorizations/{authorizationId}":{"delete":{"operationId":"assure_security_authorization_revoke","summary":"Revoke a security authorisation.","x-cortena-access":"write","x-cortena-when-to-use":"Use the moment a security exercise ends, rather than waiting for the expiry to do it.","x-cortena-examples":[{"name":"revoked","summary":"End an exercise","request":{"orgId":"00000000-0000-0000-0000-000000000001","authorizationId":"ab12cd34-ef56-4789-8a0b-1c2d3e4f5061"}}],"responses":{"204":{"description":"Revoke a security authorisation."},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"The row is marked revoked rather than deleted, so the record still says it existed and when it stopped. Security cases stop dispatching immediately. Answers 204 with no body.","tags":["security"],"x-cortena-tool-exempt-reason":"credential lifecycle is an administrator action in the Assure UI, not an agent capability; there is no delegable scope for it (DESIGN-D6).","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"authorizationId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The security authorisation uuid, from assure_security_authorization_list."},"description":"The security authorisation uuid, from assure_security_authorization_list.","example":"ab12cd34-ef56-4789-8a0b-1c2d3e4f5061"}]}},"/v1/orgs/{orgId}/batches/{batchId}":{"get":{"operationId":"assure_batch_get","summary":"One batch, with its counts and refusal tally.","x-cortena-access":"read","x-cortena-when-to-use":"Use mid-session to see how many cases have been accepted and why any were refused.","x-cortena-examples":[{"name":"in flight","summary":"How this session is doing","request":{"orgId":"00000000-0000-0000-0000-000000000001","batchId":"9a8b7c6d-5e4f-4302-8a1b-0c9d8e7f6051"},"response":{"id":"9a8b7c6d-5e4f-4302-8a1b-0c9d8e7f6051","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","openedByUserId":"u-1042","actor":{"kind":"agent","tool":"claude-code","onBehalfOf":"u-1042","displayName":"R. Mehta"},"repoId":null,"repoSha":"8f3c1a9","label":"claude-code","status":"open","counts":{"written":0,"refusedAtSubmission":0,"accepted":0,"approvedSoFar":0,"sentBackSoFar":0},"refusalReasons":{},"openedAt":"2026-09-09T10:00:00.000Z","submittedAt":null}}],"responses":{"200":{"description":"One batch, with its counts and refusal tally.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The batch uuid."},"applicationId":{"type":"string","description":"The application."},"openedByUserId":{"type":"string","description":"The person whose session opened it."},"actor":{"type":"object","properties":{"kind":{"type":"string","description":"human, agent or system."},"userId":{"type":"string","description":"The Cortena user id, when a person was acting directly."},"displayName":{"type":"string","description":"The name to show. For an agent, the person it acted for."},"tool":{"type":"string","description":"The software holding the token — \"claude-code\" and the like."},"model":{"type":"string","description":"The model behind the tool, when it named one."},"externallyRouted":{"type":"boolean","description":"True when the model sits outside the customer network."},"onBehalfOf":{"type":"string","description":"The user id an agent was acting for."}},"required":["kind"],"description":"Who opened it — a session, and the person it acted for."},"repoId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The repository reference, registered on the spot when the application had never seen it."},"repoSha":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The commit the session said it was reading."},"label":{"type":"string","description":"A short name for the batch, so a reviewer can tell two apart."},"status":{"type":"string","description":"open or submitted."},"counts":{"type":"object","properties":{"written":{"type":"number","description":"Cases offered to this batch, accepted or not."},"refusedAtSubmission":{"type":"number","description":"Cases refused on arrival for not meeting the conventions."},"accepted":{"type":"number","description":"Cases written into the record."},"approvedSoFar":{"type":"number","description":"How many of them have since been approved."},"sentBackSoFar":{"type":"number","description":"How many have since been sent back."}},"required":["written","refusedAtSubmission","accepted","approvedSoFar","sentBackSoFar"],"description":"What this batch produced. Assure keeps the arithmetic; the session does not state it."},"refusalReasons":{"type":"object","additionalProperties":{"type":"number"},"description":"How many cases each refusal reason accounted for, so a session can correct itself."},"openedAt":{"type":"string","format":"date-time","description":"When the batch was opened."},"submittedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When it was submitted, or null while it is open."}},"required":["id","applicationId","openedByUserId","actor","repoId","repoSha","label","status","counts","refusalReasons","openedAt","submittedAt"],"description":"One session’s cases, reviewed as one submission carrying their provenance."},"examples":{"in flight":{"value":{"id":"9a8b7c6d-5e4f-4302-8a1b-0c9d8e7f6051","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","openedByUserId":"u-1042","actor":{"kind":"agent","tool":"claude-code","onBehalfOf":"u-1042","displayName":"R. Mehta"},"repoId":null,"repoSha":"8f3c1a9","label":"claude-code","status":"open","counts":{"written":0,"refusedAtSubmission":0,"accepted":0,"approvedSoFar":0,"sentBackSoFar":0},"refusalReasons":{},"openedAt":"2026-09-09T10:00:00.000Z","submittedAt":null}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"`refusalReasons` is how a session corrects itself: it names which convention was missed and how often, so the next twenty cases are written differently rather than refused the same way.","tags":["batches"],"x-cortena-tool":"assure_batch_get","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"batchId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The batch uuid. Over MCP it defaults to the batch this session opened, so leave it out."},"description":"The batch uuid. Over MCP it defaults to the batch this session opened, so leave it out.","example":"9a8b7c6d-5e4f-4302-8a1b-0c9d8e7f6051"}]}},"/v1/orgs/{orgId}/batches/{batchId}/cases":{"post":{"operationId":"assure_case_write","summary":"Write one case into an open batch.","x-cortena-access":"write","x-cortena-when-to-use":"Use once per assertion, after assure_catalog_search has shown you what is already covered. Write what is missing, not the two hundredth version of something already agreed.","x-cortena-examples":[{"name":"a limit check","summary":"Assert something the code should do","request":{"orgId":"00000000-0000-0000-0000-000000000001","batchId":"9a8b7c6d-5e4f-4302-8a1b-0c9d8e7f6051","assetKey":"api:POST /v1/transfers","assetName":"POST /v1/transfers","assetPath":"src/routes/transfers.ts","segment":"api","priority":"high","title":"Rejects a transfer that would breach the daily limit","steps":["Sign in as a teller","Post a transfer above the remaining daily allowance"],"expected":"The call returns status 422 and the transfer is not created. The daily total is unchanged.","notes":"The limit check reads the running total before the write but does not lock it.","evidenceRefs":[{"path":"src/routes/transfers.ts","line":88,"sha":"8f3c1a"}]},"response":{"id":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","publicId":"PAY-014"}}],"responses":{"201":{"description":"Write one case into an open batch.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The new case’s uuid."},"publicId":{"type":"string","description":"Its permanent public id — quote this one."}},"required":["id","publicId"],"description":"What a case write answers when the case was accepted."},"examples":{"a limit check":{"value":{"id":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","publicId":"PAY-014"}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"Validated on arrival: a case missing evidence references, missing notes, or carrying a truth source that cannot resolve to pass or fail is refused HERE with the reason, as a 422 whose `details.refusals` names each one. Fix it and write again rather than letting a reviewer send it back an hour later.","tags":["cases"],"x-cortena-tool":"assure_case_write","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"batchId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The batch uuid. Over MCP it defaults to the batch this session opened, so leave it out."},"description":"The batch uuid. Over MCP it defaults to the batch this session opened, so leave it out.","example":"9a8b7c6d-5e4f-4302-8a1b-0c9d8e7f6051"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"assetKey":{"type":"string","minLength":1,"description":"Stable key for what this case is about: `api:POST /v1/transfers`, `proc:core.sp_x`, `screen:/path`."},"assetKind":{"type":"string","description":"What kind of thing it is. Derived from the key when omitted."},"assetName":{"type":"string","description":"The display name for the asset."},"assetPath":{"type":"string","description":"Where it lives in the repository."},"segment":{"type":"string","enum":["screen","api","database","security","performance"],"description":"Which kind of thing is being asserted: screen, api, database, security or performance."},"securityClass":{"anyOf":[{"type":"string","enum":["authorization","authentication","exposure","injection","tampering","dependency","secrets"],"description":"The class of security check. injection and tampering write or delete data and are refused against production."},{"type":"null"}],"description":"The class of security check. injection and tampering write or delete data and are refused against production."},"checkKind":{"type":"string","enum":["behavioural","measured","judged"],"description":"behavioural, measured or judged. A judged check is an opinion and never satisfies a gate."},"priority":{"type":"string","enum":["high","medium","low"],"description":"high, medium or low."},"title":{"type":"string","minLength":1,"description":"What the case asserts, in one line."},"preconditions":{"type":"array","items":{"type":"string"},"description":"What must already be true before the steps make sense."},"steps":{"type":"array","items":{"type":"string"},"minItems":1,"description":"What to do, in order."},"expected":{"type":"string","minLength":1,"description":"The truth source. Must be decidable — name a state, a value, a count or an absence."},"notes":{"type":"string","minLength":1,"description":"Why this case exists, in terms of the code. Required."},"evidenceRefs":{"type":"array","items":{"type":"object","properties":{"repo":{"type":"string","description":"The repository, when the case spans more than one."},"path":{"type":"string","minLength":1,"description":"The file the claim was read from."},"line":{"type":"integer","minimum":0,"description":"The line number in that file."},"sha":{"type":"string","minLength":1,"description":"The commit the file was read at."}},"required":["path","line","sha"],"description":"Where a claim came from. Required on every case — a case with no evidence reference is refused."},"minItems":1,"description":"Where the claim came from. Required — a case with none is refused."},"viewports":{"type":"array","items":{"type":"number"},"description":"Screen cases: the viewport widths to run at."},"themes":{"type":"array","items":{"type":"string"},"description":"Screen cases: the themes to run under."},"thresholdSourced":{"type":"boolean","description":"Performance: false means you found no basis in the repository for the number."}},"required":["assetKey","segment","title","steps","expected","notes","evidenceRefs"]},"examples":{"a limit check":{"value":{"assetKey":"api:POST /v1/transfers","assetName":"POST /v1/transfers","assetPath":"src/routes/transfers.ts","segment":"api","priority":"high","title":"Rejects a transfer that would breach the daily limit","steps":["Sign in as a teller","Post a transfer above the remaining daily allowance"],"expected":"The call returns status 422 and the transfer is not created. The daily total is unchanged.","notes":"The limit check reads the running total before the write but does not lock it.","evidenceRefs":[{"path":"src/routes/transfers.ts","line":88,"sha":"8f3c1a"}]}}}}}}}},"/v1/orgs/{orgId}/batches/{batchId}/submit":{"post":{"operationId":"assure_batch_submit","summary":"Close the batch and send it to review.","x-cortena-access":"write","x-cortena-when-to-use":"Use when you have finished writing for this session, before handing over to a reviewer.","x-cortena-examples":[{"name":"handed over","summary":"Finish a writing session","request":{"orgId":"00000000-0000-0000-0000-000000000001","batchId":"9a8b7c6d-5e4f-4302-8a1b-0c9d8e7f6051"},"response":{"id":"9a8b7c6d-5e4f-4302-8a1b-0c9d8e7f6051","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","openedByUserId":"u-1042","actor":{"kind":"agent","tool":"claude-code","onBehalfOf":"u-1042","displayName":"R. Mehta"},"repoId":null,"repoSha":"8f3c1a9","label":"claude-code","status":"submitted","counts":{"written":0,"refusedAtSubmission":0,"accepted":0,"approvedSoFar":0,"sentBackSoFar":0},"refusalReasons":{},"openedAt":"2026-09-09T10:00:00.000Z","submittedAt":"2026-09-09T10:40:00.000Z"}}],"responses":{"200":{"description":"Close the batch and send it to review.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The batch uuid."},"applicationId":{"type":"string","description":"The application."},"openedByUserId":{"type":"string","description":"The person whose session opened it."},"actor":{"type":"object","properties":{"kind":{"type":"string","description":"human, agent or system."},"userId":{"type":"string","description":"The Cortena user id, when a person was acting directly."},"displayName":{"type":"string","description":"The name to show. For an agent, the person it acted for."},"tool":{"type":"string","description":"The software holding the token — \"claude-code\" and the like."},"model":{"type":"string","description":"The model behind the tool, when it named one."},"externallyRouted":{"type":"boolean","description":"True when the model sits outside the customer network."},"onBehalfOf":{"type":"string","description":"The user id an agent was acting for."}},"required":["kind"],"description":"Who opened it — a session, and the person it acted for."},"repoId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The repository reference, registered on the spot when the application had never seen it."},"repoSha":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The commit the session said it was reading."},"label":{"type":"string","description":"A short name for the batch, so a reviewer can tell two apart."},"status":{"type":"string","description":"open or submitted."},"counts":{"type":"object","properties":{"written":{"type":"number","description":"Cases offered to this batch, accepted or not."},"refusedAtSubmission":{"type":"number","description":"Cases refused on arrival for not meeting the conventions."},"accepted":{"type":"number","description":"Cases written into the record."},"approvedSoFar":{"type":"number","description":"How many of them have since been approved."},"sentBackSoFar":{"type":"number","description":"How many have since been sent back."}},"required":["written","refusedAtSubmission","accepted","approvedSoFar","sentBackSoFar"],"description":"What this batch produced. Assure keeps the arithmetic; the session does not state it."},"refusalReasons":{"type":"object","additionalProperties":{"type":"number"},"description":"How many cases each refusal reason accounted for, so a session can correct itself."},"openedAt":{"type":"string","format":"date-time","description":"When the batch was opened."},"submittedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When it was submitted, or null while it is open."}},"required":["id","applicationId","openedByUserId","actor","repoId","repoSha","label","status","counts","refusalReasons","openedAt","submittedAt"],"description":"One session’s cases, reviewed as one submission carrying their provenance."},"examples":{"handed over":{"value":{"id":"9a8b7c6d-5e4f-4302-8a1b-0c9d8e7f6051","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","openedByUserId":"u-1042","actor":{"kind":"agent","tool":"claude-code","onBehalfOf":"u-1042","displayName":"R. Mehta"},"repoId":null,"repoSha":"8f3c1a9","label":"claude-code","status":"submitted","counts":{"written":0,"refusedAtSubmission":0,"accepted":0,"approvedSoFar":0,"sentBackSoFar":0},"refusalReasons":{},"openedAt":"2026-09-09T10:00:00.000Z","submittedAt":"2026-09-09T10:40:00.000Z"}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"Cases are already `waiting` from the moment they were written, so submitting moves no case: it closes the batch and fixes its provenance. Cases already accepted are kept even if the batch is refused for exceeding a limit.","tags":["batches"],"x-cortena-tool":"assure_batch_submit","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"batchId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The batch uuid. Over MCP it defaults to the batch this session opened, so leave it out."},"description":"The batch uuid. Over MCP it defaults to the batch this session opened, so leave it out.","example":"9a8b7c6d-5e4f-4302-8a1b-0c9d8e7f6051"}]}},"/v1/orgs/{orgId}/cases/{caseId}":{"get":{"operationId":"assure_case_get","summary":"One case with its current version, its approval and its history of flapping.","x-cortena-access":"read","x-cortena-when-to-use":"Use before approving, editing or explaining a case, and whenever somebody quotes a case id at you.","x-cortena-examples":[{"name":"one case","summary":"Everything needed to read or approve it","request":{"orgId":"00000000-0000-0000-0000-000000000001","caseId":"PAY-014"},"response":{"id":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","assetId":"5a6b7c8d-9e0f-4102-8334-4556677889aa","publicId":"PAY-014","segment":"api","securityClass":null,"checkKind":"behavioural","priority":"high","status":"waiting","currentVersionId":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","approvedVersionId":null,"batchId":"9a8b7c6d-5e4f-4302-8a1b-0c9d8e7f6051","createdAt":"2026-09-09T10:05:00.000Z","retiredAt":null,"asset":{"id":"5a6b7c8d-9e0f-4102-8334-4556677889aa","key":"api:POST /v1/transfers","name":"POST /v1/transfers","path":"src/routes/transfers.ts"},"currentVersion":{"id":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","caseId":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","version":1,"title":"Rejects a transfer that would breach the daily limit","preconditions":["A teller account with a daily allowance already part-used"],"steps":["Sign in as a teller","Post a transfer above the remaining daily allowance"],"expected":"The call returns status 422 and the transfer is not created. The daily total is unchanged.","notes":"The limit check reads the running total before the write but does not lock it.","evidenceRefs":[{"path":"src/routes/transfers.ts","line":88,"sha":"8f3c1a"}],"viewports":null,"themes":null,"thresholdSourced":null,"authoredBy":{"kind":"agent","tool":"claude-code","onBehalfOf":"u-1042"},"createdAt":"2026-09-09T10:05:00.000Z","supersededAt":null},"approval":null,"approvedVia":null,"inconsistencyRate":null}}],"responses":{"200":{"description":"One case with its current version, its approval and its history of flapping.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The case uuid."},"applicationId":{"type":"string","description":"The application."},"assetId":{"type":"string","description":"What the case is about."},"publicId":{"type":"string","description":"Permanent and never renumbered — quote this to a person."},"segment":{"type":"string","description":"screen, api, database, security or performance."},"securityClass":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"For a security case, which class. Null otherwise."},"checkKind":{"type":"string","description":"behavioural, measured or judged."},"priority":{"type":"string","description":"high, medium or low."},"status":{"type":"string","description":"waiting, approved, changes_requested or retired."},"currentVersionId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The version as it stands now."},"approvedVersionId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The version a counted run may execute. Null unless approved."},"batchId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The batch it was written in."},"createdAt":{"type":"string","format":"date-time","description":"When it was written."},"retiredAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When it was retired, or null."},"asset":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","description":"The asset uuid."},"key":{"type":"string","description":"The stable asset key."},"name":{"type":"string","description":"The display name."},"path":{"type":"string","description":"Where it lives."}},"required":["id","key","name","path"]},{"type":"null"}],"description":"What the case is about."},"currentVersion":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","description":"The version uuid — this is what an approval pins."},"caseId":{"type":"string","description":"The case."},"version":{"type":"number","description":"1, 2, 3 … Every edit mints a new one."},"title":{"type":"string","description":"What the case asserts, in one line."},"preconditions":{"type":"array","items":{"type":"string"},"description":"What must already be true before the steps make sense."},"steps":{"type":"array","items":{"type":"string"},"description":"What to do, in order."},"expected":{"type":"string","description":"The truth source: the statement that decides pass from fail."},"notes":{"type":"string","description":"Why this case exists, in terms of the code."},"evidenceRefs":{"type":"array","items":{"type":"object","properties":{"repo":{"type":"string","description":"The repository, when the case spans more than one."},"path":{"type":"string","minLength":1,"description":"The file the claim was read from."},"line":{"type":"integer","minimum":0,"description":"The line number in that file."},"sha":{"type":"string","minLength":1,"description":"The commit the file was read at."}},"required":["path","line","sha"],"description":"Where a claim came from. Required on every case — a case with no evidence reference is refused."},"description":"Where the claim came from."},"viewports":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Screen cases: the viewport widths to run at."},"themes":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Screen cases: the themes to run under."},"thresholdSourced":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Performance: false means the session found no basis in the repository for the number."},"authoredBy":{"type":"object","properties":{"kind":{"type":"string","description":"human, agent or system."},"userId":{"type":"string","description":"The Cortena user id, when a person was acting directly."},"displayName":{"type":"string","description":"The name to show. For an agent, the person it acted for."},"tool":{"type":"string","description":"The software holding the token — \"claude-code\" and the like."},"model":{"type":"string","description":"The model behind the tool, when it named one."},"externallyRouted":{"type":"boolean","description":"True when the model sits outside the customer network."},"onBehalfOf":{"type":"string","description":"The user id an agent was acting for."}},"required":["kind"],"description":"Who wrote this version."},"createdAt":{"type":"string","format":"date-time","description":"When it was written."},"supersededAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When a later version replaced it, or null while it is current."}},"required":["id","caseId","version","title","preconditions","steps","expected","notes","evidenceRefs","viewports","themes","thresholdSourced","authoredBy","createdAt","supersededAt"],"description":"The English a person reads and approves. Immutable once superseded."},{"type":"null"}],"description":"The version as it stands — read this before approving."},"approval":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","description":"The approval uuid."},"caseId":{"type":"string","description":"The case."},"caseVersionId":{"type":"string","description":"The version that was approved. An approval pins a version, never a case."},"approvedByUserId":{"type":"string","description":"The person it is recorded against."},"approvedByName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Their name, suffixed with the tool when software held the token."},"approvedAt":{"type":"string","format":"date-time","description":"When it was approved."},"via":{"type":"string","description":"interface when somebody clicked, walkthrough when an agent presented it to them."},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why it was approved."},"revokedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the approval was revoked, or null while it stands."},"revokedReason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"case_edited or withdrawn."}},"required":["id","caseId","caseVersionId","approvedByUserId","approvedByName","approvedAt","via","note","revokedAt","revokedReason"],"description":"The attribution of D5 and the pin of D6. Append-only: a revoked approval is marked, never deleted."},{"type":"null"}],"description":"The live approval, or null."},"approvedVia":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"interface or walkthrough, from the live approval."},"inconsistencyRate":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"How often this case has flipped between pass and fail over its recent history, or null when there is too little history."}},"required":["id","applicationId","assetId","publicId","segment","securityClass","checkKind","priority","status","currentVersionId","approvedVersionId","batchId","createdAt","retiredAt","asset","currentVersion","approval","approvedVia","inconsistencyRate"],"description":"One case with everything needed to read it, approve it or explain it."},"examples":{"one case":{"value":{"id":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","assetId":"5a6b7c8d-9e0f-4102-8334-4556677889aa","publicId":"PAY-014","segment":"api","securityClass":null,"checkKind":"behavioural","priority":"high","status":"waiting","currentVersionId":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","approvedVersionId":null,"batchId":"9a8b7c6d-5e4f-4302-8a1b-0c9d8e7f6051","createdAt":"2026-09-09T10:05:00.000Z","retiredAt":null,"asset":{"id":"5a6b7c8d-9e0f-4102-8334-4556677889aa","key":"api:POST /v1/transfers","name":"POST /v1/transfers","path":"src/routes/transfers.ts"},"currentVersion":{"id":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","caseId":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","version":1,"title":"Rejects a transfer that would breach the daily limit","preconditions":["A teller account with a daily allowance already part-used"],"steps":["Sign in as a teller","Post a transfer above the remaining daily allowance"],"expected":"The call returns status 422 and the transfer is not created. The daily total is unchanged.","notes":"The limit check reads the running total before the write but does not lock it.","evidenceRefs":[{"path":"src/routes/transfers.ts","line":88,"sha":"8f3c1a"}],"viewports":null,"themes":null,"thresholdSourced":null,"authoredBy":{"kind":"agent","tool":"claude-code","onBehalfOf":"u-1042"},"createdAt":"2026-09-09T10:05:00.000Z","supersededAt":null},"approval":null,"approvedVia":null,"inconsistencyRate":null}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"`currentVersion.id` is what an approval pins. Read it here and pass that id back — a mismatch is refused rather than approving something else.","tags":["cases"],"x-cortena-tool":"assure_case_get","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"caseId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"The case: its uuid, or its permanent public id such as \"PAY-014\". Both name the same case."},"description":"The case: its uuid, or its permanent public id such as \"PAY-014\". Both name the same case.","example":"PAY-014"}]},"patch":{"operationId":"assure_case_edit","summary":"Edit a case, minting a new version.","x-cortena-access":"write","x-cortena-when-to-use":"Use to correct a case a reviewer sent back, or to sharpen a truth source that turned out not to decide anything. Retire it instead if it no longer needs to hold.","x-cortena-examples":[{"name":"sharpen the expectation","summary":"Make a truth source decidable","request":{"orgId":"00000000-0000-0000-0000-000000000001","caseId":"PAY-014","expected":"The call returns status 422 and the transfer is not created. The daily total is unchanged."},"response":{"id":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","assetId":"5a6b7c8d-9e0f-4102-8334-4556677889aa","publicId":"PAY-014","segment":"api","securityClass":null,"checkKind":"behavioural","priority":"high","status":"waiting","currentVersionId":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","approvedVersionId":null,"batchId":"9a8b7c6d-5e4f-4302-8a1b-0c9d8e7f6051","createdAt":"2026-09-09T10:05:00.000Z","retiredAt":null,"asset":{"id":"5a6b7c8d-9e0f-4102-8334-4556677889aa","key":"api:POST /v1/transfers","name":"POST /v1/transfers","path":"src/routes/transfers.ts"},"currentVersion":{"id":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","caseId":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","version":1,"title":"Rejects a transfer that would breach the daily limit","preconditions":["A teller account with a daily allowance already part-used"],"steps":["Sign in as a teller","Post a transfer above the remaining daily allowance"],"expected":"The call returns status 422 and the transfer is not created. The daily total is unchanged.","notes":"The limit check reads the running total before the write but does not lock it.","evidenceRefs":[{"path":"src/routes/transfers.ts","line":88,"sha":"8f3c1a"}],"viewports":null,"themes":null,"thresholdSourced":null,"authoredBy":{"kind":"agent","tool":"claude-code","onBehalfOf":"u-1042"},"createdAt":"2026-09-09T10:05:00.000Z","supersededAt":null},"approval":null,"approvedVia":null,"inconsistencyRate":null}}],"responses":{"200":{"description":"Edit a case, minting a new version.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The case uuid."},"applicationId":{"type":"string","description":"The application."},"assetId":{"type":"string","description":"What the case is about."},"publicId":{"type":"string","description":"Permanent and never renumbered — quote this to a person."},"segment":{"type":"string","description":"screen, api, database, security or performance."},"securityClass":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"For a security case, which class. Null otherwise."},"checkKind":{"type":"string","description":"behavioural, measured or judged."},"priority":{"type":"string","description":"high, medium or low."},"status":{"type":"string","description":"waiting, approved, changes_requested or retired."},"currentVersionId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The version as it stands now."},"approvedVersionId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The version a counted run may execute. Null unless approved."},"batchId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The batch it was written in."},"createdAt":{"type":"string","format":"date-time","description":"When it was written."},"retiredAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When it was retired, or null."},"asset":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","description":"The asset uuid."},"key":{"type":"string","description":"The stable asset key."},"name":{"type":"string","description":"The display name."},"path":{"type":"string","description":"Where it lives."}},"required":["id","key","name","path"]},{"type":"null"}],"description":"What the case is about."},"currentVersion":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","description":"The version uuid — this is what an approval pins."},"caseId":{"type":"string","description":"The case."},"version":{"type":"number","description":"1, 2, 3 … Every edit mints a new one."},"title":{"type":"string","description":"What the case asserts, in one line."},"preconditions":{"type":"array","items":{"type":"string"},"description":"What must already be true before the steps make sense."},"steps":{"type":"array","items":{"type":"string"},"description":"What to do, in order."},"expected":{"type":"string","description":"The truth source: the statement that decides pass from fail."},"notes":{"type":"string","description":"Why this case exists, in terms of the code."},"evidenceRefs":{"type":"array","items":{"type":"object","properties":{"repo":{"type":"string","description":"The repository, when the case spans more than one."},"path":{"type":"string","minLength":1,"description":"The file the claim was read from."},"line":{"type":"integer","minimum":0,"description":"The line number in that file."},"sha":{"type":"string","minLength":1,"description":"The commit the file was read at."}},"required":["path","line","sha"],"description":"Where a claim came from. Required on every case — a case with no evidence reference is refused."},"description":"Where the claim came from."},"viewports":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Screen cases: the viewport widths to run at."},"themes":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Screen cases: the themes to run under."},"thresholdSourced":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Performance: false means the session found no basis in the repository for the number."},"authoredBy":{"type":"object","properties":{"kind":{"type":"string","description":"human, agent or system."},"userId":{"type":"string","description":"The Cortena user id, when a person was acting directly."},"displayName":{"type":"string","description":"The name to show. For an agent, the person it acted for."},"tool":{"type":"string","description":"The software holding the token — \"claude-code\" and the like."},"model":{"type":"string","description":"The model behind the tool, when it named one."},"externallyRouted":{"type":"boolean","description":"True when the model sits outside the customer network."},"onBehalfOf":{"type":"string","description":"The user id an agent was acting for."}},"required":["kind"],"description":"Who wrote this version."},"createdAt":{"type":"string","format":"date-time","description":"When it was written."},"supersededAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When a later version replaced it, or null while it is current."}},"required":["id","caseId","version","title","preconditions","steps","expected","notes","evidenceRefs","viewports","themes","thresholdSourced","authoredBy","createdAt","supersededAt"],"description":"The English a person reads and approves. Immutable once superseded."},{"type":"null"}],"description":"The version as it stands — read this before approving."},"approval":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","description":"The approval uuid."},"caseId":{"type":"string","description":"The case."},"caseVersionId":{"type":"string","description":"The version that was approved. An approval pins a version, never a case."},"approvedByUserId":{"type":"string","description":"The person it is recorded against."},"approvedByName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Their name, suffixed with the tool when software held the token."},"approvedAt":{"type":"string","format":"date-time","description":"When it was approved."},"via":{"type":"string","description":"interface when somebody clicked, walkthrough when an agent presented it to them."},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why it was approved."},"revokedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the approval was revoked, or null while it stands."},"revokedReason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"case_edited or withdrawn."}},"required":["id","caseId","caseVersionId","approvedByUserId","approvedByName","approvedAt","via","note","revokedAt","revokedReason"],"description":"The attribution of D5 and the pin of D6. Append-only: a revoked approval is marked, never deleted."},{"type":"null"}],"description":"The live approval, or null."},"approvedVia":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"interface or walkthrough, from the live approval."},"inconsistencyRate":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"How often this case has flipped between pass and fail over its recent history, or null when there is too little history."}},"required":["id","applicationId","assetId","publicId","segment","securityClass","checkKind","priority","status","currentVersionId","approvedVersionId","batchId","createdAt","retiredAt","asset","currentVersion","approval","approvedVia","inconsistencyRate"],"description":"One case with everything needed to read it, approve it or explain it."},"examples":{"sharpen the expectation":{"value":{"id":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","assetId":"5a6b7c8d-9e0f-4102-8334-4556677889aa","publicId":"PAY-014","segment":"api","securityClass":null,"checkKind":"behavioural","priority":"high","status":"waiting","currentVersionId":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","approvedVersionId":null,"batchId":"9a8b7c6d-5e4f-4302-8a1b-0c9d8e7f6051","createdAt":"2026-09-09T10:05:00.000Z","retiredAt":null,"asset":{"id":"5a6b7c8d-9e0f-4102-8334-4556677889aa","key":"api:POST /v1/transfers","name":"POST /v1/transfers","path":"src/routes/transfers.ts"},"currentVersion":{"id":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","caseId":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","version":1,"title":"Rejects a transfer that would breach the daily limit","preconditions":["A teller account with a daily allowance already part-used"],"steps":["Sign in as a teller","Post a transfer above the remaining daily allowance"],"expected":"The call returns status 422 and the transfer is not created. The daily total is unchanged.","notes":"The limit check reads the running total before the write but does not lock it.","evidenceRefs":[{"path":"src/routes/transfers.ts","line":88,"sha":"8f3c1a"}],"viewports":null,"themes":null,"thresholdSourced":null,"authoredBy":{"kind":"agent","tool":"claude-code","onBehalfOf":"u-1042"},"createdAt":"2026-09-09T10:05:00.000Z","supersededAt":null},"approval":null,"approvedVia":null,"inconsistencyRate":null}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"Any edit — by a person or a session — creates a new version and revokes the approval. There is no path by which an approved case changes meaning without returning to review.","tags":["cases"],"x-cortena-tool":"assure_case_edit","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"caseId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"The case: its uuid, or its permanent public id such as \"PAY-014\". Both name the same case."},"description":"The case: its uuid, or its permanent public id such as \"PAY-014\". Both name the same case.","example":"PAY-014"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","description":"What the case asserts, in one line."},"preconditions":{"type":"array","items":{"type":"string"},"description":"What must already be true."},"steps":{"type":"array","items":{"type":"string"},"minItems":1,"description":"What to do, in order."},"expected":{"type":"string","description":"The truth source. Must be decidable."},"notes":{"type":"string","description":"Why the case exists, in terms of the code."},"priority":{"type":"string","enum":["high","medium","low"],"description":"high, medium or low."}}},"examples":{"sharpen the expectation":{"value":{"expected":"The call returns status 422 and the transfer is not created. The daily total is unchanged."}}}}}}}},"/v1/orgs/{orgId}/cases/{caseId}/approve":{"post":{"operationId":"assure_case_approve","summary":"Approve a case yourself.","x-cortena-access":"write","x-cortena-when-to-use":"Use when you are the one deciding. If somebody is reading along with you, use assure_case_present instead so the record says a person saw it.","x-cortena-examples":[{"name":"approved","summary":"Accept a case as it stands","request":{"orgId":"00000000-0000-0000-0000-000000000001","caseId":"PAY-014","caseVersionId":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","note":"Matches the limit check in transfers.ts."},"response":{"id":"b2c3d4e5-6f70-4819-8a2b-3c4d5e6f7081","caseId":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","caseVersionId":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","approvedByUserId":"u-1042","approvedByName":"R. Mehta (claude-code)","approvedAt":"2026-09-09T11:00:00.000Z","via":"interface","note":"Matches the limit check in transfers.ts.","revokedAt":null,"revokedReason":null}}],"responses":{"201":{"description":"Approve a case yourself.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The approval uuid."},"caseId":{"type":"string","description":"The case."},"caseVersionId":{"type":"string","description":"The version that was approved. An approval pins a version, never a case."},"approvedByUserId":{"type":"string","description":"The person it is recorded against."},"approvedByName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Their name, suffixed with the tool when software held the token."},"approvedAt":{"type":"string","format":"date-time","description":"When it was approved."},"via":{"type":"string","description":"interface when somebody clicked, walkthrough when an agent presented it to them."},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why it was approved."},"revokedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the approval was revoked, or null while it stands."},"revokedReason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"case_edited or withdrawn."}},"required":["id","caseId","caseVersionId","approvedByUserId","approvedByName","approvedAt","via","note","revokedAt","revokedReason"],"description":"The attribution of D5 and the pin of D6. Append-only: a revoked approval is marked, never deleted."},"examples":{"approved":{"value":{"id":"b2c3d4e5-6f70-4819-8a2b-3c4d5e6f7081","caseId":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","caseVersionId":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","approvedByUserId":"u-1042","approvedByName":"R. Mehta (claude-code)","approvedAt":"2026-09-09T11:00:00.000Z","via":"interface","note":"Matches the limit check in transfers.ts.","revokedAt":null,"revokedReason":null}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"The approval pins `caseVersionId`, so read the case first and pass the version you actually read — a mismatch is refused rather than approving something else. Open to a session as well as a person since D4 was removed, and either way the approval is recorded against the person the token belongs to, never against the tool.","tags":["cases"],"x-cortena-tool":"assure_case_approve","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"caseId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"The case: its uuid, or its permanent public id such as \"PAY-014\". Both name the same case."},"description":"The case: its uuid, or its permanent public id such as \"PAY-014\". Both name the same case.","example":"PAY-014"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"caseVersionId":{"type":"string","format":"uuid","description":"The version you read. Refused if the case has moved since."},"note":{"type":"string","description":"Why you approved it. Worth writing — nobody else witnessed this."}},"required":["caseVersionId"]},"examples":{"approved":{"value":{"caseVersionId":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","note":"Matches the limit check in transfers.ts."}}}}}}}},"/v1/orgs/{orgId}/cases/{caseId}/present":{"post":{"operationId":"assure_case_present","summary":"Relay a reviewer’s decision after explaining a case to them.","x-cortena-access":"write","x-cortena-when-to-use":"Use when somebody is actually reading along with you. Use assure_case_approve when you are the one deciding.","x-cortena-examples":[{"name":"they agreed","summary":"Record a walkthrough approval","request":{"orgId":"00000000-0000-0000-0000-000000000001","caseId":"PAY-014","caseVersionId":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","decision":"approve","reviewerUserId":"u-2087","reviewerName":"S. Nair"},"response":{"id":"b2c3d4e5-6f70-4819-8a2b-3c4d5e6f7081","caseId":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","caseVersionId":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","approvedByUserId":"u-2087","approvedByName":"S. Nair","approvedAt":"2026-09-09T11:00:00.000Z","via":"walkthrough","note":"Matches the limit check in transfers.ts.","revokedAt":null,"revokedReason":null}},{"name":"they moved on","summary":"Record a skip","request":{"orgId":"00000000-0000-0000-0000-000000000001","caseId":"PAY-014","caseVersionId":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","decision":"skip","reviewerUserId":"u-2087"},"response":{"skipped":true}}],"responses":{"200":{"description":"Relay a reviewer’s decision after explaining a case to them.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","description":"The approval uuid."},"caseId":{"type":"string","description":"The case."},"caseVersionId":{"type":"string","description":"The version that was approved. An approval pins a version, never a case."},"approvedByUserId":{"type":"string","description":"The person it is recorded against."},"approvedByName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Their name, suffixed with the tool when software held the token."},"approvedAt":{"type":"string","format":"date-time","description":"When it was approved."},"via":{"type":"string","description":"interface when somebody clicked, walkthrough when an agent presented it to them."},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why it was approved."},"revokedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the approval was revoked, or null while it stands."},"revokedReason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"case_edited or withdrawn."}},"required":["id","caseId","caseVersionId","approvedByUserId","approvedByName","approvedAt","via","note","revokedAt","revokedReason"],"description":"The attribution of D5 and the pin of D6. Append-only: a revoked approval is marked, never deleted."},{"type":"object","properties":{"skipped":{"const":true,"description":"The reviewer moved on without deciding."}},"required":["skipped"]},{"type":"object","properties":{"sentBack":{"const":true,"description":"The case went back for changes."}},"required":["sentBack"]}],"description":"What the reviewer decided: the approval they gave, or a note that they skipped or sent it back."},"examples":{"they agreed":{"value":{"id":"b2c3d4e5-6f70-4819-8a2b-3c4d5e6f7081","caseId":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","caseVersionId":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","approvedByUserId":"u-2087","approvedByName":"S. Nair","approvedAt":"2026-09-09T11:00:00.000Z","via":"walkthrough","note":"Matches the limit check in transfers.ts.","revokedAt":null,"revokedReason":null}},"they moved on":{"value":{"skipped":true}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"The approval is recorded AGAINST THAT PERSON and marked as given during a walkthrough, which is what distinguishes it from one an agent made itself. There is no value of `decision` that means \"the agent approved it\" — this is a relay, not a judgement. The reviewer is taken as given: requiring them to be on the roster meant a walkthrough with a colleague nobody had added simply failed.","tags":["review"],"x-cortena-tool":"assure_case_present","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"caseId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"The case: its uuid, or its permanent public id such as \"PAY-014\". Both name the same case."},"description":"The case: its uuid, or its permanent public id such as \"PAY-014\". Both name the same case.","example":"PAY-014"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"caseVersionId":{"type":"string","format":"uuid","description":"The version that was read aloud."},"decision":{"type":"string","enum":["approve","send_back","skip"],"description":"What the person said."},"note":{"type":"string","description":"Required when sending back."},"reviewerUserId":{"type":"string","minLength":1,"description":"The person who made the decision. The approval is recorded against them."},"reviewerName":{"type":"string","description":"Their name, for the record."}},"required":["caseVersionId","decision","reviewerUserId"]},"examples":{"they agreed":{"value":{"caseVersionId":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","decision":"approve","reviewerUserId":"u-2087","reviewerName":"S. Nair"}},"they moved on":{"value":{"caseVersionId":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","decision":"skip","reviewerUserId":"u-2087"}}}}}}}},"/v1/orgs/{orgId}/cases/{caseId}/results":{"get":{"operationId":"assure_case_results","summary":"The history of one case: its results across runs, newest first.","x-cortena-access":"read","x-cortena-when-to-use":"Use from a page that draws how a case has behaved over time. An agent reads a run’s results instead.","x-cortena-examples":[{"name":"a performance case","summary":"Its last results, with the figures each recorded","request":{"orgId":"00000000-0000-0000-0000-000000000001","caseId":"PAY-014","limit":20},"response":{"items":[{"id":"6f708192-a3b4-45c6-8d7e-8f9012345678","runId":"1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d","runPublicId":"RUN-0007","caseId":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","caseVersionId":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","casePublicId":"PAY-014","segment":"performance","variant":null,"attempt":1,"status":"passed","refusalReason":null,"skipReason":null,"durationMs":30120,"summary":"Listing tasks stays under its latency budget — held","narrative":"k6 ran the pack \"list-tasks\" against https://qa.example.com and it held every threshold.","failureDetail":null,"measurements":{"engine":"k6","requests":4244,"latencyMs":{"p95":212.4}},"judged":false,"countsTowardCoverage":true,"countsTowardGate":true,"executedAt":"2026-09-10T09:04:00.000Z"}]}}],"responses":{"200":{"description":"The history of one case: its results across runs, newest first.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The result uuid — attach evidence to this."},"runId":{"type":"string","description":"The run."},"caseId":{"type":"string","description":"The case."},"caseVersionId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The version that was executed, pinned so a later edit cannot rewrite history."},"variant":{"anyOf":[{"type":"object","properties":{"viewport":{"type":"number","description":"The viewport width this execution covers."},"theme":{"type":"string","description":"The theme this execution covers."}},"description":"For a screen case, the viewport and theme one execution covers."},{"type":"null"}],"description":"The viewport and theme, for a screen case."},"attempt":{"type":"number","description":"1 for the first execution of this case in this run."},"status":{"type":"string","description":"passed, failed, skipped, refused or errored."},"refusalReason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why Assure declined to dispatch it, when it did."},"skipReason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why the session skipped it."},"durationMs":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"How long it took."},"summary":{"type":"string","description":"One line, used for grouping failures and for the report."},"narrative":{"type":"string","description":"What was actually done and observed, in full. This is what makes \"passed\" checkable."},"failureDetail":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}],"description":"Structured detail of the failure."},"measurements":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}],"description":"Numbers a measured check produced."},"judged":{"type":"boolean","description":"A judged screen check — an opinion. Reported, never gating."},"countsTowardCoverage":{"type":"boolean","description":"False for drafts."},"countsTowardGate":{"type":"boolean","description":"False for drafts, refusals and judged results. A column, not a policy."},"executedAt":{"type":"string","format":"date-time","description":"When it was executed."},"casePublicId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The case’s public id, joined in so a list is readable."},"segment":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The case’s segment."},"runPublicId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The public id of the run this result belongs to."}},"required":["id","runId","caseId","caseVersionId","variant","attempt","status","refusalReason","skipReason","durationMs","summary","narrative","failureDetail","measurements","judged","countsTowardCoverage","countsTowardGate","executedAt","casePublicId","segment","runPublicId"],"description":"One execution of a case, with the run it came from."},"description":"The case’s results, newest first, up to one hundred."}},"required":["items"],"description":"The case’s results, newest first, up to one hundred."},"examples":{"a performance case":{"value":{"items":[{"id":"6f708192-a3b4-45c6-8d7e-8f9012345678","runId":"1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d","runPublicId":"RUN-0007","caseId":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","caseVersionId":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","casePublicId":"PAY-014","segment":"performance","variant":null,"attempt":1,"status":"passed","refusalReason":null,"skipReason":null,"durationMs":30120,"summary":"Listing tasks stays under its latency budget — held","narrative":"k6 ran the pack \"list-tasks\" against https://qa.example.com and it held every threshold.","failureDetail":null,"measurements":{"engine":"k6","requests":4244,"latencyMs":{"p95":212.4}},"judged":false,"countsTowardCoverage":true,"countsTowardGate":true,"executedAt":"2026-09-10T09:04:00.000Z"}]}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"Every execution of the case in any run, including refused and errored ones. A measured check carries its numbers in `measurements`, so a performance case’s results across runs are its trend.","tags":["cases"],"x-cortena-tool-exempt-reason":"it exists to draw a case’s trend on a page. An agent reads the numbers off a run’s results (assure_result_list), which are already in its context for the run it is explaining.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"caseId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"The case: its uuid, or its permanent public id such as \"PAY-014\". Both name the same case."},"description":"The case: its uuid, or its permanent public id such as \"PAY-014\". Both name the same case.","example":"PAY-014"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"description":"How many to return. Defaults to 20."},"description":"How many to return. Defaults to 20.","example":20}]}},"/v1/orgs/{orgId}/cases/{caseId}/retire":{"post":{"operationId":"assure_case_retire","summary":"Retire a case: it no longer needs to hold.","x-cortena-access":"write","x-cortena-when-to-use":"Use when the behaviour the case asserts has been deliberately changed or removed. Say plainly in the reason what changed; \"obsolete\" is not a reason.","x-cortena-examples":[{"name":"behaviour removed","summary":"Retire a case whose behaviour is gone","request":{"orgId":"00000000-0000-0000-0000-000000000001","caseId":"PAY-014","reason":"Daily limits moved to the ledger service in release 4.2; this endpoint no longer checks them."},"response":{"id":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","assetId":"5a6b7c8d-9e0f-4102-8334-4556677889aa","publicId":"PAY-014","segment":"api","securityClass":null,"checkKind":"behavioural","priority":"high","status":"retired","currentVersionId":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","approvedVersionId":null,"batchId":"9a8b7c6d-5e4f-4302-8a1b-0c9d8e7f6051","createdAt":"2026-09-09T10:05:00.000Z","retiredAt":"2026-09-10T09:00:00.000Z","asset":{"id":"5a6b7c8d-9e0f-4102-8334-4556677889aa","key":"api:POST /v1/transfers","name":"POST /v1/transfers","path":"src/routes/transfers.ts"},"currentVersion":{"id":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","caseId":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","version":1,"title":"Rejects a transfer that would breach the daily limit","preconditions":["A teller account with a daily allowance already part-used"],"steps":["Sign in as a teller","Post a transfer above the remaining daily allowance"],"expected":"The call returns status 422 and the transfer is not created. The daily total is unchanged.","notes":"The limit check reads the running total before the write but does not lock it.","evidenceRefs":[{"path":"src/routes/transfers.ts","line":88,"sha":"8f3c1a"}],"viewports":null,"themes":null,"thresholdSourced":null,"authoredBy":{"kind":"agent","tool":"claude-code","onBehalfOf":"u-1042"},"createdAt":"2026-09-09T10:05:00.000Z","supersededAt":null},"approval":null,"approvedVia":null,"inconsistencyRate":null}}],"responses":{"200":{"description":"Retire a case: it no longer needs to hold.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The case uuid."},"applicationId":{"type":"string","description":"The application."},"assetId":{"type":"string","description":"What the case is about."},"publicId":{"type":"string","description":"Permanent and never renumbered — quote this to a person."},"segment":{"type":"string","description":"screen, api, database, security or performance."},"securityClass":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"For a security case, which class. Null otherwise."},"checkKind":{"type":"string","description":"behavioural, measured or judged."},"priority":{"type":"string","description":"high, medium or low."},"status":{"type":"string","description":"waiting, approved, changes_requested or retired."},"currentVersionId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The version as it stands now."},"approvedVersionId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The version a counted run may execute. Null unless approved."},"batchId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The batch it was written in."},"createdAt":{"type":"string","format":"date-time","description":"When it was written."},"retiredAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When it was retired, or null."},"asset":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","description":"The asset uuid."},"key":{"type":"string","description":"The stable asset key."},"name":{"type":"string","description":"The display name."},"path":{"type":"string","description":"Where it lives."}},"required":["id","key","name","path"]},{"type":"null"}],"description":"What the case is about."},"currentVersion":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","description":"The version uuid — this is what an approval pins."},"caseId":{"type":"string","description":"The case."},"version":{"type":"number","description":"1, 2, 3 … Every edit mints a new one."},"title":{"type":"string","description":"What the case asserts, in one line."},"preconditions":{"type":"array","items":{"type":"string"},"description":"What must already be true before the steps make sense."},"steps":{"type":"array","items":{"type":"string"},"description":"What to do, in order."},"expected":{"type":"string","description":"The truth source: the statement that decides pass from fail."},"notes":{"type":"string","description":"Why this case exists, in terms of the code."},"evidenceRefs":{"type":"array","items":{"type":"object","properties":{"repo":{"type":"string","description":"The repository, when the case spans more than one."},"path":{"type":"string","minLength":1,"description":"The file the claim was read from."},"line":{"type":"integer","minimum":0,"description":"The line number in that file."},"sha":{"type":"string","minLength":1,"description":"The commit the file was read at."}},"required":["path","line","sha"],"description":"Where a claim came from. Required on every case — a case with no evidence reference is refused."},"description":"Where the claim came from."},"viewports":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Screen cases: the viewport widths to run at."},"themes":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Screen cases: the themes to run under."},"thresholdSourced":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Performance: false means the session found no basis in the repository for the number."},"authoredBy":{"type":"object","properties":{"kind":{"type":"string","description":"human, agent or system."},"userId":{"type":"string","description":"The Cortena user id, when a person was acting directly."},"displayName":{"type":"string","description":"The name to show. For an agent, the person it acted for."},"tool":{"type":"string","description":"The software holding the token — \"claude-code\" and the like."},"model":{"type":"string","description":"The model behind the tool, when it named one."},"externallyRouted":{"type":"boolean","description":"True when the model sits outside the customer network."},"onBehalfOf":{"type":"string","description":"The user id an agent was acting for."}},"required":["kind"],"description":"Who wrote this version."},"createdAt":{"type":"string","format":"date-time","description":"When it was written."},"supersededAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When a later version replaced it, or null while it is current."}},"required":["id","caseId","version","title","preconditions","steps","expected","notes","evidenceRefs","viewports","themes","thresholdSourced","authoredBy","createdAt","supersededAt"],"description":"The English a person reads and approves. Immutable once superseded."},{"type":"null"}],"description":"The version as it stands — read this before approving."},"approval":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","description":"The approval uuid."},"caseId":{"type":"string","description":"The case."},"caseVersionId":{"type":"string","description":"The version that was approved. An approval pins a version, never a case."},"approvedByUserId":{"type":"string","description":"The person it is recorded against."},"approvedByName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Their name, suffixed with the tool when software held the token."},"approvedAt":{"type":"string","format":"date-time","description":"When it was approved."},"via":{"type":"string","description":"interface when somebody clicked, walkthrough when an agent presented it to them."},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why it was approved."},"revokedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the approval was revoked, or null while it stands."},"revokedReason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"case_edited or withdrawn."}},"required":["id","caseId","caseVersionId","approvedByUserId","approvedByName","approvedAt","via","note","revokedAt","revokedReason"],"description":"The attribution of D5 and the pin of D6. Append-only: a revoked approval is marked, never deleted."},{"type":"null"}],"description":"The live approval, or null."},"approvedVia":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"interface or walkthrough, from the live approval."},"inconsistencyRate":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"How often this case has flipped between pass and fail over its recent history, or null when there is too little history."}},"required":["id","applicationId","assetId","publicId","segment","securityClass","checkKind","priority","status","currentVersionId","approvedVersionId","batchId","createdAt","retiredAt","asset","currentVersion","approval","approvedVia","inconsistencyRate"],"description":"One case with everything needed to read it, approve it or explain it."},"examples":{"behaviour removed":{"value":{"id":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","assetId":"5a6b7c8d-9e0f-4102-8334-4556677889aa","publicId":"PAY-014","segment":"api","securityClass":null,"checkKind":"behavioural","priority":"high","status":"retired","currentVersionId":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","approvedVersionId":null,"batchId":"9a8b7c6d-5e4f-4302-8a1b-0c9d8e7f6051","createdAt":"2026-09-09T10:05:00.000Z","retiredAt":"2026-09-10T09:00:00.000Z","asset":{"id":"5a6b7c8d-9e0f-4102-8334-4556677889aa","key":"api:POST /v1/transfers","name":"POST /v1/transfers","path":"src/routes/transfers.ts"},"currentVersion":{"id":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","caseId":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","version":1,"title":"Rejects a transfer that would breach the daily limit","preconditions":["A teller account with a daily allowance already part-used"],"steps":["Sign in as a teller","Post a transfer above the remaining daily allowance"],"expected":"The call returns status 422 and the transfer is not created. The daily total is unchanged.","notes":"The limit check reads the running total before the write but does not lock it.","evidenceRefs":[{"path":"src/routes/transfers.ts","line":88,"sha":"8f3c1a"}],"viewports":null,"themes":null,"thresholdSourced":null,"authoredBy":{"kind":"agent","tool":"claude-code","onBehalfOf":"u-1042"},"createdAt":"2026-09-09T10:05:00.000Z","supersededAt":null},"approval":null,"approvedVia":null,"inconsistencyRate":null}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"This revokes any approval and removes the case from coverage. The row stays — a retired case is still readable, and a defect report from eighteen months ago still resolves.","tags":["cases"],"x-cortena-tool":"assure_case_retire","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"caseId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"The case: its uuid, or its permanent public id such as \"PAY-014\". Both name the same case."},"description":"The case: its uuid, or its permanent public id such as \"PAY-014\". Both name the same case.","example":"PAY-014"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"description":"What changed. \"Obsolete\" is not a reason."}},"required":["reason"]},"examples":{"behaviour removed":{"value":{"reason":"Daily limits moved to the ledger service in release 4.2; this endpoint no longer checks them."}}}}}}}},"/v1/orgs/{orgId}/cases/{caseId}/send-back":{"post":{"operationId":"assure_case_send_back","summary":"Send a case back for changes, with a note saying what was wrong.","x-cortena-access":"write","x-cortena-when-to-use":"Use when a case is salvageable but not as written. Retire it instead if it no longer needs to hold at all.","x-cortena-examples":[{"name":"not decidable","summary":"Return a case with a reason","request":{"orgId":"00000000-0000-0000-0000-000000000001","caseId":"PAY-014","note":"The expectation says \"works correctly\", which cannot resolve to pass or fail."},"response":{"id":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","assetId":"5a6b7c8d-9e0f-4102-8334-4556677889aa","publicId":"PAY-014","segment":"api","securityClass":null,"checkKind":"behavioural","priority":"high","status":"changes_requested","currentVersionId":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","approvedVersionId":null,"batchId":"9a8b7c6d-5e4f-4302-8a1b-0c9d8e7f6051","createdAt":"2026-09-09T10:05:00.000Z","retiredAt":null,"asset":{"id":"5a6b7c8d-9e0f-4102-8334-4556677889aa","key":"api:POST /v1/transfers","name":"POST /v1/transfers","path":"src/routes/transfers.ts"},"currentVersion":{"id":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","caseId":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","version":1,"title":"Rejects a transfer that would breach the daily limit","preconditions":["A teller account with a daily allowance already part-used"],"steps":["Sign in as a teller","Post a transfer above the remaining daily allowance"],"expected":"The call returns status 422 and the transfer is not created. The daily total is unchanged.","notes":"The limit check reads the running total before the write but does not lock it.","evidenceRefs":[{"path":"src/routes/transfers.ts","line":88,"sha":"8f3c1a"}],"viewports":null,"themes":null,"thresholdSourced":null,"authoredBy":{"kind":"agent","tool":"claude-code","onBehalfOf":"u-1042"},"createdAt":"2026-09-09T10:05:00.000Z","supersededAt":null},"approval":null,"approvedVia":null,"inconsistencyRate":null}}],"responses":{"200":{"description":"Send a case back for changes, with a note saying what was wrong.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The case uuid."},"applicationId":{"type":"string","description":"The application."},"assetId":{"type":"string","description":"What the case is about."},"publicId":{"type":"string","description":"Permanent and never renumbered — quote this to a person."},"segment":{"type":"string","description":"screen, api, database, security or performance."},"securityClass":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"For a security case, which class. Null otherwise."},"checkKind":{"type":"string","description":"behavioural, measured or judged."},"priority":{"type":"string","description":"high, medium or low."},"status":{"type":"string","description":"waiting, approved, changes_requested or retired."},"currentVersionId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The version as it stands now."},"approvedVersionId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The version a counted run may execute. Null unless approved."},"batchId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The batch it was written in."},"createdAt":{"type":"string","format":"date-time","description":"When it was written."},"retiredAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When it was retired, or null."},"asset":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","description":"The asset uuid."},"key":{"type":"string","description":"The stable asset key."},"name":{"type":"string","description":"The display name."},"path":{"type":"string","description":"Where it lives."}},"required":["id","key","name","path"]},{"type":"null"}],"description":"What the case is about."},"currentVersion":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","description":"The version uuid — this is what an approval pins."},"caseId":{"type":"string","description":"The case."},"version":{"type":"number","description":"1, 2, 3 … Every edit mints a new one."},"title":{"type":"string","description":"What the case asserts, in one line."},"preconditions":{"type":"array","items":{"type":"string"},"description":"What must already be true before the steps make sense."},"steps":{"type":"array","items":{"type":"string"},"description":"What to do, in order."},"expected":{"type":"string","description":"The truth source: the statement that decides pass from fail."},"notes":{"type":"string","description":"Why this case exists, in terms of the code."},"evidenceRefs":{"type":"array","items":{"type":"object","properties":{"repo":{"type":"string","description":"The repository, when the case spans more than one."},"path":{"type":"string","minLength":1,"description":"The file the claim was read from."},"line":{"type":"integer","minimum":0,"description":"The line number in that file."},"sha":{"type":"string","minLength":1,"description":"The commit the file was read at."}},"required":["path","line","sha"],"description":"Where a claim came from. Required on every case — a case with no evidence reference is refused."},"description":"Where the claim came from."},"viewports":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Screen cases: the viewport widths to run at."},"themes":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Screen cases: the themes to run under."},"thresholdSourced":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Performance: false means the session found no basis in the repository for the number."},"authoredBy":{"type":"object","properties":{"kind":{"type":"string","description":"human, agent or system."},"userId":{"type":"string","description":"The Cortena user id, when a person was acting directly."},"displayName":{"type":"string","description":"The name to show. For an agent, the person it acted for."},"tool":{"type":"string","description":"The software holding the token — \"claude-code\" and the like."},"model":{"type":"string","description":"The model behind the tool, when it named one."},"externallyRouted":{"type":"boolean","description":"True when the model sits outside the customer network."},"onBehalfOf":{"type":"string","description":"The user id an agent was acting for."}},"required":["kind"],"description":"Who wrote this version."},"createdAt":{"type":"string","format":"date-time","description":"When it was written."},"supersededAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When a later version replaced it, or null while it is current."}},"required":["id","caseId","version","title","preconditions","steps","expected","notes","evidenceRefs","viewports","themes","thresholdSourced","authoredBy","createdAt","supersededAt"],"description":"The English a person reads and approves. Immutable once superseded."},{"type":"null"}],"description":"The version as it stands — read this before approving."},"approval":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","description":"The approval uuid."},"caseId":{"type":"string","description":"The case."},"caseVersionId":{"type":"string","description":"The version that was approved. An approval pins a version, never a case."},"approvedByUserId":{"type":"string","description":"The person it is recorded against."},"approvedByName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Their name, suffixed with the tool when software held the token."},"approvedAt":{"type":"string","format":"date-time","description":"When it was approved."},"via":{"type":"string","description":"interface when somebody clicked, walkthrough when an agent presented it to them."},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why it was approved."},"revokedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the approval was revoked, or null while it stands."},"revokedReason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"case_edited or withdrawn."}},"required":["id","caseId","caseVersionId","approvedByUserId","approvedByName","approvedAt","via","note","revokedAt","revokedReason"],"description":"The attribution of D5 and the pin of D6. Append-only: a revoked approval is marked, never deleted."},{"type":"null"}],"description":"The live approval, or null."},"approvedVia":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"interface or walkthrough, from the live approval."},"inconsistencyRate":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"How often this case has flipped between pass and fail over its recent history, or null when there is too little history."}},"required":["id","applicationId","assetId","publicId","segment","securityClass","checkKind","priority","status","currentVersionId","approvedVersionId","batchId","createdAt","retiredAt","asset","currentVersion","approval","approvedVia","inconsistencyRate"],"description":"One case with everything needed to read it, approve it or explain it."},"examples":{"not decidable":{"value":{"id":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","assetId":"5a6b7c8d-9e0f-4102-8334-4556677889aa","publicId":"PAY-014","segment":"api","securityClass":null,"checkKind":"behavioural","priority":"high","status":"changes_requested","currentVersionId":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","approvedVersionId":null,"batchId":"9a8b7c6d-5e4f-4302-8a1b-0c9d8e7f6051","createdAt":"2026-09-09T10:05:00.000Z","retiredAt":null,"asset":{"id":"5a6b7c8d-9e0f-4102-8334-4556677889aa","key":"api:POST /v1/transfers","name":"POST /v1/transfers","path":"src/routes/transfers.ts"},"currentVersion":{"id":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","caseId":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","version":1,"title":"Rejects a transfer that would breach the daily limit","preconditions":["A teller account with a daily allowance already part-used"],"steps":["Sign in as a teller","Post a transfer above the remaining daily allowance"],"expected":"The call returns status 422 and the transfer is not created. The daily total is unchanged.","notes":"The limit check reads the running total before the write but does not lock it.","evidenceRefs":[{"path":"src/routes/transfers.ts","line":88,"sha":"8f3c1a"}],"viewports":null,"themes":null,"thresholdSourced":null,"authoredBy":{"kind":"agent","tool":"claude-code","onBehalfOf":"u-1042"},"createdAt":"2026-09-09T10:05:00.000Z","supersededAt":null},"approval":null,"approvedVia":null,"inconsistencyRate":null}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"An empty rejection is refused — the loop only improves quality if the note says what to change. The batch’s tally of cases sent back is updated too, so a session can see the shape of its own mistakes.","tags":["cases"],"x-cortena-tool":"assure_case_send_back","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"caseId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"The case: its uuid, or its permanent public id such as \"PAY-014\". Both name the same case."},"description":"The case: its uuid, or its permanent public id such as \"PAY-014\". Both name the same case.","example":"PAY-014"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string","minLength":1,"description":"What is wrong, specifically. \"Needs work\" is not a note."}},"required":["note"]},"examples":{"not decidable":{"value":{"note":"The expectation says \"works correctly\", which cannot resolve to pass or fail."}}}}}}}},"/v1/orgs/{orgId}/defects/{defectId}":{"patch":{"operationId":"assure_defect_update","summary":"Change a defect’s severity, state, or whether somebody has confirmed it.","x-cortena-access":"write","x-cortena-when-to-use":"Use when a person has looked at a defect an agent raised, or when the fix has landed.","x-cortena-examples":[{"name":"acknowledged","summary":"A person has looked at it","request":{"orgId":"00000000-0000-0000-0000-000000000001","defectId":"bc23de45-f067-489a-8b1c-2d3e4f506172","acknowledge":true},"response":{"id":"bc23de45-f067-489a-8b1c-2d3e4f506172","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","publicId":"PAY-D003","title":"Daily transfer limit is not enforced under concurrency","detail":"The limit is read before the write and never locked, so two concurrent transfers both pass the check.","severity":"high","status":"open","assetIds":["5a6b7c8d-9e0f-4102-8334-4556677889aa"],"resultIds":["6f708192-a3b4-45c6-8d7e-8f9012345678"],"raisedBy":{"kind":"agent","tool":"claude-code","onBehalfOf":"u-1042"},"confirmedByUserId":"u-1042","externalKey":null,"externalUrl":null,"syncState":"local","openedAt":"2026-09-10T10:15:00.000Z","closedAt":null}}],"responses":{"200":{"description":"Change a defect’s severity, state, or whether somebody has confirmed it.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The defect uuid."},"applicationId":{"type":"string","description":"The application."},"publicId":{"type":"string","description":"Permanent — quote this one."},"title":{"type":"string","description":"What is wrong, in one line."},"detail":{"type":"string","description":"What was observed, and why it is the code rather than the case."},"severity":{"type":"string","description":"critical, high, medium or low."},"status":{"type":"string","description":"open, in_progress, fixed, wont_fix or closed."},"assetIds":{"type":"array","items":{"type":"string"},"description":"What it blocks. This is what connects a defect to a release gate."},"resultIds":{"type":"array","items":{"type":"string"},"description":"The failures it was raised from."},"raisedBy":{"type":"object","properties":{"kind":{"type":"string","description":"human, agent or system."},"userId":{"type":"string","description":"The Cortena user id, when a person was acting directly."},"displayName":{"type":"string","description":"The name to show. For an agent, the person it acted for."},"tool":{"type":"string","description":"The software holding the token — \"claude-code\" and the like."},"model":{"type":"string","description":"The model behind the tool, when it named one."},"externallyRouted":{"type":"boolean","description":"True when the model sits outside the customer network."},"onBehalfOf":{"type":"string","description":"The user id an agent was acting for."}},"required":["kind"],"description":"Who raised it."},"confirmedByUserId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Who confirmed it. Not required for it to block a gate."},"externalKey":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The id in an external tracker, when it has been pushed."},"externalUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Where it lives in that tracker."},"syncState":{"type":"string","description":"local or synced."},"openedAt":{"type":"string","format":"date-time","description":"When it was raised."},"closedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When it was closed, or null."}},"required":["id","applicationId","publicId","title","detail","severity","status","assetIds","resultIds","raisedBy","confirmedByUserId","externalKey","externalUrl","syncState","openedAt","closedAt"],"description":"A defect. It blocks a gate whether or not anybody has confirmed it."},"examples":{"acknowledged":{"value":{"id":"bc23de45-f067-489a-8b1c-2d3e4f506172","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","publicId":"PAY-D003","title":"Daily transfer limit is not enforced under concurrency","detail":"The limit is read before the write and never locked, so two concurrent transfers both pass the check.","severity":"high","status":"open","assetIds":["5a6b7c8d-9e0f-4102-8334-4556677889aa"],"resultIds":["6f708192-a3b4-45c6-8d7e-8f9012345678"],"raisedBy":{"kind":"agent","tool":"claude-code","onBehalfOf":"u-1042"},"confirmedByUserId":"u-1042","externalKey":null,"externalUrl":null,"syncState":"local","openedAt":"2026-09-10T10:15:00.000Z","closedAt":null}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"Setting the status to fixed, closed or wont_fix stamps `closedAt`; moving it back to open clears it. Confirming records who did so — it does not change whether the defect blocks, because it always did.","tags":["defects"],"x-cortena-tool":"assure_defect_update","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"defectId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The defect uuid, from assure_defect_list."},"description":"The defect uuid, from assure_defect_list.","example":"bc23de45-f067-489a-8b1c-2d3e4f506172"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"severity":{"type":"string","enum":["critical","high","medium","low"],"description":"critical, high, medium or low."},"status":{"type":"string","enum":["open","in_progress","fixed","wont_fix","closed"],"description":"Where it has got to."},"acknowledge":{"type":"boolean","description":"True records the caller as having confirmed the defect."}}},"examples":{"acknowledged":{"value":{"acknowledge":true}}}}}}}},"/v1/orgs/{orgId}/environments":{"get":{"operationId":"assure_environment_list","summary":"The organisation’s environments, each with the state of its security authorisation.","x-cortena-access":"read","x-cortena-when-to-use":"Use before opening a run, to find the environment id — and to see whether security cases will dispatch at all before you queue a hundred of them.","x-cortena-examples":[{"name":"where we can run","summary":"Environments and their authorisations","request":{"orgId":"00000000-0000-0000-0000-000000000001"},"response":{"items":[{"id":"4d5e6f70-8192-43a4-8b5c-6d7e8f901234","orgId":"00000000-0000-0000-0000-000000000001","name":"Staging","baseUrl":"https://staging.payments.example","dbHostname":"staging-db.internal","identityNames":["teller","supervisor"],"isProduction":false,"capabilities":["seed-data","reset"],"accessNotes":"Request access in #payments-staging; approval takes a day.","createdBy":"u-1042","createdAt":"2026-08-02T09:00:00.000Z","securityAuthorization":{"id":"ab12cd34-ef56-4789-8a0b-1c2d3e4f5061","environmentId":"4d5e6f70-8192-43a4-8b5c-6d7e8f901234","classes":["authorization","exposure"],"authorizedByUserId":"u-1042","authorizedByName":"R. Mehta","authorizedAt":"2026-09-01T09:00:00.000Z","expiresAt":"2026-10-01T09:00:00.000Z","revokedAt":null,"scopeNote":"Read-only probing of the transfers API only. No data modification.","state":"live","daysRemaining":21}}]}}],"responses":{"200":{"description":"The organisation’s environments, each with the state of its security authorisation.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The environment uuid."},"orgId":{"type":"string","description":"The organisation."},"name":{"type":"string","description":"What people call it — \"Staging\", \"Production\"."},"baseUrl":{"type":"string","description":"Where it answers."},"dbHostname":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The database host, for database cases."},"identityNames":{"type":"array","items":{"type":"string"},"description":"The test identities available here, by name. No credentials — see D7."},"isProduction":{"type":"boolean","description":"True refuses destructive security classes outright, whatever is authorised."},"capabilities":{"type":"array","items":{"type":"string"},"description":"What can be done here."},"accessNotes":{"type":"string","description":"How a person obtains access. Assure points at the process instead of holding the key."},"createdBy":{"type":"string","description":"Who registered it."},"createdAt":{"type":"string","format":"date-time","description":"When it was registered."},"securityAuthorization":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","description":"The authorisation uuid."},"environmentId":{"type":"string","description":"The environment it covers."},"classes":{"type":"array","items":{"type":"string"},"description":"Exactly the classes it grants. Nothing else dispatches."},"authorizedByUserId":{"type":"string","description":"Who granted it."},"authorizedByName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Their name, suffixed with the tool when software held the token."},"authorizedAt":{"type":"string","format":"date-time","description":"When it was granted."},"expiresAt":{"type":"string","format":"date-time","description":"When it lapses. There is no perpetual authorisation."},"revokedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When it was revoked, or null while it stands."},"scopeNote":{"type":"string","description":"What is in scope and what is not."},"state":{"type":"string","description":"live, or expiring when it lapses within a fortnight."},"daysRemaining":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"How many days are left on it."}},"required":["id","environmentId","classes","authorizedByUserId","authorizedByName","authorizedAt","expiresAt","revokedAt","scopeNote","state","daysRemaining"],"description":"The gate of D8: dated, owned and revocable."},{"type":"null"}],"description":"The live authorisation on this environment, or null when there is none."}},"required":["id","orgId","name","baseUrl","dbHostname","identityNames","isProduction","capabilities","accessNotes","createdBy","createdAt","securityAuthorization"],"description":"An environment with the state of its security authorisation beside it — the thing this system is most prone to letting lapse."},"description":"Every environment in the organisation."}},"required":["items"],"description":"Every environment in the organisation."},"examples":{"where we can run":{"value":{"items":[{"id":"4d5e6f70-8192-43a4-8b5c-6d7e8f901234","orgId":"00000000-0000-0000-0000-000000000001","name":"Staging","baseUrl":"https://staging.payments.example","dbHostname":"staging-db.internal","identityNames":["teller","supervisor"],"isProduction":false,"capabilities":["seed-data","reset"],"accessNotes":"Request access in #payments-staging; approval takes a day.","createdBy":"u-1042","createdAt":"2026-08-02T09:00:00.000Z","securityAuthorization":{"id":"ab12cd34-ef56-4789-8a0b-1c2d3e4f5061","environmentId":"4d5e6f70-8192-43a4-8b5c-6d7e8f901234","classes":["authorization","exposure"],"authorizedByUserId":"u-1042","authorizedByName":"R. Mehta","authorizedAt":"2026-09-01T09:00:00.000Z","expiresAt":"2026-10-01T09:00:00.000Z","revokedAt":null,"scopeNote":"Read-only probing of the transfers API only. No data modification.","state":"live","daysRemaining":21}}]}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"The authorisation is carried here rather than left to be looked up, because an authorisation lapsing unnoticed is the failure this system is most prone to. `state` is `expiring` within a fortnight of the expiry and `live` before that.","tags":["environments"],"x-cortena-tool":"assure_environment_list","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"}]},"post":{"operationId":"assure_environment_create","summary":"Register an environment cases can be executed against.","x-cortena-access":"write","x-cortena-when-to-use":"Use once per environment. Mark production as production before anybody points a security run at it.","x-cortena-examples":[{"name":"staging","summary":"Register somewhere to run","request":{"orgId":"00000000-0000-0000-0000-000000000001","name":"Staging","baseUrl":"https://staging.payments.example","identityNames":["teller","supervisor"],"accessNotes":"Request access in #payments-staging; approval takes a day."},"response":{"id":"4d5e6f70-8192-43a4-8b5c-6d7e8f901234","orgId":"00000000-0000-0000-0000-000000000001","name":"Staging","baseUrl":"https://staging.payments.example","dbHostname":"staging-db.internal","identityNames":["teller","supervisor"],"isProduction":false,"capabilities":["seed-data","reset"],"accessNotes":"Request access in #payments-staging; approval takes a day.","createdBy":"u-1042","createdAt":"2026-08-02T09:00:00.000Z"}}],"responses":{"201":{"description":"Register an environment cases can be executed against.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The environment uuid."},"orgId":{"type":"string","description":"The organisation."},"name":{"type":"string","description":"What people call it — \"Staging\", \"Production\"."},"baseUrl":{"type":"string","description":"Where it answers."},"dbHostname":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The database host, for database cases."},"identityNames":{"type":"array","items":{"type":"string"},"description":"The test identities available here, by name. No credentials — see D7."},"isProduction":{"type":"boolean","description":"True refuses destructive security classes outright, whatever is authorised."},"capabilities":{"type":"array","items":{"type":"string"},"description":"What can be done here."},"accessNotes":{"type":"string","description":"How a person obtains access. Assure points at the process instead of holding the key."},"createdBy":{"type":"string","description":"Who registered it."},"createdAt":{"type":"string","format":"date-time","description":"When it was registered."}},"required":["id","orgId","name","baseUrl","dbHostname","identityNames","isProduction","capabilities","accessNotes","createdBy","createdAt"],"description":"Somewhere cases can be executed. Assure records what exists and what is permitted; it holds no credentials."},"examples":{"staging":{"value":{"id":"4d5e6f70-8192-43a4-8b5c-6d7e8f901234","orgId":"00000000-0000-0000-0000-000000000001","name":"Staging","baseUrl":"https://staging.payments.example","dbHostname":"staging-db.internal","identityNames":["teller","supervisor"],"isProduction":false,"capabilities":["seed-data","reset"],"accessNotes":"Request access in #payments-staging; approval takes a day.","createdBy":"u-1042","createdAt":"2026-08-02T09:00:00.000Z"}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"Per D7 Assure holds no credentials. `accessNotes` carries what would otherwise be a secret — how a person obtains access — so Assure points at the process instead of holding the key. `isProduction` refuses destructive security classes outright, and there is no setting that changes that.","tags":["environments"],"x-cortena-tool":"assure_environment_create","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"What people call it — \"Staging\", \"Production\"."},"baseUrl":{"type":"string","format":"uri","description":"Where it answers."},"dbHostname":{"type":"string","description":"The database host, for database cases."},"identityNames":{"type":"array","items":{"type":"string"},"description":"The test identities available here, by name. No credentials."},"isProduction":{"type":"boolean","description":"True refuses destructive security classes outright, whatever is authorised."},"capabilities":{"type":"array","items":{"type":"string"},"description":"What can be done here — seeding, resetting, and so on."},"accessNotes":{"type":"string","description":"How a person obtains access. This is the pointer that replaces holding a key."}},"required":["name","baseUrl"]},"examples":{"staging":{"value":{"name":"Staging","baseUrl":"https://staging.payments.example","identityNames":["teller","supervisor"],"accessNotes":"Request access in #payments-staging; approval takes a day."}}}}}}}},"/v1/orgs/{orgId}/environments/{environmentId}/authorizations":{"get":{"operationId":"assure_security_authorization_list","summary":"Every security authorisation on an environment, newest first.","x-cortena-access":"read","x-cortena-when-to-use":"Use when a security case was refused and you need to see what is actually granted, and by whom.","x-cortena-examples":[{"name":"what is granted","summary":"The authorisation history","request":{"orgId":"00000000-0000-0000-0000-000000000001","environmentId":"4d5e6f70-8192-43a4-8b5c-6d7e8f901234"},"response":{"items":[{"id":"ab12cd34-ef56-4789-8a0b-1c2d3e4f5061","environmentId":"4d5e6f70-8192-43a4-8b5c-6d7e8f901234","classes":["authorization","exposure"],"authorizedByUserId":"u-1042","authorizedByName":"R. Mehta","authorizedAt":"2026-09-01T09:00:00.000Z","expiresAt":"2026-10-01T09:00:00.000Z","revokedAt":null,"scopeNote":"Read-only probing of the transfers API only. No data modification."}]}}],"responses":{"200":{"description":"Every security authorisation on an environment, newest first.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The authorisation uuid."},"environmentId":{"type":"string","description":"The environment it covers."},"classes":{"type":"array","items":{"type":"string"},"description":"Exactly the classes it grants. Nothing else dispatches."},"authorizedByUserId":{"type":"string","description":"Who granted it."},"authorizedByName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Their name, suffixed with the tool when software held the token."},"authorizedAt":{"type":"string","format":"date-time","description":"When it was granted."},"expiresAt":{"type":"string","format":"date-time","description":"When it lapses. There is no perpetual authorisation."},"revokedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When it was revoked, or null while it stands."},"scopeNote":{"type":"string","description":"What is in scope and what is not."}},"required":["id","environmentId","classes","authorizedByUserId","authorizedByName","authorizedAt","expiresAt","revokedAt","scopeNote"],"description":"The gate of D8: dated, owned and revocable."},"description":"Every authorisation ever granted on this environment, newest first."}},"required":["items"],"description":"Every authorisation ever granted on this environment, newest first."},"examples":{"what is granted":{"value":{"items":[{"id":"ab12cd34-ef56-4789-8a0b-1c2d3e4f5061","environmentId":"4d5e6f70-8192-43a4-8b5c-6d7e8f901234","classes":["authorization","exposure"],"authorizedByUserId":"u-1042","authorizedByName":"R. Mehta","authorizedAt":"2026-09-01T09:00:00.000Z","expiresAt":"2026-10-01T09:00:00.000Z","revokedAt":null,"scopeNote":"Read-only probing of the transfers API only. No data modification."}]}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"Revoked and expired ones are included: the point of the list is the history of who granted what and until when, not only what is live.","tags":["security"],"x-cortena-tool":"assure_security_authorization_list","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"environmentId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The environment uuid, from assure_environment_list."},"description":"The environment uuid, from assure_environment_list.","example":"4d5e6f70-8192-43a4-8b5c-6d7e8f901234"}]},"post":{"operationId":"assure_security_authorize","summary":"Authorise security testing against an environment, until an expiry you set.","x-cortena-access":"write","x-cortena-when-to-use":"Use before a security run, naming only the classes you mean. This is not a place for completeness — do not authorise an environment you cannot account for.","x-cortena-examples":[{"name":"read-only probing","summary":"Authorise the non-destructive classes","request":{"orgId":"00000000-0000-0000-0000-000000000001","environmentId":"4d5e6f70-8192-43a4-8b5c-6d7e8f901234","classes":["authorization","exposure"],"expiresAt":"2026-10-01T09:00:00.000Z","scopeNote":"Read-only probing of the transfers API only. No data modification."},"response":{"id":"ab12cd34-ef56-4789-8a0b-1c2d3e4f5061","environmentId":"4d5e6f70-8192-43a4-8b5c-6d7e8f901234","classes":["authorization","exposure"],"authorizedByUserId":"u-1042","authorizedByName":"R. Mehta","authorizedAt":"2026-09-01T09:00:00.000Z","expiresAt":"2026-10-01T09:00:00.000Z","revokedAt":null,"scopeNote":"Read-only probing of the transfers API only. No data modification."}}],"responses":{"201":{"description":"Authorise security testing against an environment, until an expiry you set.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The authorisation uuid."},"environmentId":{"type":"string","description":"The environment it covers."},"classes":{"type":"array","items":{"type":"string"},"description":"Exactly the classes it grants. Nothing else dispatches."},"authorizedByUserId":{"type":"string","description":"Who granted it."},"authorizedByName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Their name, suffixed with the tool when software held the token."},"authorizedAt":{"type":"string","format":"date-time","description":"When it was granted."},"expiresAt":{"type":"string","format":"date-time","description":"When it lapses. There is no perpetual authorisation."},"revokedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When it was revoked, or null while it stands."},"scopeNote":{"type":"string","description":"What is in scope and what is not."}},"required":["id","environmentId","classes","authorizedByUserId","authorizedByName","authorizedAt","expiresAt","revokedAt","scopeNote"],"description":"The gate of D8: dated, owned and revocable."},"examples":{"read-only probing":{"value":{"id":"ab12cd34-ef56-4789-8a0b-1c2d3e4f5061","environmentId":"4d5e6f70-8192-43a4-8b5c-6d7e8f901234","classes":["authorization","exposure"],"authorizedByUserId":"u-1042","authorizedByName":"R. Mehta","authorizedAt":"2026-09-01T09:00:00.000Z","expiresAt":"2026-10-01T09:00:00.000Z","revokedAt":null,"scopeNote":"Read-only probing of the transfers API only. No data modification."}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"Required before security cases will dispatch. The destructive classes — injection and tampering — write, alter or delete real data to prove their point, and are refused on a production environment even with this. Open to a session as well as a person since D4 was removed; what survives is the record of who authorised it and until when.","tags":["security"],"x-cortena-tool":"assure_security_authorize","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"environmentId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The environment uuid, from assure_environment_list."},"description":"The environment uuid, from assure_environment_list.","example":"4d5e6f70-8192-43a4-8b5c-6d7e8f901234"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"classes":{"type":"array","items":{"type":"string","enum":["authorization","authentication","exposure","injection","tampering","dependency","secrets"],"description":"The class of security check. injection and tampering write or delete data and are refused against production."},"minItems":1,"description":"Only the classes you mean. Anything not named here will not dispatch."},"expiresAt":{"type":"string","format":"date-time","description":"When it lapses. Keep it short — there is no perpetual authorisation."},"scopeNote":{"type":"string","minLength":1,"description":"What is in scope and what is not."}},"required":["classes","expiresAt","scopeNote"]},"examples":{"read-only probing":{"value":{"classes":["authorization","exposure"],"expiresAt":"2026-10-01T09:00:00.000Z","scopeNote":"Read-only probing of the transfers API only. No data modification."}}}}}}}},"/v1/orgs/{orgId}/releases/{releaseId}/evaluate":{"post":{"operationId":"assure_release_evaluate","summary":"Re-evaluate a release gate from the record.","x-cortena-access":"write","x-cortena-when-to-use":"Use after approving cases, closing a run or fixing a defect, to see whether the gate has moved.","x-cortena-examples":[{"name":"re-evaluated","summary":"Ask the gate again","request":{"orgId":"00000000-0000-0000-0000-000000000001","releaseId":"cd34ef56-0178-49ab-8c2d-3e4f50617283"},"response":{"id":"cd34ef56-0178-49ab-8c2d-3e4f50617283","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","environmentId":"4d5e6f70-8192-43a4-8b5c-6d7e8f901234","name":"4.3.0","scope":{"minimumPriority":"high"},"status":"held","conditions":[{"key":"all_approved","state":"met","description":"Every case in scope at or above the minimum priority has a live approval","detail":{"inScope":12,"unapproved":0,"examples":[]}},{"key":"all_passed","state":"unmet","description":"One completed run covers the scope and everything in it passed","detail":{"reason":"One case failed"}},{"key":"no_open_defects","state":"unmet","description":"No open defect blocks an asset in scope","detail":{"open":1}},{"key":"security_current","state":"met","description":"Security testing is current and its authorisation has not lapsed","detail":{"authorisation":"live","ageDays":2,"limitDays":7}}],"advisory":{"judgedResults":0,"inconsistentCases":0},"satisfyingRunId":null,"evaluatedAt":"2026-09-10T11:00:00.000Z","createdBy":"u-1042","createdAt":"2026-09-10T10:55:00.000Z"}}],"responses":{"200":{"description":"Re-evaluate a release gate from the record.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The release uuid."},"applicationId":{"type":"string","description":"The application."},"environmentId":{"type":"string","description":"The environment the gate is evaluated against."},"name":{"type":"string","description":"What this release is called."},"scope":{"type":"object","properties":{"assetIds":{"type":"array","items":{"type":"string"},"description":"Only cases on these assets."},"minimumPriority":{"type":"string","description":"Only cases at or above this priority. Defaults to high."}},"description":"What the gate covers."},"status":{"type":"string","description":"open, held, met or signed."},"conditions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"all_approved, all_passed, no_open_defects or security_current."},"state":{"type":"string","description":"met, unmet or not_evaluated."},"description":{"type":"string","description":"What the condition says, in a sentence."},"detail":{"type":"object","additionalProperties":{},"description":"The numbers behind it — what is unapproved, which run satisfied it, what is open."}},"required":["key","state","description","detail"],"description":"One condition of a release gate, evaluated from the record."},"description":"The four conditions and whether each holds."},"advisory":{"type":"object","properties":{"judgedResults":{"type":"number","description":"Judged results in scope. Not gating, but the signer should see it."},"inconsistentCases":{"type":"number","description":"Cases that have flipped between pass and fail. A release over forty flapping cases is a different proposition."}},"required":["judgedResults","inconsistentCases"],"description":"What does not gate but the signer should still read."},"satisfyingRunId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The completed run that satisfies the scope, or null."},"evaluatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the gate was last evaluated."},"createdBy":{"type":"string","description":"Who created it."},"createdAt":{"type":"string","format":"date-time","description":"When it was created."}},"required":["id","applicationId","environmentId","name","scope","status","conditions","advisory","satisfyingRunId","evaluatedAt","createdBy","createdAt"],"description":"A release and the state of its gate. Evaluated from the record, never asserted."},"examples":{"re-evaluated":{"value":{"id":"cd34ef56-0178-49ab-8c2d-3e4f50617283","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","environmentId":"4d5e6f70-8192-43a4-8b5c-6d7e8f901234","name":"4.3.0","scope":{"minimumPriority":"high"},"status":"held","conditions":[{"key":"all_approved","state":"met","description":"Every case in scope at or above the minimum priority has a live approval","detail":{"inScope":12,"unapproved":0,"examples":[]}},{"key":"all_passed","state":"unmet","description":"One completed run covers the scope and everything in it passed","detail":{"reason":"One case failed"}},{"key":"no_open_defects","state":"unmet","description":"No open defect blocks an asset in scope","detail":{"open":1}},{"key":"security_current","state":"met","description":"Security testing is current and its authorisation has not lapsed","detail":{"authorisation":"live","ageDays":2,"limitDays":7}}],"advisory":{"judgedResults":0,"inconsistentCases":0},"satisfyingRunId":null,"evaluatedAt":"2026-09-10T11:00:00.000Z","createdBy":"u-1042","createdAt":"2026-09-10T10:55:00.000Z"}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"Four conditions, computed rather than asserted: every case in scope approved, one completed run covering the scope with everything passed, no open defect on an asset in scope, and security testing current with a live authorisation. Writes the result back onto the release.","tags":["releases"],"x-cortena-tool":"assure_release_evaluate","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"releaseId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The release uuid, from assure_release_list."},"description":"The release uuid, from assure_release_list.","example":"cd34ef56-0178-49ab-8c2d-3e4f50617283"}]}},"/v1/orgs/{orgId}/releases/{releaseId}/signoff":{"post":{"operationId":"assure_release_sign","summary":"Sign off a release.","x-cortena-access":"write","x-cortena-when-to-use":"Read assure_release_verdict first. Signing records what the gate said at this moment alongside your name — if the gate is failing, either say why in the note or do not sign.","x-cortena-examples":[{"name":"signed","summary":"Sign a release whose gate is met","request":{"orgId":"00000000-0000-0000-0000-000000000001","releaseId":"cd34ef56-0178-49ab-8c2d-3e4f50617283","note":"Gate green; the two judged results are cosmetic."},"response":{"id":"ef560178-29ab-4cd3-8e4f-506172839405","releaseId":"cd34ef56-0178-49ab-8c2d-3e4f50617283","record":{"release":"4.3.0","approvedCases":12,"signedAt":"2026-09-10T12:00:00.000Z"},"recordHash":"sha256:1c2d3e4f…","signedByUserId":"u-1042","signedByName":"R. Mehta","signedAt":"2026-09-10T12:00:00.000Z","countersignedByUserId":null,"countersignedAt":null,"delegationEnforced":false,"retainUntil":null}}],"responses":{"201":{"description":"Sign off a release.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The sign-off uuid."},"releaseId":{"type":"string","description":"The release."},"record":{"type":"object","additionalProperties":{},"description":"The immutable record: what was in scope, who approved it, which run satisfied it, and the caveats."},"recordHash":{"type":"string","description":"sha256 of the canonical record."},"signedByUserId":{"type":"string","description":"Who signed."},"signedByName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Their name, suffixed with the tool when software held the token."},"signedAt":{"type":"string","format":"date-time","description":"When they signed."},"countersignedByUserId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Who countersigned, or null."},"countersignedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When, or null."},"delegationEnforced":{"type":"boolean","description":"False means Assure could not prove the request came from a person at the time (AR-1). The record says so rather than being silently indistinguishable."},"retainUntil":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When it may be discarded."}},"required":["id","releaseId","record","recordHash","signedByUserId","signedByName","signedAt","countersignedByUserId","countersignedAt","delegationEnforced","retainUntil"],"description":"Written once; there is no update path."},"examples":{"signed":{"value":{"id":"ef560178-29ab-4cd3-8e4f-506172839405","releaseId":"cd34ef56-0178-49ab-8c2d-3e4f50617283","record":{"release":"4.3.0","approvedCases":12,"signedAt":"2026-09-10T12:00:00.000Z"},"recordHash":"sha256:1c2d3e4f…","signedByUserId":"u-1042","signedByName":"R. Mehta","signedAt":"2026-09-10T12:00:00.000Z","countersignedByUserId":null,"countersignedAt":null,"delegationEnforced":false,"retainUntil":null}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"A sign-off is immutable and there is no update path. It records the manifest of what was approved, by whom and when, the run that satisfied the scope, and the caveats — including `evidentiaryWarning` while Assure cannot yet prove a request came from a person rather than software (AR-1). An unmet condition is refused, naming which; countersigning adds a second name to an existing sign-off.","tags":["releases"],"x-cortena-tool":"assure_release_sign","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"releaseId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The release uuid, from assure_release_list."},"description":"The release uuid, from assure_release_list.","example":"cd34ef56-0178-49ab-8c2d-3e4f50617283"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string","description":"Why you are signing. Required in practice when signing over anything unusual."},"countersign":{"type":"boolean","description":"Add a second name to a sign-off that already exists."}}},"examples":{"signed":{"value":{"note":"Gate green; the two judged results are cosmetic."}}}}}}}},"/v1/orgs/{orgId}/releases/{releaseId}/verdict":{"get":{"operationId":"assure_release_verdict","summary":"A release gate’s state: each condition, whether it holds, and what is advisory.","x-cortena-access":"read","x-cortena-when-to-use":"Read this before assure_release_sign, and from a deployment pipeline deciding whether to proceed.","x-cortena-examples":[{"name":"held","summary":"Why a release cannot go yet","request":{"orgId":"00000000-0000-0000-0000-000000000001","releaseId":"cd34ef56-0178-49ab-8c2d-3e4f50617283"},"response":{"release":"4.3.0","status":"held","conditions":[{"key":"all_approved","state":"met","detail":{"inScope":12,"unapproved":0,"examples":[]}},{"key":"all_passed","state":"unmet","detail":{"reason":"One case failed"}},{"key":"no_open_defects","state":"unmet","detail":{"open":1}},{"key":"security_current","state":"met","detail":{"authorisation":"live","ageDays":2,"limitDays":7}}],"advisory":{"judgedResults":0,"inconsistentCases":0},"evaluatedAt":"2026-09-10T11:00:00.000Z","signoff":null}}],"responses":{"200":{"description":"A release gate’s state: each condition, whether it holds, and what is advisory.","content":{"application/json":{"schema":{"type":"object","properties":{"release":{"type":"string","description":"The release name."},"status":{"type":"string","description":"open, held, met or signed."},"conditions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"Which condition."},"state":{"type":"string","description":"met, unmet or not_evaluated."},"detail":{"type":"object","additionalProperties":{},"description":"The numbers behind it."}},"required":["key","state","detail"]},"description":"Each condition and whether it holds."},"advisory":{"type":"object","properties":{"judgedResults":{"type":"number","description":"Judged results in scope. Not gating, but the signer should see it."},"inconsistentCases":{"type":"number","description":"Cases that have flipped between pass and fail. A release over forty flapping cases is a different proposition."}},"required":["judgedResults","inconsistentCases"],"description":"What does not gate but the signer should still read."},"evaluatedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When the gate was last evaluated, as ISO-8601."},"signoff":{"anyOf":[{"type":"object","properties":{"signedBy":{"type":"string","description":"Who signed."},"signedAt":{"type":"string","description":"When, as ISO-8601."},"recordHash":{"type":"string","description":"The hash of the immutable sign-off record."},"delegationEnforced":{"type":"boolean","description":"False means the record was written before Assure could prove a request came from a person (AR-1)."}},"required":["signedBy","signedAt","recordHash","delegationEnforced"]},{"type":"null"}],"description":"The sign-off, or null when nobody has signed."}},"required":["release","status","conditions","advisory","evaluatedAt","signoff"],"description":"The pipeline-readable gate state. Keys are added, never renamed or removed — this is the most stability-sensitive surface in the system."},"examples":{"held":{"value":{"release":"4.3.0","status":"held","conditions":[{"key":"all_approved","state":"met","detail":{"inScope":12,"unapproved":0,"examples":[]}},{"key":"all_passed","state":"unmet","detail":{"reason":"One case failed"}},{"key":"no_open_defects","state":"unmet","detail":{"open":1}},{"key":"security_current","state":"met","detail":{"authorisation":"live","ageDays":2,"limitDays":7}}],"advisory":{"judgedResults":0,"inconsistentCases":0},"evaluatedAt":"2026-09-10T11:00:00.000Z","signoff":null}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"The pipeline-readable shape, and the most stability-sensitive surface in the system: keys are added, never renamed or removed. `advisory` does not gate but the signer should read it — a release whose scope contains forty flapping cases is a different proposition from a stable one. Evaluates before answering, so the state is current.","tags":["releases"],"x-cortena-tool":"assure_release_verdict","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"releaseId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The release uuid, from assure_release_list."},"description":"The release uuid, from assure_release_list.","example":"cd34ef56-0178-49ab-8c2d-3e4f50617283"}]}},"/v1/orgs/{orgId}/results/{resultId}/evidence":{"get":{"operationId":"assure_evidence_list","summary":"The evidence attached to a result.","x-cortena-access":"read","x-cortena-when-to-use":"Use when reading a failure somebody else recorded, before deciding whether it is a defect or a stale case.","x-cortena-examples":[{"name":"what was captured","summary":"Inspect a failure","request":{"orgId":"00000000-0000-0000-0000-000000000001","resultId":"6f708192-a3b4-45c6-8d7e-8f9012345678"},"response":{"items":[{"id":"8f901234-5678-49ab-8cde-f01234567890","resultId":"6f708192-a3b4-45c6-8d7e-8f9012345678","kind":"http_transcript","caption":"Request and response for the over-limit transfer","uri":"files://assure/run-0007/pay-014.http","sizeBytes":4096,"redactions":["$.request.headers.authorization"],"retainUntil":null,"createdAt":"2026-09-10T09:05:00.000Z"}]}}],"responses":{"200":{"description":"The evidence attached to a result.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The evidence uuid."},"resultId":{"type":"string","description":"The result it belongs to."},"kind":{"type":"string","description":"screenshot, har, http_transcript, sql_transcript, console or note."},"caption":{"type":"string","description":"What it shows."},"uri":{"type":"string","description":"Where the object lives. Assure stores the reference, not the bytes."},"sizeBytes":{"type":"number","description":"How big it is."},"redactions":{"type":"array","items":{"type":"string"},"description":"What was masked before storage, so a reader knows something was removed."},"retainUntil":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When it may be discarded."},"createdAt":{"type":"string","format":"date-time","description":"When it was attached."}},"required":["id","resultId","kind","caption","uri","sizeBytes","redactions","retainUntil","createdAt"],"description":"Something a reader can inspect. A failure with no evidence is rejected at close."},"description":"Everything attached to this result."}},"required":["items"],"description":"Everything attached to this result."},"examples":{"what was captured":{"value":{"items":[{"id":"8f901234-5678-49ab-8cde-f01234567890","resultId":"6f708192-a3b4-45c6-8d7e-8f9012345678","kind":"http_transcript","caption":"Request and response for the over-limit transfer","uri":"files://assure/run-0007/pay-014.http","sizeBytes":4096,"redactions":["$.request.headers.authorization"],"retainUntil":null,"createdAt":"2026-09-10T09:05:00.000Z"}]}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"`redactions` names what was masked before storage, so a reader knows something was removed rather than absent.","tags":["results"],"x-cortena-tool":"assure_evidence_list","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"resultId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The result uuid, from assure_result_post."},"description":"The result uuid, from assure_result_post.","example":"6f708192-a3b4-45c6-8d7e-8f9012345678"}]},"post":{"operationId":"assure_evidence_attach","summary":"Attach evidence to a result.","x-cortena-access":"write","x-cortena-when-to-use":"Use after posting a failed result, and after any result where what you saw would be hard to believe without seeing it.","x-cortena-examples":[{"name":"the transcript","summary":"Attach the HTTP exchange behind a failure","request":{"orgId":"00000000-0000-0000-0000-000000000001","resultId":"6f708192-a3b4-45c6-8d7e-8f9012345678","kind":"http_transcript","uri":"files://assure/run-0007/pay-014.http","caption":"Request and response for the over-limit transfer"},"response":{"id":"8f901234-5678-49ab-8cde-f01234567890","resultId":"6f708192-a3b4-45c6-8d7e-8f9012345678","kind":"http_transcript","caption":"Request and response for the over-limit transfer","uri":"files://assure/run-0007/pay-014.http","sizeBytes":0,"redactions":[],"retainUntil":null,"createdAt":"2026-09-10T09:05:00.000Z"}}],"responses":{"201":{"description":"Attach evidence to a result.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The evidence uuid."},"resultId":{"type":"string","description":"The result it belongs to."},"kind":{"type":"string","description":"screenshot, har, http_transcript, sql_transcript, console or note."},"caption":{"type":"string","description":"What it shows."},"uri":{"type":"string","description":"Where the object lives. Assure stores the reference, not the bytes."},"sizeBytes":{"type":"number","description":"How big it is."},"redactions":{"type":"array","items":{"type":"string"},"description":"What was masked before storage, so a reader knows something was removed."},"retainUntil":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When it may be discarded."},"createdAt":{"type":"string","format":"date-time","description":"When it was attached."}},"required":["id","resultId","kind","caption","uri","sizeBytes","redactions","retainUntil","createdAt"],"description":"Something a reader can inspect. A failure with no evidence is rejected at close."},"examples":{"the transcript":{"value":{"id":"8f901234-5678-49ab-8cde-f01234567890","resultId":"6f708192-a3b4-45c6-8d7e-8f9012345678","kind":"http_transcript","caption":"Request and response for the over-limit transfer","uri":"files://assure/run-0007/pay-014.http","sizeBytes":0,"redactions":[],"retainUntil":null,"createdAt":"2026-09-10T09:05:00.000Z"}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"JSON metadata and a URI — Assure stores the reference, not the bytes. The binary goes to the organisation’s File Manager; in development a session writes locally and passes the path. A failure with no evidence is reported at close, because a failure nobody can inspect will be argued with and then ignored.","tags":["results"],"x-cortena-tool":"assure_evidence_attach","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"resultId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The result uuid, from assure_result_post."},"description":"The result uuid, from assure_result_post.","example":"6f708192-a3b4-45c6-8d7e-8f9012345678"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["screenshot","har","http_transcript","sql_transcript","console","note"],"description":"What the evidence is: screenshot, har, http_transcript, sql_transcript, console or note."},"uri":{"type":"string","minLength":1,"description":"Where the object lives."},"caption":{"type":"string","description":"What it shows."},"sizeBytes":{"type":"integer","description":"How big it is."},"redactions":{"type":"array","items":{"type":"string"},"description":"Paths you masked before storing, so a reader knows something was removed."}},"required":["kind","uri"]},"examples":{"the transcript":{"value":{"kind":"http_transcript","uri":"files://assure/run-0007/pay-014.http","caption":"Request and response for the over-limit transfer"}}}}}}}},"/v1/orgs/{orgId}/results/{resultId}/evidence/{evidenceId}/file":{"get":{"operationId":"assure_evidence_file_get","summary":"Read an uploaded screenshot.","x-cortena-access":"read","x-cortena-when-to-use":"Use from a page that shows the picture. An agent reads the evidence row instead.","x-cortena-examples":[{"name":"a stored screenshot","summary":"Show what the browser saw","request":{"orgId":"00000000-0000-0000-0000-000000000001","resultId":"6f708192-a3b4-45c6-8d7e-8f9012345678","evidenceId":"8f901234-5678-49ab-8cde-f01234567890"},"response":{"contentType":"image/png","dataBase64":"iVBORw0KGgo="}}],"responses":{"200":{"description":"Read an uploaded screenshot.","content":{"application/json":{"schema":{"type":"object","properties":{"contentType":{"type":"string","enum":["image/png","image/jpeg"],"description":"What the bytes are."},"dataBase64":{"type":"string","description":"The file, base64 encoded."}},"required":["contentType","dataBase64"],"description":"An uploaded screenshot."},"examples":{"a stored screenshot":{"value":{"contentType":"image/png","dataBase64":"iVBORw0KGgo="}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"The bytes behind an `assure://` evidence reference, base64 encoded. Checked against the result’s application like the evidence list is. 404 when that evidence was recorded by reference only.","tags":["results"],"x-cortena-tool-exempt-reason":"it carries an image as base64. An agent has no use for the bytes and they would fill its context window; it reads the evidence row from assure_evidence_list and a person sees the picture on the Runs page (§5).","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"resultId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The result uuid, from assure_result_post."},"description":"The result uuid, from assure_result_post.","example":"6f708192-a3b4-45c6-8d7e-8f9012345678"},{"name":"evidenceId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The evidence uuid."},"description":"The evidence uuid.","example":"8f901234-5678-49ab-8cde-f01234567890"}]}},"/v1/orgs/{orgId}/results/{resultId}/evidence/file":{"post":{"operationId":"assure_evidence_upload","summary":"Upload a screenshot for a result.","x-cortena-access":"write","x-cortena-when-to-use":"Use from a test runner holding a run token, to keep a screenshot where the result lives instead of on the runner.","x-cortena-examples":[{"name":"a passing login page","summary":"Keep what the browser saw","request":{"orgId":"00000000-0000-0000-0000-000000000001","resultId":"6f708192-a3b4-45c6-8d7e-8f9012345678","contentType":"image/png","dataBase64":"iVBORw0KGgo=","caption":"The login page at 1280px"},"response":{"id":"8f901234-5678-49ab-8cde-f01234567890","resultId":"6f708192-a3b4-45c6-8d7e-8f9012345678","kind":"screenshot","caption":"The login page at 1280px","uri":"assure://results/6f708192-a3b4-45c6-8d7e-8f9012345678/evidence/8f901234-5678-49ab-8cde-f01234567890/file","sizeBytes":8,"redactions":[],"retainUntil":null,"createdAt":"2026-09-10T09:05:00.000Z"}}],"responses":{"201":{"description":"Upload a screenshot for a result.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The evidence uuid."},"resultId":{"type":"string","description":"The result it belongs to."},"kind":{"type":"string","description":"screenshot, har, http_transcript, sql_transcript, console or note."},"caption":{"type":"string","description":"What it shows."},"uri":{"type":"string","description":"Where the object lives. Assure stores the reference, not the bytes."},"sizeBytes":{"type":"number","description":"How big it is."},"redactions":{"type":"array","items":{"type":"string"},"description":"What was masked before storage, so a reader knows something was removed."},"retainUntil":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When it may be discarded."},"createdAt":{"type":"string","format":"date-time","description":"When it was attached."}},"required":["id","resultId","kind","caption","uri","sizeBytes","redactions","retainUntil","createdAt"],"description":"Something a reader can inspect. A failure with no evidence is rejected at close."},"examples":{"a passing login page":{"value":{"id":"8f901234-5678-49ab-8cde-f01234567890","resultId":"6f708192-a3b4-45c6-8d7e-8f9012345678","kind":"screenshot","caption":"The login page at 1280px","uri":"assure://results/6f708192-a3b4-45c6-8d7e-8f9012345678/evidence/8f901234-5678-49ab-8cde-f01234567890/file","sizeBytes":8,"redactions":[],"retainUntil":null,"createdAt":"2026-09-10T09:05:00.000Z"}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"Stores the image in Assure and attaches it as `screenshot` evidence whose `uri` is an `assure://` reference. PNG or JPEG, at most 1 MiB decoded, five per result; the type is checked against the file’s first bytes. For runners: an agent attaches a reference with assure_evidence_attach instead.","tags":["results"],"x-cortena-tool-exempt-reason":"it carries an image as base64. An agent has no use for the bytes and they would fill its context window; it reads the evidence row from assure_evidence_list and a person sees the picture on the Runs page (§5).","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"resultId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The result uuid, from assure_result_post."},"description":"The result uuid, from assure_result_post.","example":"6f708192-a3b4-45c6-8d7e-8f9012345678"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contentType":{"type":"string","enum":["image/png","image/jpeg"],"description":"What the bytes are."},"dataBase64":{"type":"string","description":"The file, base64 encoded."},"caption":{"type":"string","maxLength":1000,"description":"What it shows."}},"required":["contentType","dataBase64"],"description":"An uploaded screenshot."},"examples":{"a passing login page":{"value":{"contentType":"image/png","dataBase64":"iVBORw0KGgo=","caption":"The login page at 1280px"}}}}}}}},"/v1/orgs/{orgId}/runs/{runId}":{"get":{"operationId":"assure_run_get","summary":"One run, with its work list and its counts.","x-cortena-access":"read","x-cortena-when-to-use":"Use to resume a run you did not open, or to see where a run got to before it went quiet.","x-cortena-examples":[{"name":"in flight","summary":"Where a run got to","request":{"orgId":"00000000-0000-0000-0000-000000000001","runId":"1a2b3c4d-5e6f-4718-8920-a1b2c3d4e5f6"},"response":{"id":"1a2b3c4d-5e6f-4718-8920-a1b2c3d4e5f6","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","environmentId":"4d5e6f70-8192-43a4-8b5c-6d7e8f901234","publicId":"RUN-0007","openedByUserId":"u-1042","actor":{"kind":"agent","tool":"claude-code","onBehalfOf":"u-1042"},"scope":{"minimumPriority":"high"},"includeDrafts":false,"fullEvidence":false,"status":"open","counts":{"total":12,"passed":0,"failed":0,"skipped":0,"errored":0,"refused":0,"judged":0,"remaining":12},"queue":[{"caseId":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80"}],"cursor":0,"openedAt":"2026-09-10T09:00:00.000Z","closedAt":null,"heartbeatAt":"2026-09-10T09:00:00.000Z"}}],"responses":{"200":{"description":"One run, with its work list and its counts.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The run uuid."},"applicationId":{"type":"string","description":"The application."},"environmentId":{"type":"string","description":"Where it is being executed."},"publicId":{"type":"string","description":"RUN-0007 and the like — quote this to a person."},"openedByUserId":{"type":"string","description":"The person whose session opened it."},"actor":{"type":"object","properties":{"kind":{"type":"string","description":"human, agent or system."},"userId":{"type":"string","description":"The Cortena user id, when a person was acting directly."},"displayName":{"type":"string","description":"The name to show. For an agent, the person it acted for."},"tool":{"type":"string","description":"The software holding the token — \"claude-code\" and the like."},"model":{"type":"string","description":"The model behind the tool, when it named one."},"externallyRouted":{"type":"boolean","description":"True when the model sits outside the customer network."},"onBehalfOf":{"type":"string","description":"The user id an agent was acting for."}},"required":["kind"],"description":"Who opened it."},"scope":{"type":"object","properties":{"whole":{"type":"boolean","description":"Everything in the application."},"assetIds":{"type":"array","items":{"type":"string"},"description":"Only cases on these assets."},"caseIds":{"type":"array","items":{"type":"string"},"description":"Only these cases."},"segments":{"type":"array","items":{"type":"string"},"description":"Only these segments."},"minimumPriority":{"type":"string","description":"Only cases at or above this priority."}},"description":"What the run covers, as it was asked for."},"includeDrafts":{"type":"boolean","description":"True means unapproved cases are executed too. Their results never count toward coverage or a gate."},"fullEvidence":{"type":"boolean","description":"True asks the session for evidence on every result, not only failures."},"status":{"type":"string","description":"open, completed or abandoned."},"counts":{"type":"object","properties":{"total":{"type":"number","description":"How many entries the work list held when the run opened."},"passed":{"type":"number","description":"Results the session reported as passed."},"failed":{"type":"number","description":"Results the session reported as failed."},"skipped":{"type":"number","description":"Results the session skipped, with a reason."},"errored":{"type":"number","description":"Results that could not be executed."},"refused":{"type":"number","description":"Cases Assure declined to hand over. Counted separately — a run that refused 400 cases is not a passing run."},"judged":{"type":"number","description":"Judged screen results. Reported, never counted toward a gate."},"remaining":{"type":"number","description":"How much of the work list is left."}},"required":["total","passed","failed","skipped","errored","refused","judged","remaining"],"description":"What this run has produced so far. Assure owns these figures."},"queue":{"type":"array","items":{"type":"object","properties":{"caseId":{"type":"string","description":"The case."},"variant":{"type":"object","properties":{"viewport":{"type":"number","description":"The viewport width this execution covers."},"theme":{"type":"string","description":"The theme this execution covers."}},"description":"For a screen case, the viewport and theme one execution covers."}},"required":["caseId"]},"description":"The ordered work list, minted at open. One entry is one case at one variant."},"cursor":{"type":"number","description":"How far through the work list the session has been handed."},"openedAt":{"type":"string","format":"date-time","description":"When the run opened."},"closedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When it closed, or null while it is open."},"heartbeatAt":{"type":"string","format":"date-time","description":"The last sign of life. A run that goes quiet is marked abandoned and keeps its results."}},"required":["id","applicationId","environmentId","publicId","openedByUserId","actor","scope","includeDrafts","fullEvidence","status","counts","queue","cursor","openedAt","closedAt","heartbeatAt"],"description":"One session working through a list. There is no queue service and no dispatcher — Assure executes nothing."},"examples":{"in flight":{"value":{"id":"1a2b3c4d-5e6f-4718-8920-a1b2c3d4e5f6","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","environmentId":"4d5e6f70-8192-43a4-8b5c-6d7e8f901234","publicId":"RUN-0007","openedByUserId":"u-1042","actor":{"kind":"agent","tool":"claude-code","onBehalfOf":"u-1042"},"scope":{"minimumPriority":"high"},"includeDrafts":false,"fullEvidence":false,"status":"open","counts":{"total":12,"passed":0,"failed":0,"skipped":0,"errored":0,"refused":0,"judged":0,"remaining":12},"queue":[{"caseId":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80"}],"cursor":0,"openedAt":"2026-09-10T09:00:00.000Z","closedAt":null,"heartbeatAt":"2026-09-10T09:00:00.000Z"}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"`cursor` says how far through the work list the session has been handed; `counts.remaining` is what is left.","tags":["runs"],"x-cortena-tool":"assure_run_get","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"runId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The run uuid. Over MCP it defaults to the run this session opened, so leave it out."},"description":"The run uuid. Over MCP it defaults to the run this session opened, so leave it out.","example":"1a2b3c4d-5e6f-4718-8920-a1b2c3d4e5f6"}]}},"/v1/orgs/{orgId}/runs/{runId}/close":{"post":{"operationId":"assure_run_close","summary":"Close the run and seal its counts.","x-cortena-access":"write","x-cortena-when-to-use":"Use when the work list is exhausted, before writing the report.","x-cortena-examples":[{"name":"sealed","summary":"Finish a run","request":{"orgId":"00000000-0000-0000-0000-000000000001","runId":"1a2b3c4d-5e6f-4718-8920-a1b2c3d4e5f6"},"response":{"run":{"id":"1a2b3c4d-5e6f-4718-8920-a1b2c3d4e5f6","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","environmentId":"4d5e6f70-8192-43a4-8b5c-6d7e8f901234","publicId":"RUN-0007","openedByUserId":"u-1042","actor":{"kind":"agent","tool":"claude-code","onBehalfOf":"u-1042"},"scope":{"minimumPriority":"high"},"includeDrafts":false,"fullEvidence":false,"status":"completed","counts":{"total":12,"passed":0,"failed":0,"skipped":0,"errored":0,"refused":0,"judged":0,"remaining":0},"queue":[{"caseId":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80"}],"cursor":0,"openedAt":"2026-09-10T09:00:00.000Z","closedAt":"2026-09-10T10:00:00.000Z","heartbeatAt":"2026-09-10T09:00:00.000Z"},"failuresWithoutEvidence":["PAY-014"]}}],"responses":{"200":{"description":"Close the run and seal its counts.","content":{"application/json":{"schema":{"type":"object","properties":{"run":{"type":"object","properties":{"id":{"type":"string","description":"The run uuid."},"applicationId":{"type":"string","description":"The application."},"environmentId":{"type":"string","description":"Where it is being executed."},"publicId":{"type":"string","description":"RUN-0007 and the like — quote this to a person."},"openedByUserId":{"type":"string","description":"The person whose session opened it."},"actor":{"type":"object","properties":{"kind":{"type":"string","description":"human, agent or system."},"userId":{"type":"string","description":"The Cortena user id, when a person was acting directly."},"displayName":{"type":"string","description":"The name to show. For an agent, the person it acted for."},"tool":{"type":"string","description":"The software holding the token — \"claude-code\" and the like."},"model":{"type":"string","description":"The model behind the tool, when it named one."},"externallyRouted":{"type":"boolean","description":"True when the model sits outside the customer network."},"onBehalfOf":{"type":"string","description":"The user id an agent was acting for."}},"required":["kind"],"description":"Who opened it."},"scope":{"type":"object","properties":{"whole":{"type":"boolean","description":"Everything in the application."},"assetIds":{"type":"array","items":{"type":"string"},"description":"Only cases on these assets."},"caseIds":{"type":"array","items":{"type":"string"},"description":"Only these cases."},"segments":{"type":"array","items":{"type":"string"},"description":"Only these segments."},"minimumPriority":{"type":"string","description":"Only cases at or above this priority."}},"description":"What the run covers, as it was asked for."},"includeDrafts":{"type":"boolean","description":"True means unapproved cases are executed too. Their results never count toward coverage or a gate."},"fullEvidence":{"type":"boolean","description":"True asks the session for evidence on every result, not only failures."},"status":{"type":"string","description":"open, completed or abandoned."},"counts":{"type":"object","properties":{"total":{"type":"number","description":"How many entries the work list held when the run opened."},"passed":{"type":"number","description":"Results the session reported as passed."},"failed":{"type":"number","description":"Results the session reported as failed."},"skipped":{"type":"number","description":"Results the session skipped, with a reason."},"errored":{"type":"number","description":"Results that could not be executed."},"refused":{"type":"number","description":"Cases Assure declined to hand over. Counted separately — a run that refused 400 cases is not a passing run."},"judged":{"type":"number","description":"Judged screen results. Reported, never counted toward a gate."},"remaining":{"type":"number","description":"How much of the work list is left."}},"required":["total","passed","failed","skipped","errored","refused","judged","remaining"],"description":"What this run has produced so far. Assure owns these figures."},"queue":{"type":"array","items":{"type":"object","properties":{"caseId":{"type":"string","description":"The case."},"variant":{"type":"object","properties":{"viewport":{"type":"number","description":"The viewport width this execution covers."},"theme":{"type":"string","description":"The theme this execution covers."}},"description":"For a screen case, the viewport and theme one execution covers."}},"required":["caseId"]},"description":"The ordered work list, minted at open. One entry is one case at one variant."},"cursor":{"type":"number","description":"How far through the work list the session has been handed."},"openedAt":{"type":"string","format":"date-time","description":"When the run opened."},"closedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When it closed, or null while it is open."},"heartbeatAt":{"type":"string","format":"date-time","description":"The last sign of life. A run that goes quiet is marked abandoned and keeps its results."}},"required":["id","applicationId","environmentId","publicId","openedByUserId","actor","scope","includeDrafts","fullEvidence","status","counts","queue","cursor","openedAt","closedAt","heartbeatAt"],"description":"The run, now sealed."},"failuresWithoutEvidence":{"type":"array","items":{"type":"string"},"description":"Public ids of failed cases carrying no evidence. A failure nobody can inspect will be argued with and then ignored."}},"required":["run","failuresWithoutEvidence"],"description":"What closing a run answers: the sealed run and anything still missing evidence."},"examples":{"sealed":{"value":{"run":{"id":"1a2b3c4d-5e6f-4718-8920-a1b2c3d4e5f6","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","environmentId":"4d5e6f70-8192-43a4-8b5c-6d7e8f901234","publicId":"RUN-0007","openedByUserId":"u-1042","actor":{"kind":"agent","tool":"claude-code","onBehalfOf":"u-1042"},"scope":{"minimumPriority":"high"},"includeDrafts":false,"fullEvidence":false,"status":"completed","counts":{"total":12,"passed":0,"failed":0,"skipped":0,"errored":0,"refused":0,"judged":0,"remaining":0},"queue":[{"caseId":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80"}],"cursor":0,"openedAt":"2026-09-10T09:00:00.000Z","closedAt":"2026-09-10T10:00:00.000Z","heartbeatAt":"2026-09-10T09:00:00.000Z"},"failuresWithoutEvidence":["PAY-014"]}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"Reports which failures still have no evidence rather than refusing the close — the check is made here, after posting, so a session can upload evidence when it has it rather than being forced to hold a result until then.","tags":["runs"],"x-cortena-tool":"assure_run_close","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"runId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The run uuid. Over MCP it defaults to the run this session opened, so leave it out."},"description":"The run uuid. Over MCP it defaults to the run this session opened, so leave it out.","example":"1a2b3c4d-5e6f-4718-8920-a1b2c3d4e5f6"}]}},"/v1/orgs/{orgId}/runs/{runId}/counts":{"get":{"operationId":"assure_run_counts","summary":"The figures Assure computed for this run.","x-cortena-access":"read","x-cortena-when-to-use":"Check your arithmetic against these BEFORE publishing a report — a report whose stated counts disagree with the record is rejected.","x-cortena-examples":[{"name":"the arithmetic","summary":"What the record says","request":{"orgId":"00000000-0000-0000-0000-000000000001","runId":"1a2b3c4d-5e6f-4718-8920-a1b2c3d4e5f6"},"response":{"total":12,"passed":11,"failed":1,"skipped":0,"errored":0,"refused":0,"judged":0,"inconsistent":0,"unapproved":0}}],"responses":{"200":{"description":"The figures Assure computed for this run.","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number","description":"Every result in the run."},"passed":{"type":"number","description":"Passed."},"failed":{"type":"number","description":"Failed."},"skipped":{"type":"number","description":"Skipped."},"errored":{"type":"number","description":"Errored."},"refused":{"type":"number","description":"Refused by Assure before dispatch."},"judged":{"type":"number","description":"Judged screen results."},"inconsistent":{"type":"number","description":"Cases that have flipped between pass and fail over their recent history."},"unapproved":{"type":"number","description":"Ran, but nothing they assert can be relied on — no live approval."}},"required":["total","passed","failed","skipped","errored","refused","judged","inconsistent","unapproved"],"description":"The figures Assure computed. Check a report’s arithmetic against these before publishing."},"examples":{"the arithmetic":{"value":{"total":12,"passed":11,"failed":1,"skipped":0,"errored":0,"refused":0,"judged":0,"inconsistent":0,"unapproved":0}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"Recomputed from the results each time rather than read off the run row, so it is the number a report will be checked against rather than a cached one.","tags":["reports"],"x-cortena-tool":"assure_run_counts","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"runId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The run uuid. Over MCP it defaults to the run this session opened, so leave it out."},"description":"The run uuid. Over MCP it defaults to the run this session opened, so leave it out.","example":"1a2b3c4d-5e6f-4718-8920-a1b2c3d4e5f6"}]}},"/v1/orgs/{orgId}/runs/{runId}/next":{"post":{"operationId":"assure_run_next","summary":"The next case to execute, or nothing left.","x-cortena-access":"write","x-cortena-when-to-use":"Use in a loop: ask for a case, execute it, post the result, ask again — until `done` is true.","x-cortena-examples":[{"name":"next case","summary":"Take the next piece of work","request":{"orgId":"00000000-0000-0000-0000-000000000001","runId":"1a2b3c4d-5e6f-4718-8920-a1b2c3d4e5f6"},"response":{"case":{"id":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","publicId":"PAY-014","segment":"api","securityClass":null,"checkKind":"behavioural","priority":"high","caseVersionId":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","asset":{"id":"5a6b7c8d-9e0f-4102-8334-4556677889aa","key":"api:POST /v1/transfers","name":"POST /v1/transfers","path":"src/routes/transfers.ts"},"title":"Rejects a transfer that would breach the daily limit","preconditions":["A teller account with a daily allowance already part-used"],"steps":["Sign in as a teller","Post a transfer above the remaining daily allowance"],"expected":"The call returns status 422 and the transfer is not created.","notes":"The limit check reads the running total before the write but does not lock it.","evidenceRefs":[{"path":"src/routes/transfers.ts","line":88,"sha":"8f3c1a"}]},"remaining":11,"done":false}},{"name":"finished","summary":"The work list is exhausted","request":{"orgId":"00000000-0000-0000-0000-000000000001","runId":"1a2b3c4d-5e6f-4718-8920-a1b2c3d4e5f6"},"response":{"remaining":0,"done":true}}],"responses":{"200":{"description":"The next case to execute, or nothing left.","content":{"application/json":{"schema":{"type":"object","properties":{"case":{"type":"object","properties":{"id":{"type":"string","description":"The case uuid."},"publicId":{"type":"string","description":"Its permanent public id."},"segment":{"type":"string","description":"Which segment it belongs to."},"securityClass":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"For a security case, which class."},"checkKind":{"type":"string","description":"behavioural, measured or judged."},"priority":{"type":"string","description":"high, medium or low."},"caseVersionId":{"type":"string","description":"The version to execute — pass this back on the result."},"asset":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","description":"The asset uuid."},"key":{"type":"string","description":"The stable asset key."},"name":{"type":"string","description":"The display name."},"path":{"type":"string","description":"Where it lives."}},"required":["id","key","name","path"]},{"type":"null"}],"description":"What the case is about."},"title":{"type":"string","description":"What it asserts."},"preconditions":{"type":"array","items":{"type":"string"},"description":"What must already be true."},"steps":{"type":"array","items":{"type":"string"},"description":"What to do, in order."},"expected":{"type":"string","description":"The truth source. This is what decides pass from fail."},"notes":{"type":"string","description":"Why the case exists, in terms of the code."},"evidenceRefs":{"type":"array","items":{"type":"object","properties":{"repo":{"type":"string","description":"The repository, when the case spans more than one."},"path":{"type":"string","minLength":1,"description":"The file the claim was read from."},"line":{"type":"integer","minimum":0,"description":"The line number in that file."},"sha":{"type":"string","minLength":1,"description":"The commit the file was read at."}},"required":["path","line","sha"],"description":"Where a claim came from. Required on every case — a case with no evidence reference is refused."},"description":"Where the claim came from."}},"required":["id","publicId","segment","securityClass","checkKind","priority","caseVersionId","asset","title","preconditions","steps","expected","notes","evidenceRefs"],"description":"The case to execute. Absent when the run is done."},"variant":{"type":"object","properties":{"viewport":{"type":"number","description":"The viewport width this execution covers."},"theme":{"type":"string","description":"The theme this execution covers."}},"description":"For a screen case, the viewport and theme one execution covers."},"refusal":{"type":"object","properties":{"caseId":{"type":"string","description":"The case that was not handed over."},"casePublicId":{"type":"string","description":"Its public id."},"reason":{"type":"string","description":"no_approval, version_moved, no_security_authorization, authorization_expired, class_not_authorized or production_destructive."},"detail":{"type":"string","description":"What would have to change."}},"required":["caseId","casePublicId","reason","detail"],"description":"Present when Assure declined a case. It is recorded as a refused result and the queue advances."},"remaining":{"type":"number","description":"How many entries are left after this one."},"done":{"type":"boolean","description":"True when the work list is exhausted."}},"required":["remaining","done"],"description":"The next case to execute, or nothing left. Every dispatch check happens server-side, so a session never holds a case it may not run."},"examples":{"next case":{"value":{"case":{"id":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","publicId":"PAY-014","segment":"api","securityClass":null,"checkKind":"behavioural","priority":"high","caseVersionId":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","asset":{"id":"5a6b7c8d-9e0f-4102-8334-4556677889aa","key":"api:POST /v1/transfers","name":"POST /v1/transfers","path":"src/routes/transfers.ts"},"title":"Rejects a transfer that would breach the daily limit","preconditions":["A teller account with a daily allowance already part-used"],"steps":["Sign in as a teller","Post a transfer above the remaining daily allowance"],"expected":"The call returns status 422 and the transfer is not created.","notes":"The limit check reads the running total before the write but does not lock it.","evidenceRefs":[{"path":"src/routes/transfers.ts","line":88,"sha":"8f3c1a"}]},"remaining":11,"done":false}},"finished":{"value":{"remaining":0,"done":true}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"Every dispatch check happens here, so a session never holds a case it may not run: an unapproved case, or a security case the environment is not authorised for, is recorded as a refused result and skipped rather than handed over. There is no moment at which a session holds an attack it has been told not to run. A screen case comes back once per viewport and theme.","tags":["runs"],"x-cortena-tool":"assure_run_next","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"runId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The run uuid. Over MCP it defaults to the run this session opened, so leave it out."},"description":"The run uuid. Over MCP it defaults to the run this session opened, so leave it out.","example":"1a2b3c4d-5e6f-4718-8920-a1b2c3d4e5f6"}]}},"/v1/orgs/{orgId}/runs/{runId}/report":{"get":{"operationId":"assure_report_get","summary":"The report for a run.","x-cortena-access":"read","x-cortena-when-to-use":"Use to read what a run concluded, and to quote its causes when deciding whether to release.","x-cortena-examples":[{"name":"the conclusion","summary":"Read what a run meant","request":{"orgId":"00000000-0000-0000-0000-000000000001","runId":"1a2b3c4d-5e6f-4718-8920-a1b2c3d4e5f6"},"response":{"id":"90123456-789a-4bcd-8ef0-123456789abc","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","runId":"1a2b3c4d-5e6f-4718-8920-a1b2c3d4e5f6","title":"","summary":"The daily-limit check does not hold under concurrency. Everything else passed.","causes":[],"counts":{"total":12,"passed":11,"failed":1},"notCounted":{"refused":0,"judged":0,"inconsistent":0,"unapproved":0},"authoredBy":{"kind":"agent","tool":"claude-code","onBehalfOf":"u-1042"},"createdAt":"2026-09-10T10:10:00.000Z"}}],"responses":{"200":{"description":"The report for a run.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The report uuid."},"applicationId":{"type":"string","description":"The application."},"runId":{"type":"string","description":"The run it reports on."},"title":{"type":"string","description":"The report title."},"summary":{"type":"string","description":"What the run means, not what it did. Written by the session."},"causes":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string","description":"What the cause is, in one line."},"verdict":{"type":"string","description":"defect, stale_case, environment, ambiguous_case or inconsistent."},"rationale":{"type":"string","description":"Why the failures group this way."},"resultIds":{"type":"array","items":{"type":"string"},"description":"The results this cause accounts for. Every one must belong to this run."},"defectId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The defect raised from it, when there is one."}},"required":["title","verdict","rationale","resultIds"],"description":"A group of failures with one explanation. A cause is worth more than a count."},"description":"The failures, grouped and explained."},"counts":{"type":"object","additionalProperties":{"type":"number"},"description":"Computed by Assure, never taken from the session."},"notCounted":{"type":"object","additionalProperties":{"type":"number"},"description":"What was excluded from the figures and why: refused, judged, inconsistent, unapproved."},"authoredBy":{"type":"object","properties":{"kind":{"type":"string","description":"human, agent or system."},"userId":{"type":"string","description":"The Cortena user id, when a person was acting directly."},"displayName":{"type":"string","description":"The name to show. For an agent, the person it acted for."},"tool":{"type":"string","description":"The software holding the token — \"claude-code\" and the like."},"model":{"type":"string","description":"The model behind the tool, when it named one."},"externallyRouted":{"type":"boolean","description":"True when the model sits outside the customer network."},"onBehalfOf":{"type":"string","description":"The user id an agent was acting for."}},"required":["kind"],"description":"Who wrote it."},"createdAt":{"type":"string","format":"date-time","description":"When it was published."}},"required":["id","applicationId","runId","title","summary","causes","counts","notCounted","authoredBy","createdAt"],"description":"The report for a run. Immutable once published."},"examples":{"the conclusion":{"value":{"id":"90123456-789a-4bcd-8ef0-123456789abc","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","runId":"1a2b3c4d-5e6f-4718-8920-a1b2c3d4e5f6","title":"","summary":"The daily-limit check does not hold under concurrency. Everything else passed.","causes":[],"counts":{"total":12,"passed":11,"failed":1},"notCounted":{"refused":0,"judged":0,"inconsistent":0,"unapproved":0},"authoredBy":{"kind":"agent","tool":"claude-code","onBehalfOf":"u-1042"},"createdAt":"2026-09-10T10:10:00.000Z"}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"404 when nothing has been published for this run yet. `counts` are Assure’s, never the session’s.","tags":["reports"],"x-cortena-tool":"assure_report_get","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"runId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The run uuid. Over MCP it defaults to the run this session opened, so leave it out."},"description":"The run uuid. Over MCP it defaults to the run this session opened, so leave it out.","example":"1a2b3c4d-5e6f-4718-8920-a1b2c3d4e5f6"}]},"post":{"operationId":"assure_report_write","summary":"Publish the report for a run.","x-cortena-access":"write","x-cortena-when-to-use":"Use after closing the run, once you have grouped the failures into causes. Check your arithmetic against assure_run_counts first.","x-cortena-examples":[{"name":"one cause","summary":"Explain a run","request":{"orgId":"00000000-0000-0000-0000-000000000001","runId":"1a2b3c4d-5e6f-4718-8920-a1b2c3d4e5f6","summary":"The daily-limit check does not hold under concurrency. Everything else passed.","causes":[{"title":"Daily limit not enforced","verdict":"defect","rationale":"The limit is read before the write and never locked, so two transfers both pass the check.","resultIds":["6f708192-a3b4-45c6-8d7e-8f9012345678"]}]},"response":{"id":"90123456-789a-4bcd-8ef0-123456789abc","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","runId":"1a2b3c4d-5e6f-4718-8920-a1b2c3d4e5f6","title":"","summary":"The daily-limit check does not hold under concurrency. Everything else passed.","causes":[{"title":"Daily limit not enforced","verdict":"defect","rationale":"The limit is read before the write and never locked, so two transfers both pass the check.","resultIds":["6f708192-a3b4-45c6-8d7e-8f9012345678"]}],"counts":{"total":12,"passed":11,"failed":1,"skipped":0,"errored":0,"refused":0,"judged":0,"inconsistent":0,"unapproved":0},"notCounted":{"refused":0,"judged":0,"inconsistent":0,"unapproved":0},"authoredBy":{"kind":"agent","tool":"claude-code","onBehalfOf":"u-1042"},"createdAt":"2026-09-10T10:10:00.000Z"}}],"responses":{"201":{"description":"Publish the report for a run.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The report uuid."},"applicationId":{"type":"string","description":"The application."},"runId":{"type":"string","description":"The run it reports on."},"title":{"type":"string","description":"The report title."},"summary":{"type":"string","description":"What the run means, not what it did. Written by the session."},"causes":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string","description":"What the cause is, in one line."},"verdict":{"type":"string","description":"defect, stale_case, environment, ambiguous_case or inconsistent."},"rationale":{"type":"string","description":"Why the failures group this way."},"resultIds":{"type":"array","items":{"type":"string"},"description":"The results this cause accounts for. Every one must belong to this run."},"defectId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The defect raised from it, when there is one."}},"required":["title","verdict","rationale","resultIds"],"description":"A group of failures with one explanation. A cause is worth more than a count."},"description":"The failures, grouped and explained."},"counts":{"type":"object","additionalProperties":{"type":"number"},"description":"Computed by Assure, never taken from the session."},"notCounted":{"type":"object","additionalProperties":{"type":"number"},"description":"What was excluded from the figures and why: refused, judged, inconsistent, unapproved."},"authoredBy":{"type":"object","properties":{"kind":{"type":"string","description":"human, agent or system."},"userId":{"type":"string","description":"The Cortena user id, when a person was acting directly."},"displayName":{"type":"string","description":"The name to show. For an agent, the person it acted for."},"tool":{"type":"string","description":"The software holding the token — \"claude-code\" and the like."},"model":{"type":"string","description":"The model behind the tool, when it named one."},"externallyRouted":{"type":"boolean","description":"True when the model sits outside the customer network."},"onBehalfOf":{"type":"string","description":"The user id an agent was acting for."}},"required":["kind"],"description":"Who wrote it."},"createdAt":{"type":"string","format":"date-time","description":"When it was published."}},"required":["id","applicationId","runId","title","summary","causes","counts","notCounted","authoredBy","createdAt"],"description":"The report for a run. Immutable once published."},"examples":{"one cause":{"value":{"id":"90123456-789a-4bcd-8ef0-123456789abc","applicationId":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","runId":"1a2b3c4d-5e6f-4718-8920-a1b2c3d4e5f6","title":"","summary":"The daily-limit check does not hold under concurrency. Everything else passed.","causes":[{"title":"Daily limit not enforced","verdict":"defect","rationale":"The limit is read before the write and never locked, so two transfers both pass the check.","resultIds":["6f708192-a3b4-45c6-8d7e-8f9012345678"]}],"counts":{"total":12,"passed":11,"failed":1,"skipped":0,"errored":0,"refused":0,"judged":0,"inconsistent":0,"unapproved":0},"notCounted":{"refused":0,"judged":0,"inconsistent":0,"unapproved":0},"authoredBy":{"kind":"agent","tool":"claude-code","onBehalfOf":"u-1042"},"createdAt":"2026-09-10T10:10:00.000Z"}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"You write the prose; Assure owns the arithmetic and recomputes every figure. A report whose stated counts disagree with the record is rejected, naming the figure that was wrong — a plausible wrong number in a QA report is worse than no report, because it is the kind of thing that gets pasted into a change advisory board paper and believed. Reports are immutable once published.","tags":["reports"],"x-cortena-tool":"assure_report_write","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"runId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The run uuid. Over MCP it defaults to the run this session opened, so leave it out."},"description":"The run uuid. Over MCP it defaults to the run this session opened, so leave it out.","example":"1a2b3c4d-5e6f-4718-8920-a1b2c3d4e5f6"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","description":"The report title."},"summary":{"type":"string","minLength":1,"description":"What the run means, not what it did."},"causes":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string","description":"What the cause is, in one line."},"verdict":{"type":"string","enum":["defect","stale_case","environment","ambiguous_case","inconsistent"],"description":"What kind of thing it is."},"rationale":{"type":"string","description":"Why these failures group together."},"resultIds":{"type":"array","items":{"type":"string","format":"uuid"},"description":"The results this cause accounts for. Every one must belong to this run."},"defectId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"The defect raised from it, when there is one."}},"required":["title","verdict","rationale","resultIds"]},"default":[],"description":"The failures, grouped and explained. A cause is worth more than a count."},"statedCounts":{"type":"object","additionalProperties":{"type":"number"},"description":"Your figures. Assure checks them and names any that disagree."}},"required":["summary"]},"examples":{"one cause":{"value":{"summary":"The daily-limit check does not hold under concurrency. Everything else passed.","causes":[{"title":"Daily limit not enforced","verdict":"defect","rationale":"The limit is read before the write and never locked, so two transfers both pass the check.","resultIds":["6f708192-a3b4-45c6-8d7e-8f9012345678"]}]}}}}}}}},"/v1/orgs/{orgId}/runs/{runId}/results":{"get":{"operationId":"assure_result_list","summary":"The results of a run, newest first.","x-cortena-access":"read","x-cortena-when-to-use":"Use before writing a report, to group the failures into causes — and to find the result ids a defect will name.","x-cortena-examples":[{"name":"the failures","summary":"What went wrong in this run","request":{"orgId":"00000000-0000-0000-0000-000000000001","runId":"1a2b3c4d-5e6f-4718-8920-a1b2c3d4e5f6","status":"failed"},"response":{"items":[{"id":"6f708192-a3b4-45c6-8d7e-8f9012345678","runId":"1a2b3c4d-5e6f-4718-8920-a1b2c3d4e5f6","caseId":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","caseVersionId":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","variant":null,"attempt":1,"status":"failed","refusalReason":null,"skipReason":null,"durationMs":1840,"summary":"The transfer was created despite breaching the daily limit","narrative":"Signed in as a teller with 200 of a 1,000 daily allowance remaining and posted a transfer of 500. The call answered 201 and the transfer appears in the ledger; the daily total moved to 1,300.","failureDetail":{"observedStatus":201,"expectedStatus":422},"measurements":null,"judged":false,"countsTowardCoverage":true,"countsTowardGate":true,"executedAt":"2026-09-10T09:04:00.000Z","casePublicId":"PAY-014","segment":"api"}]}}],"responses":{"200":{"description":"The results of a run, newest first.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The result uuid — attach evidence to this."},"runId":{"type":"string","description":"The run."},"caseId":{"type":"string","description":"The case."},"caseVersionId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The version that was executed, pinned so a later edit cannot rewrite history."},"variant":{"anyOf":[{"type":"object","properties":{"viewport":{"type":"number","description":"The viewport width this execution covers."},"theme":{"type":"string","description":"The theme this execution covers."}},"description":"For a screen case, the viewport and theme one execution covers."},{"type":"null"}],"description":"The viewport and theme, for a screen case."},"attempt":{"type":"number","description":"1 for the first execution of this case in this run."},"status":{"type":"string","description":"passed, failed, skipped, refused or errored."},"refusalReason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why Assure declined to dispatch it, when it did."},"skipReason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why the session skipped it."},"durationMs":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"How long it took."},"summary":{"type":"string","description":"One line, used for grouping failures and for the report."},"narrative":{"type":"string","description":"What was actually done and observed, in full. This is what makes \"passed\" checkable."},"failureDetail":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}],"description":"Structured detail of the failure."},"measurements":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}],"description":"Numbers a measured check produced."},"judged":{"type":"boolean","description":"A judged screen check — an opinion. Reported, never gating."},"countsTowardCoverage":{"type":"boolean","description":"False for drafts."},"countsTowardGate":{"type":"boolean","description":"False for drafts, refusals and judged results. A column, not a policy."},"executedAt":{"type":"string","format":"date-time","description":"When it was executed."},"casePublicId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The case’s public id, joined in so a list is readable."},"segment":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The case’s segment."}},"required":["id","runId","caseId","caseVersionId","variant","attempt","status","refusalReason","skipReason","durationMs","summary","narrative","failureDetail","measurements","judged","countsTowardCoverage","countsTowardGate","executedAt","casePublicId","segment"],"description":"A result as the list returns it."},"description":"The results, newest first, up to five hundred."}},"required":["items"],"description":"The results, newest first, up to five hundred."},"examples":{"the failures":{"value":{"items":[{"id":"6f708192-a3b4-45c6-8d7e-8f9012345678","runId":"1a2b3c4d-5e6f-4718-8920-a1b2c3d4e5f6","caseId":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","caseVersionId":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","variant":null,"attempt":1,"status":"failed","refusalReason":null,"skipReason":null,"durationMs":1840,"summary":"The transfer was created despite breaching the daily limit","narrative":"Signed in as a teller with 200 of a 1,000 daily allowance remaining and posted a transfer of 500. The call answered 201 and the transfer appears in the ledger; the daily total moved to 1,300.","failureDetail":{"observedStatus":201,"expectedStatus":422},"measurements":null,"judged":false,"countsTowardCoverage":true,"countsTowardGate":true,"executedAt":"2026-09-10T09:04:00.000Z","casePublicId":"PAY-014","segment":"api"}]}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"A refused result is in here too, carrying `refusalReason`. It is a distinct outcome from a failure and from a skip, and it is never a pass.","tags":["results"],"x-cortena-tool":"assure_result_list","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"runId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The run uuid. Over MCP it defaults to the run this session opened, so leave it out."},"description":"The run uuid. Over MCP it defaults to the run this session opened, so leave it out.","example":"1a2b3c4d-5e6f-4718-8920-a1b2c3d4e5f6"},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["passed","failed","skipped","refused","errored"],"description":"Only results with this outcome."},"description":"Only results with this outcome.","example":"failed"}]},"post":{"operationId":"assure_result_post","summary":"Post one result.","x-cortena-access":"write","x-cortena-when-to-use":"Use immediately after executing a case, before asking for the next one.","x-cortena-examples":[{"name":"a failure","summary":"Record what actually happened","request":{"orgId":"00000000-0000-0000-0000-000000000001","runId":"1a2b3c4d-5e6f-4718-8920-a1b2c3d4e5f6","caseId":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","caseVersionId":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","status":"failed","summary":"The transfer was created despite breaching the daily limit","narrative":"Signed in as a teller with 200 of a 1,000 daily allowance remaining and posted a transfer of 500. The call answered 201 and the transfer appears in the ledger."},"response":{"id":"6f708192-a3b4-45c6-8d7e-8f9012345678","runId":"1a2b3c4d-5e6f-4718-8920-a1b2c3d4e5f6","caseId":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","caseVersionId":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","variant":null,"attempt":1,"status":"failed","refusalReason":null,"skipReason":null,"durationMs":1840,"summary":"The transfer was created despite breaching the daily limit","narrative":"Signed in as a teller with 200 of a 1,000 daily allowance remaining and posted a transfer of 500. The call answered 201 and the transfer appears in the ledger; the daily total moved to 1,300.","failureDetail":{"observedStatus":201,"expectedStatus":422},"measurements":null,"judged":false,"countsTowardCoverage":true,"countsTowardGate":true,"executedAt":"2026-09-10T09:04:00.000Z"}}],"responses":{"201":{"description":"Post one result.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The result uuid — attach evidence to this."},"runId":{"type":"string","description":"The run."},"caseId":{"type":"string","description":"The case."},"caseVersionId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The version that was executed, pinned so a later edit cannot rewrite history."},"variant":{"anyOf":[{"type":"object","properties":{"viewport":{"type":"number","description":"The viewport width this execution covers."},"theme":{"type":"string","description":"The theme this execution covers."}},"description":"For a screen case, the viewport and theme one execution covers."},{"type":"null"}],"description":"The viewport and theme, for a screen case."},"attempt":{"type":"number","description":"1 for the first execution of this case in this run."},"status":{"type":"string","description":"passed, failed, skipped, refused or errored."},"refusalReason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why Assure declined to dispatch it, when it did."},"skipReason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why the session skipped it."},"durationMs":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"How long it took."},"summary":{"type":"string","description":"One line, used for grouping failures and for the report."},"narrative":{"type":"string","description":"What was actually done and observed, in full. This is what makes \"passed\" checkable."},"failureDetail":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}],"description":"Structured detail of the failure."},"measurements":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}],"description":"Numbers a measured check produced."},"judged":{"type":"boolean","description":"A judged screen check — an opinion. Reported, never gating."},"countsTowardCoverage":{"type":"boolean","description":"False for drafts."},"countsTowardGate":{"type":"boolean","description":"False for drafts, refusals and judged results. A column, not a policy."},"executedAt":{"type":"string","format":"date-time","description":"When it was executed."}},"required":["id","runId","caseId","caseVersionId","variant","attempt","status","refusalReason","skipReason","durationMs","summary","narrative","failureDetail","measurements","judged","countsTowardCoverage","countsTowardGate","executedAt"],"description":"One execution of one case at one variant."},"examples":{"a failure":{"value":{"id":"6f708192-a3b4-45c6-8d7e-8f9012345678","runId":"1a2b3c4d-5e6f-4718-8920-a1b2c3d4e5f6","caseId":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","caseVersionId":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","variant":null,"attempt":1,"status":"failed","refusalReason":null,"skipReason":null,"durationMs":1840,"summary":"The transfer was created despite breaching the daily limit","narrative":"Signed in as a teller with 200 of a 1,000 daily allowance remaining and posted a transfer of 500. The call answered 201 and the transfer appears in the ledger; the daily total moved to 1,300.","failureDetail":{"observedStatus":201,"expectedStatus":422},"measurements":null,"judged":false,"countsTowardCoverage":true,"countsTowardGate":true,"executedAt":"2026-09-10T09:04:00.000Z"}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"The narrative is REQUIRED and a result without one is rejected. With a model executing, \"passed\" is a claim, and the narrative is what lets a reviewer or an auditor check it. Say what you actually did and observed, not what you expected to happen.","tags":["results"],"x-cortena-tool":"assure_result_post","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"},{"name":"runId","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The run uuid. Over MCP it defaults to the run this session opened, so leave it out."},"description":"The run uuid. Over MCP it defaults to the run this session opened, so leave it out.","example":"1a2b3c4d-5e6f-4718-8920-a1b2c3d4e5f6"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"caseId":{"type":"string","format":"uuid","description":"The case that was executed."},"caseVersionId":{"type":"string","format":"uuid","description":"The version that was executed, as assure_run_next gave it to you. Pinned so a later edit cannot rewrite history."},"variant":{"type":"object","properties":{"viewport":{"type":"number","description":"The viewport width this execution covers."},"theme":{"type":"string","description":"The theme this execution covers."}},"description":"For a screen case, the viewport and theme one execution covers."},"status":{"type":"string","enum":["passed","failed","skipped","errored"],"description":"What the session observed: passed, failed, skipped or errored."},"judged":{"type":"boolean","description":"Set for a judged screen check. It will never satisfy a gate."},"durationMs":{"type":"integer","description":"How long it took."},"summary":{"type":"string","description":"One line, used for grouping failures and for the report."},"narrative":{"type":"string","description":"What you did and observed, in full. Required, and at least twenty characters."},"failureDetail":{"type":"object","additionalProperties":{},"description":"Structured detail of the failure."},"measurements":{"type":"object","additionalProperties":{},"description":"Numbers a measured check produced."},"skipReason":{"type":"string","description":"Why you skipped it."}},"required":["caseId","status","narrative"]},"examples":{"a failure":{"value":{"caseId":"c3f1e0a2-7d9b-4a55-9f21-0b3c5d6e7f80","caseVersionId":"d7c2b1a0-3e4f-4a5b-8c9d-0e1f2a3b4c5d","status":"failed","summary":"The transfer was created despite breaching the daily limit","narrative":"Signed in as a teller with 200 of a 1,000 daily allowance remaining and posted a transfer of 500. The call answered 201 and the transfer appears in the ledger."}}}}}}}},"/v1/orgs/{orgId}/sessions/delegate":{"post":{"operationId":"assure_session_delegate","summary":"Exchange an interactive session token for a delegated one.","x-cortena-access":"write","x-cortena-when-to-use":"Use once at the start of a headless session that was handed a person’s interactive token. An MCP session does not need it: /mcp performs the same exchange at initialize.","x-cortena-examples":[{"name":"bootstrap","summary":"Mint a working credential for a session","request":{"orgId":"00000000-0000-0000-0000-000000000001","tool":"claude-code"},"response":{"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.…","tokenType":"Bearer","expiresInHours":12,"scopes":["case:write","run:execute"],"cannot":[],"note":"Use this for every subsequent call."}}],"responses":{"201":{"description":"Exchange an interactive session token for a delegated one.","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"The delegated bearer. Shown once."},"tokenType":{"type":"string","description":"Bearer."},"expiresInHours":{"type":"number","description":"How long it lasts."},"scopes":{"type":"array","items":{"type":"string"},"description":"What it carries."},"cannot":{"type":"array","items":{"type":"string"},"description":"Always empty since D4 was removed."},"note":{"type":"string","description":"What the token means for the record."}},"required":["token","tokenType","expiresInHours","scopes","cannot","note"],"description":"A reduced-scope token carrying an actor claim, so the record can say a tool did the work while still naming the person it acted for."},"examples":{"bootstrap":{"value":{"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.…","tokenType":"Bearer","expiresInHours":12,"scopes":["case:write","run:execute"],"cannot":[],"note":"Use this for every subsequent call."}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"The Phase 1 bootstrap (AR-1). Claude drives Chrome, the developer signs in normally, and the session JWT is presented here once. Assure verifies it and mints its own token: reduced scope, an actor claim, and a lifetime long enough to outlast a run. The session JWT is never used as the working credential — it carries no actor claim, so the record could not say a tool did the work.","tags":["access"],"x-cortena-tool-exempt-reason":"it mints a bearer token and returns it in the body. A session reaching this tool already holds a delegated token — /mcp exchanged one at initialize — so the only thing it could do is mint a second credential and put it in a model’s context window (§5).","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tool":{"type":"string","default":"claude-code","description":"The software that will hold the token."},"model":{"type":"string","description":"The model behind it, when there is one."},"externallyRouted":{"type":"boolean","description":"True if the model sits outside the customer network. Recorded, never enforced."},"scopes":{"type":"array","items":{"type":"string","enum":["catalog:read","case:read","case:write","case:edit-draft","run:execute","run:read","report:write","defect:read","defect:create","finding:read","case:approve","case:retire","security:authorize","release:sign","member:write"]},"description":"Narrow the grant. Omitted, the token carries everything."}}},"examples":{"bootstrap":{"value":{"tool":"claude-code"}}}}}}}},"/v1/orgs/{orgId}/whoami":{"get":{"operationId":"assure_whoami","summary":"Which identity this session holds, and which applications it can see.","x-cortena-access":"read","x-cortena-when-to-use":"Call this first in any Assure session. It names the boundary — the person you are acting for, the scopes you carry and the applications you can reach — rather than leaving it to be discovered by hitting it.","x-cortena-examples":[{"name":"a delegated session","summary":"Software holding a token for a person","request":{"orgId":"00000000-0000-0000-0000-000000000001"},"response":{"subject":"u-1042","displayName":"R. Mehta","delegated":true,"actor":{"kind":"agent","tool":"claude-code","externallyRouted":false,"onBehalfOf":"u-1042","displayName":"R. Mehta"},"scopes":["case:write","case:approve","run:execute"],"applications":[{"id":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","key":"PAY","name":"Payments","allowExternalDrafts":false,"segmentsEnabled":["screen","api","database","security","performance"],"defaultViewports":[375,768,1440],"defaultThemes":["light","dark"]}],"cannot":[],"note":"This token is held by software acting for you."}}],"responses":{"200":{"description":"Which identity this session holds, and which applications it can see.","content":{"application/json":{"schema":{"type":"object","properties":{"subject":{"type":"string","description":"The person this session acts for."},"displayName":{"type":"string","description":"Their name."},"delegated":{"type":"boolean","description":"True when software is holding the token."},"actor":{"type":"object","properties":{"kind":{"type":"string","description":"human, agent or system."},"userId":{"type":"string","description":"The Cortena user id, when a person was acting directly."},"displayName":{"type":"string","description":"The name to show. For an agent, the person it acted for."},"tool":{"type":"string","description":"The software holding the token — \"claude-code\" and the like."},"model":{"type":"string","description":"The model behind the tool, when it named one."},"externallyRouted":{"type":"boolean","description":"True when the model sits outside the customer network."},"onBehalfOf":{"type":"string","description":"The user id an agent was acting for."}},"required":["kind"],"description":"What will be stamped on anything this session writes."},"scopes":{"type":"array","items":{"type":"string"},"description":"What the token carries. An interactive session carries none and is unrestricted."},"applications":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The application uuid."},"key":{"type":"string","description":"The short permanent key."},"name":{"type":"string","description":"The display name."},"allowExternalDrafts":{"type":"boolean","description":"Whether an externally routed session may write here."},"segmentsEnabled":{"type":"array","items":{"type":"string"},"description":"Which segments cases may be written in."},"defaultViewports":{"type":"array","items":{"type":"number"},"description":"Screen-case viewport defaults."},"defaultThemes":{"type":"array","items":{"type":"string"},"description":"Screen-case theme defaults."}},"required":["id","key","name","allowExternalDrafts","segmentsEnabled","defaultViewports","defaultThemes"]},"description":"Every active application in the organisation. The organisation is the boundary."},"cannot":{"type":"array","items":{"type":"string"},"description":"Always empty: nothing is withheld from a session. Kept so an absent field cannot be read as a version mismatch."},"note":{"type":"string","description":"What this token means for the record, in a sentence."}},"required":["subject","displayName","delegated","actor","scopes","applications","cannot","note"],"description":"Who this session is acting for and what it can see. Call it first — it names the boundary rather than leaving it to be discovered by hitting it."},"examples":{"a delegated session":{"value":{"subject":"u-1042","displayName":"R. Mehta","delegated":true,"actor":{"kind":"agent","tool":"claude-code","externallyRouted":false,"onBehalfOf":"u-1042","displayName":"R. Mehta"},"scopes":["case:write","case:approve","run:execute"],"applications":[{"id":"2f1c0b9a-8d7e-4f60-9a1b-2c3d4e5f6071","key":"PAY","name":"Payments","allowExternalDrafts":false,"segmentsEnabled":["screen","api","database","security","performance"],"defaultViewports":[375,768,1440],"defaultThemes":["light","dark"]}],"cannot":[],"note":"This token is held by software acting for you."}}}}}},"400":{"description":"Validation failed. The message names the offending field (§15.6, P-22).","content":{"application/json":{"schema":{"type":"object","description":"The error envelope of the extension protocol §15.6. `status` is load-bearing: a 400 carrying a field name lets the caller correct itself, a 500 says stop.","properties":{"ok":{"const":false},"status":{"type":"integer","description":"The HTTP status, repeated in the body so a broker that normalises the response keeps it."},"code":{"type":"string","description":"A stable machine code, e.g. `validation_failed`."},"message":{"type":"string","description":"Human- and model-readable, in the form `field: reason`."},"details":{"type":"object","description":"Zod issues, flattened.","properties":{"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}}}},"required":["ok","status","code","message"]}}}}},"description":"`cannot` is always empty — nothing is withheld from a session since D4 was removed. It is kept in the response rather than dropped, because clients read it and an absent field would look like a version mismatch where an empty list plainly says nothing is withheld.","tags":["access"],"x-cortena-tool":"assure_whoami","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out."},"description":"The organisation id. Over HTTP it is in the path and always present; over MCP the session supplies it, so leave it out.","example":"00000000-0000-0000-0000-000000000001"}]}}},"components":{"securitySchemes":{"cortenaAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Issued by `cortena-auth`, carrying `sub`, `orgId`, `orgRole`, `email`, `displayName` and resolved directory groups.\n\nA token may additionally carry an RFC 8693 `act` claim naming the software holding it. Such a token is an agent acting on behalf of the user in `sub`, and is treated as **delegated**. Delegation withholds nothing on its own — scope is the only limit — but it is what lets the audit trail record that a tool acted, and for whom."}}}}