Compatibility: Pactmark 0.1.x. The OpenAPI document is runtime-derived — treat it as the signature source rather than copying request fields into unrelated documentation.

Mounting the handler

Routes

Operational

Readiness fails closed. A memory-backed runtime asked for a production profile returns not-ready.

Runs

Human interaction

Effects

Output

Starting a run

Tenant and principal are not in the body. They come from the injected authenticator.

Streaming events

Figure 1. SSE with sequence replay. Reconnect with afterSequence and the store replays from persisted events before tailing new ones.

Idempotency

Map your idempotency key into the validated CommandContext. Same key with the same content returns the same result; same key with different content raises KAF_HTTP_IDEMPOTENCY_CONFLICT; an elapsed horizon raises KAF_COMMAND_IDEMPOTENCY_EXPIRED.

Errors

Problem Details with a stable code. See Error reference for the full registry and retryability.

What the host configures

Authentication

An injected authenticator resolving principal, tenant, authentication strength and decision roles.

CORS and credential mode

Whatever is right for your client — the adapter does not guess.

CSRF

Required for cookie-authenticated browser clients.

Request, body and time limits

Set them. A missing body limit is a denial-of-service surface.

Admission

Per-tenant quotas and concurrency.

Disclosure level

How much a response reveals versus what goes to logs.
Treat a client disconnect as loss of transport — not cancellation, and not proof that work stopped. Inspect terminal state through the authenticated run API, and cancel explicitly when you mean it.

Streaming and clients

Building a correct client, including reconnection.

CLI

The same surfaces from a terminal.