@cotal-ai/connector-opencode 0.13.2 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -136,7 +136,7 @@ import { isConcreteChannel as isConcreteChannel3, channelInAllow as channelInAll
136
136
 
137
137
  // ../connector-core/dist/docs-bundle.generated.js
138
138
  var DOCS_BUNDLE = {
139
- "version": "0.13.2",
139
+ "version": "0.14.0",
140
140
  "generatedFrom": "docs/*.md + SPEC.md + spec/cotal.schema.json",
141
141
  "pages": [
142
142
  {
@@ -207,21 +207,21 @@ var DOCS_BUNDLE = {
207
207
  "title": "`cotal` CLI reference",
208
208
  "kind": "Reference: describes the TypeScript reference implementation (the `cotal` CLI), not the wire contract.",
209
209
  "summary": "cotal is the operator command line for the reference implementation: bring a mesh up, mint identities, launch agents, watch what they do, and tear it all down.",
210
- "body": "# `cotal` CLI reference\n\n> **Reference**: describes the TypeScript reference implementation (the `cotal` CLI), not the wire contract. \xB7 **For:** operators \xB7 **Wire contract:** [SPEC](../SPEC.md)\n\n`cotal` is the operator command line for the reference implementation: bring a mesh up, mint\nidentities, launch agents, watch what they do, and tear it all down. It is a thin client over the\nwire contract: the normative subjects and schemas live in the [SPEC](../SPEC.md); this page is\nlookup material for the commands, not a walkthrough; if you are new, start with\n[Getting started](getting-started.md).\n\n## Running it\n\n```bash\nnpm install -g cotal-ai # puts `cotal` on your PATH (needs Node 20+)\ncotal --help # every command, grouped\ncotal --version # cotal-ai version + each installed extension's (also `cotal -v`)\ncotal <command> --help # one command's flags and usage\n```\n\n`npx cotal-ai <command>` runs it without a global install; in a dev clone, `pnpm cotal <command>`\nruns it through `tsx` with no build step. Bare `cotal` prints help. Every command generates its own\n`--help`, usage, and shell completion from its declared flags.\n\nCommands come from the surfaces the binary composes: the base mesh CLI, the manager\n(`supervise`), and the delivery daemon (`deliver`), plus any operator-installed extensions.\n`cotal ext add <npm-package>` installs any registry providers a package contributes: commands,\nruntimes, and local process lifecycle descriptors. The `web` dashboard and optional manager\nruntimes ship this way.\n\n## Commands\n\n| Area | Command | Purpose |\n|---|---|---|\n| Set up & lifecycle | [`setup`](#setup) | Guided, configure-only setup (installs, seeds personas; launches nothing) |\n| Set up & lifecycle | [`update`](#update) | Reconcile first-party extensions and check or opt into a coherent CLI upgrade |\n| Set up & lifecycle | [`up`](#up) | Start a local mesh (nats-server + JetStream), or boot a whole manifest with `-f` |\n| Set up & lifecycle | [`down`](#down) | Stop the whole stack, selected registered components, or a manifest deploy |\n| Set up & lifecycle | [`backup`](#backup-and-restore) | Create an offline full-space or registry-only artifact from a preserved cut |\n| Set up & lifecycle | [`clean`](#clean) | Configurable cleanup: purge history (live), or wipe the local store / identity (stopped) |\n| Set up & lifecycle | [`meshes`](#meshes-use-status) | List the running meshes on this machine |\n| Set up & lifecycle | [`use`](#meshes-use-status) | Set the default mesh a bare `cotal spawn` joins |\n| Set up & lifecycle | [`status`](#meshes-use-status) | Read-only diagnostics for setup, processes, and the selected mesh |\n| Agents & personas | [`spawn`](#spawn) | Launch an agent from a persona (foreground, or `--detach` via the manager) |\n| Agents & personas | [`models`](#models) | List connector model catalogs and variants from the manager |\n| Agents & personas | [`ps`](#ps-stop-attach) | List managed agents and their mesh status |\n| Agents & personas | [`stop`](#ps-stop-attach) | Ask the manager to stop a managed agent |\n| Agents & personas | [`attach`](#ps-stop-attach) | Stream and drive a managed agent's terminal (pty runtime) |\n| Agents & personas | [`personas`](#personas) | List, show, edit, create, or remove local personas |\n| Agents & personas | [`supervise`](#supervise) | Run a manager daemon (the agent supervisor / control plane) |\n| Agents & personas | [`runtimes`](#runtimes) | List the agent runtimes the manager can spawn through and whether each is reachable |\n| Messaging & watching | [`endpoints`](#endpoints) | List every endpoint in the live presence roster, including infrastructure |\n| Messaging & watching | [`send`](#send) | Send one message, then exit: DM a peer, post a channel, or ask a role |\n| Messaging & watching | [`channels`](#channels) | Inspect or set the channel registry |\n| Messaging & watching | [`history`](#history) | Clear retained message history |\n| Messaging & watching | [`console`](#console) | Live protocol view for a space (TUI, or `--plain` line stream) |\n| Messaging & watching | [`web`](#web) | Browser dashboard (installed as the `@cotal-ai/web` extension) |\n| Auth & meshes | [`mint`](#mint) | Mint a creds file for a space (static auth mode) |\n| Auth & meshes | [`login`](#login-logout) | Sign in to a per-user-auth mesh's IdP (once per machine) |\n| Auth & meshes | [`logout`](#login-logout) | Revoke the IdP session and clear the cached login |\n| Auth & meshes | [`actor`](#actor) | Manage a user-auth space's actor ledger (grant / revoke / list) |\n| Auth & meshes | [`doctor`](#doctor) | Credential-health diagnosis and repair (`doctor auth`) |\n| Auth & meshes | [`join`](#join) | Join a space as your own presence (interactive) |\n| Manifest | [`topology`](#manifest-deploys) | Validate and view a mesh manifest's access graph (read-only) |\n| Extensions & misc | [`ext`](#ext) | Install / remove operator CLI extensions |\n| Extensions & misc | [`completion`](#completion) | Print or install shell completion |\n| Extensions & misc | [`feedback`](#feedback) | Send feedback to the Cotal developers |\n| Extensions & misc | [`deliver`](#server-daemons) | Run the server-side Plane-3 delivery daemon |\n| Extensions & misc | [`feedback-intake`](#server-daemons) | Run a self-hosted feedback intake server |\n\nThe manifest modes of `up`, `spawn`, and `down` (`-f <cotal.yaml>`) plus `topology` are covered\ntogether under [Manifest deploys](#manifest-deploys).\n\n## setup\n\n```bash\ncotal setup [--full] [--demo] [--yes]\n```\n\n| Flag | Default | Meaning |\n|---|---|---|\n| `--full` | off | Redo the full guided flow (implies `--demo`) |\n| `--demo` | off | Also seed the guided expert team (`david`, `sven`, `me`) |\n| `--yes`, `-y` | off | Non-interactive accept-all (for agents / CI) |\n\nGuided setup is **configure-only**: it checks prerequisites, installs the Claude Code plugin, and\nseeds persona files, and it launches nothing (no mesh, no web, no manager). First run gets the\nnarrated flow; later runs print a status card. By default it seeds one `default` persona; the\n`david`/`sven`/`me` team is opt-in via `--demo`. See [Getting started](getting-started.md) and, for\nmaintainers, [setup internals](setup-internals.md).\n\n## update\n\n```bash\ncotal update [--self]\n```\n\n| Flag | Default | Meaning |\n|---|---|---|\n| `--self` | off | If a newer release exists, install that exact validated `cotal-ai` version globally and reconcile through the newly installed binary |\n\nWithout `--self`, `update` keeps the installed first-party surfaces coherent with the running\nbinary: it force-reconciles the four built-in connectors, then reinstalls other `@cotal-ai/*`\noperator extensions at the binary's exact version. Each extension runs in an isolated child, so one\nfailure cannot poison later replays. It then checks npm; a newer binary is an informational notice\nwith `cotal update --self` as the next command, not an automatic install.\n\nWith `--self`, the npm check happens first. When a newer release exists, Cotal installs the exact\nversion it validated, resolves and verifies that package in npm's global root, then launches that\nbinary to reconcile connectors and first-party extensions to the new generation. An npx or dev-clone\ninvocation therefore installs and continues through a separate global copy; it never claims the\nalready-running process changed. If the binary is current, `--self` performs the normal local\nreconcile without reinstalling it.\n\nThird-party extensions are listed with their installed version and recorded spec but are not\nauto-updated in v1. Floating third-party updates require `@cotal-ai/*` peer-range validation and are\na future follow-up. A failed connector/extension install, npm metadata check, or requested global\ninstall is reported and makes the command exit nonzero. Independent extension attempts continue so\nthe output includes every failure; an unavailable npm registry does not undo a completed local\nreconcile, but the command still exits nonzero because it could not establish that the install is\ncurrent.\n\n## up\n\n```bash\ncotal up [--detach] [--open] [--space <s>] [--server <url>] [--channels <path>] [--runtime <name>]\ncotal up --restore <dir> [--restore-only registry] [--accept-missing-source]\ncotal up -f <cotal.yaml> [--dry-run] [--runtime <name>]\n```\n\n| Flag | Default | Meaning |\n|---|---|---|\n| `--server <url>` | auto (free local port) | Listen URL override |\n| `--host <host>` | \u2014 | Bind host override |\n| `--space <s>` | the folder's name | Space name |\n| `--store-dir <dir>` | \u2014 | JetStream store directory |\n| `--channels <path>` | `.cotal/channels.json` if present | Channel-registry seed file (JSON). An explicit path that is missing is an error |\n| `--restore <dir>` | \u2014 | Restore a completed offline backup before exposing the normal listener |\n| `--restore-only registry` | artifact selection | Restore only the registry component |\n| `--accept-missing-source` | off | Explicit disaster consent when the inode-bound preserved source is absent |\n| `--open` | off (auth) | Unauthenticated dev mesh: no JWT, no ACLs |\n| `--user-auth` | off | Per-user auth: people `cotal login`; connects are authorized against the actor ledger |\n| `--idp <url>` | \u2014 | With `--user-auth`: the IdP auth base URL to pin on first enable |\n| `--detach` | off | Run in the background (stop with `cotal down`) |\n| `--file <cotal.yaml>`, `-f` | \u2014 | Launch a whole mesh from a manifest |\n| `--dry-run` | off | With `-f`: print the plan, mutate nothing |\n| `--runtime <name>` | `pty` (or the manifest's, with `-f`) | Agent runtime for the mesh manager (`pty` built in; others are installed extensions, explicit-only). Resolved + probed before the broker starts; an uninstalled/unreachable runtime fails loud. With `-f`, overrides the manifest's runtime |\n\n`cotal up` boots a local nats-server with JetStream and, in auth mode (the default), JWT auth and\nper-agent ACLs; `--detach` records the mesh so `cotal spawn` from any directory can find it. With no\n`--server`, it auto-selects a free port if the default address is taken; an explicit `--server`\nstays fail-loud on collision. `--detach` also brings up the control plane (delivery daemon in auth\nmode, then the manager). The `-f` form is a [manifest deploy](#manifest-deploys); see\n[Run a mesh](run-a-mesh.md).\n\n`--user-auth --idp <url>` starts the space's auth service alongside the broker (the NATS\nauth callout plus the loopback token exchange); it is torn down with `cotal down`, and a\nre-run of `cotal up` heals a dead service on a running broker. `--user-auth` and `--open`\ncontradict each other and are refused loudly; a running broker cannot change auth mode\nwithout a `cotal down` first. See [identity & auth](identity-and-auth.md).\n\n## down\n\n```bash\ncotal down\ncotal down --preserve-state [--store-dir <dir>]\ncotal down manager [delivery auth web nats ...]\ncotal down -f <cotal.yaml> | --run <id> [--dry-run]\n```\n\n| Flag | Default | Meaning |\n|---|---|---|\n| `--file <cotal.yaml>`, `-f` | \u2014 | Tear down this manifest's deploy |\n| `--run <id>` | \u2014 | Tear down one `spawn -f` run by id |\n| `--dry-run` | off | Print the manifest teardown or selected components, mutate nothing |\n| `--preserve-state` | off | Bare whole stack only: fence the manager, retain principals and durable state, stop and prove the stack down, then publish `ready` |\n| `--store-dir <dir>` | `.cotal/nats` | With `--preserve-state`: the actual store path (required for a custom store) |\n\nBare `cotal down` stops the whole local stack in dependency order. Positional component names stop\nonly those self-registered local processes; for example, `cotal down manager` leaves delivery and\nthe broker running, and `cotal down web` is available when the web extension is installed. The\n`-f` / `--run` forms tear down a [manifest deploy](#manifest-deploys) without stopping the whole mesh\nand cannot be combined with component names. Stopping `nats` alone is refused while an unselected\nregistered daemon is still live; include those components or use bare `cotal down`.\n\nNormal `down` remains destructive at the logical identity/durable layer. `--preserve-state` is a\ndifferent maintenance transition: it suppresses leave/deprovision cleanup, persists the manager's\nsame-principal resume inventory, stops the entire stack without removing run/auth artifacts, and\npublishes a stable inode-bound cut only after every recorded process is proven stopped and the exact\nrecorded NATS endpoint is unreachable. A missing or stale broker pidfile never counts as stopped. The\nattempt is bound durably before the manager is fenced, the resume document and attempt-bound\n`cut-intent` are fsynced before manager commit, and the manager's commitment itself is journaled\n(`cut-committed`) before any process stops. A retry after a crash at any of those boundaries reuses\nthe exact recorded attempt and finishes the remaining stop and endpoint proofs idempotently, without\nneeding the (by then intentionally dead) manager. A partial cut never publishes `ready`. It cannot\nbe combined with component names, manifest teardown, or `--dry-run`.\n\n## clean\n\n```bash\ncotal clean <history|store|all> --force\ncotal clean restore-attempt --attempt <id> --force\ncotal clean restore-fallback --attempt <id> --force\n```\n\n| Flag | Default | Meaning |\n|---|---|---|\n| `--space <s>` / `--server <url>` / `--creds <path>` | resolved mesh | `history`: target mesh |\n| `--dms` | off | `history`: also clear DM history |\n| `--store-dir <dir>` | `.cotal/nats` | `store`/`all`: JetStream store directory |\n| `--force` | \u2014 | Required: destructive, no prompting |\n| `--attempt <id>` | \u2014 | `restore-attempt`: exact stale pre-commit attempt; `restore-fallback`: matching healthy committed restore |\n\nOne configurable cleanup verb; every target requires `--force`.\n\n- `history` purges the retained message backlog on the **running** broker (channels, plus DMs\n with `--dms`). The same operation as [`history clear`](#history), which stays as an alias.\n- `store` deletes the **stopped** mesh's JetStream store (`.cotal/nats`): streams, durable\n consumers, and messages. This is the reset for stale on-disk broker state, e.g. durables\n minted by an older, incompatible Cotal generation surviving a `down`/`up` cycle.\n- `all` is `store` plus the space identity (`.cotal/auth`), the local creds and markers tied to\n it, any crash residue a normal `down` would have swept (stale pidfiles, `run/`), and the mesh's\n registry entry; the next `cotal up` mints a fresh identity.\n\n`history` needs the mesh up; `store` and `all` refuse while any recorded mesh process is still\nalive or any same-root recorded broker endpoint remains reachable (run `cotal down` first). Personas\n(`.cotal/agents`) and logs are never touched. A custom\nstore location is not recorded anywhere, so `--store-dir` must repeat whatever the mesh was\nlaunched with. Custom cleanup targets must contain either the Cotal store-generation marker or a\nreal `jetstream/` store directory; filesystem roots, project roots, and Cotal auth/maintenance trees\nare always refused.\n\n`store` and `all` also refuse every maintenance journal state. After a healthy committed restore,\n`restore-fallback` is the only supported way to remove the recorded unchanged old-store inode; it\nnever deletes the active target, requires both the exact attempt id and `--force`, and retires the\ncompleted restore journal so a later `down --preserve-state` can start a new backup cycle.\n\n## backup and restore\n\n```bash\ncotal down --preserve-state [--store-dir <dir>]\ncotal backup create <dir> [--only full|registry] [--store-dir <dir>]\ncotal up --restore <dir> [--restore-only registry] [--accept-missing-source]\n```\n\nBackup is offline-only. It requires the stable `ready` record from `down --preserve-state`, an exact\nstore match, no live recorded process, and an unreachable exact endpoint from the recorded cut.\nThat endpoint is probed immediately before cloning, so a live broker with a missing or stale pidfile\nis still refused. It claims the cut, reflink/copies the stopped source to a\nprivate attempt clone, and opens only that clone on a random loopback bootstrap broker with an\nindependent parent/deadline watchdog. It validates the canonical stream and pull-consumer inventory,\nwrites native snapshots with consumers excluded, and stores conservative contiguous ACK-floor\ncheckpoints separately. The original store is never opened by the backup broker, and the stack is\nnot restarted implicitly. Artifact destinations must not overlap the preserved source or maintenance\nattempt tree. Restore artifacts and targets likewise cannot nest inside or contain each other, the\npreserved source, or the maintenance attempt tree.\n\n`full` is the default and indivisible: channel registry, CHAT/DM/TASK/INBOX/DLV, ACL, MEMBERS, and\nvalidated durable checkpoints. `registry` is the sole partial artifact. Presence, derived membership\nfeed, leases, native ephemeral/history consumers, credentials, keys, tokens, owner secrets, and actor\nledger files are excluded. Artifacts are exclusively created `0700`; snapshot/checkpoint files and\nthe manifest are `0600`; `manifest.json` is written last with exact sizes and SHA-256 values. The\ndirectory is trusted operator input: hashes detect corruption, not malicious rewriting.\n\nRestore validates and stages the exact allowlisted artifact bytes before moving or creating a store.\nIt requires the same space and existing trust state. The whole pre-commit window holds a journaled\nliveness claim (coordinator, watchdogs, brokers, absolute deadline): ordinary `up` and a repeated\n`up --restore` refuse while the claim is live, and a stale attempt is recovered only after the\ndeadline has elapsed and every recorded owner is proven dead \u2014 automatically by a retried\n`up --restore`, or explicitly with `cotal clean restore-attempt --attempt <id> --force`. Nothing\never rolls back a live attempt. A registry-only artifact restores as registry-only whether or not\n`--restore-only registry` is passed; omitted infrastructure is always created and the exact\npost-restore stream inventory is asserted before commit intent. Ordinary `up` from a preserved cut\nresumes only the exact recorded source store and runtime; a contradicting `--store-dir` or\n`--runtime` fails in preflight. Authenticated restores validate the complete\nspace trust bundle before staging, including nkeys, seed matches, JWTs, signers, and space binding;\nfull restores commit to the validated operator, system-account, data-account, and active-signer root\nchain in addition to the static/user authority fingerprint. The composed commitment is revalidated\nimmediately before store mutation and never includes secret seeds. Restore never creates fresh auth.\nSame-path restores atomically retain the old\nsource at the journaled fallback path; alternate targets retain it in place; a missing canonical\nsource needs explicit `--accept-missing-source`. Quarantine and target restores use current canonical\nconfigs on isolated random-loopback brokers, never expose native snapshot consumers, and publish a\ncommit-intent immediately before the normal listener starts. Archive bytes never instantiate the real\ntarget: after quarantine validation, every stream is re-snapshotted from the validated quarantine\nstate into attempt-owned sanitized files, and the target is restored solely from those. Before that boundary, failure rolls back\nthe attempt-owned target; after it, ambiguity preserves both stores and records forward-repair\nrecourse. The cooperative maintenance lock excludes Cotal commands, not arbitrary raw NATS processes.\n\nBootstrap brokers in every auth mode \u2014 including open \u2014 mount the store under a local account with\nrandom operation-specific logins only, each carrying the exact per-phase subject permission matrix;\nnormal static credentials and user-auth sentinel/bearer connections are rejected, and no auth\nservice or callout starts. Open mode differs only in its account label, never in authority. Inventory, each stream snapshot,\nrestore initiation, exact upload id, validation, and each checkpoint recreation use separate exact\nauthorities. Every checkpoint carries the source stream's message/first/last sequence state and must\nmatch its snapshot record before mutation; core then derives and validates the only allowed start\npolicy. TASK is not a CLI exception: the same core checkpoint API recreates its canonical `DeliverAll`\nWorkQueue durable because acknowledged tasks are absent from retention and NATS forbids a\nstart-sequence policy there. Registry-only restore creates every omitted canonical stream and transient\nbucket on the isolated target before the normal listener is exposed. It deliberately does not resume\nretained agents or recreate their DM/DLV/TASK/ACL state; their identity material stays retained and\nstopped rather than being reprovisioned into a partial restore.\n\nAfter listener readiness, the manager starts attempt-bound, validates retained credentials/tokens\nwithout granting or reprovisioning, and resumes the exact persisted principals under cleanup\nsuppression. Registry-only restore uses the same flow with an empty agent set. `commitResume` is an\nidempotent validation barrier only: success must be `awaitingFinalize` with an attempt-bound 64-hex\ncommit token and does not release suppression. Under the workspace lock, the CLI first fsyncs that\nexact evidence as `manager-committed` (restore) or `resume-committed` (ordinary resume), then calls\ntoken-bound `finalizeResume`; only an `active` response for the exact token releases suppression. The\nCLI records the same token in finalization evidence before a restore becomes `active`, or before an\nordinary resume retires and consumes the marker. Re-entry from either committed state skips the prior\nidempotent activation/commit phases, retries finalization with the durable token, and finishes the\nworkspace transition. Failure before finalization preserves the committed state and cleanup\nsuppression; it is not rewritten through a degraded transition. Re-entry between any two earlier\nboundaries reuses the same attempt and may retry the idempotent phases without deleting retained state. A missing or\nchanged per-agent dependency is a named fail-closed result; the journal becomes degraded and remains\navailable for forward repair. A retry from `resume-intent`,\n`resume-active`, or `resume-degraded` reuses the same attempt and inventory after the prior listener is\nproven stopped. Every normal restore listener has an unguessable attempt-bound NATS server name. The\nCLI fsyncs its exact name/nonce, canonical endpoint, process owner, and generation-bound target identity\nimmediately after spawn. Re-entry accepts a surviving listener only when its INFO server name, live PID\nrecord, endpoint, and target identity all match that proof; degraded restore repair then moves through\nthe guarded workspace transition only after manager commit. If an uncommitted bound owner is provably\ndead, recovery retires that exact proof under the maintenance lock and binds a fresh listener for the\nsame attempt, endpoint, and target with a new nonce and server name. A live foreign/mismatched listener\nor ambiguous owner is preserved and refused, never adopted by reachability alone. A reconstructed\ncommit/degraded attempt without either the exact bound proof or a durable dead-listener replacement\nrecord fails closed even when the recorded port is free. A later ordinary startup may pass an `active`\nrestore only when its details prove manager commit and its exact recorded listener is dead.\n\n## meshes, use, status\n\n```bash\ncotal meshes\ncotal use <space>\ncotal status [--space <s>] [--server <url>]\n```\n\n`meshes` lists the running meshes on this machine; a `*` marks the `current` default a bare\n`cotal spawn` joins. `use <space>` sets that default; the selection applies from every directory,\nincluding inside another mesh's project. `status` is a read-only report: machine prerequisites\n(starting with the installed `cotal-ai` version), the installed extensions and their versions, this\nfolder's `.cotal/`, the recorded meshes, and a live snapshot of the selected mesh (roster, channels,\nmembership feed). `status` takes only `--space` / `--server` to pick the mesh to inspect; it starts\nnothing.\n\n## spawn\n\n```bash\ncotal spawn [<persona>] [--detach] [--name <n>] [--agent <a>] [--model <m>] [--variant <v>] [--prompt <text>] [--cwd <dir>]\ncotal spawn -f <cotal.yaml> [--dry-run]\n```\n\n| Flag | Default | Meaning |\n|---|---|---|\n| `--space <s>` | resolved mesh | Target space |\n| `--server <url>` | registry entry | Broker URL override |\n| `--creds <path>` | \u2014 | Control-caller creds for an off-registry manager (`--detach` only) |\n| `--name <n>` | persona's `name:` | Presence-name override (does not choose the persona) |\n| `--config <persona-or-path>` | \u2014 | Persona catalog name or file path; wins over the positional |\n| `--agent <a>` | `COTAL_DEFAULT_AGENT`, else `claude` | Connector type (`claude`, `opencode`, `hermes`, \u2026) |\n| `--role <r>` | persona's `role:` | Role override |\n| `--model <m>` | persona's `model:` | Model override |\n| `--variant <v>` | persona's `variant:` | Model variant override (connector-defined; e.g. OpenCode reasoning tiers) |\n| `--cwd <dir>` | this cwd | Working directory to root the agent at |\n| `--prompt <text>` | \u2014 | Initial prompt auto-submitted at start |\n| `--resume <id>` | \u2014 | Fork an existing session id into the mesh (claude only) |\n| `--transcript` / `--no-transcript` | off | Mirror the session transcript to `tr-<name>` |\n| `--share-tools <sel>` | none | Share named operator MCP servers with the agent |\n| `--subscribe <a,b>` | persona's | Channel read-set override |\n| `--allow-subscribe <a,b>` | = subscribe | Read-ACL override |\n| `--allow-publish <a,b>` | deny | Post-ACL override |\n| `--detach`, `-d` | off | Launch via the manager into a detached PTY (reattach with `cotal attach`) |\n| `--file <cotal.yaml>`, `-f` | \u2014 | Deploy a manifest onto the running mesh |\n| `--dry-run` | off | With `-f`: print the plan, mutate nothing |\n| `--allow-stale <a,b>` | \u2014 | With `-f`: waive named stale agents (apply-only) |\n| `--runtime <name>` | manifest's | With `-f`: override the manifest's runtime |\n\nThe persona (`--config` > positional > `COTAL_DEFAULT_PERSONA` > `default`) is loaded from the\ntarget mesh's `.cotal/agents/`; the launch flags override the file. Foreground runs the agent\nattached to your terminal; `--detach` hands the launch to the running manager. Both modes get the\ndurable backstop on a mesh that runs the delivery daemon; `--live-only` skips it for a foreground\nspawn (messages posted while it is disconnected are then not replayed). A foreground exit retires\nthe agent's creds and broker footprint, like a manager despawn. See\n[Connect Claude Code](connect-claude.md) and [Agent files](agent-files.md); `-f` is a\n[manifest deploy](#manifest-deploys). (`cotal start` was merged into `cotal spawn --detach`.)\n\n## models\n\n```bash\ncotal models [--agent <connector>] [--refresh]\n```\n\n| Flag | Default | Meaning |\n|---|---|---|\n| `--space <s>` / `--server <url>` / `--creds <path>` | resolved mesh | Which manager to reach |\n| `--agent <connector>` | all registered connectors | Connector whose catalog to list |\n| `--refresh` | off | Ask the connector to refresh its provider cache |\n\nAsks the running manager for each connector's model catalog (model ids plus their variants)\nfor connectors that expose one (OpenCode today; a connector without a catalog says so). Pick a\nresult with `cotal spawn --model <provider/model> --variant <v>`.\n\n## endpoints\n\n```bash\ncotal endpoints [--space <s>] [--server <url>] [--creds <path>]\n```\n\nLists the mesh presence roster: agents, the manager, and any other protocol endpoint, with each\nendpoint's role, kind, status, and current activity. Unlike `ps`, this is a read-only presence view;\nit is not limited to child processes owned by the manager.\n\n## ps, stop, attach\n\n```bash\ncotal ps [--space <s>]\ncotal stop --name <n> [--space <s>]\ncotal attach --name <n> [--space <s>]\n```\n\n| Flag | Default | Meaning |\n|---|---|---|\n| `--space <s>` / `--server <url>` / `--creds <path>` | resolved mesh | Which manager to reach |\n| `--name <n>` | \u2014 | Managed agent to stop / attach (required) |\n\nThese are operator clients over the running manager's control plane. `ps` lists managed agents with\ntheir mesh status (`starting\u2026` / `working` / `waiting` / `offline`); on a user-auth mesh it also\nrenders each managed agent's last credential-refresh outcome, fail-closed. `attach` streams and\ndrives an agent's terminal on the `pty` runtime; detach with the escape key (Ctrl-] by default; see\n[`COTAL_DETACH_KEY`](config.md)). `stop` and `attach` need a running manager to talk to. On a\nstatic mesh they are cross-agent admin operations. On a user-auth mesh, your own agents (any agent\nunder your owner) need only the `spawn` scope; another owner's agent needs `admin` on your ledger\nrow ([identity & auth](identity-and-auth.md)). Launch detached agents with\n[`spawn --detach`](#spawn).\n\n## personas\n\n```bash\ncotal personas list [-v] [--running]\ncotal personas show <name>\ncotal personas edit <name>\ncotal personas new <name> (--prompt <t> | --from <f>) [--role <r>] [--model <m>]\ncotal personas rm <name> --force\n```\n\n| Flag | Default | Meaning |\n|---|---|---|\n| `--space <s>` / `--server <url>` / `--creds <path>` | resolved mesh | Which mesh's persona catalog |\n| `--role <r>` | \u2014 | `new`: the persona's role |\n| `--model <m>` | \u2014 | `new`: the persona's model |\n| `--prompt <t>` | \u2014 | `new`: the persona's prompt text |\n| `--from <f>` | \u2014 | `new`: seed the prompt from a file |\n| `--verbose`, `-v` | off | `list`: include role / model / description |\n| `--running` | off | `list`: mark personas live on the mesh |\n| `--force` | \u2014 | `rm`: required, delete without prompting |\n\nPersonas are the local agent files under `.cotal/agents/` that `cotal spawn` launches. See\n[Agent files](agent-files.md) for the file format.\n\n## supervise\n\n```bash\ncotal supervise [--runtime <name>] [--space <s>] [--server <url>] [--spawn <names>]\n```\n\n| Flag | Default | Meaning |\n|---|---|---|\n| `--space <s>` | this folder's auth space | Space to supervise |\n| `--server <url>` | the local mesh | Broker URL |\n| `--runtime <name>` | `pty` | Agent runtime (`pty` built in; extension runtimes are explicit-only) |\n| `--console-port <n>` | \u2014 | Protocol-console port |\n| `--roster <file>` | \u2014 | Declarative roster to boot at startup |\n| `--launch <spec>` | \u2014 | Resolved manifest launch spec (from `up -f` / `spawn -f`) |\n| `--spawn <names>` | \u2014 | Comma-separated personas to pre-spawn at startup |\n\nThe manager is the agent supervisor and control plane: it answers `spawn --detach`, `stop`, `ps`,\n`attach`, and the `cotal_*` manager tools. `cotal up --detach` starts one for you; run `supervise`\ndirectly to recover a dead manager or drive a custom runtime. Default runtime is `pty`; install an\noptional provider first (`cotal ext add @cotal-ai/orca`, `@cotal-ai/tmux`, or `@cotal-ai/cmux`) and\nselect it explicitly. A missing provider or app fails loudly; there is no fallback. See [Deploy](deploy.md).\n\n## runtimes\n\n```bash\ncotal runtimes\n```\n\nLists every agent runtime the manager can spawn through: the built-in `pty`, the official providers\n(`orca`, `tmux`, `cmux`), and any custom provider installed via `cotal ext add`. Each installed\nprovider is probed so you can see what is actually reachable on this machine before selecting it:\n\n```\npty built in\norca installed \xB7 reachable @cotal-ai/orca\ntmux available \xB7 cotal ext add @cotal-ai/tmux\ncmux available \xB7 cotal ext add @cotal-ai/cmux\n```\n\n`installed \xB7 reachable` / `unreachable` is the provider's own `available()` probe; `available` means\nit is a known runtime you can add with the shown command. Selecting an unknown or uninstalled runtime\nvia `up`/`spawn --runtime <name>` fails loud and, for a known one, points at the exact `cotal ext add`\npackage \u2014 there is no silent fallback to `pty`.\n\n## send\n\n```bash\ncotal send dm <agent> \"<text>\" [--space <s>] [--server <url>] [--creds <path>]\ncotal send msg <channel> \"<text>\"\ncotal send ask <role> \"<text>\"\n```\n\n| Flag | Default | Meaning |\n|---|---|---|\n| `--space <s>` / `--server <url>` / `--creds <path>` | resolved mesh | Which mesh, and (off-registry) which credential |\n\nOne-shot messaging: connect, send a single direct message (`dm`), channel post (`msg`), or role\nask/anycast (`ask`), then exit. For a running conversation, agents use the mesh tools instead\n([MCP tools](mcp-tools.md)).\n\n## channels\n\n```bash\ncotal channels list\ncotal channels set <name> [--replay | --no-replay] [--window <n>] [--desc <s>] [--instructions <s>]\ncotal channels default --replay | --no-replay\n```\n\n| Flag | Default | Meaning |\n|---|---|---|\n| `--space <s>` / `--server <url>` / `--creds <path>` | resolved mesh | Target mesh |\n| `--replay` / `--no-replay` | \u2014 | `set`/`default`: replay history to new joiners, or not |\n| `--window <n>` | \u2014 | `set`: replay window size |\n| `--desc <s>` | \u2014 | `set`: one-line channel description |\n| `--instructions <s>` | \u2014 | `set`: instructions shown to joiners |\n\nInspects and edits the channel registry: replay policy, description, and joiner instructions. ACL\nsemantics (who may read or post) are set at mint / provision time, not here; see\n[Channels and permissions](channels-and-permissions.md). On a user-auth mesh, `list` rides your\nown login as is; `set` and `default` edit the registry over a short-lived\nchannel-writer view, which needs ledger scope `admin` ([Identity & auth](identity-and-auth.md)).\n\n\n## history\n\n```bash\ncotal history clear --force [--dms] [--space <s>]\n```\n\n| Flag | Default | Meaning |\n|---|---|---|\n| `--space <s>` / `--server <url>` / `--creds <path>` | resolved mesh | Target mesh |\n| `--dms` | off | Also clear DM history |\n| `--force` | \u2014 | Required: clear without prompting |\n\nPurges retained channel history; `--dms` extends it to direct-message history. An alias of\n[`clean history`](#clean). On a user-auth mesh the purge rides a short-lived purger view over\nyour login, which needs ledger scope `admin` ([Identity & auth](identity-and-auth.md)).\n\n## console\n\n```bash\ncotal console [--plain] [--space <s>]\n```\n\n| Flag | Default | Meaning |\n|---|---|---|\n| `--space <s>` / `--server <url>` / `--creds <path>` | resolved mesh | Space to watch |\n| `--plain` | off | Line stream instead of the TUI |\n\nA live protocol view for a space: a lazygit-style TUI, or a plain line stream on `--plain`. On a\nuser-auth mesh it rides the read-only admin view over your login, which needs ledger scope\n`admin`. See [Watch a mesh](watch-a-mesh.md).\n\n## web\n\n```bash\ncotal web [--detach] [--port <n>] [--no-open] [--space <s>]\n```\n\n| Flag | Default | Meaning |\n|---|---|---|\n| `--space <s>` / `--server <url>` / `--creds <path>` | resolved mesh | Space to serve |\n| `--port <n>` | `7799` | HTTP port |\n| `--detach` | off | Run in the background; stop with `cotal down web` or bare `cotal down` |\n| `--no-open` | off | Don't open the browser |\n\nThe browser observability dashboard: presence, channels, and a live feed. It is **not** part of\n`cotal up`: it ships inside `cotal-ai` as the `@cotal-ai/web` extension, seeded automatically on first\nrun (like the built-in connectors) so it always matches your CLI version. It self-registers `cotal web`\ninto this surface and serves\n`http://cotal.localhost:7799` (loopback; `*.localhost` resolves in Chrome/Firefox/Edge; Safari may\nneed `http://127.0.0.1:7799`). On a user-auth mesh the dashboard rides the read-only admin view\nover your login, and a channel purge asks for its own channel-purger view per click; both need\nledger scope `admin`. Detached mode re-execs the current Cotal installation, writes diagnostics to\nthe mesh root's `.cotal/web.log`, and reports success only after the HTTP server answers. It requires\na recorded mesh root, but can be launched from any directory once `cotal up` has recorded the mesh.\nSee [Watch a mesh](watch-a-mesh.md).\n\n## mint\n\n```bash\ncotal mint <name> [--profile <agent|observer|admin>] [--out <path>] [--signer]\n```\n\n| Flag | Default | Meaning |\n|---|---|---|\n| `--profile <agent\\|observer\\|admin>` | `agent` | Credential profile |\n| `--out <path>` | `.cotal/auth/creds/<name>.creds` | Output path |\n| `--signer` | off | Emit a stripped account-signing file instead |\n| `--force` | off | With `--signer`: overwrite an existing file |\n| `--allow-subscribe <a,b>` | profile default | Read-ACL override |\n| `--allow-publish <a,b>` | profile default | Post-ACL override |\n\nMints a NATS creds file for a space in **static** auth mode, scoped to a profile and (optionally)\nexplicit read/post ACLs. `--signer` emits an account-signing file for delegating minting to another\nhost. A per-user-auth space refuses `mint`: agents there join under a logged-in user\n([`login`](#login-logout) + [`actor grant`](#actor)), never via a handed-out creds file. See\n[Identity and auth](identity-and-auth.md).\n\n## login, logout\n\n```bash\ncotal login --idp <auth base URL> [--client-id <id>]\ncotal logout --idp <auth base URL>\n```\n\nSigns you in to a per-user-auth mesh's IdP (device code flow) and caches the session; run it\nonce per machine. It prints your IdP subject, the id the operator grants against. After a\nlogin, every command on that mesh works under your identity: each connect takes a fresh IdP\nproof, exchanges it locally for a short-lived bearer, and is authorized against the actor\nledger at connect time. `logout` revokes the IdP session and clears the cache. See\n[identity & auth](identity-and-auth.md).\n\n## actor\n\n```bash\ncotal actor grant <actor> --sub <IdP subject> [--scope a,b] [--allow-subscribe a,b] [--allow-publish a,b] [--role <r>] [--label <l>]\ncotal actor revoke <actor> (--sub <IdP subject> | --owner <u_\u2026>)\ncotal actor list\n```\n\n| Flag | Default | Meaning |\n|---|---|---|\n| `--space <s>` | the folder's | Space whose ledger to manage |\n| `--sub <subject>` | \u2014 | The IdP subject (shown by `cotal login`) the actor belongs to |\n| `--owner <u_\u2026>` | \u2014 | The derived owner token (alternative to `--sub`) |\n| `--scope <a,b>` | `spawn,role:default` | Capability scope (`''` = none; `spawn` = may run agents, `role:<r>` = may delegate role r, `admin` = cross-agent control) |\n| `--allow-subscribe <a,b>` | `>` (all channels) | Channel read ACL; the user's envelope, their agents can never read beyond it |\n| `--allow-publish <a,b>` | `>` (all channels) | Channel post ACL; also the envelope for their agents' posting |\n| `--role <r>` | \u2014 | Role (scopes the task-queue consumer) |\n| `--label <l>` | \u2014 | Display label for `actor list` (never the IdP subject) |\n\nThe actor ledger is the single authorization source of a user-auth space: no row, no access.\nA bare `grant` is the **full** envelope (all channels, may spawn); the flags narrow it. A\nre-grant **replaces** the row, so to add a capability, re-grant with it added to the current\nscope (`cotal actor list` shows what a row holds). `revoke` denies the next exchange and the\nnext connect with no restart, and evicts the principal's live connections. Managed-agent rows\n(written by the spawn path) live in a disjoint row space this command never touches. See\n[identity & auth](identity-and-auth.md).\n\n## doctor\n\n```bash\ncotal doctor auth [--fix]\n```\n\nCredential-health diagnosis and repair for this folder's mesh: renders every managed\ncredential as healthy / near-expiry / expired and ends in `healthy` or the exact next\ncommand; `--fix` applies the repairs it can. The one surface every stale-credential error\npoints at.\n\n## join\n\n```bash\ncotal join --space <s> --name <n> [--role <r>] [--channel <c>]\ncotal join --link <url> | --token <t>\n```\n\n| Flag | Default | Meaning |\n|---|---|---|\n| `--space <s>` / `--server <url>` / `--creds <path>` | resolved mesh | Which mesh, and which credential |\n| `--name <n>` | \u2014 | Your presence name |\n| `--role <r>` | \u2014 | Your role |\n| `--channel <c>` | \u2014 | Channel to join |\n| `--kind <k>` | `agent` | Endpoint kind |\n| `--link <url>` | \u2014 | Join link (`cotal://\u2026`) |\n| `--token <t>` | \u2014 | Join token |\n| `--lifecycle-uid <uid>` | \u2014 | Required with `--creds`: the lifecycle UID minted alongside the credential (`COTAL_LIFECYCLE_UID` works too). A credential's durable grants name exact lifecycle-keyed resources, so `join` refuses to invent one |\n| `--tls` | off | Connect over TLS |\n\nAn interactive presence: join a space under your own name and role, without launching an agent\nharness. A `--link` or `--token` supplies the where and the auth in one value. See\n[Spaces](spaces.md) and [Identity and auth](identity-and-auth.md).\n\n## Manifest deploys\n\nA `cotal.yaml` manifest declares a whole mesh (channels, personas, roles, and ACLs) in one file.\nThree commands consume it, plus a read-only validator:\n\n```bash\ncotal up -f cotal.yaml # boot a fresh mesh from the manifest\ncotal spawn -f cotal.yaml # deploy the manifest additively onto a running mesh\ncotal down -f cotal.yaml # tear that deploy down (or --run <id> for one run)\ncotal topology view -f cotal.yaml # validate + view the access graph, change nothing\n```\n\n`up -f` and `spawn -f` differ in target: `up -f` brings up a new broker and applies the manifest;\n`spawn -f` requires an already-reachable mesh and applies additively (ownership-scoped). On a\nuser-auth mesh, `spawn -f` deploys over your own login (the deployer view, gated on ledger scope\n`spawn`): the manifest's agents land under your owner, a manifest claiming another owner is\nrefused, and seeding new channels additionally needs scope `admin`. Both take\n`--dry-run` to print the plan without mutating anything. `topology` validates the manifest and\nrenders its channel / role / ACL graph. See [Define a team](define-a-team.md) and the\n[manifest reference](manifest.md).\n\n## ext\n\n```bash\ncotal ext # same as `list`\ncotal ext add <npm-package>\ncotal ext remove <name>\ncotal ext list\ncotal ext root # print just the install prefix (scriptable)\ncotal ext seed [--repair|--reset|--force]\n```\n\nOperator-installed extensions: `add` installs an npm package into a cotal-owned prefix and records\nevery registry provider it contributes. Commands appear in help, completion, and dispatch; runtime\nproviders are lazy-loaded by commands such as `supervise`; local process providers participate in\n`status` and selective `down`. `remove` and `list` manage them. The `@cotal-ai/web` dashboard is the\ncanonical command/process example. Installed packages and their location are described in\n[config](config.md).\n\nBare `cotal ext` lists the inventory, headed by the install prefix. That prefix is a cotal-owned npm\nroot kept **separate** from npm's own global tree, so these packages never show up in `npm list -g` \u2014\n`cotal ext` (or the Extensions section of `cotal status`) is the canonical inventory. `cotal ext root`\nprints only the path, for scripts. The versions shown are the manifest pin recorded at add time.\n\nRemoving an extension that owns a running local process is refused with the mesh root and its\n`cotal down <component>` command; stop it first so uninstalling the package never strands a process\nwhose lifecycle provider is gone.\n\n### Built-in connectors are seeded extensions\n\nThe four first-party agent connectors (`claude`, `opencode`, `hermes`, `pi`) are not compiled into\nthe binary. They are seeded on first run through the **same** `ext add` path a third party uses, and\nappear in `cotal ext list` like any other extension. So you can remove one you do not want\n(`cotal ext remove @cotal-ai/connector-hermes`), and a deliberately-removed connector STAYS removed\nacross upgrades. `cotal ext add <your-package>` adds a third-party connector the same way. The web\ndashboard (`@cotal-ai/web`, providing `command:web`) is a fifth built-in seeded on the same path.\n\n`cotal ext seed` is the maintenance entry for that seeding (it runs automatically on the first real\ncommand of each boot, so you rarely call it):\n\n| Flag | Meaning |\n|---|---|\n| (none) | Reconcile: seed any never-seeded built-in, refresh a seeded one whose version the binary bumped, leave a removed one removed. A no-op once current. |\n| `--repair` | Recover after an interrupted seed or a lost authority (rebuilds the interrupted connector; restores the removed-vs-never-seeded record from its durable backup). |\n| `--reset` | Discard the record and re-seed all five built-ins (the four connectors plus the web dashboard). **Resurrects any you removed.** Rebuilds cleanly over corrupt seed state. |\n| `--force` | Re-seed the built-ins even when the version stamp is current or a downgrade. |\n\nThe default connector for a bare `cotal spawn` (no `--agent`) is `claude`; set `COTAL_DEFAULT_AGENT`\n(e.g. `opencode`) to change it. An `--agent` naming a removed connector fails loud with the exact\n`cotal ext add` to restore it. Set `COTAL_SKIP_CONNECTOR_SEED=1` to turn off the automatic first-run\nseed/refresh entirely (for a controlled or offline setup that manages connectors by hand); `cotal ext\nseed` still runs on request.\n\n## completion\n\n```bash\ncotal completion <bash|zsh|fish|powershell> # print a stub to eval / source\ncotal completion install [shell] # install it persistently\n```\n\nPrints or installs shell completion. Completion candidates come from each command's declared flags\nand, where useful, live mesh state (spaces, personas, managed agents) resolved offline.\n\n## feedback\n\n```bash\ncotal feedback \"<summary>\" [--type <t>] [--email <e>] [--details <text>]\n```\n\n| Flag | Default | Meaning |\n|---|---|---|\n| `--type <t>` | \u2014 | `bug` \\| `idea` \\| `friction` \\| `praise` \\| `other` |\n| `--details <text>` | \u2014 | Longer free-form details |\n| `--severity <s>` | \u2014 | `low` \\| `medium` \\| `high` |\n| `--area <a>` | \u2014 | The part of Cotal this concerns |\n| `--email <e>` | git email | Contact email (required on the keyless public path) |\n| `--name <n>` | \u2014 | Your name (optional) |\n| `--url <url>` | keyed / public intake | Intake URL override |\n| `--key <k>` | `COTAL_FEEDBACK_KEY` | Feedback key |\n\nSends feedback to the Cotal developers. With a key (`--key` / `COTAL_FEEDBACK_KEY`) it routes to the\nkeyed beta intake; without one it goes to the public `cotal.ai` intake and requires a contact email\n(`--email` / `COTAL_FEEDBACK_EMAIL`, else your git email). Run a self-hosted intake with\n[`feedback-intake`](#server-daemons).\n\n## Server daemons\n\nTwo long-lived infra roles ship with the CLI. They are not part of everyday operation; the delivery\ndaemon comes up automatically with `cotal up --detach` in auth mode.\n\n```bash\ncotal deliver --space <s> [--server <url>] [--creds <file>]\ncotal auth-service --space <s> --server <url> [--port <n>]\ncotal feedback-intake --keys <keys.json> [--port <n>] [--creds <file>]\n```\n\n`auth-service` runs a user-auth space's identity plane (the NATS auth callout plus the\nloopback token exchange and JWKS); `cotal up --user-auth` starts and supervises it for you,\nso you run it directly only to recover one by hand.\n\n`deliver` runs the server-side Plane-3 delivery daemon: the durable backstop and membership/ACL\nauthority. It is auth-mode-only and single-instance (`--shard`/`--shards` accept only `N=1`);\n`--dev-mint` mints a scoped cred from the local signer for standalone dev. See the\n[delivery daemon](delivery-daemon.md). `feedback-intake` runs a self-hosted feedback server\n(requires `--keys` and a scoped `--creds`), announcing submissions into a space channel; flags\ninclude `--host`/`--port`, `--store`, `--space`/`--channel`, `--max-bytes`, and `--rate-limit`.\n\n## Plumbing\n\n`cotal __complete <words\u2026>` is the internal entry the shell-completion stubs call to emit candidates\nfor the current command line; you never run it directly. `cotal agent-bearer` is machine-facing\nplumbing on user-auth meshes: spawned agents exec it to print a fresh short-lived bearer from their\nspawn-time secret; you never run it directly either. (`cotal start` is a removed tombstone: it\nerrors and points you to `cotal spawn --detach`.)\n"
210
+ "body": "# `cotal` CLI reference\n\n> **Reference**: describes the TypeScript reference implementation (the `cotal` CLI), not the wire contract. \xB7 **For:** operators \xB7 **Wire contract:** [SPEC](../SPEC.md)\n\n`cotal` is the operator command line for the reference implementation: bring a mesh up, mint\nidentities, launch agents, watch what they do, and tear it all down. It is a thin client over the\nwire contract: the normative subjects and schemas live in the [SPEC](../SPEC.md); this page is\nlookup material for the commands, not a walkthrough; if you are new, start with\n[Getting started](getting-started.md).\n\n## Running it\n\n```bash\nnpm install -g cotal-ai # puts `cotal` on your PATH (needs Node 20+)\ncotal --help # every command, grouped\ncotal --version # cotal-ai version + each installed extension's (also `cotal -v`)\ncotal <command> --help # one command's flags and usage\n```\n\n`npx cotal-ai <command>` runs it without a global install; in a dev clone, `pnpm cotal <command>`\nruns it through `tsx` with no build step. Bare `cotal` prints help. Every command generates its own\n`--help`, usage, and shell completion from its declared flags.\n\nCommands come from the surfaces the binary composes: the base mesh CLI, the manager\n(`supervise`), and the delivery daemon (`deliver`), plus any operator-installed extensions.\n`cotal ext add <npm-package>` installs any registry providers a package contributes: commands,\nruntimes, and local process lifecycle descriptors. The `web` dashboard and optional manager\nruntimes ship this way.\n\n## Commands\n\n| Area | Command | Purpose |\n|---|---|---|\n| Set up & lifecycle | [`setup`](#setup) | Guided, configure-only setup (installs, seeds personas; launches nothing) |\n| Set up & lifecycle | [`update`](#update) | Reconcile first-party extensions and check or opt into a coherent CLI upgrade |\n| Set up & lifecycle | [`up`](#up) | Start a local mesh (nats-server + JetStream), or boot a whole manifest with `-f` |\n| Set up & lifecycle | [`down`](#down) | Stop the whole stack, selected registered components, or a manifest deploy |\n| Set up & lifecycle | [`backup`](#backup-and-restore) | Create an offline full-space or registry-only artifact from a preserved cut |\n| Set up & lifecycle | [`clean`](#clean) | Configurable cleanup: purge history (live), or wipe the local store / identity (stopped) |\n| Set up & lifecycle | [`meshes`](#meshes-use-status) | List the running meshes on this machine |\n| Set up & lifecycle | [`use`](#meshes-use-status) | Set the default mesh a bare `cotal spawn` joins |\n| Set up & lifecycle | [`status`](#meshes-use-status) | Read-only diagnostics for setup, processes, and the selected mesh |\n| Agents & personas | [`spawn`](#spawn) | Launch an agent from a persona (foreground, or `--detach` via the manager) |\n| Agents & personas | [`models`](#models) | List connector model catalogs and variants from the manager |\n| Agents & personas | [`ps`](#ps-stop-attach) | List managed agents and their mesh status |\n| Agents & personas | [`stop`](#ps-stop-attach) | Ask the manager to stop a managed agent |\n| Agents & personas | [`attach`](#ps-stop-attach) | Stream and drive a managed agent's terminal (pty runtime) |\n| Agents & personas | [`personas`](#personas) | List, show, edit, create, or remove local personas |\n| Agents & personas | [`supervise`](#supervise) | Run a manager daemon (the agent supervisor / control plane) |\n| Agents & personas | [`runtimes`](#runtimes) | List the agent runtimes the manager can spawn through and whether each is reachable |\n| Messaging & watching | [`endpoints`](#endpoints) | List every endpoint in the live presence roster, including infrastructure |\n| Messaging & watching | [`send`](#send) | Send one message, then exit: DM a peer, post a channel, or ask a role |\n| Messaging & watching | [`channels`](#channels) | Inspect or set the channel registry |\n| Messaging & watching | [`history`](#history) | Clear retained message history |\n| Messaging & watching | [`console`](#console) | Live protocol view for a space (TUI, or `--plain` line stream) |\n| Messaging & watching | [`web`](#web) | Browser dashboard (installed as the `@cotal-ai/web` extension) |\n| Auth & meshes | [`mint`](#mint) | Mint a creds file for a space (static auth mode) |\n| Auth & meshes | [`login`](#login-logout) | Sign in to a per-user-auth mesh's IdP (once per machine) |\n| Auth & meshes | [`logout`](#login-logout) | Revoke the IdP session and clear the cached login |\n| Auth & meshes | [`actor`](#actor) | Manage a user-auth space's actor ledger (grant / revoke / list) |\n| Auth & meshes | [`doctor`](#doctor) | Credential-health diagnosis and repair (`doctor auth`) |\n| Auth & meshes | [`join`](#join) | Join a space as your own presence (interactive) |\n| Manifest | [`topology`](#manifest-deploys) | Validate and view a mesh manifest's access graph (read-only) |\n| Extensions & misc | [`ext`](#ext) | Install / remove operator CLI extensions |\n| Extensions & misc | [`completion`](#completion) | Print or install shell completion |\n| Extensions & misc | [`feedback`](#feedback) | Send feedback to the Cotal developers |\n| Extensions & misc | [`deliver`](#server-daemons) | Run the server-side Plane-3 delivery daemon |\n| Extensions & misc | [`feedback-intake`](#server-daemons) | Run a self-hosted feedback intake server |\n\nThe manifest modes of `up`, `spawn`, and `down` (`-f <cotal.yaml>`) plus `topology` are covered\ntogether under [Manifest deploys](#manifest-deploys).\n\n## setup\n\n```bash\ncotal setup [--full] [--demo] [--yes]\n```\n\n| Flag | Default | Meaning |\n|---|---|---|\n| `--full` | off | Redo the full guided flow (implies `--demo`) |\n| `--demo` | off | Also seed the guided expert team (`david`, `sven`, `me`) |\n| `--yes`, `-y` | off | Non-interactive accept-all (for agents / CI) |\n\nGuided setup is **configure-only**: it checks prerequisites, installs the Claude Code plugin, and\nseeds persona files, and it launches nothing (no mesh, no web, no manager). First run gets the\nnarrated flow; later runs print a status card. By default it seeds one `default` persona; the\n`david`/`sven`/`me` team is opt-in via `--demo`. See [Getting started](getting-started.md) and, for\nmaintainers, [setup internals](setup-internals.md).\n\n## update\n\n```bash\ncotal update [--self]\n```\n\n| Flag | Default | Meaning |\n|---|---|---|\n| `--self` | off | If a newer release exists, install that exact validated `cotal-ai` version globally and reconcile through the newly installed binary |\n\nWithout `--self`, `update` keeps the installed first-party surfaces coherent with the running\nbinary: it force-reconciles the four built-in connectors, then reinstalls other `@cotal-ai/*`\noperator extensions at the binary's exact version. Each extension runs in an isolated child, so one\nfailure cannot poison later replays. It then checks npm; a newer binary is an informational notice\nwith `cotal update --self` as the next command, not an automatic install.\n\nWith `--self`, the npm check happens first. When a newer release exists, Cotal installs the exact\nversion it validated, resolves and verifies that package in npm's global root, then launches that\nbinary to reconcile connectors and first-party extensions to the new generation. An npx or dev-clone\ninvocation therefore installs and continues through a separate global copy; it never claims the\nalready-running process changed. If the binary is current, `--self` performs the normal local\nreconcile without reinstalling it.\n\nThird-party extensions are listed with their installed version and recorded spec but are not\nauto-updated in v1. Floating third-party updates require `@cotal-ai/*` peer-range validation and are\na future follow-up. A failed connector/extension install, npm metadata check, or requested global\ninstall is reported and makes the command exit nonzero. Independent extension attempts continue so\nthe output includes every failure; an unavailable npm registry does not undo a completed local\nreconcile, but the command still exits nonzero because it could not establish that the install is\ncurrent.\n\n## up\n\n```bash\ncotal up [--detach] [--open] [--space <s>] [--server <url>] [--channels <path>] [--runtime <name>]\ncotal up --restore <dir> [--restore-only registry] [--accept-missing-source]\ncotal up -f <cotal.yaml> [--dry-run] [--runtime <name>]\n```\n\n| Flag | Default | Meaning |\n|---|---|---|\n| `--server <url>` | auto (free local port) | Listen URL override |\n| `--host <host>` | \u2014 | Bind host override |\n| `--space <s>` | the folder's name | Space name |\n| `--store-dir <dir>` | \u2014 | JetStream store directory |\n| `--channels <path>` | `.cotal/channels.json` if present | Channel-registry seed file (JSON). An explicit path that is missing is an error |\n| `--restore <dir>` | \u2014 | Restore a completed offline backup before exposing the normal listener |\n| `--restore-only registry` | artifact selection | Restore only the registry component |\n| `--accept-missing-source` | off | Explicit disaster consent when the inode-bound preserved source is absent |\n| `--open` | off (auth) | Unauthenticated dev mesh: no JWT, no ACLs |\n| `--user-auth` | off | Per-user auth: people `cotal login`; connects are authorized against the actor ledger |\n| `--idp <url>` | \u2014 | With `--user-auth`: the IdP auth base URL to pin on first enable |\n| `--detach` | off | Run in the background (stop with `cotal down`) |\n| `--file <cotal.yaml>`, `-f` | \u2014 | Launch a whole mesh from a manifest |\n| `--dry-run` | off | With `-f`: print the plan, mutate nothing |\n| `--runtime <name>` | `pty` (or the manifest's, with `-f`) | Agent runtime for the mesh manager (`pty` built in; others are installed extensions, explicit-only). Resolved + probed before the broker starts; an uninstalled/unreachable runtime fails loud. With `-f`, overrides the manifest's runtime |\n\n`cotal up` boots a local nats-server with JetStream and, in auth mode (the default), JWT auth and\nper-agent ACLs; `--detach` records the mesh so `cotal spawn` from any directory can find it. With no\n`--server`, it auto-selects a free port if the default address is taken; an explicit `--server`\nstays fail-loud on collision. `--detach` also brings up the control plane (delivery daemon in auth\nmode, then the manager). The `-f` form is a [manifest deploy](#manifest-deploys); see\n[Run a mesh](run-a-mesh.md).\n\n`--user-auth --idp <url>` starts the space's auth service alongside the broker (the NATS\nauth callout plus the loopback token exchange); it is torn down with `cotal down`, and a\nre-run of `cotal up` heals a dead service on a running broker. `--user-auth` and `--open`\ncontradict each other and are refused loudly; a running broker cannot change auth mode\nwithout a `cotal down` first. See [identity & auth](identity-and-auth.md).\n\n## down\n\n```bash\ncotal down\ncotal down --preserve-state [--store-dir <dir>]\ncotal down manager [delivery auth web nats ...]\ncotal down -f <cotal.yaml> | --run <id> [--dry-run]\n```\n\n| Flag | Default | Meaning |\n|---|---|---|\n| `--file <cotal.yaml>`, `-f` | \u2014 | Tear down this manifest's deploy |\n| `--run <id>` | \u2014 | Tear down one `spawn -f` run by id |\n| `--dry-run` | off | Print the manifest teardown or selected components, mutate nothing |\n| `--preserve-state` | off | Bare whole stack only: fence the manager, retain principals and durable state, stop and prove the stack down, then publish `ready` |\n| `--store-dir <dir>` | `.cotal/nats` | With `--preserve-state`: the actual store path (required for a custom store) |\n\nBare `cotal down` stops the whole local stack in dependency order. Positional component names stop\nonly those self-registered local processes; for example, `cotal down manager` leaves delivery and\nthe broker running, and `cotal down web` is available when the web extension is installed. The\n`-f` / `--run` forms tear down a [manifest deploy](#manifest-deploys) without stopping the whole mesh\nand cannot be combined with component names. Stopping `nats` alone is refused while an unselected\nregistered daemon is still live; include those components or use bare `cotal down`.\n\nNormal `down` remains destructive at the logical identity/durable layer. `--preserve-state` is a\ndifferent maintenance transition: it suppresses leave/deprovision cleanup, persists the manager's\nsame-principal resume inventory, stops the entire stack without removing run/auth artifacts, and\npublishes a stable inode-bound cut only after every recorded process is proven stopped and the exact\nrecorded NATS endpoint is unreachable. A missing or stale broker pidfile never counts as stopped. The\nattempt is bound durably before the manager is fenced, the resume document and attempt-bound\n`cut-intent` are fsynced before manager commit, and the manager's commitment itself is journaled\n(`cut-committed`) before any process stops. A retry after a crash at any of those boundaries reuses\nthe exact recorded attempt and finishes the remaining stop and endpoint proofs idempotently, without\nneeding the (by then intentionally dead) manager. A partial cut never publishes `ready`. It cannot\nbe combined with component names, manifest teardown, or `--dry-run`.\n\n## clean\n\n```bash\ncotal clean <history|store|all> --force\ncotal clean restore-attempt --attempt <id> --force\ncotal clean restore-fallback --attempt <id> --force\n```\n\n| Flag | Default | Meaning |\n|---|---|---|\n| `--space <s>` / `--server <url>` / `--creds <path>` | resolved mesh | `history`: target mesh |\n| `--dms` | off | `history`: also clear DM history |\n| `--store-dir <dir>` | `.cotal/nats` | `store`/`all`: JetStream store directory |\n| `--force` | \u2014 | Required: destructive, no prompting |\n| `--attempt <id>` | \u2014 | `restore-attempt`: exact stale pre-commit attempt; `restore-fallback`: matching healthy committed restore |\n\nOne configurable cleanup verb; every target requires `--force`.\n\n- `history` purges the retained message backlog on the **running** broker (channels, plus DMs\n with `--dms`). The same operation as [`history clear`](#history), which stays as an alias.\n- `store` deletes the **stopped** mesh's JetStream store (`.cotal/nats`): streams, durable\n consumers, and messages. This is the reset for stale on-disk broker state, e.g. durables\n minted by an older, incompatible Cotal generation surviving a `down`/`up` cycle.\n- `all` is `store` plus the space identity (`.cotal/auth`), the local creds and markers tied to\n it, any crash residue a normal `down` would have swept (stale pidfiles, `run/`), and the mesh's\n registry entry; the next `cotal up` mints a fresh identity.\n\n`history` needs the mesh up; `store` and `all` refuse while any recorded mesh process is still\nalive or any same-root recorded broker endpoint remains reachable (run `cotal down` first). They\nalso refuse outright on a root that holds accounts for several spaces: the store and the broker\ntrust record are shared by every space on the broker, so both targets would take out all of them\nand no `--space` can narrow that. `down`, `backup` and `up --restore` refuse there for the same\nreason. `cotal status` lists the tenants on such a root. Personas\n(`.cotal/agents`) and logs are never touched. A custom\nstore location is not recorded anywhere, so `--store-dir` must repeat whatever the mesh was\nlaunched with. Custom cleanup targets must contain either the Cotal store-generation marker or a\nreal `jetstream/` store directory; filesystem roots, project roots, and Cotal auth/maintenance trees\nare always refused.\n\n`store` and `all` also refuse every maintenance journal state. After a healthy committed restore,\n`restore-fallback` is the only supported way to remove the recorded unchanged old-store inode; it\nnever deletes the active target, requires both the exact attempt id and `--force`, and retires the\ncompleted restore journal so a later `down --preserve-state` can start a new backup cycle.\n\n## backup and restore\n\n```bash\ncotal down --preserve-state [--store-dir <dir>]\ncotal backup create <dir> [--only full|registry] [--store-dir <dir>]\ncotal up --restore <dir> [--restore-only registry] [--accept-missing-source]\n```\n\nBackup is offline-only. It requires the stable `ready` record from `down --preserve-state`, an exact\nstore match, no live recorded process, and an unreachable exact endpoint from the recorded cut.\nThat endpoint is probed immediately before cloning, so a live broker with a missing or stale pidfile\nis still refused. It claims the cut, reflink/copies the stopped source to a\nprivate attempt clone, and opens only that clone on a random loopback bootstrap broker with an\nindependent parent/deadline watchdog. It validates the canonical stream and pull-consumer inventory,\nwrites native snapshots with consumers excluded, and stores conservative contiguous ACK-floor\ncheckpoints separately. The original store is never opened by the backup broker, and the stack is\nnot restarted implicitly. Artifact destinations must not overlap the preserved source or maintenance\nattempt tree. Restore artifacts and targets likewise cannot nest inside or contain each other, the\npreserved source, or the maintenance attempt tree.\n\n`full` is the default and indivisible: channel registry, CHAT/DM/TASK/INBOX/DLV, ACL, MEMBERS, and\nvalidated durable checkpoints. `registry` is the sole partial artifact. Presence, derived membership\nfeed, leases, native ephemeral/history consumers, credentials, keys, tokens, owner secrets, and actor\nledger files are excluded. Artifacts are exclusively created `0700`; snapshot/checkpoint files and\nthe manifest are `0600`; `manifest.json` is written last with exact sizes and SHA-256 values. The\ndirectory is trusted operator input: hashes detect corruption, not malicious rewriting.\n\nRestore validates and stages the exact allowlisted artifact bytes before moving or creating a store.\nIt requires the same space and existing trust state. The whole pre-commit window holds a journaled\nliveness claim (coordinator, watchdogs, brokers, absolute deadline): ordinary `up` and a repeated\n`up --restore` refuse while the claim is live, and a stale attempt is recovered only after the\ndeadline has elapsed and every recorded owner is proven dead \u2014 automatically by a retried\n`up --restore`, or explicitly with `cotal clean restore-attempt --attempt <id> --force`. Nothing\never rolls back a live attempt. A registry-only artifact restores as registry-only whether or not\n`--restore-only registry` is passed; omitted infrastructure is always created and the exact\npost-restore stream inventory is asserted before commit intent. Ordinary `up` from a preserved cut\nresumes only the exact recorded source store and runtime; a contradicting `--store-dir` or\n`--runtime` fails in preflight. Authenticated restores validate the complete\nspace trust bundle before staging, including nkeys, seed matches, JWTs, signers, and space binding;\nfull restores commit to the validated operator, system-account, data-account, and active-signer root\nchain in addition to the static/user authority fingerprint. The composed commitment is revalidated\nimmediately before store mutation and never includes secret seeds. Restore never creates fresh auth.\nSame-path restores atomically retain the old\nsource at the journaled fallback path; alternate targets retain it in place; a missing canonical\nsource needs explicit `--accept-missing-source`. Quarantine and target restores use current canonical\nconfigs on isolated random-loopback brokers, never expose native snapshot consumers, and publish a\ncommit-intent immediately before the normal listener starts. Archive bytes never instantiate the real\ntarget: after quarantine validation, every stream is re-snapshotted from the validated quarantine\nstate into attempt-owned sanitized files, and the target is restored solely from those. Before that boundary, failure rolls back\nthe attempt-owned target; after it, ambiguity preserves both stores and records forward-repair\nrecourse. The cooperative maintenance lock excludes Cotal commands, not arbitrary raw NATS processes.\n\nBootstrap brokers in every auth mode \u2014 including open \u2014 mount the store under a local account with\nrandom operation-specific logins only, each carrying the exact per-phase subject permission matrix;\nnormal static credentials and user-auth sentinel/bearer connections are rejected, and no auth\nservice or callout starts. Open mode differs only in its account label, never in authority. Inventory, each stream snapshot,\nrestore initiation, exact upload id, validation, and each checkpoint recreation use separate exact\nauthorities. Every checkpoint carries the source stream's message/first/last sequence state and must\nmatch its snapshot record before mutation; core then derives and validates the only allowed start\npolicy. TASK is not a CLI exception: the same core checkpoint API recreates its canonical `DeliverAll`\nWorkQueue durable because acknowledged tasks are absent from retention and NATS forbids a\nstart-sequence policy there. Registry-only restore creates every omitted canonical stream and transient\nbucket on the isolated target before the normal listener is exposed. It deliberately does not resume\nretained agents or recreate their DM/DLV/TASK/ACL state; their identity material stays retained and\nstopped rather than being reprovisioned into a partial restore.\n\nAfter listener readiness, the manager starts attempt-bound, validates retained credentials/tokens\nwithout granting or reprovisioning, and resumes the exact persisted principals under cleanup\nsuppression. Registry-only restore uses the same flow with an empty agent set. `commitResume` is an\nidempotent validation barrier only: success must be `awaitingFinalize` with an attempt-bound 64-hex\ncommit token and does not release suppression. Under the workspace lock, the CLI first fsyncs that\nexact evidence as `manager-committed` (restore) or `resume-committed` (ordinary resume), then calls\ntoken-bound `finalizeResume`; only an `active` response for the exact token releases suppression. The\nCLI records the same token in finalization evidence before a restore becomes `active`, or before an\nordinary resume retires and consumes the marker. Re-entry from either committed state skips the prior\nidempotent activation/commit phases, retries finalization with the durable token, and finishes the\nworkspace transition. Failure before finalization preserves the committed state and cleanup\nsuppression; it is not rewritten through a degraded transition. Re-entry between any two earlier\nboundaries reuses the same attempt and may retry the idempotent phases without deleting retained state. A missing or\nchanged per-agent dependency is a named fail-closed result; the journal becomes degraded and remains\navailable for forward repair. A retry from `resume-intent`,\n`resume-active`, or `resume-degraded` reuses the same attempt and inventory after the prior listener is\nproven stopped. Every normal restore listener has an unguessable attempt-bound NATS server name. The\nCLI fsyncs its exact name/nonce, canonical endpoint, process owner, and generation-bound target identity\nimmediately after spawn. Re-entry accepts a surviving listener only when its INFO server name, live PID\nrecord, endpoint, and target identity all match that proof; degraded restore repair then moves through\nthe guarded workspace transition only after manager commit. If an uncommitted bound owner is provably\ndead, recovery retires that exact proof under the maintenance lock and binds a fresh listener for the\nsame attempt, endpoint, and target with a new nonce and server name. A live foreign/mismatched listener\nor ambiguous owner is preserved and refused, never adopted by reachability alone. A reconstructed\ncommit/degraded attempt without either the exact bound proof or a durable dead-listener replacement\nrecord fails closed even when the recorded port is free. A later ordinary startup may pass an `active`\nrestore only when its details prove manager commit and its exact recorded listener is dead.\n\n## meshes, use, status\n\n```bash\ncotal meshes\ncotal use <space>\ncotal status [--space <s>] [--server <url>]\n```\n\n`meshes` lists the running meshes on this machine; a `*` marks the `current` default a bare\n`cotal spawn` joins. `use <space>` sets that default; the selection applies from every directory,\nincluding inside another mesh's project. `status` is a read-only report: machine prerequisites\n(starting with the installed `cotal-ai` version), the installed extensions and their versions, this\nfolder's `.cotal/`, the recorded meshes, and a live snapshot of the selected mesh (roster, channels,\nmembership feed). `status` takes only `--space` / `--server` to pick the mesh to inspect; it starts\nnothing.\n\n## spawn\n\n```bash\ncotal spawn [<persona>] [--detach] [--name <n>] [--agent <a>] [--model <m>] [--variant <v>] [--prompt <text>] [--cwd <dir>]\ncotal spawn -f <cotal.yaml> [--dry-run]\n```\n\n| Flag | Default | Meaning |\n|---|---|---|\n| `--space <s>` | resolved mesh | Target space |\n| `--server <url>` | registry entry | Broker URL override |\n| `--creds <path>` | \u2014 | Control-caller creds for an off-registry manager (`--detach` only) |\n| `--name <n>` | persona's `name:` | Presence-name override (does not choose the persona) |\n| `--config <persona-or-path>` | \u2014 | Persona catalog name or file path; wins over the positional |\n| `--agent <a>` | `COTAL_DEFAULT_AGENT`, else `claude` | Connector type (`claude`, `opencode`, `hermes`, \u2026) |\n| `--role <r>` | persona's `role:` | Role override |\n| `--model <m>` | persona's `model:` | Model override |\n| `--variant <v>` | persona's `variant:` | Model variant override (connector-defined; e.g. OpenCode reasoning tiers) |\n| `--cwd <dir>` | this cwd | Working directory to root the agent at |\n| `--prompt <text>` | \u2014 | Initial prompt auto-submitted at start |\n| `--resume <id>` | \u2014 | Fork an existing session id into the mesh (claude only) |\n| `--transcript` / `--no-transcript` | off | Mirror the session transcript to `tr-<name>` |\n| `--share-tools <sel>` | none | Share named operator MCP servers with the agent |\n| `--subscribe <a,b>` | persona's | Channel read-set override |\n| `--allow-subscribe <a,b>` | = subscribe | Read-ACL override |\n| `--allow-publish <a,b>` | deny | Post-ACL override |\n| `--detach`, `-d` | off | Launch via the manager into a detached PTY (reattach with `cotal attach`) |\n| `--file <cotal.yaml>`, `-f` | \u2014 | Deploy a manifest onto the running mesh |\n| `--dry-run` | off | With `-f`: print the plan, mutate nothing |\n| `--allow-stale <a,b>` | \u2014 | With `-f`: waive named stale agents (apply-only) |\n| `--runtime <name>` | manifest's | With `-f`: override the manifest's runtime |\n\nThe persona (`--config` > positional > `COTAL_DEFAULT_PERSONA` > `default`) is loaded from the\ntarget mesh's `.cotal/agents/`; the launch flags override the file. Foreground runs the agent\nattached to your terminal; `--detach` hands the launch to the running manager. Both modes get the\ndurable backstop on a mesh that runs the delivery daemon; `--live-only` skips it for a foreground\nspawn (messages posted while it is disconnected are then not replayed). A foreground exit retires\nthe agent's creds and broker footprint, like a manager despawn. See\n[Connect Claude Code](connect-claude.md) and [Agent files](agent-files.md); `-f` is a\n[manifest deploy](#manifest-deploys). (`cotal start` was merged into `cotal spawn --detach`.)\n\n## models\n\n```bash\ncotal models [--agent <connector>] [--refresh]\n```\n\n| Flag | Default | Meaning |\n|---|---|---|\n| `--space <s>` / `--server <url>` / `--creds <path>` | resolved mesh | Which manager to reach |\n| `--agent <connector>` | all registered connectors | Connector whose catalog to list |\n| `--refresh` | off | Ask the connector to refresh its provider cache |\n\nAsks the running manager for each connector's model catalog (model ids plus their variants)\nfor connectors that expose one (OpenCode today; a connector without a catalog says so). Pick a\nresult with `cotal spawn --model <provider/model> --variant <v>`.\n\n## endpoints\n\n```bash\ncotal endpoints [--space <s>] [--server <url>] [--creds <path>]\n```\n\nLists the mesh presence roster: agents, the manager, and any other protocol endpoint, with each\nendpoint's role, kind, status, and current activity. Unlike `ps`, this is a read-only presence view;\nit is not limited to child processes owned by the manager.\n\n## ps, stop, attach\n\n```bash\ncotal ps [--space <s>]\ncotal stop --name <n> [--space <s>]\ncotal attach --name <n> [--space <s>]\n```\n\n| Flag | Default | Meaning |\n|---|---|---|\n| `--space <s>` / `--server <url>` / `--creds <path>` | resolved mesh | Which manager to reach |\n| `--name <n>` | \u2014 | Managed agent to stop / attach (required) |\n\nThese are operator clients over the running manager's control plane. `ps` lists managed agents with\ntheir mesh status (`starting\u2026` / `working` / `waiting` / `offline`); on a user-auth mesh it also\nrenders each managed agent's last credential-refresh outcome, fail-closed. `attach` streams and\ndrives an agent's terminal on the `pty` runtime; detach with the escape key (Ctrl-] by default; see\n[`COTAL_DETACH_KEY`](config.md)). `stop` and `attach` need a running manager to talk to. On a\nstatic mesh they are cross-agent admin operations. On a user-auth mesh, your own agents (any agent\nunder your owner) need only the `spawn` scope; another owner's agent needs `admin` on your ledger\nrow ([identity & auth](identity-and-auth.md)). Launch detached agents with\n[`spawn --detach`](#spawn).\n\n## personas\n\n```bash\ncotal personas list [-v] [--running]\ncotal personas show <name>\ncotal personas edit <name>\ncotal personas new <name> (--prompt <t> | --from <f>) [--role <r>] [--model <m>]\ncotal personas rm <name> --force\n```\n\n| Flag | Default | Meaning |\n|---|---|---|\n| `--space <s>` / `--server <url>` / `--creds <path>` | resolved mesh | Which mesh's persona catalog |\n| `--role <r>` | \u2014 | `new`: the persona's role |\n| `--model <m>` | \u2014 | `new`: the persona's model |\n| `--prompt <t>` | \u2014 | `new`: the persona's prompt text |\n| `--from <f>` | \u2014 | `new`: seed the prompt from a file |\n| `--verbose`, `-v` | off | `list`: include role / model / description |\n| `--running` | off | `list`: mark personas live on the mesh |\n| `--force` | \u2014 | `rm`: required, delete without prompting |\n\nPersonas are the local agent files under `.cotal/agents/` that `cotal spawn` launches. See\n[Agent files](agent-files.md) for the file format.\n\n## supervise\n\n```bash\ncotal supervise [--runtime <name>] [--space <s>] [--server <url>] [--spawn <names>]\n```\n\n| Flag | Default | Meaning |\n|---|---|---|\n| `--space <s>` | this folder's auth space | Space to supervise |\n| `--server <url>` | the local mesh | Broker URL |\n| `--runtime <name>` | `pty` | Agent runtime (`pty` built in; extension runtimes are explicit-only) |\n| `--console-port <n>` | \u2014 | Protocol-console port |\n| `--roster <file>` | \u2014 | Declarative roster to boot at startup |\n| `--launch <spec>` | \u2014 | Resolved manifest launch spec (from `up -f` / `spawn -f`) |\n| `--spawn <names>` | \u2014 | Comma-separated personas to pre-spawn at startup |\n\nThe manager is the agent supervisor and control plane: it answers `spawn --detach`, `stop`, `ps`,\n`attach`, and the `cotal_*` manager tools. `cotal up --detach` starts one for you; run `supervise`\ndirectly to recover a dead manager or drive a custom runtime. Default runtime is `pty`; install an\noptional provider first (`cotal ext add @cotal-ai/orca`, `@cotal-ai/tmux`, or `@cotal-ai/cmux`) and\nselect it explicitly. A missing provider or app fails loudly; there is no fallback. See [Deploy](deploy.md).\n\n## runtimes\n\n```bash\ncotal runtimes\n```\n\nLists every agent runtime the manager can spawn through: the built-in `pty`, the official providers\n(`orca`, `tmux`, `cmux`), and any custom provider installed via `cotal ext add`. Each installed\nprovider is probed so you can see what is actually reachable on this machine before selecting it:\n\n```\npty built in\norca installed \xB7 reachable @cotal-ai/orca\ntmux available \xB7 cotal ext add @cotal-ai/tmux\ncmux available \xB7 cotal ext add @cotal-ai/cmux\n```\n\n`installed \xB7 reachable` / `unreachable` is the provider's own `available()` probe; `available` means\nit is a known runtime you can add with the shown command. Selecting an unknown or uninstalled runtime\nvia `up`/`spawn --runtime <name>` fails loud and, for a known one, points at the exact `cotal ext add`\npackage \u2014 there is no silent fallback to `pty`.\n\n## send\n\n```bash\ncotal send dm <agent> \"<text>\" [--space <s>] [--server <url>] [--creds <path>]\ncotal send msg <channel> \"<text>\"\ncotal send ask <role> \"<text>\"\n```\n\n| Flag | Default | Meaning |\n|---|---|---|\n| `--space <s>` / `--server <url>` / `--creds <path>` | resolved mesh | Which mesh, and (off-registry) which credential |\n\nOne-shot messaging: connect, send a single direct message (`dm`), channel post (`msg`), or role\nask/anycast (`ask`), then exit. For a running conversation, agents use the mesh tools instead\n([MCP tools](mcp-tools.md)).\n\n## channels\n\n```bash\ncotal channels list\ncotal channels set <name> [--replay | --no-replay] [--window <n>] [--desc <s>] [--instructions <s>]\ncotal channels default --replay | --no-replay\n```\n\n| Flag | Default | Meaning |\n|---|---|---|\n| `--space <s>` / `--server <url>` / `--creds <path>` | resolved mesh | Target mesh |\n| `--replay` / `--no-replay` | \u2014 | `set`/`default`: replay history to new joiners, or not |\n| `--window <n>` | \u2014 | `set`: replay window size |\n| `--desc <s>` | \u2014 | `set`: one-line channel description |\n| `--instructions <s>` | \u2014 | `set`: instructions shown to joiners |\n\nInspects and edits the channel registry: replay policy, description, and joiner instructions. ACL\nsemantics (who may read or post) are set at mint / provision time, not here; see\n[Channels and permissions](channels-and-permissions.md). On a user-auth mesh, `list` rides your\nown login as is; `set` and `default` edit the registry over a short-lived\nchannel-writer view, which needs ledger scope `admin` ([Identity & auth](identity-and-auth.md)).\n\n\n## history\n\n```bash\ncotal history clear --force [--dms] [--space <s>]\n```\n\n| Flag | Default | Meaning |\n|---|---|---|\n| `--space <s>` / `--server <url>` / `--creds <path>` | resolved mesh | Target mesh |\n| `--dms` | off | Also clear DM history |\n| `--force` | \u2014 | Required: clear without prompting |\n\nPurges retained channel history; `--dms` extends it to direct-message history. An alias of\n[`clean history`](#clean). On a user-auth mesh the purge rides a short-lived purger view over\nyour login, which needs ledger scope `admin` ([Identity & auth](identity-and-auth.md)).\n\n## console\n\n```bash\ncotal console [--plain] [--space <s>]\n```\n\n| Flag | Default | Meaning |\n|---|---|---|\n| `--space <s>` / `--server <url>` / `--creds <path>` | resolved mesh | Space to watch |\n| `--plain` | off | Line stream instead of the TUI |\n\nA live protocol view for a space: a lazygit-style TUI, or a plain line stream on `--plain`. On a\nuser-auth mesh it rides the read-only admin view over your login, which needs ledger scope\n`admin`. See [Watch a mesh](watch-a-mesh.md).\n\n## web\n\n```bash\ncotal web [--detach] [--port <n>] [--no-open] [--space <s>]\n```\n\n| Flag | Default | Meaning |\n|---|---|---|\n| `--space <s>` / `--server <url>` / `--creds <path>` | resolved mesh | Space to serve |\n| `--port <n>` | `7799` | HTTP port |\n| `--detach` | off | Run in the background; stop with `cotal down web` or bare `cotal down` |\n| `--no-open` | off | Don't open the browser |\n\nThe browser observability dashboard: presence, channels, and a live feed. It is **not** part of\n`cotal up`: it ships inside `cotal-ai` as the `@cotal-ai/web` extension, seeded automatically on first\nrun (like the built-in connectors) so it always matches your CLI version. It self-registers `cotal web`\ninto this surface and serves\n`http://cotal.localhost:7799` (loopback; `*.localhost` resolves in Chrome/Firefox/Edge; Safari may\nneed `http://127.0.0.1:7799`). On a user-auth mesh the dashboard rides the read-only admin view\nover your login, and a channel purge asks for its own channel-purger view per click; both need\nledger scope `admin`. Detached mode re-execs the current Cotal installation, writes diagnostics to\nthe mesh root's `.cotal/web.log`, and reports success only after the HTTP server answers. It requires\na recorded mesh root, but can be launched from any directory once `cotal up` has recorded the mesh.\nSee [Watch a mesh](watch-a-mesh.md).\n\n## mint\n\n```bash\ncotal mint <name> [--profile <agent|observer|admin>] [--out <path>] [--signer]\n```\n\n| Flag | Default | Meaning |\n|---|---|---|\n| `--profile <agent\\|observer\\|admin>` | `agent` | Credential profile |\n| `--out <path>` | `.cotal/auth/creds/<name>.creds` | Output path |\n| `--signer` | off | Emit a stripped account-signing file instead |\n| `--force` | off | With `--signer`: overwrite an existing file |\n| `--allow-subscribe <a,b>` | profile default | Read-ACL override |\n| `--allow-publish <a,b>` | profile default | Post-ACL override |\n\nMints a NATS creds file for a space in **static** auth mode, scoped to a profile and (optionally)\nexplicit read/post ACLs. `--signer` emits an account-signing file for delegating minting to another\nhost. A per-user-auth space refuses `mint`: agents there join under a logged-in user\n([`login`](#login-logout) + [`actor grant`](#actor)), never via a handed-out creds file. See\n[Identity and auth](identity-and-auth.md).\n\n## login, logout\n\n```bash\ncotal login --idp <auth base URL> [--client-id <id>]\ncotal logout --idp <auth base URL>\n```\n\nSigns you in to a per-user-auth mesh's IdP (device code flow) and caches the session; run it\nonce per machine. It prints your IdP subject, the id the operator grants against. After a\nlogin, every command on that mesh works under your identity: each connect takes a fresh IdP\nproof, exchanges it locally for a short-lived bearer, and is authorized against the actor\nledger at connect time. `logout` revokes the IdP session and clears the cache. See\n[identity & auth](identity-and-auth.md).\n\n## actor\n\n```bash\ncotal actor grant <actor> --sub <IdP subject> [--scope a,b] [--allow-subscribe a,b] [--allow-publish a,b] [--role <r>] [--label <l>]\ncotal actor revoke <actor> (--sub <IdP subject> | --owner <u_\u2026>)\ncotal actor list\n```\n\n| Flag | Default | Meaning |\n|---|---|---|\n| `--space <s>` | the folder's | Space whose ledger to manage |\n| `--sub <subject>` | \u2014 | The IdP subject (shown by `cotal login`) the actor belongs to |\n| `--owner <u_\u2026>` | \u2014 | The derived owner token (alternative to `--sub`) |\n| `--scope <a,b>` | `spawn,role:default` | Capability scope (`''` = none; `spawn` = may run agents, `role:<r>` = may delegate role r, `admin` = cross-agent control) |\n| `--allow-subscribe <a,b>` | `>` (all channels) | Channel read ACL; the user's envelope, their agents can never read beyond it |\n| `--allow-publish <a,b>` | `>` (all channels) | Channel post ACL; also the envelope for their agents' posting |\n| `--role <r>` | \u2014 | Role (scopes the task-queue consumer) |\n| `--label <l>` | \u2014 | Display label for `actor list` (never the IdP subject) |\n\nThe actor ledger is the single authorization source of a user-auth space: no row, no access.\nA bare `grant` is the **full** envelope (all channels, may spawn); the flags narrow it. A\nre-grant **replaces** the row, so to add a capability, re-grant with it added to the current\nscope (`cotal actor list` shows what a row holds). `revoke` denies the next exchange and the\nnext connect with no restart, and evicts the principal's live connections. Managed-agent rows\n(written by the spawn path) live in a disjoint row space this command never touches. See\n[identity & auth](identity-and-auth.md).\n\n## doctor\n\n```bash\ncotal doctor auth [--fix]\n```\n\nCredential-health diagnosis and repair for this folder's mesh: renders every managed\ncredential as healthy / near-expiry / expired and ends in `healthy` or the exact next\ncommand; `--fix` applies the repairs it can. The one surface every stale-credential error\npoints at.\n\n## join\n\n```bash\ncotal join --space <s> --name <n> [--role <r>] [--channel <c>]\ncotal join --link <url> | --token <t>\n```\n\n| Flag | Default | Meaning |\n|---|---|---|\n| `--space <s>` / `--server <url>` / `--creds <path>` | resolved mesh | Which mesh, and which credential |\n| `--name <n>` | \u2014 | Your presence name |\n| `--role <r>` | \u2014 | Your role |\n| `--channel <c>` | \u2014 | Channel to join |\n| `--kind <k>` | `agent` | Endpoint kind |\n| `--link <url>` | \u2014 | Join link (`cotal://\u2026`) |\n| `--token <t>` | \u2014 | Join token |\n| `--lifecycle-uid <uid>` | \u2014 | Required with `--creds`: the lifecycle UID minted alongside the credential (`COTAL_LIFECYCLE_UID` works too). A credential's durable grants name exact lifecycle-keyed resources, so `join` refuses to invent one |\n| `--tls` | off | Connect over TLS |\n\nAn interactive presence: join a space under your own name and role, without launching an agent\nharness. A `--link` or `--token` supplies the where and the auth in one value. See\n[Spaces](spaces.md) and [Identity and auth](identity-and-auth.md).\n\n## Manifest deploys\n\nA `cotal.yaml` manifest declares a whole mesh (channels, personas, roles, and ACLs) in one file.\nThree commands consume it, plus a read-only validator:\n\n```bash\ncotal up -f cotal.yaml # boot a fresh mesh from the manifest\ncotal spawn -f cotal.yaml # deploy the manifest additively onto a running mesh\ncotal down -f cotal.yaml # tear that deploy down (or --run <id> for one run)\ncotal topology view -f cotal.yaml # validate + view the access graph, change nothing\n```\n\n`up -f` and `spawn -f` differ in target: `up -f` brings up a new broker and applies the manifest;\n`spawn -f` requires an already-reachable mesh and applies additively (ownership-scoped). On a\nuser-auth mesh, `spawn -f` deploys over your own login (the deployer view, gated on ledger scope\n`spawn`): the manifest's agents land under your owner, a manifest claiming another owner is\nrefused, and seeding new channels additionally needs scope `admin`. Both take\n`--dry-run` to print the plan without mutating anything. `topology` validates the manifest and\nrenders its channel / role / ACL graph. See [Define a team](define-a-team.md) and the\n[manifest reference](manifest.md).\n\n## ext\n\n```bash\ncotal ext # same as `list`\ncotal ext add <npm-package>\ncotal ext remove <name>\ncotal ext list\ncotal ext root # print just the install prefix (scriptable)\ncotal ext seed [--repair|--reset|--force]\n```\n\nOperator-installed extensions: `add` installs an npm package into a cotal-owned prefix and records\nevery registry provider it contributes. Commands appear in help, completion, and dispatch; runtime\nproviders are lazy-loaded by commands such as `supervise`; local process providers participate in\n`status` and selective `down`. `remove` and `list` manage them. The `@cotal-ai/web` dashboard is the\ncanonical command/process example. Installed packages and their location are described in\n[config](config.md).\n\nBare `cotal ext` lists the inventory, headed by the install prefix. That prefix is a cotal-owned npm\nroot kept **separate** from npm's own global tree, so these packages never show up in `npm list -g` \u2014\n`cotal ext` (or the Extensions section of `cotal status`) is the canonical inventory. `cotal ext root`\nprints only the path, for scripts. The versions shown are the manifest pin recorded at add time.\n\nRemoving an extension that owns a running local process is refused with the mesh root and its\n`cotal down <component>` command; stop it first so uninstalling the package never strands a process\nwhose lifecycle provider is gone.\n\n### Built-in connectors are seeded extensions\n\nThe four first-party agent connectors (`claude`, `opencode`, `hermes`, `pi`) are not compiled into\nthe binary. They are seeded on first run through the **same** `ext add` path a third party uses, and\nappear in `cotal ext list` like any other extension. So you can remove one you do not want\n(`cotal ext remove @cotal-ai/connector-hermes`), and a deliberately-removed connector STAYS removed\nacross upgrades. `cotal ext add <your-package>` adds a third-party connector the same way. The web\ndashboard (`@cotal-ai/web`, providing `command:web`) is a fifth built-in seeded on the same path.\n\n`cotal ext seed` is the maintenance entry for that seeding (it runs automatically on the first real\ncommand of each boot, so you rarely call it):\n\n| Flag | Meaning |\n|---|---|\n| (none) | Reconcile: seed any never-seeded built-in, refresh a seeded one whose version the binary bumped, leave a removed one removed. A no-op once current. |\n| `--repair` | Recover after an interrupted seed or a lost authority (rebuilds the interrupted connector; restores the removed-vs-never-seeded record from its durable backup). |\n| `--reset` | Discard the record and re-seed all five built-ins (the four connectors plus the web dashboard). **Resurrects any you removed.** Rebuilds cleanly over corrupt seed state. |\n| `--force` | Re-seed the built-ins even when the version stamp is current or a downgrade. |\n\nThe default connector for a bare `cotal spawn` (no `--agent`) is `claude`; set `COTAL_DEFAULT_AGENT`\n(e.g. `opencode`) to change it. An `--agent` naming a removed connector fails loud with the exact\n`cotal ext add` to restore it. Set `COTAL_SKIP_CONNECTOR_SEED=1` to turn off the automatic first-run\nseed/refresh entirely (for a controlled or offline setup that manages connectors by hand); `cotal ext\nseed` still runs on request.\n\n## completion\n\n```bash\ncotal completion <bash|zsh|fish|powershell> # print a stub to eval / source\ncotal completion install [shell] # install it persistently\n```\n\nPrints or installs shell completion. Completion candidates come from each command's declared flags\nand, where useful, live mesh state (spaces, personas, managed agents) resolved offline.\n\n## feedback\n\n```bash\ncotal feedback \"<summary>\" [--type <t>] [--email <e>] [--details <text>]\n```\n\n| Flag | Default | Meaning |\n|---|---|---|\n| `--type <t>` | \u2014 | `bug` \\| `idea` \\| `friction` \\| `praise` \\| `other` |\n| `--details <text>` | \u2014 | Longer free-form details |\n| `--severity <s>` | \u2014 | `low` \\| `medium` \\| `high` |\n| `--area <a>` | \u2014 | The part of Cotal this concerns |\n| `--email <e>` | git email | Contact email (required on the keyless public path) |\n| `--name <n>` | \u2014 | Your name (optional) |\n| `--url <url>` | keyed / public intake | Intake URL override |\n| `--key <k>` | `COTAL_FEEDBACK_KEY` | Feedback key |\n\nSends feedback to the Cotal developers. With a key (`--key` / `COTAL_FEEDBACK_KEY`) it routes to the\nkeyed beta intake; without one it goes to the public `cotal.ai` intake and requires a contact email\n(`--email` / `COTAL_FEEDBACK_EMAIL`, else your git email). Run a self-hosted intake with\n[`feedback-intake`](#server-daemons).\n\n## Server daemons\n\nTwo long-lived infra roles ship with the CLI. They are not part of everyday operation; the delivery\ndaemon comes up automatically with `cotal up --detach` in auth mode.\n\n```bash\ncotal deliver --space <s> [--server <url>] [--creds <file>]\ncotal auth-service --space <s> --server <url> [--port <n>]\ncotal feedback-intake --keys <keys.json> [--port <n>] [--creds <file>]\n```\n\n`auth-service` runs a user-auth space's identity plane (the NATS auth callout plus the\nloopback token exchange and JWKS); `cotal up --user-auth` starts and supervises it for you,\nso you run it directly only to recover one by hand.\n\n`deliver` runs the server-side Plane-3 delivery daemon: the durable backstop and membership/ACL\nauthority. It is auth-mode-only and single-instance (`--shard`/`--shards` accept only `N=1`);\n`--dev-mint` mints a scoped cred from the local signer for standalone dev. See the\n[delivery daemon](delivery-daemon.md). `feedback-intake` runs a self-hosted feedback server\n(requires `--keys` and a scoped `--creds`), announcing submissions into a space channel; flags\ninclude `--host`/`--port`, `--store`, `--space`/`--channel`, `--max-bytes`, and `--rate-limit`.\n\n## Plumbing\n\n`cotal __complete <words\u2026>` is the internal entry the shell-completion stubs call to emit candidates\nfor the current command line; you never run it directly. `cotal agent-bearer` is machine-facing\nplumbing on user-auth meshes: spawned agents exec it to print a fresh short-lived bearer from their\nspawn-time secret; you never run it directly either. (`cotal start` is a removed tombstone: it\nerrors and points you to `cotal spawn --detach`.)\n"
211
211
  },
212
212
  {
213
213
  "slug": "config",
214
214
  "title": "Configuration & environment",
215
215
  "kind": "Reference: describes the TypeScript reference implementation (the `cotal` CLI and connectors), not the wire contract.",
216
216
  "summary": "Three things configure a Cotal workstation: the config file (per-connector settings, notably which of your MCP servers get shared with spawned agents), a set of COTAL environment variables, and the\u2026",
217
- "body": '# Configuration & environment\n\n> **Reference**: describes the TypeScript reference implementation (the `cotal` CLI and connectors), not the wire contract. \xB7 **For:** operators \xB7 **Wire contract:** [SPEC](../SPEC.md)\n\nThree things configure a Cotal workstation: the **config file** (per-connector settings, notably\nwhich of your MCP servers get shared with spawned agents), a set of **`COTAL_*` environment\nvariables**, and the **on-disk layout** under a project\'s `.cotal/` and your machine\'s `~/.cotal`.\nNone of these are part of the wire contract; they configure the reference implementation only.\n\n## The config file\n\nThe cotal config file carries per-connector launch settings. It is layered from two locations,\nmost-specific-wins:\n\n| Layer | Path | Scope |\n|---|---|---|\n| Base | `$XDG_CONFIG_HOME/cotal/config.json` (else `~/.config/cotal/config.json`; `%APPDATA%\\Cotal\\config.json` on Windows) | Operator-level, every space |\n| Override | `<project-root>/.cotal/config.json` | Space-local |\n\nThey merge per connector and per server name: a server in the space-local file replaces the\nsame-named server in the operator-level file; connectors or servers present in only one side are\nkept. A missing file is empty (valid); malformed JSON or a non-object top level is a loud error.\n\nToday it carries one thing: which of your personal MCP servers a connector should **share** with the\nagents it spawns. By default a spawned agent gets none: the Claude connector launches with\n`--strict-mcp-config`, dropping every ambient MCP server (they are heavy and useless to a meshed\nteammate). This file is the explicit opt-in.\n\n```json\n{\n "connectors": {\n "claude": {\n "mcpServers": {\n "github": {\n "command": "npx",\n "args": ["-y", "@modelcontextprotocol/server-github"],\n "env": { "GITHUB_TOKEN": "${GITHUB_TOKEN}" }\n }\n }\n }\n }\n}\n```\n\nEach server is written in the de-facto `.mcp.json` shape, so you can copy an entry straight out of\nyour own Claude / VS Code / Cursor config. Secrets ride as **`${VAR}` references** (also\n`${VAR:-default}`), resolved from your environment at launch and forwarded to the child **by name**\n(never as literals) so the file stays safe to keep in `~/.config` or a gitignored `.cotal/`. Only\n`command`, `args`, `env`, `url`, and `headers` are expanded; any other key passes through verbatim.\n\n**`--share-tools` interplay**. The per-spawn selection narrows what this config declares:\n\n| `--share-tools` | Result |\n|---|---|\n| (flag absent) | Every server declared for the connector |\n| `none` or empty | Nothing |\n| `a,b` | Only those named: each **must** be declared, or the spawn fails (no silent drop) |\n\nToday only the `claude` connector consumes shared MCP servers; OpenCode inherits config through its\nown merge layer and Hermes has no MCP. See [Connect Claude Code](connect-claude.md) for the full\nsharing model.\n\n## Environment variables\n\nThese are the operator-facing variables. Most of the connector-session ones (space, name, role, \u2026)\nare set **for you** by `cotal spawn` / the manager when they launch an agent; you set them by hand\nonly when you drive a connector session yourself (e.g. your own `claude` with the plugin) or a custom\nlauncher. Comma-separated lists are trimmed.\n\n| Variable | Consumed by | Meaning | Default |\n|---|---|---|---|\n| `COTAL_SPACE` | connector session | Space to join | `demo` (or the join link\'s) |\n| `COTAL_NAME` | connector session | Presence name / identity | required (or via `COTAL_AGENT_FILE` / `COTAL_LINK`) |\n| `COTAL_ROLE` | connector session | Role | agent file\'s `role:`, else none |\n| `COTAL_SERVERS` | connector session | Broker URL(s) | the default local broker (or the link\'s) |\n| `COTAL_CREDS` | connector session | Path to a NATS creds file (auth mode) | none (open mode) |\n| `COTAL_LINK` | connector session | `cotal://token@host/space` join link: supplies server, auth, space | none |\n| `COTAL_AGENT_FILE` | connector session | Path to a persona file: supplies name, role, kind, channels | none |\n| `COTAL_SUBSCRIBE` | connector session | Active channel read set | agent file / link, else `general` |\n| `COTAL_ALLOW_SUBSCRIBE` | connector session | Read ACL (channels the agent *may* read) | = `COTAL_SUBSCRIBE` |\n| `COTAL_ALLOW_PUBLISH` | connector session | Post ACL (channels the agent *may* post to) | deny (empty) |\n| `COTAL_MODEL` | connector session | Model label (display metadata) | agent file\'s `model:`, else none |\n| `COTAL_KIND` | connector session | Endpoint kind | `agent` |\n| `COTAL_TLS` | connector session | Connect over TLS (`1`) | off |\n| `COTAL_TOKEN` | connector session | Auth token (token / open modes) | none |\n| `COTAL_CAPABILITIES` | connector session | Control-plane capabilities (e.g. `spawn`) that gate manager tools | agent file\'s `capabilities:` |\n| `COTAL_QUIET` / `COTAL_MUTED` | connector session | Per-channel attention defaults (never-wake / drop-on-receive) | agent file\'s, else none |\n| `COTAL_CHANNEL` | Claude connector | Force channel wake-nudges on (`1`) / off; set to `1` by the Claude launcher | auto-detect |\n| `COTAL_TRANSCRIPT` | connector session | Mirror this session\'s transcript to `tr-<name>` (`1`) | off |\n| `COTAL_TRANSCRIPT_DEFAULT` | manager | Default transcript-mirror for managed spawns (`1`) | off |\n| `COTAL_DEFAULT_AGENT` | `cotal spawn` | Default connector type for a bare spawn | `claude` |\n| `COTAL_DEFAULT_PERSONA` | `cotal spawn` | Default persona for a bare spawn | `default` |\n| `COTAL_SKIP_CONNECTOR_SEED` | boot gate | Skip the automatic built-in-connector seed/refresh on a command (`1`); `cotal ext seed` still works | off |\n| `COTAL_DETACH_KEY` | `cotal attach` | Detach escape key (`ctrl-<char>` / `^<char>`) | `ctrl-]` |\n| `COTAL_FEEDBACK_KEY` | `feedback`, connector | Beta feedback key \u2192 keyed intake | none (public intake) |\n| `COTAL_FEEDBACK_EMAIL` | `feedback`, connector | Contact email for the keyless public intake | your git email |\n| `COTAL_FEEDBACK_URL` | `feedback`, connector | Intake URL override (self-hosted) | keyed / public intake |\n| `COTAL_SKIP_ASSIST` | `setup` | Disable the interactive Claude handoff on a failed step (`1`; for CI) | off |\n| `COTAL_COMPLETE_DEBUG` | `completion` | Print completion-resolution errors to stderr | off |\n| `COTAL_SERVE_HEADLESS` | OpenCode runtime | Run the OpenCode server without a foreground TUI (`1`) | off |\n| `COTAL_HOME` | workspace | Override the machine-home dir (`~/.cotal`), mainly for test sandboxing | `~/.cotal` |\n\n> `--console-port` is a `cotal supervise` flag, not an environment variable; there is no\n> `COTAL_CONSOLE_PORT`.\n\n### Set by the launcher, not by you\n\nThese are wired into a spawned child\'s environment by the connector / launcher and read back inside\nthe session. They are not operator knobs; listed so you recognize them in a process listing.\n\n| Variable | Purpose |\n|---|---|\n| `COTAL_ID` | Stable agent id chosen by the launcher (static meshes) |\n| `COTAL_LIFECYCLE_UID` | The incarnation\'s lifecycle UID, minted once per spawn; the session binds its lifecycle-keyed DM/delivery/history consumers by it (its credential pins the same names). Required for an authed launch (`COTAL_CREDS` or user-mode); config parsing fails loud without it. Open mode omits it (the endpoint self-mints per session) |\n| `COTAL_OWNER` / `COTAL_ACTOR` / `COTAL_SENTINEL_CREDS` / `COTAL_BEARER_CMD` | User-auth launch identity: the agent\'s principal, its sentinel creds path, and the exec-able bearer command; all four together, mutually exclusive with `COTAL_CREDS` |\n| `COTAL_CONTROL_SOCKET` / `COTAL_CONTROL_TOKEN` | The session\'s local control endpoint (path + token) the MCP server listens on and the lifecycle hooks connect to; token is env-only, never argv or logs |\n| `COTAL_BRIDGE_SOCKET` / `COTAL_TOOLS_FILE` / `COTAL_PARENT_PID` | Hermes sidecar plumbing (bridge socket, generated tool descriptors, launcher pid to watch) |\n| `OPENCODE_CONFIG_CONTENT` | Inline OpenCode config (the injected cotal plugin, highest merge layer) |\n| `OPENCODE_DB` / `OPENCODE_HOME` / `OPENCODE_PORT` / `OPENCODE_SERVER_URL` / `COTAL_OPENCODE_*` | OpenCode server plumbing (home, port, DB, server URL) |\n\nThe launcher forwards only a fixed OS allow-list (PATH, HOME, TERM, locale, XDG/Windows config dirs,\n\u2026) plus the named model-provider key and any `${VAR}` secrets a shared MCP server references, never\nyour whole environment, so unrelated secrets don\'t bleed into spawned agents. There are also a few\ninternal timing knobs (e.g. `COTAL_MEMBERSHIP_INTERVAL_MS`, `COTAL_DELIVERY_BROKER_GONE_MS`) that you\nshould not set in normal operation.\n\n## On-disk layout\n\n### Project: `.cotal/`\n\nA project\'s state lives in `.cotal/` at the mesh root (found by walking up from the cwd, like `.git`).\n**It is gitignored**; it holds secrets and machine-local process state.\n\n| Path | What it is |\n|---|---|\n| `auth/auth.json` | Space trust material: the data-account signing seed (secret; the system-account seed is stripped before writing) |\n| `auth/creds/<name>.creds` | Per-agent minted NATS credentials |\n| `auth/server.conf` | Generated nats-server config for this space |\n| `agents/<name>.md` | Persona / agent files ([Agent files](agent-files.md)) |\n| `manifests/<hash>.json` | Manifest-deploy ledger (records of `up -f` / `spawn -f` runs) |\n| `config.json` | Space-local connector config (the override layer above) |\n| `nats.pid` \xB7 `nats.log` | Background nats-server pid + log |\n| `manager.pid` \xB7 `manager.log` | Manager (supervisor) pid + log; `manager.delivery-aware` marks a delivery-aware build |\n| `delivery.pid` \xB7 `delivery.log` \xB7 `delivery.creds` | Delivery daemon pid, log, and scoped cred (auth mode) |\n| `web.pid` \xB7 `web.log` | Web dashboard pid + log |\n| `membership.json` \xB7 `membership-*.creds` | Membership feed state + its scoped creds |\n| `setup.log` | Last `cotal setup` run |\n\n### Machine: `~/.cotal`\n\nCross-project machine state, so a `cotal spawn` from any directory can find a running mesh. Location:\n`~/.cotal` on POSIX, `%LOCALAPPDATA%\\Cotal` on Windows; overridable with `COTAL_HOME`.\n\n| Path | What it is |\n|---|---|\n| `meshes/<space>.json` | Registry of running meshes: one file per broker `cotal up` started (server URL, root path, mode) |\n| `current-mesh` | Default space a bare `cotal spawn` joins (set by `cotal use`) |\n| `onboarded.json` | First-run marker (with `ONBOARD_VERSION`) that flips setup between first-run and status-card |\n| the Claude plugin marketplace | The installed `cotal-mesh` plugin assets |\n\n### Config dir: `$XDG_CONFIG_HOME/cotal`\n\nDistinct from `~/.cotal`. Location: `$XDG_CONFIG_HOME/cotal`, else `~/.config/cotal` on POSIX, or\n`%APPDATA%\\Cotal` on Windows.\n\n| Path | What it is |\n|---|---|\n| `config.json` | Operator-level connector config (the base layer above) |\n| `extensions/` | `cotal ext` install prefix: its own npm root (`node_modules`) plus an `extensions.json` provider/command-display cache. Built-in connectors install here too, seeded on first run |\n| `seed/` | Built-in-connector seeding state: the `ever-seeded` authority (+ durable backup), the init witness, the version stamp, the crash cursor, and `store/<version>/<name>` (the stable payloads `ext add --install-links` reifies each seeded connector from) |\n\nFor how `cotal setup` populates the machine state and the plugin, and how the built-in connectors are\nseeded as removable extensions, see [setup internals](setup-internals.md).\n'
217
+ "body": '# Configuration & environment\n\n> **Reference**: describes the TypeScript reference implementation (the `cotal` CLI and connectors), not the wire contract. \xB7 **For:** operators \xB7 **Wire contract:** [SPEC](../SPEC.md)\n\nThree things configure a Cotal workstation: the **config file** (per-connector settings, notably\nwhich of your MCP servers get shared with spawned agents), a set of **`COTAL_*` environment\nvariables**, and the **on-disk layout** under a project\'s `.cotal/` and your machine\'s `~/.cotal`.\nNone of these are part of the wire contract; they configure the reference implementation only.\n\n## The config file\n\nThe cotal config file carries per-connector launch settings. It is layered from two locations,\nmost-specific-wins:\n\n| Layer | Path | Scope |\n|---|---|---|\n| Base | `$XDG_CONFIG_HOME/cotal/config.json` (else `~/.config/cotal/config.json`; `%APPDATA%\\Cotal\\config.json` on Windows) | Operator-level, every space |\n| Override | `<project-root>/.cotal/config.json` | Space-local |\n\nThey merge per connector and per server name: a server in the space-local file replaces the\nsame-named server in the operator-level file; connectors or servers present in only one side are\nkept. A missing file is empty (valid); malformed JSON or a non-object top level is a loud error.\n\nToday it carries one thing: which of your personal MCP servers a connector should **share** with the\nagents it spawns. By default a spawned agent gets none: the Claude connector launches with\n`--strict-mcp-config`, dropping every ambient MCP server (they are heavy and useless to a meshed\nteammate). This file is the explicit opt-in.\n\n```json\n{\n "connectors": {\n "claude": {\n "mcpServers": {\n "github": {\n "command": "npx",\n "args": ["-y", "@modelcontextprotocol/server-github"],\n "env": { "GITHUB_TOKEN": "${GITHUB_TOKEN}" }\n }\n }\n }\n }\n}\n```\n\nEach server is written in the de-facto `.mcp.json` shape, so you can copy an entry straight out of\nyour own Claude / VS Code / Cursor config. Secrets ride as **`${VAR}` references** (also\n`${VAR:-default}`), resolved from your environment at launch and forwarded to the child **by name**\n(never as literals) so the file stays safe to keep in `~/.config` or a gitignored `.cotal/`. Only\n`command`, `args`, `env`, `url`, and `headers` are expanded; any other key passes through verbatim.\n\n**`--share-tools` interplay**. The per-spawn selection narrows what this config declares:\n\n| `--share-tools` | Result |\n|---|---|\n| (flag absent) | Every server declared for the connector |\n| `none` or empty | Nothing |\n| `a,b` | Only those named: each **must** be declared, or the spawn fails (no silent drop) |\n\nToday only the `claude` connector consumes shared MCP servers; OpenCode inherits config through its\nown merge layer and Hermes has no MCP. See [Connect Claude Code](connect-claude.md) for the full\nsharing model.\n\n## Environment variables\n\nThese are the operator-facing variables. Most of the connector-session ones (space, name, role, \u2026)\nare set **for you** by `cotal spawn` / the manager when they launch an agent; you set them by hand\nonly when you drive a connector session yourself (e.g. your own `claude` with the plugin) or a custom\nlauncher. Comma-separated lists are trimmed.\n\n| Variable | Consumed by | Meaning | Default |\n|---|---|---|---|\n| `COTAL_SPACE` | connector session | Space to join | `demo` (or the join link\'s) |\n| `COTAL_NAME` | connector session | Presence name / identity | required (or via `COTAL_AGENT_FILE` / `COTAL_LINK`) |\n| `COTAL_ROLE` | connector session | Role | agent file\'s `role:`, else none |\n| `COTAL_SERVERS` | connector session | Broker URL(s) | the default local broker (or the link\'s) |\n| `COTAL_CREDS` | connector session | Path to a NATS creds file (auth mode) | none (open mode) |\n| `COTAL_LINK` | connector session | `cotal://token@host/space` join link: supplies server, auth, space | none |\n| `COTAL_AGENT_FILE` | connector session | Path to a persona file: supplies name, role, kind, channels | none |\n| `COTAL_SUBSCRIBE` | connector session | Active channel read set | agent file / link, else `general` |\n| `COTAL_ALLOW_SUBSCRIBE` | connector session | Read ACL (channels the agent *may* read) | = `COTAL_SUBSCRIBE` |\n| `COTAL_ALLOW_PUBLISH` | connector session | Post ACL (channels the agent *may* post to) | deny (empty) |\n| `COTAL_MODEL` | connector session | Model label (display metadata) | agent file\'s `model:`, else none |\n| `COTAL_KIND` | connector session | Endpoint kind | `agent` |\n| `COTAL_TLS` | connector session | Connect over TLS (`1`) | off |\n| `COTAL_TOKEN` | connector session | Auth token (token / open modes) | none |\n| `COTAL_CAPABILITIES` | connector session | Control-plane capabilities (e.g. `spawn`) that gate manager tools | agent file\'s `capabilities:` |\n| `COTAL_QUIET` / `COTAL_MUTED` | connector session | Per-channel attention defaults (never-wake / drop-on-receive) | agent file\'s, else none |\n| `COTAL_CHANNEL` | Claude connector | Force channel wake-nudges on (`1`) / off; set to `1` by the Claude launcher | auto-detect |\n| `COTAL_TRANSCRIPT` | connector session | Mirror this session\'s transcript to `tr-<name>` (`1`) | off |\n| `COTAL_TRANSCRIPT_DEFAULT` | manager | Default transcript-mirror for managed spawns (`1`) | off |\n| `COTAL_DEFAULT_AGENT` | `cotal spawn` | Default connector type for a bare spawn | `claude` |\n| `COTAL_DEFAULT_PERSONA` | `cotal spawn` | Default persona for a bare spawn | `default` |\n| `COTAL_SKIP_CONNECTOR_SEED` | boot gate | Skip the automatic built-in-connector seed/refresh on a command (`1`); `cotal ext seed` still works | off |\n| `COTAL_DETACH_KEY` | `cotal attach` | Detach escape key (`ctrl-<char>` / `^<char>`) | `ctrl-]` |\n| `COTAL_FEEDBACK_KEY` | `feedback`, connector | Beta feedback key \u2192 keyed intake | none (public intake) |\n| `COTAL_FEEDBACK_EMAIL` | `feedback`, connector | Contact email for the keyless public intake | your git email |\n| `COTAL_FEEDBACK_URL` | `feedback`, connector | Intake URL override (self-hosted) | keyed / public intake |\n| `COTAL_SKIP_ASSIST` | `setup` | Disable the interactive Claude handoff on a failed step (`1`; for CI) | off |\n| `COTAL_COMPLETE_DEBUG` | `completion` | Print completion-resolution errors to stderr | off |\n| `COTAL_SERVE_HEADLESS` | OpenCode runtime | Run the OpenCode server without a foreground TUI (`1`) | off |\n| `COTAL_HOME` | workspace | Override the machine-home dir (`~/.cotal`), mainly for test sandboxing | `~/.cotal` |\n\n> `--console-port` is a `cotal supervise` flag, not an environment variable; there is no\n> `COTAL_CONSOLE_PORT`.\n\n### Set by the launcher, not by you\n\nThese are wired into a spawned child\'s environment by the connector / launcher and read back inside\nthe session. They are not operator knobs; listed so you recognize them in a process listing.\n\n| Variable | Purpose |\n|---|---|\n| `COTAL_ID` | Stable agent id chosen by the launcher (static meshes) |\n| `COTAL_LIFECYCLE_UID` | The incarnation\'s lifecycle UID, minted once per spawn; the session binds its lifecycle-keyed DM/delivery/history consumers by it (its credential pins the same names). Required for an authed launch (`COTAL_CREDS` or user-mode); config parsing fails loud without it. Open mode omits it (the endpoint self-mints per session) |\n| `COTAL_OWNER` / `COTAL_ACTOR` / `COTAL_SENTINEL_CREDS` / `COTAL_BEARER_CMD` | User-auth launch identity: the agent\'s principal, its sentinel creds path, and the exec-able bearer command; all four together, mutually exclusive with `COTAL_CREDS` |\n| `COTAL_CONTROL_SOCKET` / `COTAL_CONTROL_TOKEN` | The session\'s local control endpoint (path + token) the MCP server listens on and the lifecycle hooks connect to; token is env-only, never argv or logs |\n| `COTAL_BRIDGE_SOCKET` / `COTAL_TOOLS_FILE` / `COTAL_PARENT_PID` | Hermes sidecar plumbing (bridge socket, generated tool descriptors, launcher pid to watch) |\n| `OPENCODE_CONFIG_CONTENT` | Inline OpenCode config (the injected cotal plugin, highest merge layer) |\n| `OPENCODE_DB` / `OPENCODE_HOME` / `OPENCODE_PORT` / `OPENCODE_SERVER_URL` / `COTAL_OPENCODE_*` | OpenCode server plumbing (home, port, DB, server URL) |\n\nThe launcher forwards only a fixed OS allow-list (PATH, HOME, TERM, locale, XDG/Windows config dirs,\n\u2026) plus the named model-provider key and any `${VAR}` secrets a shared MCP server references, never\nyour whole environment, so unrelated secrets don\'t bleed into spawned agents. There are also a few\ninternal timing knobs (e.g. `COTAL_MEMBERSHIP_INTERVAL_MS`, `COTAL_DELIVERY_BROKER_GONE_MS`) that you\nshould not set in normal operation.\n\n## On-disk layout\n\n### Project: `.cotal/`\n\nA project\'s state lives in `.cotal/` at the mesh root (found by walking up from the cwd, like `.git`).\n**It is gitignored**; it holds secrets and machine-local process state.\n\n| Path | What it is |\n|---|---|\n| `auth/broker.json` | Broker trust material: the operator seed and the system account (secret; the system-account signing seed is stripped before writing). One per broker, shared by every space on it |\n| `auth/account.<key>.json` | One space\'s own NATS data account and signing seed (secret). One file per space, all signed by the broker above; `<key>` is a stable, case-safe hex encoding of the space name (never the raw name, so two case-differing spaces can\'t collide) |\n| `auth/space.<key>/` | One space\'s user-auth state (IdP pin, issuer keys, owner secret, callout account), present only when that space enables per-user auth. Keyed by the same case-safe hex encoding; pre-hex layouts (`auth/<space>/`) are renamed here on first touch |\n| `auth/creds/<name>.creds` | Per-agent minted NATS credentials |\n| `auth/server.conf` | Generated nats-server config for the broker. The core renderer accepts every space on the broker; `cotal up` currently orchestrates one space per root, so it renders that one space\'s account |\n| `agents/<name>.md` | Persona / agent files ([Agent files](agent-files.md)) |\n| `manifests/<hash>.json` | Manifest-deploy ledger (records of `up -f` / `spawn -f` runs) |\n| `config.json` | Space-local connector config (the override layer above) |\n| `nats.pid` \xB7 `nats.log` | Background nats-server pid + log |\n| `manager.pid` \xB7 `manager.log` | Manager (supervisor) pid + log; `manager.delivery-aware` marks a delivery-aware build |\n| `delivery.pid` \xB7 `delivery.log` \xB7 `delivery.creds` | Delivery daemon pid, log, and scoped cred (auth mode) |\n| `web.pid` \xB7 `web.log` | Web dashboard pid + log |\n| `membership.json` \xB7 `membership-*.creds` | Membership feed state + its scoped creds |\n| `setup.log` | Last `cotal setup` run |\n\n### Machine: `~/.cotal`\n\nCross-project machine state, so a `cotal spawn` from any directory can find a running mesh. Location:\n`~/.cotal` on POSIX, `%LOCALAPPDATA%\\Cotal` on Windows; overridable with `COTAL_HOME`.\n\n| Path | What it is |\n|---|---|\n| `meshes/space.<key>.json` | Registry of running meshes: one file per broker `cotal up` started (server URL, root path, mode); `<key>` is the same case-safe hex encoding of the space name, and the record\'s own `space` field is authoritative |\n| `current-mesh` | Default space a bare `cotal spawn` joins (set by `cotal use`) |\n| `onboarded.json` | First-run marker (with `ONBOARD_VERSION`) that flips setup between first-run and status-card |\n| the Claude plugin marketplace | The installed `cotal-mesh` plugin assets |\n\n### Config dir: `$XDG_CONFIG_HOME/cotal`\n\nDistinct from `~/.cotal`. Location: `$XDG_CONFIG_HOME/cotal`, else `~/.config/cotal` on POSIX, or\n`%APPDATA%\\Cotal` on Windows.\n\n| Path | What it is |\n|---|---|\n| `config.json` | Operator-level connector config (the base layer above) |\n| `extensions/` | `cotal ext` install prefix: its own npm root (`node_modules`) plus an `extensions.json` provider/command-display cache. Built-in connectors install here too, seeded on first run |\n| `seed/` | Built-in-connector seeding state: the `ever-seeded` authority (+ durable backup), the init witness, the version stamp, the crash cursor, and `store/<version>/<name>` (the stable payloads `ext add --install-links` reifies each seeded connector from) |\n\nFor how `cotal setup` populates the machine state and the plugin, and how the built-in connectors are\nseeded as removable extensions, see [setup internals](setup-internals.md).\n'
218
218
  },
219
219
  {
220
220
  "slug": "connect-claude",
221
221
  "title": "Connect Claude",
222
222
  "kind": "Guide (informative)",
223
223
  "summary": "The Claude Code connector turns a real claude session into a Cotal mesh peer.",
224
- "body": "# Connect Claude\n\n> **Guide** (informative) \xB7 **For:** operators \xB7 **Prereqs:** [Quickstart](getting-started.md)\n\nThe Claude Code connector turns a real `claude` session into a Cotal mesh peer. A bundled\nplugin inside the session joins NATS, maps lifecycle hooks to presence, and exposes the\nmesh tools. Nothing wraps Claude; it is an ordinary session that happens to be on the\nmesh.\n\nThe shared mesh runtime (agent, `cotal_*` tools, hook relay) lives in\n[`@cotal-ai/connector-core`](../extensions/connector-core); this connector is the thin\nClaude-specific adapter over it. Siblings: [OpenCode](connect-opencode.md) (beta),\n[Hermes](connect-hermes.md) (alpha), [pi](connect-pi.md) (alpha); the\n[Connectors](connectors.md) matrix compares them feature-by-feature.\n\n## Set up\n\n```bash\ncotal setup # one-time: installs the plugin, seeds one agent; launches nothing\ncotal up # brings up the mesh + delivery daemon + a detached manager\n```\n\n`cotal setup` installs the cotal plugin (so the repo's Claude sessions get the `cotal_*`\ntools) and seeds one `default` persona; `cotal up` brings up the local stack so\n`cotal spawn --detach` / `cotal_spawn` work right away. Re-running either is idempotent.\nThe install mechanics and the invariants behind them are in\n[setup internals](setup-internals.md).\n\n## Spawn a session\n\n```bash\ncotal spawn # foreground: your default agent, in this terminal\ncotal spawn dave --detach # supervised: the manager runs it in a PTY\n```\n\nA spawn resolves a persona from `.cotal/agents/<name>.md` ([agent files](agent-files.md));\n`--model`, `--variant`, `--cwd`, `--prompt`, ACL overrides, and `--share-tools` apply to\nboth forms ([run a mesh](run-a-mesh.md) has the full resolution rules). The session joins\nwith identity from its environment and auto-registers presence by the time it is\ninteractive.\n\nInside the session, the agent orients with one read-only tool, `cotal_orientation`: its\nidentity, the channels it reads and may post to, its capabilities, the tools available,\nwho's present, and unread counts. The full tool surface is the\n[MCP tool catalog](mcp-tools.md). In auth mode the team-supervision tools\n(`cotal_spawn` / `cotal_persona`) are injected **only** for personas declaring\n`capabilities: [spawn]` (the same grant that opens the privileged control subject), so an\nagent's toolset matches what it can actually invoke. Clearing retained history is\noperator-only ([run a mesh](run-a-mesh.md)), never an agent tool.\n\n## How it binds\n\nClaude Code exposes four integration surfaces, and three of them collapse into a single\ndual-purpose MCP server:\n\n| Surface | Mechanism |\n|---|---|\n| Outbound, ambient | `http` lifecycle hooks \u2192 POST to the connector (presence, activity) |\n| Outbound, deliberate | MCP tools `cotal_send` / `cotal_dm` / `cotal_anycast` (+ `cotal_feedback`) |\n| Inbound, pull | MCP tool `cotal_inbox` (same server) |\n| Inbound, push | Channel nudge + hook drain (below) |\n\nThe manager launches the *real* `claude` (no wrapper):\n\n```\nclaude --strict-mcp-config --mcp-config '{\"mcpServers\":{\"cotal\":{\u2026}}}' \\\n --dangerously-load-development-channels server:cotal\n# env: COTAL_SPACE, COTAL_NAME, COTAL_ROLE, COTAL_SERVERS, COTAL_CHANNEL=1\n```\n\n- **MCP isolation.** A spawned agent runs with **only** the cotal MCP server:\n `--strict-mcp-config` ignores every other MCP source, crucially the operator's personal\n `~/.claude.json` servers (several spawns each booting a heavy helper would starve\n memory). Share your own servers deliberately (see below).\n- **Installed, not `--plugin-dir`.** The plugin is installed once (`claude plugin install\n cotal@cotal-mesh --scope local`) because its hooks bind only to an *installed* plugin.\n In a clone the marketplace is the repo's `.claude-plugin/marketplace.json`; `cotal setup`\n (npx, no clone) materializes the same marketplace under `~/.cotal/claude-plugin/`.\n- **Identity-gated.** Connector code requires `COTAL_NAME` *or* `COTAL_LINK`. A plain\n `claude` with no `COTAL_*` env stays inert and never joins, so your own sessions in a\n repo do not appear as stray peers.\n- **Hands-free.** The dev-channels flag prints a one-time confirm prompt; the PTY runtime\n auto-clears it, so a supervised launch needs no keypress.\n\nInbound mesh messages arrive in context as\n`<channel source=\"cotal\" from=\"bob\" kind=\"dm\" \u2026>\u2026</channel>`: each meta key a tag\nattribute the agent can read for routing.\n\n## How messages reach the session\n\nDurable deliveries land in the connector's inbox from JetStream consumers\n([SPEC \xA78](../SPEC.md#8-nats--jetstream-binding)); live channel traffic can instead arrive\nthrough an at-most-once core subscription. A durable message sent while the agent is busy\nor offline waits on the stream. Two things move a message from inbox to model; one\ndelivers, the other only wakes:\n\n- **Hook drain (delivery).** `SessionStart` / `UserPromptSubmit` hooks drain automatic inbox items,\n inject the messages as `additionalContext`, and **ack** them. This is the single\n authoritative path: deterministic, works on any Claude Code build, and a crash before\n injection redelivers. Quiet ambient is excluded and stays buffered for `cotal_inbox`.\n- **Channel nudge (wake).** An arriving message fires a `notifications/claude/channel`\n event that wakes an *idle* session into a turn, so the drain runs *now* instead of at\n the next prompt. The nudge never acks anything. If a nudge is lost (a race in the host's\n channel startup, a dropped notification), JetStream redelivery re-announces the unacked\n durable item through the same attention policy, so a durable message always wakes the\n session eventually. If the channel cannot run at all, delivery still waits for the next\n hook. Live-only traffic has no durable retry.\n\n**Two priority tiers.** A *directed* message (DM, anycast, or a channel message that\n`@mentions` us) always nudges. *Ambient* channel chatter does not nudge mid-turn; it\naccumulates, and the `Stop` \u2192 idle transition fires one batch nudge so the backlog drains\ntogether.\n\n**Constraints (accepted).** Channels are a Claude Code research preview (\u2265 v2.1.80;\npermission relay \u2265 v2.1.81): Anthropic auth only, admin-enabled on Team/Enterprise, and a\ncustom channel needs the `--dangerously-load-development-channels` launch flag. The hook\ndrain does not depend on any of that; the channel only adds \"wake me when idle.\"\n\nThe same channel also relays **tool-permission requests** onto the mesh, so a peer (a\nhuman at the CLI, a policy node) can approve or deny an agent's pending tool call through\nCotal rather than a per-terminal prompt.\n\n### Attention: how much traffic wakes you\n\nAn agent picks how aggressively peer traffic reaches it with\n`cotal_status({ attention })` (three modes, orthogonal to presence):\n\n| arrival | open (default) | dnd | focus |\n|---|---|---|---|\n| directed (dm / anycast) | wake + inject | wake + inject | wake + inject |\n| channel `@mention` | wake + inject | wake + inject | ack-drop; wake to *pull*; not injected |\n| ambient channel chatter | wake when idle; hold while working | never wakes; injects next turn | ack-drop; recall via `cotal_inbox` |\n\nPer-channel overrides refine this: **quiet** (delivered, never wakes; `@mention` still\nwakes) and **muted** (dropped on receive, mentions included; DMs/anycast unaffected), set\nwith `cotal_channel_mode` or as agent-file defaults (`quiet:` / `muted:`,\n[agent files](agent-files.md)). A per-channel override is the final word for that channel.\nQuiet ambient is pull-only: it never hitchhikes on a human prompt, DM, mention, or other\nconnector-driven turn. `cotal_inbox` explicitly surfaces and clears it. A quiet-channel\n`@mention` remains automatic and injects normally.\n\nThe local inbox is bounded. On pathological overflow it evicts pull-only items before automatic\ntraffic. If the bounded live/durable classification guard also fills, the connector fails closed:\notherwise-normal ambient becomes pull-only until restart. Muted hard-drop and normal focus recall\nstill take precedence. Focus also keeps a bounded exclusion list so mode toggles cannot recall\nquiet/muted traffic; if that safety bound fills, recall skips the affected channel and reports it\nas incomplete rather than risk resurfacing excluded content.\nIf the separate hard-drop disposition guard fills, channel traffic is dropped for the rest of the\nsession rather than risk a late copy bypassing an earlier muted/focus decision; DMs and anycast are\nunaffected.\n\nAttention is **advisory UX, not a boundary**: any peer can wake a dnd/focus agent by\nnaming it, and `muted` means \"I opted out of receiving\", not \"the channel is blocked\";\nthe broker still authorizes and delivers. Focus's real effect is shrinking the\nuntrusted-ambient injection surface (only subject-authenticated dm/anycast auto-inject).\nIt resets to **open** on `SessionStart`, so a restarted agent never stays silently deaf.\nYour attention is mirrored into presence so peers can see it.\n\n## Presence mapping\n\nThe connector wires a small subset of Claude Code hooks to presence states; presence is\ncoarse, and \"what it is doing\" rides on activity updates:\n\n| Hook | \u2192 state |\n|---|---|\n| `SessionStart` | `idle` (join; drains the inbox; captures the live model into `meta.model` when no pin) |\n| `UserPromptSubmit` | `working` (turn starts; drains the inbox) |\n| `PreToolUse` | no change; records *what* is about to run, so a permission wait can name it |\n| `Notification` (permission / elicitation) | `waiting` (blocked on a human: activity leads with the pending tool, e.g. `Bash: git push \u2026`) |\n| `Stop` / `StopFailure` | `idle` (turn done / died on an API error) |\n| `SessionEnd` | `offline` (graceful leave) |\n\nHooks are relayed over the connector's **authenticated** local control endpoint (per-user\nsocket + per-launch token, constant-time checked), so a local process that finds the path\nstill can't drive presence or stop the agent. The full Claude Code hook-event list lives\nwith the adapter:\n[`extensions/connector-claude-code`](../extensions/connector-claude-code/README.md).\n\n## Transcript mirror\n\nA managed session mirrors its own transcript onto a per-agent channel, **`tr-<name>`**, so\npeers and cheap observer agents can read what the agent *actually* did: assistant text in\nfull, tool calls as one-liners, results truncated, thinking omitted. Gated by\n`COTAL_TRANSCRIPT` (set for managed sessions; a personal session with the plugin never\nmirrors). A `tr-` channel is a regular channel (durable, listed by `cotal_channels`,\nreadable on demand) with a rolling window, so long sessions age out early entries. In\nauth mode the launcher provisions publish rights for it alongside the agent's channels.\n\n## Resume an existing session (fork, never hijack)\n\n`--resume <session-id>` pulls an existing Claude session, its context and transcript,\ninto the mesh. It **forks**: Claude mints a *new* session id from that transcript\n(`--resume <id> --fork-session`), so the meshed agent gets its own session and the\noriginal is untouched.\n\n- `cotal spawn --resume <id>` (foreground) is the primary surface: the transcript is on\n *your* machine, and errors are Claude's own stderr, inline.\n- `--detach --resume <id>` works, with two differences: the id resolves against the\n **manager host's** `~/.claude` (you practically need `--cwd`), and the manager waits for\n a real outcome; `\u2713 started` means the agent *joined the mesh*, `\u2717 exited on launch`\n carries Claude's last output, and an uncertain launch (~30 s) is reported without\n tearing the agent down.\n- Resume is an **operator surface only**, deliberately not exposed on MCP `cotal_spawn`\n (a mesh peer naming host-local transcripts would widen `spawn` into transcript\n disclosure). Only the Claude connector supports it today; OpenCode and Hermes fail loud.\n- Needs a `claude` new enough for `--resume \u2026 --fork-session` (verified on 2.1.197).\n\n## Sharing your MCP servers\n\nIsolation is the default, but a meshed teammate sometimes genuinely needs one of your own\ntools (say, web search). The opt-in is the cotal config file\n(`~/.config/cotal/config.json`, or a space-local `.cotal/config.json` layered on top):\neach entry the familiar `.mcp.json` shape, secrets written as `${VAR}` references, never\nliterals ([full format](config.md)).\n\nAt launch the connector forwards *only* the named vars the chosen servers declare and\npasses the merged config as an owner-only temp file; `--strict-mcp-config` stays on, so\nonly cotal + the explicitly shared servers load. Scope per spawn with\n`--share-tools tavily,figma` (or `--share-tools none`).\n\nTwo caveats: sharing a server grants its credential to the agent (the var lives in the\nClaude process's environment, so share only when you're fine with that teammate holding\nthe key), and memory adds up, because a heavy server boots once per spawn, multiplied\nacross a team.\n\n## Feedback\n\n`cotal_feedback` works out of the box: without a key it posts to the public intake at\n`https://cotal.ai/v1/feedback` (needs a contact email: `COTAL_FEEDBACK_EMAIL`, then\n`git config user.email`, else the agent asks). Set `COTAL_FEEDBACK_KEY=fbk_<key>` in a\nbeta tester's environment to route to the keyed intake (`Authorization: Bearer`, identity\nderived from the key); `COTAL_FEEDBACK_URL` overrides either endpoint. The CLI can send\ntoo: `cotal feedback \"<summary>\" [--type bug]`. Each submission carries\n`origin: human | agent`, whether the tester asked, or the agent auto-reported a major\nissue.\n"
224
+ "body": "# Connect Claude\n\n> **Guide** (informative) \xB7 **For:** operators \xB7 **Prereqs:** [Quickstart](getting-started.md)\n\nThe Claude Code connector turns a real `claude` session into a Cotal mesh peer. A bundled\nplugin inside the session joins NATS, maps lifecycle hooks to presence, and exposes the\nmesh tools. Nothing wraps Claude; it is an ordinary session that happens to be on the\nmesh.\n\nThe shared mesh runtime (agent, `cotal_*` tools, hook relay) lives in\n[`@cotal-ai/connector-core`](../extensions/connector-core); this connector is the thin\nClaude-specific adapter over it. Siblings: [OpenCode](connect-opencode.md) (beta),\n[Hermes](connect-hermes.md) (alpha), [pi](connect-pi.md) (alpha); the\n[Connectors](connectors.md) matrix compares them feature-by-feature.\n\n## Set up\n\n```bash\ncotal setup # one-time: installs the plugin, seeds one agent; launches nothing\ncotal up # brings up the mesh + delivery daemon + a detached manager\n```\n\n`cotal setup` installs the cotal plugin (so the repo's Claude sessions get the `cotal_*`\ntools) and seeds one `default` persona; `cotal up` brings up the local stack so\n`cotal spawn --detach` / `cotal_spawn` work right away. Re-running either is idempotent.\nThe install mechanics and the invariants behind them are in\n[setup internals](setup-internals.md).\n\n`cotal setup` also installs Cotal's authored Agent Skills (`SKILL.md`, the agentskills.io format) for\ncoordinating agent teams (today `team-topology`), from one canonical source, on two channels:\n\n- **Claude Code** gets a second, skills-only plugin, `cotal-skills`, from the same `cotal-mesh`\n marketplace, at **user scope** (machine-wide), and **independent of the mesh connector**: it carries no\n code and no core dependency, installs whenever Claude is on `PATH` (even with the connector removed),\n and uninstalls on its own with `claude plugin uninstall cotal-skills --scope user`. Its plugin version\n is stamped from the running CLI release, so an upgrade + `cotal setup` runs `claude plugin update` and\n the deployed install actually gets the new skill. `cotal setup` installs it on first run and on repeat\n runs, so upgraders are not left behind.\n- **Every other harness** (Codex, Cursor, OpenCode, Gemini CLI, Windsurf/Devin) reads the cross-vendor\n `~/.agents/skills/` directory convention, which has no remote index, so `cotal setup` **reconciles** it:\n it installs/updates each Cotal skill, backs up a copy you have edited to `SKILL.md.bak` before\n replacing it, and removes a Cotal skill that is no longer shipped. Only skills Cotal owns are touched;\n your own or third-party skills there are left alone. `cotal status` reports whether the drop is current,\n stale, missing, or has a retired skill to reconcile. This is the working cross-vendor path.\n\nCotal also generates an [Agent Skills discovery index](https://cotal.ai/.well-known/agent-skills/index.json)\non cotal.ai, but that RFC is still a draft with no harness consuming it yet, so it is a forward bet,\nnot a channel to rely on today.\n\n## Spawn a session\n\n```bash\ncotal spawn # foreground: your default agent, in this terminal\ncotal spawn dave --detach # supervised: the manager runs it in a PTY\n```\n\nA spawn resolves a persona from `.cotal/agents/<name>.md` ([agent files](agent-files.md));\n`--model`, `--variant`, `--cwd`, `--prompt`, ACL overrides, and `--share-tools` apply to\nboth forms ([run a mesh](run-a-mesh.md) has the full resolution rules). The session joins\nwith identity from its environment and auto-registers presence by the time it is\ninteractive.\n\nInside the session, the agent orients with one read-only tool, `cotal_orientation`: its\nidentity, the channels it reads and may post to, its capabilities, the tools available,\nwho's present, and unread counts. The full tool surface is the\n[MCP tool catalog](mcp-tools.md). In auth mode the team-supervision tools\n(`cotal_spawn` / `cotal_persona`) are injected **only** for personas declaring\n`capabilities: [spawn]` (the same grant that opens the privileged control subject), so an\nagent's toolset matches what it can actually invoke. Clearing retained history is\noperator-only ([run a mesh](run-a-mesh.md)), never an agent tool.\n\n## How it binds\n\nClaude Code exposes four integration surfaces, and three of them collapse into a single\ndual-purpose MCP server:\n\n| Surface | Mechanism |\n|---|---|\n| Outbound, ambient | `http` lifecycle hooks \u2192 POST to the connector (presence, activity) |\n| Outbound, deliberate | MCP tools `cotal_send` / `cotal_dm` / `cotal_anycast` (+ `cotal_feedback`) |\n| Inbound, pull | MCP tool `cotal_inbox` (same server) |\n| Inbound, push | Channel nudge + hook drain (below) |\n\nThe manager launches the *real* `claude` (no wrapper):\n\n```\nclaude --strict-mcp-config --mcp-config '{\"mcpServers\":{\"cotal\":{\u2026}}}' \\\n --dangerously-load-development-channels server:cotal\n# env: COTAL_SPACE, COTAL_NAME, COTAL_ROLE, COTAL_SERVERS, COTAL_CHANNEL=1\n```\n\n- **MCP isolation.** A spawned agent runs with **only** the cotal MCP server:\n `--strict-mcp-config` ignores every other MCP source, crucially the operator's personal\n `~/.claude.json` servers (several spawns each booting a heavy helper would starve\n memory). Share your own servers deliberately (see below).\n- **Installed, not `--plugin-dir`.** The plugin is installed once (`claude plugin install\n cotal@cotal-mesh --scope local`) because its hooks bind only to an *installed* plugin.\n In a clone the marketplace is the repo's `.claude-plugin/marketplace.json`; `cotal setup`\n (npx, no clone) materializes the same marketplace under `~/.cotal/claude-plugin/` (each plugin dir is\n rebuilt from scratch and atomically replaced, never merged, so no stale file rides in). The\n `cotal-skills` plugin installs from that same marketplace at user scope (`claude plugin install\n cotal-skills@cotal-mesh --scope user`); its assets ship inside the CLI package, not the connector, and\n its version tracks the CLI release so updates land.\n- **Identity-gated.** Connector code requires `COTAL_NAME` *or* `COTAL_LINK`. A plain\n `claude` with no `COTAL_*` env stays inert and never joins, so your own sessions in a\n repo do not appear as stray peers.\n- **Hands-free.** The dev-channels flag prints a one-time confirm prompt; the PTY runtime\n auto-clears it, so a supervised launch needs no keypress.\n\nInbound mesh messages arrive in context as\n`<channel source=\"cotal\" from=\"bob\" kind=\"dm\" \u2026>\u2026</channel>`: each meta key a tag\nattribute the agent can read for routing.\n\n## How messages reach the session\n\nDurable deliveries land in the connector's inbox from JetStream consumers\n([SPEC \xA78](../SPEC.md#8-nats--jetstream-binding)); live channel traffic can instead arrive\nthrough an at-most-once core subscription. A durable message sent while the agent is busy\nor offline waits on the stream. Two things move a message from inbox to model; one\ndelivers, the other only wakes:\n\n- **Hook drain (delivery).** `SessionStart` / `UserPromptSubmit` hooks drain automatic inbox items,\n inject the messages as `additionalContext`, and **ack** them. This is the single\n authoritative path: deterministic, works on any Claude Code build, and a crash before\n injection redelivers. Quiet ambient is excluded and stays buffered for `cotal_inbox`.\n- **Channel nudge (wake).** An arriving message fires a `notifications/claude/channel`\n event that wakes an *idle* session into a turn, so the drain runs *now* instead of at\n the next prompt. The nudge never acks anything. If a nudge is lost (a race in the host's\n channel startup, a dropped notification), JetStream redelivery re-announces the unacked\n durable item through the same attention policy, so a durable message always wakes the\n session eventually. If the channel cannot run at all, delivery still waits for the next\n hook. Live-only traffic has no durable retry.\n\n**Two priority tiers.** A *directed* message (DM, anycast, or a channel message that\n`@mentions` us) always nudges. *Ambient* channel chatter does not nudge mid-turn; it\naccumulates, and the `Stop` \u2192 idle transition fires one batch nudge so the backlog drains\ntogether.\n\n**Constraints (accepted).** Channels are a Claude Code research preview (\u2265 v2.1.80;\npermission relay \u2265 v2.1.81): Anthropic auth only, admin-enabled on Team/Enterprise, and a\ncustom channel needs the `--dangerously-load-development-channels` launch flag. The hook\ndrain does not depend on any of that; the channel only adds \"wake me when idle.\"\n\nThe same channel also relays **tool-permission requests** onto the mesh, so a peer (a\nhuman at the CLI, a policy node) can approve or deny an agent's pending tool call through\nCotal rather than a per-terminal prompt.\n\n### Attention: how much traffic wakes you\n\nAn agent picks how aggressively peer traffic reaches it with\n`cotal_status({ attention })` (three modes, orthogonal to presence):\n\n| arrival | open (default) | dnd | focus |\n|---|---|---|---|\n| directed (dm / anycast) | wake + inject | wake + inject | wake + inject |\n| channel `@mention` | wake + inject | wake + inject | ack-drop; wake to *pull*; not injected |\n| ambient channel chatter | wake when idle; hold while working | never wakes; injects next turn | ack-drop; recall via `cotal_inbox` |\n\nPer-channel overrides refine this: **quiet** (delivered, never wakes; `@mention` still\nwakes) and **muted** (dropped on receive, mentions included; DMs/anycast unaffected), set\nwith `cotal_channel_mode` or as agent-file defaults (`quiet:` / `muted:`,\n[agent files](agent-files.md)). A per-channel override is the final word for that channel.\nQuiet ambient is pull-only: it never hitchhikes on a human prompt, DM, mention, or other\nconnector-driven turn. `cotal_inbox` explicitly surfaces and clears it. A quiet-channel\n`@mention` remains automatic and injects normally.\n\nThe local inbox is bounded. On pathological overflow it evicts pull-only items before automatic\ntraffic. If the bounded live/durable classification guard also fills, the connector fails closed:\notherwise-normal ambient becomes pull-only until restart. Muted hard-drop and normal focus recall\nstill take precedence. Focus also keeps a bounded exclusion list so mode toggles cannot recall\nquiet/muted traffic; if that safety bound fills, recall skips the affected channel and reports it\nas incomplete rather than risk resurfacing excluded content.\nIf the separate hard-drop disposition guard fills, channel traffic is dropped for the rest of the\nsession rather than risk a late copy bypassing an earlier muted/focus decision; DMs and anycast are\nunaffected.\n\nAttention is **advisory UX, not a boundary**: any peer can wake a dnd/focus agent by\nnaming it, and `muted` means \"I opted out of receiving\", not \"the channel is blocked\";\nthe broker still authorizes and delivers. Focus's real effect is shrinking the\nuntrusted-ambient injection surface (only subject-authenticated dm/anycast auto-inject).\nIt resets to **open** on `SessionStart`, so a restarted agent never stays silently deaf.\nYour attention is mirrored into presence so peers can see it.\n\n## Presence mapping\n\nThe connector wires a small subset of Claude Code hooks to presence states; presence is\ncoarse, and \"what it is doing\" rides on activity updates:\n\n| Hook | \u2192 state |\n|---|---|\n| `SessionStart` | `idle` (join; drains the inbox; captures the live model into `meta.model` when no pin) |\n| `UserPromptSubmit` | `working` (turn starts; drains the inbox) |\n| `PreToolUse` | no change; records *what* is about to run, so a permission wait can name it |\n| `Notification` (permission / elicitation) | `waiting` (blocked on a human: activity leads with the pending tool, e.g. `Bash: git push \u2026`) |\n| `Stop` / `StopFailure` | `idle` (turn done / died on an API error) |\n| `SessionEnd` | `offline` (graceful leave) |\n\nHooks are relayed over the connector's **authenticated** local control endpoint (per-user\nsocket + per-launch token, constant-time checked), so a local process that finds the path\nstill can't drive presence or stop the agent. The full Claude Code hook-event list lives\nwith the adapter:\n[`extensions/connector-claude-code`](../extensions/connector-claude-code/README.md).\n\n## Transcript mirror\n\nA managed session mirrors its own transcript onto a per-agent channel, **`tr-<name>`**, so\npeers and cheap observer agents can read what the agent *actually* did: assistant text in\nfull, tool calls as one-liners, results truncated, thinking omitted. Gated by\n`COTAL_TRANSCRIPT` (set for managed sessions; a personal session with the plugin never\nmirrors). A `tr-` channel is a regular channel (durable, listed by `cotal_channels`,\nreadable on demand) with a rolling window, so long sessions age out early entries. In\nauth mode the launcher provisions publish rights for it alongside the agent's channels.\n\n## Resume an existing session (fork, never hijack)\n\n`--resume <session-id>` pulls an existing Claude session, its context and transcript,\ninto the mesh. It **forks**: Claude mints a *new* session id from that transcript\n(`--resume <id> --fork-session`), so the meshed agent gets its own session and the\noriginal is untouched.\n\n- `cotal spawn --resume <id>` (foreground) is the primary surface: the transcript is on\n *your* machine, and errors are Claude's own stderr, inline.\n- `--detach --resume <id>` works, with two differences: the id resolves against the\n **manager host's** `~/.claude` (you practically need `--cwd`), and the manager waits for\n a real outcome; `\u2713 started` means the agent *joined the mesh*, `\u2717 exited on launch`\n carries Claude's last output, and an uncertain launch (~30 s) is reported without\n tearing the agent down.\n- Resume is an **operator surface only**, deliberately not exposed on MCP `cotal_spawn`\n (a mesh peer naming host-local transcripts would widen `spawn` into transcript\n disclosure). Only the Claude connector supports it today; OpenCode and Hermes fail loud.\n- Needs a `claude` new enough for `--resume \u2026 --fork-session` (verified on 2.1.197).\n\n## Sharing your MCP servers\n\nIsolation is the default, but a meshed teammate sometimes genuinely needs one of your own\ntools (say, web search). The opt-in is the cotal config file\n(`~/.config/cotal/config.json`, or a space-local `.cotal/config.json` layered on top):\neach entry the familiar `.mcp.json` shape, secrets written as `${VAR}` references, never\nliterals ([full format](config.md)).\n\nAt launch the connector forwards *only* the named vars the chosen servers declare and\npasses the merged config as an owner-only temp file; `--strict-mcp-config` stays on, so\nonly cotal + the explicitly shared servers load. Scope per spawn with\n`--share-tools tavily,figma` (or `--share-tools none`).\n\nTwo caveats: sharing a server grants its credential to the agent (the var lives in the\nClaude process's environment, so share only when you're fine with that teammate holding\nthe key), and memory adds up, because a heavy server boots once per spawn, multiplied\nacross a team.\n\n## Feedback\n\n`cotal_feedback` works out of the box: without a key it posts to the public intake at\n`https://cotal.ai/v1/feedback` (needs a contact email: `COTAL_FEEDBACK_EMAIL`, then\n`git config user.email`, else the agent asks). Set `COTAL_FEEDBACK_KEY=fbk_<key>` in a\nbeta tester's environment to route to the keyed intake (`Authorization: Bearer`, identity\nderived from the key); `COTAL_FEEDBACK_URL` overrides either endpoint. The CLI can send\ntoo: `cotal feedback \"<summary>\" [--type bug]`. Each submission carries\n`origin: human | agent`, whether the tester asked, or the agent auto-reported a major\nissue.\n"
225
225
  },
226
226
  {
227
227
  "slug": "connect-hermes",
@@ -277,7 +277,7 @@ var DOCS_BUNDLE = {
277
277
  "title": "Embedding Cotal: build a host on the published packages",
278
278
  "kind": "Guide (informative)",
279
279
  "summary": "The cotal binary in this repo is one composition root: an operator CLI.",
280
- "body": '# Embedding Cotal: build a host on the published packages\n\n> **Guide** (informative) \xB7 **For:** implementers building a service on top of Cotal \xB7 **Prereqs:** [Architecture](architecture.md), [Identity and auth](identity-and-auth.md), [Delivery daemon](delivery-daemon.md)\n\nThe `cotal` binary in this repo is one composition root: an operator CLI. A separate service\n(for example a hosted, multi-tenant Cotal) does not fork this repo. It writes its **own**\ncomposition root that depends on the published `@cotal-ai/*` packages and imports the surfaces it\nwants, exactly as `bin/cotal.ts` does. This page is the contract for that: what is a real library\nexport you can build against, how to boot the server-side daemons from those exports, and where the\ncurrent export surface stops short of a fully hosted composition.\n\nThis is the "guarded substrate" boundary in practice. Nothing here reveals or assumes a specific\nhost; it documents the public seams any embedder composes.\n\n## What you embed\n\nThe supported reference shape here is **one broker operator serving one space** (one tenant: a\ndedicated data account, under an operator that also holds the system account and a quarantined\nauth-callout account) plus three standalone processes. Running many spaces under one shared broker\noperator is a different, not-yet-composable shape (see\n[Known gaps](#known-gaps-not-hosted-composable-yet)). The three processes:\n\n| daemon | package | what it is |\n|---|---|---|\n| auth-service | `@cotal-ai/auth` | the NATS auth callout, the IdP token exchange, and JWKS. Plane 1 to Plane 2. |\n| delivery | `@cotal-ai/delivery` | the Plane-3 durable backstop: fan-out writer plus trusted reader, per space. |\n| supervise | `@cotal-ai/manager` | the per-machine agent lifecycle (spawn/despawn/attach), per space. |\n\n`mint`, `deliver`, and `auth-service` expose their behavior as direct library primitives, and the\nsupported one-space bootstrap below re-composes from exported low-level primitives. `supervise` and\nthe full `up` orchestration are **not** public runners: `up` also does broker bring-up, restore,\nprocess and registry management, and lifecycle work, and `supervise`\'s orchestration is private (see\n[The supervisor is a signer, not a scoped daemon](#the-supervisor-is-a-signer-not-a-scoped-daemon)).\n\n## The export surface\n\nEverything below is a real export of a published package, reachable from the package root (each\npackage publishes only `.` via `dist/index.{js,d.ts}` and ships `files: ["dist"]`). Type-only names\nare marked; import them with `import type`.\n\n**Daemon runners and lifecycle**\n\n| symbol | package | purpose |\n|---|---|---|\n| `runAuthService(args, store?)` | `@cotal-ai/auth` | boot the auth-service daemon; `store` injects the secret material. |\n| `runDelivery(args, store?)` | `@cotal-ai/delivery` | boot the delivery daemon; `store` injects the scoped `delivery` cred. |\n| `DELIVERY_CREDS_KEY`, `MEMBERSHIP_RW_CREDS_KEY` | `@cotal-ai/workspace` | the secret-store keys the delivery cred and the membership feed\'s rw cred are read/re-signed under. |\n| `Manager`, `ManagerOptions` *(type)* | `@cotal-ai/manager` | construct and run a supervisor in-process; `ManagerOptions.secretStore` injects the one store it reads/writes every secret through. |\n| `createRuntime`, `Runtime` *(type)* | `@cotal-ai/manager` | resolve the spawn backend (pty built in). |\n\n**Provisioning and minting** (all `@cotal-ai/core`)\n\n| symbol | purpose |\n|---|---|\n| `createSpaceAuth(space)` | mint a space\'s trust bundle (operator + system + data accounts). One space, one operator. |\n| `setupSpaceStreams({ servers, space, creds })` | create the space\'s JetStream streams. |\n| `ensureDefaultDeliveryClass({ servers, space, creds?, deliveryClass })` | write the space\'s default delivery class at creation so it is wire-discoverable (SPEC section 4). |\n| `serverConfig(auth, { storeDir, extraAccounts?, port?, host? })` | render the broker config for one operator; `storeDir` is required and `extraAccounts` preloads the auth-callout account. |\n| `mintCreds(auth, identity, profile, opts?)` | mint a scoped cred for any `Profile`. |\n| `mintMembershipObserverCreds`, `mintConnectionEvictorCreds` | mint the membership/eviction scoped creds. |\n| `provisionAgent`, `provisionAgentDurables` | create a principal\'s bind-only durables. |\n| `newIdentity`, `stripSpaceAuth` | a fresh nkey identity; a stripped signer bundle (data signing seed only). |\n| `Profile`, `CredentialKind`, `MintOpts`, `SpaceAuth` *(types)*, `CREDENTIAL_LIFETIMES` | the profile matrix and cred lifetime policy. |\n\n**Auth building blocks** (all `@cotal-ai/auth`)\n\n| symbol | purpose |\n|---|---|\n| `createCalloutAuth`, `startAuthCallout` | the NATS auth-callout responder. |\n| `createUserTokenIssuer`, `pinnedJwksResolver` | mint and verify the Cotal user bearer. |\n| `createIdpBridge` | exchange a verified IdP JWT for a Cotal bearer (see [the callout contract](identity-and-auth.md#the-idp-callout-contract)). |\n| `deriveOwnerToken`, `validateUserToken` | owner derivation; strict bearer validation. |\n| `cotalAuthProvider` | the self-registering `auth-provider` extension. |\n| `ensureCalloutAuth`/`loadCalloutAuth`, `ensureIssuer`/`loadIssuer`, `ensureOwnerSecret`/`loadOwnerSecret` | read/write the auth secret kinds through a `SecretStore`. |\n\n**Seams and the wire** (all `@cotal-ai/core` unless noted)\n\n| symbol | purpose |\n|---|---|\n| `SecretStore` *(type)* | the durable hosted-secret seam (get/put/delete); `get()` returns raw seeds/keys into process memory, so it is a blob seam, not HSM/KMS signing. |\n| `FsSecretStore`, `workspaceSecretStore(root)` | the filesystem default. **These live in `@cotal-ai/workspace`, not core.** |\n| `AuthProvider` *(type)*, `Connector` *(type)*, `Runtime` *(type)*, `Command` *(type)* | the extension contracts; implementations self-register on import. |\n| `registry` | the shared registry a composition root pulls surfaces into. |\n| `CotalEndpoint`, subjects, message types | the wire client and shapes. |\n| `ParsedArgs` *(type)* | the shape the daemon runners take (see below). |\n\nThe runners take a CLI-shaped `ParsedArgs`, not a typed options object, so a host fabricates one:\n\n```ts\nconst args: ParsedArgs = { values: { space, server, port: "0" }, positionals: [], raw: [] };\n```\n\n## Booting the daemons\n\n### auth-service\n\n`runAuthService(args, store?)` reads its provisioned long-lived secret kinds (service keys, callout\naccount, issuer keys, owner secret) through the injected `SecretStore`; a host provisions those into\nthe store first. It is a **signer and identity authority**, not a scoped daemon: at runtime it holds\nthe data-account and callout-account signing seeds, the issuer\'s private JWKs, and the\nowner-derivation secret in process memory (`SecretStore.get` exports raw values). The IdP pin and the\nactor ledger are **not** store-injected: `runAuthService` resolves them under\n`userAuthStateDir(findCotalRoot(), space)`, a path relative to the process working directory, so a\nhost provisions those into that exact directory (neither `store` nor `COTAL_HOME` selects it). It\nalso writes an ephemeral `auth-service.json` discovery file there that carries the live exchange\ncapability.\n\n```ts\nimport { runAuthService } from "@cotal-ai/auth";\n// store implements SecretStore over your secret backend; get() returns raw seeds into memory.\n// Provision the auth secret kinds into the store, AND the IdP pin + actor ledger under\n// userAuthStateDir(findCotalRoot(), space), before this call.\nawait runAuthService(\n { values: { space, server: brokerUrl, port: "8081" }, positionals: [], raw: [] },\n store,\n);\n```\n\n### delivery\n\n`runDelivery(args, store?)` runs from a **pre-minted scoped `delivery` cred** and never loads the\nsigner. Provide the cred either through the injected store (under `DELIVERY_CREDS_KEY`) or with a\n`--creds` file; the two are mutually exclusive. The daemon re-fetches the cred from the store at 75%\nof its JWT lifetime and fails loud rather than riding to expiry, so **something must re-sign a fresh\ncred into that same store**.\n\n```ts\nimport { runDelivery } from "@cotal-ai/delivery";\nawait runDelivery({ values: { space, server: brokerUrl }, positionals: [], raw: [] }, store);\n```\n\nThat renewal is a **signer** operation, not the delivery daemon\'s: `remintDaemonCreds(root, store)`\n(`@cotal-ai/workspace`) raw-loads the full `SpaceAuth` signer from `root/.cotal/auth/auth.json` and\nre-signs the daemon creds (`delivery.creds` and the membership feed\'s `membership-rw.creds`) into\n`store` (the injected `store` is only the destination, not signer custody). The reference `Manager`\nruns it on a schedule against its **own** `secretStore` (see below), so passing the manager and the\ndelivery daemon the *same* store closes the renewal loop end-to-end on an injected backend: the\nmanager re-signs into the store the daemon reads, and the daemon adopts each generation on a\npreflight-proven 75% timer. It never throws: it returns per-file results (`skipped: "no-auth"` when no\nfilesystem signer is present), so the caller must check them or the cred still rides to expiry; a\nmalformed `auth.json` does still throw from that initial signer load. A composition whose signer is\nnot filesystem-resident builds its own renewal from `identityFromCreds` + `mintCreds` instead, and a\n`--creds` file path must be replaced atomically before the 75% read. The remaining hosted gap is\nsigner **custody** (the manager still raw-loads `auth.json`), not the store seam.\n\n### The supervisor is a signer, not a scoped daemon\n\n`@cotal-ai/manager` exports the `Manager` class; there is **no** `runSupervise(opts)` runner. The\nprivate CLI `runManager` also does broker-reachability checks, space/default resolution,\nroster/launch parsing and materialization, installed-extension resolution, signal handling, staged\npre-spawn, and the forever wait. A host composes that lifecycle itself around `Manager`:\n\n```ts\nimport { Manager } from "@cotal-ai/manager";\nconst mgr = new Manager({ space, servers: brokerUrl, workspaceRoot });\nawait mgr.start(); // then wire your own SIGINT/SIGTERM -> mgr.stop()\n```\n\nUnlike delivery, the manager is **not** a pre-minted-scoped-cred daemon (auth-service is also a\nsigner: it holds fewer artifacts than the full trust bundle, but its data-account signing seed still\ngrants complete data-account mint authority on compromise, so this is not least-privilege). On `start()` the manager loads the full\nspace trust bundle (`.cotal/auth/auth.json`) from `workspaceRoot` and **self-mints** its supervisor\ncred and renewals from the data-account signing seed. In static mode it also mints every per-agent\ncred from that seed; in user mode agents instead receive callout-minted bearers, but the manager\nstill holds the signing seed for its own creds and renewal. So a hosted supervisor is a **trusted\nper-tenant account-signer process**, not a least-privilege connect client. It additionally requires a\n`~/.cotal/meshes/<space>.json` registry record and the workspace user-auth marker to start in user\nmode. `ManagerOptions.secretStore` injects the one `SecretStore` the manager reads/writes every secret\nthrough \u2014 its daemon-cred renewal (`remintDaemonCreds`) and its per-agent secret sites \u2014 defaulting to\nthe workspace filesystem store; pass the delivery daemon the *same* store for end-to-end hosted\nrenewal. What is still **not** injectable is the signer itself (the data-account seed the manager mints\nfrom); the other knobs are `workspaceRoot` and the process-global `COTAL_HOME`.\n\n**Isolating the signer is an OS-sandbox problem, not a file-permission one.** The default pty runtime\nruns agent children under the *same* OS uid and the *same* `workspaceRoot`, so mode-0600 on\n`auth.json` does not stop a hostile same-uid agent from reading its absolute path. The reference\n[deploy](deploy.md) tree does not solve this: it mounts the signer into the agent\'s own container, so\nits phase-1 boundary isolates agents from each other, not the signer from the agent. A hosted\ncomposition must run the manager/minter that holds the signer in a different uid, container, or mount\nnamespace from the agent children, which mount no signer at all; that split is future\nhosted-composition work, so until it (or a remote/injected minter) exists, do not run untrusted\nagents under this manager.\n\n## Provisioning a space (one-space reference shape)\n\n```ts\nimport { createSpaceAuth, setupSpaceStreams, ensureDefaultDeliveryClass, mintCreds, newIdentity } from "@cotal-ai/core";\nconst auth = await createSpaceAuth(space); // trust bundle (in-memory seeds)\nconst provisionerCreds = await mintCreds(auth, newIdentity(), "provisioner");\nawait setupSpaceStreams({ servers: brokerUrl, space, creds: provisionerCreds });\n// SPEC section 4: write the default delivery class at space creation so it is wire-discoverable,\n// never inferred from the resolution fallback. A daemon-backed space is "durable".\nawait ensureDefaultDeliveryClass({ servers: brokerUrl, space, creds: provisionerCreds, deliveryClass: "durable" });\nconst deliveryCreds = await mintCreds(auth, newIdentity(), "delivery");\n// put deliveryCreds into your SecretStore under DELIVERY_CREDS_KEY before booting delivery.\n```\n\nRendering the broker config for a user-auth space is `serverConfig(auth, { storeDir, extraAccounts })`,\nwhere `extraAccounts` must include the callout account from `createCalloutAuth` so the auth-service has\na broker account to answer on. That account never shares the data account.\n\n`createSpaceAuth` mints one operator + system + data account **per call**, and `serverConfig`\nrenders **one** operator. That is the single-space reference shape. Running many spaces (tenants)\nunder one shared broker operator is a different provisioning shape that the current exports do not\nyet cover; see [Known gaps](#known-gaps-not-hosted-composable-yet).\n\n## Hazardous provisioning primitives\n\n`mintCreds`, the full `Profile`/`CredentialKind` matrix, `createSpaceAuth`, and `stripSpaceAuth` are\nlow-level operator primitives. Handle them as account-authority material:\n\n- A holder of a `SpaceAuth` (or a `stripSpaceAuth` bundle, which **keeps** the data signing seed) is\n a fully-trusted tenant-account authority: it can mint `admin`, `provisioner`, and destructive\n profiles, not merely `supervisor`, and mint a DM-reading identity. `createSpaceAuth`\'s full result\n holds operator, system, and account seeds in memory.\n- Choose `profile` and `MintOpts` from **server-side constants**, never from tenant input. `MintOpts`\n can widen the bounded TTL defaults; cap it at your boundary. `CREDENTIAL_LIFETIMES` is a policy\n record, not an authorization boundary.\n- Never log signer material or export it into env. Do not co-locate signer access with an untrusted\n connector/runtime process at the same OS uid (file permissions do not contain a same-uid reader;\n see the manager\'s isolation note). Segregate per tenant; rotate on compromise\n (`rotateDataAccountSigningKey`).\n\n## Known gaps: not hosted-composable yet\n\nThe primitives above are present as exports, but three capabilities are **not** cleanly composable\nfrom the public contract today. Each is tied to work in flight; a host either waits for the seam or\nscopes the capability out. None is a wire concern.\n\n1. **Delivery immediate live eviction and a fully-hosted membership feed.** The renewable\n `membership-rw.creds` is now a `SecretStore` kind \u2014 `startMembership` reads it through the injected\n store and the manager re-signs it there, so the graph feed\'s writer renews end-to-end on a hosted\n backend (its data connection adopts each generation on a preflight-proven 75% timer). What still\n reads from a fixed on-disk path are the *static* `membership-observer.creds` and\n `connection-evictor.creds` ($SYS creds, mintable only at `up`) and `membership.json`\n (`{accountId}`, non-secret config); those, plus the private provisioning wrapper, keep immediate\n live eviction and a fully-hosted feed a partial gap. Missing files degrade membership to\n traffic-only and make live eviction refuse (loudly). The supported delivery contract here is the\n Plane-3 durable backstop.\n2. **Supervisor signer custody.** The store side has landed: `ManagerOptions.secretStore` injects the\n one `SecretStore` the manager reads/writes every secret through (its daemon-cred renewal and its\n per-agent kinds). What remains is the *signer* \u2014 the manager still raw-loads the `SpaceAuth` bundle\n from `workspaceRoot`, so a hosted supervisor is still a filesystem-resident per-tenant account-signer\n process plus mesh-registry record.\n3. **Many spaces per broker.** No published "add a tenant account under one shared operator" API;\n the exports compose the one-space reference shape. This is the multi-space operator layer.\n4. **A non-Better-Auth production IdP.** The exchange core (`createIdpBridge`) is EdDSA-generic, but\n the stock provider and login client are Better-Auth-endpoint-shaped, `cotalAuthProvider`\n self-registers on import (colliding with a host-owned provider under `resolveAuthProvider`), and\n the login flow speaks Better Auth\'s device-code endpoints. A different IdP is a host-built auth\n composition on the low-level primitives, not a configuration change (see\n [the IdP callout contract](identity-and-auth.md#the-idp-callout-contract)).\n\n## Durable state: the hosted boundary\n\nSpace-durable **coordination** state (chat/DM/task history, live presence, membership runtime, the\ndurable ACL registry, leases) lives in **JetStream**, written by the delivery daemon and the\nendpoints. It is broker-resident and needs no host-side durable path.\n\nWhat is **not** in JetStream, and is hosting-critical, is trust and authorization state a host must\nplace and keep:\n\n| state | class | where today | hosted injection |\n|---|---|---|---|\n| full `SpaceAuth` bundle (`.cotal/auth/auth.json`) | signing authority | workspace filesystem | none (the manager reads it raw; no SecretStore seam) |\n| auth kinds: callout account/creds/xkey, issuer private keys, owner-derivation secret, data-signer projection | signing/identity authority | four `SecretStore` kinds | `SecretStore` (auth-service) |\n| `delivery.creds` | standing scoped cred | `SecretStore` or `--creds` | `SecretStore` (delivery) |\n| actor ledger, IdP pin | authorization + trust config | ambient `userAuthStateDir(findCotalRoot(), space)` | none (root-relative; not `store`/`COTAL_HOME`) |\n| `membership-rw.creds` | standing scoped cred | `SecretStore` | `SecretStore` (delivery + manager renewal) |\n| membership-observer / connection-evictor creds + `membership.json` | scoped $SYS creds / config | workspace filesystem | none (see gap 1) |\n| manager agent creds, actor tokens, sentinel creds | lifecycle authority | `SecretStore` | `SecretStore` (manager `secretStore`) |\n| `~/.cotal/meshes/<space>.json` record (holds IdP trust pins/root pointers) | non-secret, integrity-critical | machine home | process-global `COTAL_HOME` only |\n| auth-health, renewal records | non-secret diagnostics | workspace filesystem | `workspaceRoot` |\n\nThe `SpaceAuth` bundle and the auth-service store kinds are **separate** identities/projections, not\nparts of one `auth.json`. `auth-service.json` (the live exchange capability) is ephemeral runtime\nstate, not durable, but is sensitive while the daemon runs. `@cotal-ai/workspace` is machine-local\noperator tooling by design; personas, PID files, and the `current-mesh` pointer are truly local and\nmust **not** sit on a hosted durable path. Everything classed above as an authority is what a hosted\ncomposition must provision and persist, today only partly through the `SecretStore` seam and\notherwise through ambient `workspaceRoot`/cwd paths.\n\n## See also\n\n- [Substrate stability](stability.md): what v0.3 and the 0.x packages guarantee, and the projected v0.4 break.\n- [Identity and auth](identity-and-auth.md): the profile matrix, the signer, and the IdP callout contract.\n- [Delivery daemon](delivery-daemon.md): the Plane-3 durable backstop.\n- [Deploy](deploy.md): the reference container against an external broker.\n'
280
+ "body": '# Embedding Cotal: build a host on the published packages\n\n> **Guide** (informative) \xB7 **For:** implementers building a service on top of Cotal \xB7 **Prereqs:** [Architecture](architecture.md), [Identity and auth](identity-and-auth.md), [Delivery daemon](delivery-daemon.md)\n\nThe `cotal` binary in this repo is one composition root: an operator CLI. A separate service\n(for example a hosted, multi-tenant Cotal) does not fork this repo. It writes its **own**\ncomposition root that depends on the published `@cotal-ai/*` packages and imports the surfaces it\nwants, exactly as `bin/cotal.ts` does. This page is the contract for that: what is a real library\nexport you can build against, how to boot the server-side daemons from those exports, and where the\ncurrent export surface stops short of a fully hosted composition.\n\nThis is the "guarded substrate" boundary in practice. Nothing here reveals or assumes a specific\nhost; it documents the public seams any embedder composes.\n\n## What you embed\n\nThe supported reference shape here is **one broker operator serving one space** (one tenant: a\ndedicated data account, under an operator that also holds the system account and a quarantined\nauth-callout account) plus three standalone processes. The trust layer itself composes many spaces\nunder one broker operator today (`createBrokerAuth` + `createSpaceAccountAuth` + N-space\n`serverConfig`); what does not exist yet is the per-space **lifecycle** on a shared broker (see\n[Known gaps](#known-gaps-not-hosted-composable-yet)). The three processes:\n\n| daemon | package | what it is |\n|---|---|---|\n| auth-service | `@cotal-ai/auth` | the NATS auth callout, the IdP token exchange, and JWKS. Plane 1 to Plane 2. |\n| delivery | `@cotal-ai/delivery` | the Plane-3 durable backstop: fan-out writer plus trusted reader, per space. |\n| supervise | `@cotal-ai/manager` | the per-machine agent lifecycle (spawn/despawn/attach), per space. |\n\n`mint`, `deliver`, and `auth-service` expose their behavior as direct library primitives, and the\nsupported one-space bootstrap below re-composes from exported low-level primitives. `supervise` and\nthe full `up` orchestration are **not** public runners: `up` also does broker bring-up, restore,\nprocess and registry management, and lifecycle work, and `supervise`\'s orchestration is private (see\n[The supervisor is a signer, not a scoped daemon](#the-supervisor-is-a-signer-not-a-scoped-daemon)).\n\n## The export surface\n\nEverything below is a real export of a published package, reachable from the package root (each\npackage publishes only `.` via `dist/index.{js,d.ts}` and ships `files: ["dist"]`). Type-only names\nare marked; import them with `import type`.\n\n**Daemon runners and lifecycle**\n\n| symbol | package | purpose |\n|---|---|---|\n| `runAuthService(args, store?)` | `@cotal-ai/auth` | boot the auth-service daemon; `store` injects the secret material. |\n| `runDelivery(args, store?)` | `@cotal-ai/delivery` | boot the delivery daemon; `store` injects the scoped `delivery` cred. |\n| `DELIVERY_CREDS_KEY`, `MEMBERSHIP_RW_CREDS_KEY` | `@cotal-ai/workspace` | the secret-store keys the delivery cred and the membership feed\'s rw cred are read/re-signed under. |\n| `Manager`, `ManagerOptions` *(type)* | `@cotal-ai/manager` | construct and run a supervisor in-process; `ManagerOptions.secretStore` injects the one store it reads/writes every secret through. |\n| `createRuntime`, `Runtime` *(type)* | `@cotal-ai/manager` | resolve the spawn backend (pty built in). |\n\n**Provisioning and minting** (all `@cotal-ai/core`)\n\n| symbol | purpose |\n|---|---|\n| `createBrokerAuth(label)` | mint BROKER trust: the operator and system account one nats-server trusts. One per broker, shared by every space on it. |\n| `createSpaceAccountAuth(broker, space)` | mint one space\'s own data account, signed by that broker\'s operator \u2014 the add-a-tenant primitive. |\n| `createSpaceAuth(space)` | the one-space convenience: broker trust + one account in a single composed bundle. |\n| `setupSpaceStreams({ servers, space, creds })` | create the space\'s JetStream streams. |\n| `ensureDefaultDeliveryClass({ servers, space, creds?, deliveryClass })` | write the space\'s default delivery class at creation so it is wire-discoverable (SPEC section 4). |\n| `serverConfig(broker, spaces, { storeDir, extraAccounts?, port?, host? })` | render the broker config: one operator, N space accounts. `storeDir` is required and `extraAccounts` preloads the auth-callout account. |\n| `mintCreds(auth, identity, profile, opts?)` | mint a scoped cred for any `Profile`. |\n| `mintMembershipObserverCreds`, `mintConnectionEvictorCreds` | mint the membership/eviction scoped creds. |\n| `provisionAgent`, `provisionAgentDurables` | create a principal\'s bind-only durables. |\n| `newIdentity`, `stripSpaceAuth` | a fresh nkey identity; a stripped signer bundle (data signing seed only). |\n| `Profile`, `CredentialKind`, `MintOpts`, `SpaceAuth` *(types)*, `CREDENTIAL_LIFETIMES` | the profile matrix and cred lifetime policy. |\n\n**Auth building blocks** (all `@cotal-ai/auth`)\n\n| symbol | purpose |\n|---|---|\n| `createCalloutAuth`, `startAuthCallout` | the NATS auth-callout responder. |\n| `createUserTokenIssuer`, `pinnedJwksResolver` | mint and verify the Cotal user bearer. |\n| `createIdpBridge` | exchange a verified IdP JWT for a Cotal bearer (see [the callout contract](identity-and-auth.md#the-idp-callout-contract)). |\n| `deriveOwnerToken`, `validateUserToken` | owner derivation; strict bearer validation. |\n| `cotalAuthProvider` | the self-registering `auth-provider` extension. |\n| `ensureCalloutAuth`/`loadCalloutAuth`, `ensureIssuer`/`loadIssuer`, `ensureOwnerSecret`/`loadOwnerSecret` | read/write the auth secret kinds through a `SecretStore`. |\n\n**Seams and the wire** (all `@cotal-ai/core` unless noted)\n\n| symbol | purpose |\n|---|---|\n| `SecretStore` *(type)* | the durable hosted-secret seam (get/put/delete); `get()` returns raw seeds/keys into process memory, so it is a blob seam, not HSM/KMS signing. |\n| `FsSecretStore`, `workspaceSecretStore(root)` | the filesystem default. **These live in `@cotal-ai/workspace`, not core.** |\n| `AuthProvider` *(type)*, `Connector` *(type)*, `Runtime` *(type)*, `Command` *(type)* | the extension contracts; implementations self-register on import. |\n| `registry` | the shared registry a composition root pulls surfaces into. |\n| `CotalEndpoint`, subjects, message types | the wire client and shapes. |\n| `ParsedArgs` *(type)* | the shape the daemon runners take (see below). |\n\nThe runners take a CLI-shaped `ParsedArgs`, not a typed options object, so a host fabricates one:\n\n```ts\nconst args: ParsedArgs = { values: { space, server, port: "0" }, positionals: [], raw: [] };\n```\n\n## Booting the daemons\n\n### auth-service\n\n`runAuthService(args, store?)` reads its provisioned long-lived secret kinds (service keys, callout\naccount, issuer keys, owner secret) through the injected `SecretStore`; a host provisions those into\nthe store first. It is a **signer and identity authority**, not a scoped daemon: at runtime it holds\nthe data-account and callout-account signing seeds, the issuer\'s private JWKs, and the\nowner-derivation secret in process memory (`SecretStore.get` exports raw values). The IdP pin and the\nactor ledger are **not** store-injected: `runAuthService` resolves them under\n`userAuthStateDir(findCotalRoot(), space)`, a path relative to the process working directory, so a\nhost provisions those into that exact directory (neither `store` nor `COTAL_HOME` selects it). It\nalso writes an ephemeral `auth-service.json` discovery file there that carries the live exchange\ncapability.\n\n```ts\nimport { runAuthService } from "@cotal-ai/auth";\n// store implements SecretStore over your secret backend; get() returns raw seeds into memory.\n// Provision the auth secret kinds into the store, AND the IdP pin + actor ledger under\n// userAuthStateDir(findCotalRoot(), space), before this call.\nawait runAuthService(\n { values: { space, server: brokerUrl, port: "8081" }, positionals: [], raw: [] },\n store,\n);\n```\n\n### delivery\n\n`runDelivery(args, store?)` runs from a **pre-minted scoped `delivery` cred** and never loads the\nsigner. Provide the cred either through the injected store (under `DELIVERY_CREDS_KEY`) or with a\n`--creds` file; the two are mutually exclusive. The daemon re-fetches the cred from the store at 75%\nof its JWT lifetime and fails loud rather than riding to expiry, so **something must re-sign a fresh\ncred into that same store**.\n\n```ts\nimport { runDelivery } from "@cotal-ai/delivery";\nawait runDelivery({ values: { space, server: brokerUrl }, positionals: [], raw: [] }, store);\n```\n\nThat renewal is a **signer** operation, not the delivery daemon\'s:\n`remintDaemonCreds(root, space, store?, { preflight? })` (`@cotal-ai/workspace`) reads the `SpaceAuth`\nsigner **through the same resolved `store`** (`getSpaceAuth(store ?? workspaceSecretStore(root), space)`,\nkeys `auth/broker.json` + `auth/account.<key>.json`; the pre-split `auth/auth.json` monolith is\nmigration input and the container signer mount only) and re-signs the daemon creds (`delivery.creds` and the membership feed\'s\n`membership-rw.creds`) back into that store \u2014 so the injected `store` is BOTH the signer source AND the\ncred destination, never a split. `space` is **required** and validated against the store\'s signer, so a\nstore swapped to a different space cannot re-sign over the wrong broker\'s creds. `preflight` \u2014 a "does\nthe broker accept this cred" proof the caller owns (the reference `Manager` passes a `probeConnect` over\nits `servers`) \u2014 gates **every** candidate before it overwrites the last-good, whether the signer is a\nfull bundle or a stripped projection: a bundle\'s JWT chain proves only that it is self-consistent and\nnamed the space, NOT that its account is the broker\'s *current* account for that space (two\n`createSpaceAuth(space)` calls yield same-named, different-account chains), so a same-label alternate\nsigner would otherwise mint a broker-dead cred and clobber the good one. Without a preflight \u2014 the\noffline local repair (`doctor auth --fix`) \u2014 the overwrite is allowed only under **authority\ncontinuity**: the candidate must be signed by the same account signing key (`iss`) as the current\n(already broker-accepted) cred. A same-label alternate account breaks continuity and is refused, full or\nstripped; a legitimate local re-sign is continuous and proceeds without a network. The reference\n`Manager` runs it on a schedule against its **own**\n`secretStore` (see below), so passing the manager and the delivery daemon the *same* store closes the\nrenewal loop end-to-end on an injected backend: the manager reads the signer from the store, re-signs\ninto it, and the daemon adopts each generation on a preflight-proven 75% timer. It never throws: it\nreturns per-file results (`skipped: "no-auth"` when the store holds no signer records),\nso the caller must check them or the cred still rides to expiry. A composition whose signer lives in\nKMS/Vault simply injects that store \u2014 no bespoke renewal needed \u2014 and a `--creds` file path must be\nreplaced atomically before the 75% read. The remaining hosted gap is no\nlonger signer custody (the signer IS injectable behind the store seam); it is signer **isolation** \u2014\nthe seed is still decrypted in-process at the manager\'s uid (an OS-sandbox / remote-signer concern).\n\n### The supervisor is a signer, not a scoped daemon\n\n`@cotal-ai/manager` exports the `Manager` class; there is **no** `runSupervise(opts)` runner. The\nprivate CLI `runManager` also does broker-reachability checks, space/default resolution,\nroster/launch parsing and materialization, installed-extension resolution, signal handling, staged\npre-spawn, and the forever wait. A host composes that lifecycle itself around `Manager`:\n\n```ts\nimport { Manager } from "@cotal-ai/manager";\nconst mgr = new Manager({ space, servers: brokerUrl, workspaceRoot });\nawait mgr.start(); // then wire your own SIGINT/SIGTERM -> mgr.stop()\n```\n\nUnlike delivery, the manager is **not** a pre-minted-scoped-cred daemon (auth-service is also a\nsigner: it holds fewer artifacts than the full trust bundle, but its data-account signing seed still\ngrants complete data-account mint authority on compromise, so this is not least-privilege). On `start()`\nthe manager reads its space\'s full trust chain **through its `secretStore`** (`getSpaceAuth(this.secrets,\nthis.space)`, composed from `auth/broker.json` + `auth/account.<key>.json`; a container may instead\nmount a stripped signer bundle at the legacy `auth/auth.json` key) and **self-mints** its supervisor cred and renewals from the\ndata-account signing seed. In static mode it also mints every per-agent cred from that seed; in user\nmode agents instead receive callout-minted bearers, but the manager still holds the signing seed for\nits own creds and renewal. So a hosted supervisor is a **trusted per-tenant account-signer process**,\nnot a least-privilege connect client. It additionally requires a `~/.cotal/meshes/space.<key>.json`\nregistry record and the workspace user-auth marker to start in user mode. `ManagerOptions.secretStore`\ninjects the one `SecretStore` the manager reads/writes every secret through \u2014 **the signer itself\n(the split trust records)**, its daemon-cred renewal (`remintDaemonCreds`), and its per-agent secret sites \u2014\ndefaulting to the workspace filesystem store; pass the delivery daemon the *same* store for end-to-end\nhosted renewal. The signer IS now injectable: a hosted composition injects a KMS/Vault store and no\nsigning seed lands on the hosted disk. What remains is signer **isolation** (the seed is decrypted\nin-process at the manager\'s uid \u2014 an OS-sandbox / remote-signer problem, below), not custody. The other\nknobs are `workspaceRoot` and the process-global `COTAL_HOME`.\n\n> Scope note: the **static-auth** operator paths (`cotal spawn`/`join`/`status`/`web`, via\n> `mesh-target` \u2192 `connect`/`preflight`) still read the signer from the local split records (sync\n> `loadSpaceAuth`). That is the single-machine composition, where the signer is on local disk by the\n> static-auth model; multi-tenant hosting runs **user mode**, which never mints from on-disk trust. The\n> store-injectable signer path is the hosted-server set: the manager, `remintDaemonCreds`, and delivery.\n\n**Isolating the signer is an OS-sandbox problem, not a file-permission one.** The default pty runtime\nruns agent children under the *same* OS uid and the *same* `workspaceRoot`, so mode-0600 on\nthe trust records does not stop a hostile same-uid agent from reading their absolute paths. The reference\n[deploy](deploy.md) tree does not solve this: it mounts the signer into the agent\'s own container, so\nits phase-1 boundary isolates agents from each other, not the signer from the agent. A hosted\ncomposition must run the manager/minter that holds the signer in a different uid, container, or mount\nnamespace from the agent children, which mount no signer at all; that split is future\nhosted-composition work, so until it (or a remote/injected minter) exists, do not run untrusted\nagents under this manager.\n\n## Provisioning a space (one-space reference shape)\n\n```ts\nimport { createSpaceAuth, setupSpaceStreams, ensureDefaultDeliveryClass, mintCreds, newIdentity } from "@cotal-ai/core";\nconst auth = await createSpaceAuth(space); // trust bundle (in-memory seeds)\nconst provisionerCreds = await mintCreds(auth, newIdentity(), "provisioner");\nawait setupSpaceStreams({ servers: brokerUrl, space, creds: provisionerCreds });\n// SPEC section 4: write the default delivery class at space creation so it is wire-discoverable,\n// never inferred from the resolution fallback. A daemon-backed space is "durable".\nawait ensureDefaultDeliveryClass({ servers: brokerUrl, space, creds: provisionerCreds, deliveryClass: "durable" });\nconst deliveryCreds = await mintCreds(auth, newIdentity(), "delivery");\n// put deliveryCreds into your SecretStore under DELIVERY_CREDS_KEY before booting delivery.\n```\n\nRendering the broker config for a user-auth space is `serverConfig(broker, spaces, { storeDir,\nextraAccounts })`, where `extraAccounts` must include the callout account from `createCalloutAuth` so\nthe auth-service has a broker account to answer on. That account never shares the data account.\n\nBroker trust and space accounts are separate authorities: `createBrokerAuth` mints the one\noperator + system account a broker trusts, `createSpaceAccountAuth(broker, space)` signs each\ntenant\'s data account under it, and `serverConfig(broker, spaces, opts)` renders them all into one\nconfig. A host composition can therefore provision several spaces on one broker today. The `cotal`\nCLI itself still orchestrates one space per root (its `up`/`down` lifecycle refuses broker-wide\noperations on a multi-space root rather than scoping them); the per-space lifecycle is the\nremaining multi-space operator layer \u2014 see\n[Known gaps](#known-gaps-not-hosted-composable-yet).\n\n## Hazardous provisioning primitives\n\n`mintCreds`, the full `Profile`/`CredentialKind` matrix, `createSpaceAuth`, and `stripSpaceAuth` are\nlow-level operator primitives. Handle them as account-authority material:\n\n- A holder of a `SpaceAuth` (or a `stripSpaceAuth` bundle, which **keeps** the data signing seed) is\n a fully-trusted tenant-account authority: it can mint `admin`, `provisioner`, and destructive\n profiles, not merely `supervisor`, and mint a DM-reading identity. `createSpaceAuth`\'s full result\n holds operator, system, and account seeds in memory.\n- Choose `profile` and `MintOpts` from **server-side constants**, never from tenant input. `MintOpts`\n can widen the bounded TTL defaults; cap it at your boundary. `CREDENTIAL_LIFETIMES` is a policy\n record, not an authorization boundary.\n- Never log signer material or export it into env. Do not co-locate signer access with an untrusted\n connector/runtime process at the same OS uid (file permissions do not contain a same-uid reader;\n see the manager\'s isolation note). Segregate per tenant; rotate on compromise\n (`rotateDataAccountSigningKey`).\n\n## Known gaps: not hosted-composable yet\n\nThe primitives above are present as exports, but three capabilities are **not** cleanly composable\nfrom the public contract today. Each is tied to work in flight; a host either waits for the seam or\nscopes the capability out. None is a wire concern.\n\n1. **Delivery immediate live eviction and a fully-hosted membership feed.** The renewable\n `membership-rw.creds` is now a `SecretStore` kind \u2014 `startMembership` reads it through the injected\n store and the manager re-signs it there, so the graph feed\'s writer renews end-to-end on a hosted\n backend (its data connection adopts each generation on a preflight-proven 75% timer). What still\n reads from a fixed on-disk path are the *static* `membership-observer.creds` and\n `connection-evictor.creds` ($SYS creds, mintable only at `up`) and `membership.json`\n (`{accountId}`, non-secret config); those, plus the private provisioning wrapper, keep immediate\n live eviction and a fully-hosted feed a partial gap. Missing files degrade membership to\n traffic-only and make live eviction refuse (loudly). The supported delivery contract here is the\n Plane-3 durable backstop.\n2. **Supervisor signer isolation.** `ManagerOptions.secretStore` now injects the one `SecretStore` the\n manager reads/writes every secret through, including the composed `SpaceAuth`\n signer (the split trust records), its daemon-cred renewal, and its per-agent kinds. What remains is process\n isolation: the manager still decrypts the signer in-process at its uid, so untrusted agent children\n must run under a different uid/container/mount namespace or behind a future remote signer.\n3. **Per-space lifecycle on a shared broker.** The trust layer is multi-space\n (`createBrokerAuth` + `createSpaceAccountAuth` + N-space `serverConfig`, persisted as\n `broker.json` + `account.<key>.json`), but there is no per-space teardown/backup/restore:\n the CLI\'s broker-wide lifecycle verbs refuse on a multi-space root, naming the tenants.\n This is the remaining multi-space operator layer.\n4. **A non-Better-Auth production IdP.** The exchange core (`createIdpBridge`) is EdDSA-generic, but\n the stock provider and login client are Better-Auth-endpoint-shaped, `cotalAuthProvider`\n self-registers on import (colliding with a host-owned provider under `resolveAuthProvider`), and\n the login flow speaks Better Auth\'s device-code endpoints. A different IdP is a host-built auth\n composition on the low-level primitives, not a configuration change (see\n [the IdP callout contract](identity-and-auth.md#the-idp-callout-contract)).\n\n## Durable state: the hosted boundary\n\nSpace-durable **coordination** state (chat/DM/task history, live presence, membership runtime, the\ndurable ACL registry, leases) lives in **JetStream**, written by the delivery daemon and the\nendpoints. It is broker-resident and needs no host-side durable path.\n\nWhat is **not** in JetStream, and is hosting-critical, is trust and authorization state a host must\nplace and keep:\n\n| state | class | where today | hosted injection |\n|---|---|---|---|\n| full `SpaceAuth` trust chain (`auth/broker.json` + `auth/account.<key>.json`, composed; a stripped signer bundle may instead be mounted at the legacy `auth/auth.json` key) | signing authority | `SecretStore` | `SecretStore` (manager + renewal) |\n| auth kinds: callout account/creds/xkey, issuer private keys, owner-derivation secret, data-signer projection | signing/identity authority | four `SecretStore` kinds | `SecretStore` (auth-service) |\n| `delivery.creds` | standing scoped cred | `SecretStore` or `--creds` | `SecretStore` (delivery) |\n| actor ledger, IdP pin | authorization + trust config | ambient `userAuthStateDir(findCotalRoot(), space)` | none (root-relative; not `store`/`COTAL_HOME`) |\n| `membership-rw.creds` | standing scoped cred | `SecretStore` | `SecretStore` (delivery + manager renewal) |\n| membership-observer / connection-evictor creds + `membership.json` | scoped $SYS creds / config | workspace filesystem | none (see gap 1) |\n| manager agent creds, actor tokens, sentinel creds | lifecycle authority | `SecretStore` | `SecretStore` (manager `secretStore`) |\n| `~/.cotal/meshes/space.<key>.json` record (holds IdP trust pins/root pointers) | non-secret, integrity-critical | machine home | process-global `COTAL_HOME` only |\n| auth-health, renewal records | non-secret diagnostics | workspace filesystem | `workspaceRoot` |\n\nThe `SpaceAuth` trust chain and the auth-service store kinds are **separate** identities/projections,\nnever parts of one document. `auth-service.json` (the live exchange capability) is ephemeral runtime\nstate, not durable, but is sensitive while the daemon runs. `@cotal-ai/workspace` is machine-local\noperator tooling by design; personas, PID files, and the `current-mesh` pointer are truly local and\nmust **not** sit on a hosted durable path. Everything classed above as an authority is what a hosted\ncomposition must provision and persist: signer-bearing server secrets now have `SecretStore` seams;\nthe remaining non-injectable rows are the explicit ambient `workspaceRoot`/cwd paths above.\n\n## See also\n\n- [Substrate stability](stability.md): what v0.3 and the 0.x packages guarantee, and the projected v0.4 break.\n- [Identity and auth](identity-and-auth.md): the profile matrix, the signer, and the IdP callout contract.\n- [Delivery daemon](delivery-daemon.md): the Plane-3 durable backstop.\n- [Deploy](deploy.md): the reference container against an external broker.\n'
281
281
  },
282
282
  {
283
283
  "slug": "examples",
@@ -326,14 +326,14 @@ var DOCS_BUNDLE = {
326
326
  "title": "Roadmap",
327
327
  "kind": "Project (non-normative)",
328
328
  "summary": "Cotal is pre-1.0. The wire contract (v0.x) may still change under the change process. This page tracks what is deliberately not built yet, and the direction each area is headed.",
329
- "body": "# Roadmap\n\n> **Project** (non-normative) \xB7 Direction and deferred designs; nothing here is shipped\n> behavior unless a linked page says so. The shipped contract is the [spec](../SPEC.md).\n\nCotal is pre-1.0. The wire contract (v0.x) may still change under the\n[change process](../SPEC.md#11-versioning-and-extensibility). This page tracks what is\ndeliberately *not* built yet, and the direction each area is headed.\n\n## Where we are\n\nThe core is running today: all three delivery modes over JetStream, presence and\ndiscovery, channel replay and durable delivery classes, JWT identity and per-agent ACLs on\nby default, a supervising manager with pluggable runtimes, connectors for Claude Code,\nOpenCode, Hermes, and pi, the mesh manifest (`cotal.yaml`), and the console + web observers.\nThe [Quickstart](getting-started.md) is the fastest proof.\n\n## Deferred, designed-for\n\nThese have a reserved shape in the spec or the architecture, and are intentionally not\nbuilt yet.\n\n| Area | Direction |\n|---|---|\n| **Signed envelopes + DID identity** | Non-repudiation: authenticity that survives an untrusted relay or federation hop, not just a single trusted broker. Instance ids are shaped to become `did:key`. ([SPEC \xA711](../SPEC.md#11-versioning-and-extensibility)) |\n| **Auth-callout onboarding** | Shipped for per-user-auth spaces: the auth service mints scoped creds *at connect* from the data-account signing key, which a running manager also holds ([identity & auth](identity-and-auth.md)). Remaining: the join-link bootstrap-token variant for static meshes. |\n| **Credential revocation / TTL** | User-auth spaces have it (short bearers, ledger revocation, live-connection eviction); command and daemon creds are bounded and renewed everywhere. Remaining: TTL on static *agent* creds, where despawn still cuts the session, not the credential, and signing-key rotation is the only per-cred revocation. ([Security model](security.md)) |\n| **Sessions + moderator** | Managed group membership (admit/remove). Channels today carry no roster of their own. |\n| **Artifact delivery** | Large payloads move to a per-space JetStream Object Store; the message carries a reference part. Part shape reserved, transfer not built. ([SPEC \xA75](../SPEC.md#5-envelopes)) |\n| **Instant offline (`$SYS`)** | Manager-observed disconnect events for immediate `offline`, instead of waiting out the presence heartbeat window. The heartbeat sweep stays the floor. |\n| **Host mode (Agent SDK)** | Headless sessions with true mid-turn interrupt, observed via the plain stream instead of a native TUI. Documented upgrade path from attach mode. |\n| **Multi-space brokers** | Today one broker serves one authenticated space. Agents in many spaces, and many spaces per broker, are planned; nothing should hardcode the 1:1. |\n| **Strict metadata containment** | Chat *content* reads are ACL-bounded today; stream metadata (channel names, per-subject counts) still leaks to in-space agents. Hiding it needs the channel-major stream model. ([SPEC \xA79](../SPEC.md#9-nats--jetstream-security-and-authorization)) |\n\n## Connecting spaces (federation)\n\nThe rule: **never merge trust roots.** The staged path, from\n[spaces & channels](spaces.md):\n\n- **v0: origin-qualified identity.** An additive `name@space` qualifier on the envelope\n and card, so a remote peer is unambiguous. Cheap, non-breaking, prerequisite for any\n bridge.\n- **v1: application-level relay.** A bridge endpoint holding a separate credential each\n side issued forwards one channel both ways (loop-marker, identity rewriting, explicit\n config on both ends), or both parties' delegates meet in a neutral **rendezvous\n space**. Works in open and auth mode with no NATS reconfiguration.\n- **v2: NATS-native.** Account export/import (same operator), leaf nodes\n (cross-operator), mirror/source streams for durable cross-space history (\"copy, don't\n share\").\n- **North star: encrypted group as the boundary.** A federated channel as an\n end-to-end-encrypted group whose membership is keys (MLS-style), relays carrying\n ciphertext without being trusted, DID self-issued identity. Not built now, not blocked\n either.\n\n## Open questions\n\n- **Inbound buffer/policy defaults**: queue vs coalesce vs immediate injection.\n- **Agent-directed control ops**: manager lifecycle ops exist; the agent-directed set\n (directive, set-role, pause/resume) is still open.\n- **Coordination primitives**: settled for the endpoint control surface. v0.4 defines goals and\n a decision journal, competitive work pools, and leases/obligations\n ([SPEC \xA713](../SPEC.md#13-endpoint-control-surface-v04)); whether a lighter *advisory* intent\n record also belongs on the chat plane is still open.\n- **Collaboration patterns**: agents are declared today ([agent files](agent-files.md));\n how a user declares the patterns *between* them (who delegates to whom) is open.\n\nWatch the [changelog](../SPEC.md#11-versioning-and-extensibility) and releases for what\nlands; propose changes against the spec first ([change process](../SPEC.md#11-versioning-and-extensibility)).\n"
329
+ "body": "# Roadmap\n\n> **Project** (non-normative) \xB7 Direction and deferred designs; nothing here is shipped\n> behavior unless a linked page says so. The shipped contract is the [spec](../SPEC.md).\n\nCotal is pre-1.0. The wire contract (v0.x) may still change under the\n[change process](../SPEC.md#11-versioning-and-extensibility). This page tracks what is\ndeliberately *not* built yet, and the direction each area is headed.\n\n## Where we are\n\nThe core is running today: all three delivery modes over JetStream, presence and\ndiscovery, channel replay and durable delivery classes, JWT identity and per-agent ACLs on\nby default, a supervising manager with pluggable runtimes, connectors for Claude Code,\nOpenCode, Hermes, and pi, the mesh manifest (`cotal.yaml`), and the console + web observers.\nThe [Quickstart](getting-started.md) is the fastest proof.\n\n## Deferred, designed-for\n\nThese have a reserved shape in the spec or the architecture, and are intentionally not\nbuilt yet.\n\n| Area | Direction |\n|---|---|\n| **Signed envelopes + DID identity** | Non-repudiation: authenticity that survives an untrusted relay or federation hop, not just a single trusted broker. Instance ids are shaped to become `did:key`. ([SPEC \xA711](../SPEC.md#11-versioning-and-extensibility)) |\n| **Auth-callout onboarding** | Shipped for per-user-auth spaces: the auth service mints scoped creds *at connect* from the data-account signing key, which a running manager also holds ([identity & auth](identity-and-auth.md)). Remaining: the join-link bootstrap-token variant for static meshes. |\n| **Credential revocation / TTL** | User-auth spaces have it (short bearers, ledger revocation, live-connection eviction); command and daemon creds are bounded and renewed everywhere. Remaining: TTL on static *agent* creds, where despawn still cuts the session, not the credential, and signing-key rotation is the only per-cred revocation. ([Security model](security.md)) |\n| **Sessions + moderator** | Managed group membership (admit/remove). Channels today carry no roster of their own. |\n| **Artifact delivery** | Large payloads move to a per-space JetStream Object Store; the message carries a reference part. Part shape reserved, transfer not built. ([SPEC \xA75](../SPEC.md#5-envelopes)) |\n| **Instant offline (`$SYS`)** | Manager-observed disconnect events for immediate `offline`, instead of waiting out the presence heartbeat window. The heartbeat sweep stays the floor. |\n| **Host mode (Agent SDK)** | Headless sessions with true mid-turn interrupt, observed via the plain stream instead of a native TUI. Documented upgrade path from attach mode. |\n| **Multi-space brokers** | The trust layer already hosts many spaces per broker (one operator signs one account per space, per [SPEC \xA79](../SPEC.md#9-nats--jetstream-security-and-authorization)), and broker-wide lifecycle verbs refuse on a multi-space root rather than scoping to one tenant. Still to build: per-space lifecycle (provisioning a new space through `up`, per-space teardown/backup) and agents present in many spaces at once. |\n| **Strict metadata containment** | Chat *content* reads are ACL-bounded today; stream metadata (channel names, per-subject counts) still leaks to in-space agents. Hiding it needs the channel-major stream model. ([SPEC \xA79](../SPEC.md#9-nats--jetstream-security-and-authorization)) |\n\n## Connecting spaces (federation)\n\nThe rule: **never merge trust roots.** The staged path, from\n[spaces & channels](spaces.md):\n\n- **v0: origin-qualified identity.** An additive `name@space` qualifier on the envelope\n and card, so a remote peer is unambiguous. Cheap, non-breaking, prerequisite for any\n bridge.\n- **v1: application-level relay.** A bridge endpoint holding a separate credential each\n side issued forwards one channel both ways (loop-marker, identity rewriting, explicit\n config on both ends), or both parties' delegates meet in a neutral **rendezvous\n space**. Works in open and auth mode with no NATS reconfiguration.\n- **v2: NATS-native.** Account export/import (same operator), leaf nodes\n (cross-operator), mirror/source streams for durable cross-space history (\"copy, don't\n share\").\n- **North star: encrypted group as the boundary.** A federated channel as an\n end-to-end-encrypted group whose membership is keys (MLS-style), relays carrying\n ciphertext without being trusted, DID self-issued identity. Not built now, not blocked\n either.\n\n## Open questions\n\n- **Inbound buffer/policy defaults**: queue vs coalesce vs immediate injection.\n- **Agent-directed control ops**: manager lifecycle ops exist; the agent-directed set\n (directive, set-role, pause/resume) is still open.\n- **Coordination primitives**: settled for the endpoint control surface. v0.4 defines goals and\n a decision journal, competitive work pools, and leases/obligations\n ([SPEC \xA713](../SPEC.md#13-endpoint-control-surface-v04)); whether a lighter *advisory* intent\n record also belongs on the chat plane is still open.\n- **Collaboration patterns**: agents are declared today ([agent files](agent-files.md));\n how a user declares the patterns *between* them (who delegates to whom) is open.\n\nWatch the [changelog](../SPEC.md#11-versioning-and-extensibility) and releases for what\nlands; propose changes against the spec first ([change process](../SPEC.md#11-versioning-and-extensibility)).\n"
330
330
  },
331
331
  {
332
332
  "slug": "run-a-mesh",
333
333
  "title": "Run a mesh",
334
334
  "kind": "Guide (informative)",
335
335
  "summary": "Day-to-day operation of a local mesh: what cotal up actually runs, how spawning resolves personas, harnesses, and models, how to reach a mesh from any directory, and the operator-only maintenance v\u2026",
336
- "body": "# Run a mesh\n\n> **Guide** (informative) \xB7 **For:** operators \xB7 **Prereqs:** [Quickstart](getting-started.md)\n\nDay-to-day operation of a local mesh: what `cotal up` actually runs, how spawning\nresolves personas, harnesses, and models, how to reach a mesh from any directory, and the\noperator-only maintenance verbs. Every command's full flag set is in the\n[CLI reference](cli.md).\n\n## The stack\n\n`cotal up` brings up the whole local stack and bare `cotal down` stops it:\n\n- **Broker**: a local `nats-server` (logs to `.cotal/nats.log`).\n- **Delivery daemon**: the durable backstop, auth mode only\n ([what it does](delivery-daemon.md)).\n- **Manager**: a detached supervisor answering the control plane, so\n `cotal spawn --detach` and the `cotal_spawn` tool work right after `up`.\n\nThree modes:\n\n- **Default (static auth).** JWT-authed, on by default: sender authenticity and per-agent\n ACLs, enforced by the broker ([how](identity-and-auth.md)).\n- **`--user-auth --idp <url>`.** Per-user auth: people `cotal login` once, the operator\n grants their agents on the actor ledger, and every connect is authorized live against\n that grant. Starts the space's auth service alongside the broker\n ([how](identity-and-auth.md)).\n- **`--open`.** An unauthenticated, live-only dev mesh (no auth, no delivery daemon). For\n quick local experiments.\n\nAll bind **loopback** by default. `--host 0.0.0.0` widens the bind independently of the\nauth mode, so \"network-reachable\" never silently means \"unauthenticated\". With no explicit\n`--server`, `cotal up` auto-selects a free local port when the default address is already\nheld by another project; an explicit `--server` fails loud on collision.\n\n`cotal status` prints the detailed setup, process, registry, and live mesh status;\n`cotal setup` (after the first run) prints the compact card.\n\nStop one part without tearing down the mesh by naming its registered component: `cotal down\nmanager`, `cotal down delivery`, or `cotal down web`. Component names from installed extensions\njoin the same surface; `cotal down` with no names retains whole-stack behavior.\n\n## Spawning agents\n\n```bash\ncotal spawn # foreground: your default agent, in this terminal\ncotal spawn reviewer --detach # supervised: the manager runs it in a PTY\ncotal attach reviewer # watch/type into a detached agent (Ctrl-] detaches)\ncotal ps # what the manager is running\ncotal stop reviewer # stop one\n```\n\nHow a spawn resolves:\n\n- **Persona.** A bare `cotal spawn` uses `.cotal/agents/default.md`; a positional name\n picks `.cotal/agents/<name>.md`; `--config` takes an explicit ref or path. Set\n `COTAL_DEFAULT_PERSONA=<name-or-path>` to change the fallback. Fields and format:\n [agent files](agent-files.md).\n- **Harness.** Claude by default; `--agent opencode` / `--agent hermes` / `--agent pi` per\n spawn, or `COTAL_DEFAULT_AGENT` to change the default. Compared in\n [Connectors](connectors.md); per-connector guides:\n [Claude](connect-claude.md) \xB7 [OpenCode](connect-opencode.md) \xB7\n [Hermes](connect-hermes.md) \xB7 [pi](connect-pi.md).\n- **Model.** `--model` overrides the persona file's `model:` (Claude: `opus` / `sonnet` or\n a full id; OpenCode: `provider/model`). Connectors that expose a catalog report it via\n `cotal models --agent opencode`: model ids plus available variants; pick one with\n `--model provider/model --variant high`.\n- **Tools.** A spawned agent gets only the cotal tools by default; share your own MCP\n servers deliberately with `--share-tools` ([config](config.md)).\n- **Launch options.** `--opt key=value` (repeatable) passes a native harness flag straight\n through; a persona or manifest `launchOptions:` mapping does the same declaratively (a\n `--opt` wins per key). It is a **raw passthrough**, with no allow/deny list: Claude renders\n each as `--key value` (a bare `--key` for an empty value), OpenCode merges them into its\n agent config, and Hermes has no option surface so it fails loud. The trust boundary is the\n `spawn` capability itself, not the flag set, so granting `spawn` is host-launch authority\n ([security](security.md)). A key must be a plain flag name; malformed or prototype-polluting\n keys are refused.\n\nDetach from an attached PTY with **Ctrl-]** (the agent keeps running); rebind it with\n`COTAL_DETACH_KEY=ctrl-<char>` when it clashes with a keybinding inside the agent's TUI.\n\n**Runtimes.** The manager spawns into a **pty** it owns by default. Optional runtimes are installed\nthrough the extension surface, for example `cotal ext add @cotal-ai/orca`, then selected with\n`--runtime orca` (similarly `@cotal-ai/tmux` and `@cotal-ai/cmux`). They put teammates in native\nterminal surfaces rather than manager-owned PTYs. Runtime names are open-ended and resolved from\nthe registry; a missing provider or app throws, never silently falls back\n([architecture](architecture.md)).\n\n## From any directory: the mesh registry\n\n`cotal up` records each running mesh in a machine-local registry\n(`~/.cotal/meshes/<space>.json`: broker URL, the project root holding its creds and\npersonas, and its mode). So a bare `cotal spawn <persona>` from *any* directory joins the\nrunning mesh with the right credentials instead of mistaking the cwd for a space:\n\n- `cotal use <name>` sets the default from every directory, including inside another mesh's\n project. `--space <name>` overrides it for one command.\n- With no live selected default, a project with its own `.cotal/` resolves to that project's\n mesh; otherwise one running mesh is used automatically and several are an error.\n- `cotal meshes` lists them (a `*` marks the default); `cotal down` removes the entry.\n\nThe registry stores a *path*, never a secret; trust material stays in each project's\n`.cotal/auth`. If the mesh is down or won't take your creds, spawn fails with one\nsentence, never a raw NATS trace.\n\n## Watching\n\n`cotal console` is the terminal view (TUI on a real terminal, plain line stream when\npiped); `cotal web` is the browser dashboard. Both are read-only observers; the\nwalkthrough is [Watch a mesh](watch-a-mesh.md).\n\n## History\n\nRetained history is operator-owned. `cotal clean history --force` purges a space's\nretained channel history; `--dms` also purges DMs (`cotal history clear` is an alias).\nIt is deliberately **not** an agent tool: agents cannot wipe the record\n([identity & auth](identity-and-auth.md)). For a **stopped** mesh, `cotal clean store\n--force` deletes the on-disk JetStream store outright, and `cotal clean all --force`\nalso resets the space identity ([CLI reference](cli.md#clean)).\n\n## Offline backup\n\nFor a coherent durable cut, preserve the whole stack first, then create the artifact while it stays\ndown:\n\n```bash\ncotal down --preserve-state\ncotal backup create ./space-backup # full by default\n# later: deliberately resume the unchanged source\ncotal up --detach\n# or, from another preserved cut, restore before the normal listener opens\ncotal up --restore ./space-backup --detach\n```\n\nUse `--store-dir` on both preservation and backup for a custom JetStream store. `registry` is the\nonly partial selection (`backup create ... --only registry`; `up --restore ... --restore-only\nregistry`). Backup never stops or restarts a mesh implicitly, never opens the original store, and\ndoes not contain credentials or trust secrets. Backup/restore in every auth mode \u2014 open included \u2014\nuses isolated, operation-specific maintenance logins; normal agent credentials cannot enter that\nlistener. Full\nrestore requires the same space and exact current local trust continuity, recreates conservative\nconsumer checkpoints bound to their snapshot stream sequence state, and resumes retained agents under\ntheir original principals. The trust commitment includes the cryptographically validated full\noperator/system/data-account root chain as well as static/user authority state. A registry-only\nrestore completes canonical empty infrastructure but leaves retained agents stopped because their\nDM/DLV/TASK/ACL state is outside that selection. Authenticated restore validates the complete space\ntrust bundle before staging or changing the preserved store. Interrupted ordinary resume retries the\nsame durable attempt after its prior listener is stopped. Restore re-entry can recover a surviving normal listener\nonly when its attempt nonce, NATS server name, process owner, endpoint, and target-store identity all\nmatch the fsynced proof. A provably dead uncommitted owner is retired under lock and replaced with a\nfresh attempt-bound listener; an occupied foreign listener or ambiguous owner is never adopted. The\nmanager commit validates while retained cleanup is still suppressed; the CLI durably records its\nattempt-bound 64-hex token in `manager-committed` / `resume-committed` before `finalizeResume` can\nrelease suppression. A retry from either committed state goes straight to exact-token finalization;\nfailure preserves the committed gate and retained cleanup suppression. Missing commit evidence,\ninterrupted finalization, a live recorded endpoint despite missing pidfiles, or ambiguous proof fails closed. See the [CLI\nbackup and restore contract](cli.md#backup-and-restore) for artifact, checkpoint, fallback,\ndisaster-consent, and degraded-recovery details.\n\n## Personas from the CLI\n\n`cotal personas` manages the local catalog offline: `list` (`--running` overlays live\nmarkers), `show <name>`, `edit <name>` (re-validates on save), `new <name>`, `rm <name>\n--force`. The runtime counterpart is the `cotal_persona` tool, which goes over the wire\nwith the manager's ownership checks. Fields: [agent files](agent-files.md).\n\n## When something looks absent\n\nPermission denials are **loud, never silent**: an over-tight ACL shows up as a logged\ndenial on the endpoint, not as a peer that mysteriously looks absent. Check\n`.cotal/manager.log`, `.cotal/delivery.log`, and `.cotal/nats.log`; `cotal status` shows\nwhat is actually running. The access rules are collected in\n[Channels & permissions](channels-and-permissions.md).\n"
336
+ "body": "# Run a mesh\n\n> **Guide** (informative) \xB7 **For:** operators \xB7 **Prereqs:** [Quickstart](getting-started.md)\n\nDay-to-day operation of a local mesh: what `cotal up` actually runs, how spawning\nresolves personas, harnesses, and models, how to reach a mesh from any directory, and the\noperator-only maintenance verbs. Every command's full flag set is in the\n[CLI reference](cli.md).\n\n## The stack\n\n`cotal up` brings up the whole local stack and bare `cotal down` stops it:\n\n- **Broker**: a local `nats-server` (logs to `.cotal/nats.log`).\n- **Delivery daemon**: the durable backstop, auth mode only\n ([what it does](delivery-daemon.md)).\n- **Manager**: a detached supervisor answering the control plane, so\n `cotal spawn --detach` and the `cotal_spawn` tool work right after `up`.\n\nThree modes:\n\n- **Default (static auth).** JWT-authed, on by default: sender authenticity and per-agent\n ACLs, enforced by the broker ([how](identity-and-auth.md)).\n- **`--user-auth --idp <url>`.** Per-user auth: people `cotal login` once, the operator\n grants their agents on the actor ledger, and every connect is authorized live against\n that grant. Starts the space's auth service alongside the broker\n ([how](identity-and-auth.md)).\n- **`--open`.** An unauthenticated, live-only dev mesh (no auth, no delivery daemon). For\n quick local experiments.\n\nAll bind **loopback** by default. `--host 0.0.0.0` widens the bind independently of the\nauth mode, so \"network-reachable\" never silently means \"unauthenticated\". With no explicit\n`--server`, `cotal up` auto-selects a free local port when the default address is already\nheld by another project; an explicit `--server` fails loud on collision.\n\n`cotal status` prints the detailed setup, process, registry, and live mesh status;\n`cotal setup` (after the first run) prints the compact card.\n\nStop one part without tearing down the mesh by naming its registered component: `cotal down\nmanager`, `cotal down delivery`, or `cotal down web`. Component names from installed extensions\njoin the same surface; `cotal down` with no names retains whole-stack behavior.\n\n## Spawning agents\n\n```bash\ncotal spawn # foreground: your default agent, in this terminal\ncotal spawn reviewer --detach # supervised: the manager runs it in a PTY\ncotal attach reviewer # watch/type into a detached agent (Ctrl-] detaches)\ncotal ps # what the manager is running\ncotal stop reviewer # stop one\n```\n\nHow a spawn resolves:\n\n- **Persona.** A bare `cotal spawn` uses `.cotal/agents/default.md`; a positional name\n picks `.cotal/agents/<name>.md`; `--config` takes an explicit ref or path. Set\n `COTAL_DEFAULT_PERSONA=<name-or-path>` to change the fallback. Fields and format:\n [agent files](agent-files.md).\n- **Harness.** Claude by default; `--agent opencode` / `--agent hermes` / `--agent pi` per\n spawn, or `COTAL_DEFAULT_AGENT` to change the default. Compared in\n [Connectors](connectors.md); per-connector guides:\n [Claude](connect-claude.md) \xB7 [OpenCode](connect-opencode.md) \xB7\n [Hermes](connect-hermes.md) \xB7 [pi](connect-pi.md).\n- **Model.** `--model` overrides the persona file's `model:` (Claude: `opus` / `sonnet` or\n a full id; OpenCode: `provider/model`). Connectors that expose a catalog report it via\n `cotal models --agent opencode`: model ids plus available variants; pick one with\n `--model provider/model --variant high`.\n- **Tools.** A spawned agent gets only the cotal tools by default; share your own MCP\n servers deliberately with `--share-tools` ([config](config.md)).\n- **Launch options.** `--opt key=value` (repeatable) passes a native harness flag straight\n through; a persona or manifest `launchOptions:` mapping does the same declaratively (a\n `--opt` wins per key). It is a **raw passthrough**, with no allow/deny list: Claude renders\n each as `--key value` (a bare `--key` for an empty value), OpenCode merges them into its\n agent config, and Hermes has no option surface so it fails loud. The trust boundary is the\n `spawn` capability itself, not the flag set, so granting `spawn` is host-launch authority\n ([security](security.md)). A key must be a plain flag name; malformed or prototype-polluting\n keys are refused.\n\nDetach from an attached PTY with **Ctrl-]** (the agent keeps running); rebind it with\n`COTAL_DETACH_KEY=ctrl-<char>` when it clashes with a keybinding inside the agent's TUI.\n\n**Runtimes.** The manager spawns into a **pty** it owns by default. Optional runtimes are installed\nthrough the extension surface, for example `cotal ext add @cotal-ai/orca`, then selected with\n`--runtime orca` (similarly `@cotal-ai/tmux` and `@cotal-ai/cmux`). They put teammates in native\nterminal surfaces rather than manager-owned PTYs. Runtime names are open-ended and resolved from\nthe registry; a missing provider or app throws, never silently falls back\n([architecture](architecture.md)).\n\n## From any directory: the mesh registry\n\n`cotal up` records each running mesh in a machine-local registry\n(`~/.cotal/meshes/space.<key>.json`, named by a case-safe hex encoding of the space: broker URL, the project root holding its creds and\npersonas, and its mode). So a bare `cotal spawn <persona>` from *any* directory joins the\nrunning mesh with the right credentials instead of mistaking the cwd for a space:\n\n- `cotal use <name>` sets the default from every directory, including inside another mesh's\n project. `--space <name>` overrides it for one command.\n- With no live selected default, a project with its own `.cotal/` resolves to that project's\n mesh; otherwise one running mesh is used automatically and several are an error.\n- `cotal meshes` lists them (a `*` marks the default); `cotal down` removes the entry.\n\nThe registry stores a *path*, never a secret; trust material stays in each project's\n`.cotal/auth`. If the mesh is down or won't take your creds, spawn fails with one\nsentence, never a raw NATS trace.\n\n## Watching\n\n`cotal console` is the terminal view (TUI on a real terminal, plain line stream when\npiped); `cotal web` is the browser dashboard. Both are read-only observers; the\nwalkthrough is [Watch a mesh](watch-a-mesh.md).\n\n## History\n\nRetained history is operator-owned. `cotal clean history --force` purges a space's\nretained channel history; `--dms` also purges DMs (`cotal history clear` is an alias).\nIt is deliberately **not** an agent tool: agents cannot wipe the record\n([identity & auth](identity-and-auth.md)). For a **stopped** mesh, `cotal clean store\n--force` deletes the on-disk JetStream store outright, and `cotal clean all --force`\nalso resets the space identity ([CLI reference](cli.md#clean)).\n\n## Offline backup\n\nFor a coherent durable cut, preserve the whole stack first, then create the artifact while it stays\ndown:\n\n```bash\ncotal down --preserve-state\ncotal backup create ./space-backup # full by default\n# later: deliberately resume the unchanged source\ncotal up --detach\n# or, from another preserved cut, restore before the normal listener opens\ncotal up --restore ./space-backup --detach\n```\n\nUse `--store-dir` on both preservation and backup for a custom JetStream store. `registry` is the\nonly partial selection (`backup create ... --only registry`; `up --restore ... --restore-only\nregistry`). Backup never stops or restarts a mesh implicitly, never opens the original store, and\ndoes not contain credentials or trust secrets. Backup/restore in every auth mode \u2014 open included \u2014\nuses isolated, operation-specific maintenance logins; normal agent credentials cannot enter that\nlistener. Full\nrestore requires the same space and exact current local trust continuity, recreates conservative\nconsumer checkpoints bound to their snapshot stream sequence state, and resumes retained agents under\ntheir original principals. The trust commitment includes the cryptographically validated full\noperator/system/data-account root chain as well as static/user authority state. A registry-only\nrestore completes canonical empty infrastructure but leaves retained agents stopped because their\nDM/DLV/TASK/ACL state is outside that selection. Authenticated restore validates the complete space\ntrust bundle before staging or changing the preserved store. Interrupted ordinary resume retries the\nsame durable attempt after its prior listener is stopped. Restore re-entry can recover a surviving normal listener\nonly when its attempt nonce, NATS server name, process owner, endpoint, and target-store identity all\nmatch the fsynced proof. A provably dead uncommitted owner is retired under lock and replaced with a\nfresh attempt-bound listener; an occupied foreign listener or ambiguous owner is never adopted. The\nmanager commit validates while retained cleanup is still suppressed; the CLI durably records its\nattempt-bound 64-hex token in `manager-committed` / `resume-committed` before `finalizeResume` can\nrelease suppression. A retry from either committed state goes straight to exact-token finalization;\nfailure preserves the committed gate and retained cleanup suppression. Missing commit evidence,\ninterrupted finalization, a live recorded endpoint despite missing pidfiles, or ambiguous proof fails closed. See the [CLI\nbackup and restore contract](cli.md#backup-and-restore) for artifact, checkpoint, fallback,\ndisaster-consent, and degraded-recovery details.\n\n## Personas from the CLI\n\n`cotal personas` manages the local catalog offline: `list` (`--running` overlays live\nmarkers), `show <name>`, `edit <name>` (re-validates on save), `new <name>`, `rm <name>\n--force`. The runtime counterpart is the `cotal_persona` tool, which goes over the wire\nwith the manager's ownership checks. Fields: [agent files](agent-files.md).\n\n## When something looks absent\n\nPermission denials are **loud, never silent**: an over-tight ACL shows up as a logged\ndenial on the endpoint, not as a peer that mysteriously looks absent. Check\n`.cotal/manager.log`, `.cotal/delivery.log`, and `.cotal/nats.log`; `cotal status` shows\nwhat is actually running. The access rules are collected in\n[Channels & permissions](channels-and-permissions.md).\n"
337
337
  },
338
338
  {
339
339
  "slug": "security",
@@ -380,7 +380,7 @@ var DOCS_BUNDLE = {
380
380
  ],
381
381
  "spec": {
382
382
  "title": "Cotal Wire Specification",
383
- "body": "# Cotal Wire Specification\n\n> **Status:** Draft, v0.4 (pre-1.0). This document is the normative wire contract. Libraries\n> (including the reference TypeScript implementation) are thin clients over it; where a\n> client disagrees with this document, this document wins.\n>\n> **Layered authority.** Message *shapes* are defined by the machine-readable schema,\n> [`spec/cotal.schema.json`](spec/cotal.schema.json) (\xA75); this document's prose defines\n> *semantics*: routing, delivery guarantees, presence, authorization, and conformance. For\n> the reference implementation's operator surfaces (the CLI, the `cotal_*` tools), see the\n> [Reference docs](docs/README.md#reference); those describe the TypeScript implementation,\n> not this contract.\n>\n> **Editors:** Cotal maintainers. **Last updated:** 2026-07-19. Changes are tracked in\n> [Appendix D](#appendix-d-change-log); versioning rules are \xA711.\n>\n> **v0.3 binding revision: owner+actor identity.** An instance's wire identity moves from a single\n> id (the connection nkey, used as the sender token everywhere) to a two-token **principal**\n> `(owner, actor)` (\xA72): the human/account owner and the agent actor become distinct routing tokens,\n> so every subject carries the sender as `<owner>.<actor>` (\xA73), and grants, durables, presence, and\n> `from.id` re-key onto the principal (\xA76, \xA78, \xA79). The connection nkey survives only as the transport\n> credential, keying the per-connection reply inbox `_INBOX_<connId>` (\xA72, \xA710); the wire identity and\n> the connection credential are now distinct. Cross-owner **and** same-owner cross-actor forge/read\n> isolation is a normative confinement property (\xA79). `parseSubject` splits the tokens; a well-formed\n> split is necessary but not sufficient: a reader additionally rejects a non-principal owner token\n> (e.g. an old-shape alias carrying a raw nkey) at the surfacing boundary (\xA73, \xA79). The owner-token\n> *format* (`u_` + 26 base32-lower) is normative; its *derivation* from an owner's identity (login \u2192\n> auth callout, or another identity adapter) is a pluggable edge, not fixed by this contract. This\n> supersedes the v0.2/early-v0.3 single-id grammar. As with the live-delivery revision, the advertised\n> wire `protocolVersion` (\xA76, \xA711) is the migration's normative target, not a claim that every surface\n> has cut over.\n>\n> **v0.4 binding revision: endpoint control surface.** Structured command traffic moves from the v0\n> `ctl` control rail to one standardized, typed, discoverable endpoint surface (\xA713): class +\n> instance + scatter rails with per-command broker enforcement, a versioned envelope, three\n> delivery contracts (ephemeral / record / journal), normative composites (action, checkpoint,\n> guard, capability handle, session), content-addressed contracts with governed traits, and\n> lifecycle identity (\xA713.1) extending \xA72/\xA76/\xA78. This is an intentional **hard cut** (\xA711,\n> \xA713.11): the v0 control grammar, envelope, and authority tiers are deleted, not dual-served.\n> The advertised `protocolVersion` targets `0.4` at the completion of this revision's migration;\n> `1.0` remains reserved as a later stability declaration, not part of this revision.\n>\n> **v0.3 binding revision: channel live delivery.** Channel *live* delivery moves from a single\n> mediated JetStream live-tail durable (`chat_<id>`) to native core-NATS subscriptions bounded by\n> `sub.allow`, with durability provided by an explicit per-channel `live`/`durable` delivery class\n> (\xA74, \xA77, \xA78). Join/leave becomes a direct subscribe/unsubscribe with no privileged mediation,\n> and channel membership moves off consumer topology to a privileged-written registry (\xA77). This\n> supersedes the v0.2 single-durable live-tail. The reference implementation migrates additively\n> (the legacy durable and the new core-sub path coexist behind `id` dedup until the legacy path is\n> removed), but that migration path is not itself normative. The advertised wire `protocolVersion`\n> (\xA76, \xA711) stays `0.2` until the core-sub behaviour ships; this revision is the normative target the\n> migration converges to, and the additive `deliveryClass` field is backward-compatible meanwhile.\n\nThe key words MUST, MUST NOT, REQUIRED, SHALL, SHOULD, SHOULD NOT, MAY, and OPTIONAL in\nthis document are to be interpreted as described in [RFC 2119](https://www.rfc-editor.org/rfc/rfc2119)\nand [RFC 8174](https://www.rfc-editor.org/rfc/rfc8174).\n\nSections 3 to 7 define the transport-agnostic Cotal contract. Sections 8 to 10 define\nthe NATS + JetStream binding (v0). A conformant deployment implements one binding; the\nNATS binding is the only one defined today. External specifications this document relies on\nare listed in Appendix C.\n\n---\n\n## 1. Scope and terminology\n\nCotal is a wire interface for software, especially AI agents, to coordinate in real time\nas lateral peers in a shared pub/sub space, not as nodes in an orchestrator tree.\n\n- **Space**: an isolated coordination context. One space is one tenant boundary; messages\n in one space are not visible in another. NATS binding: one space = one account.\n- **Instance**: a connected participant, identified by a stable **instance id**. Also called\n an endpoint.\n- **Agent node**: an instance whose `kind` is `agent`, versus a plain `endpoint` such as an\n observer, logger, or dashboard.\n- **Peer**: any other instance in the same space.\n- **Channel**: a named multicast topic within a space, dotted and hierarchical.\n- **Service**: an anycast role reached by name (`svc`, \xA74).\n- **Endpoint (control surface)**: a daemon that registers a service identity, publishes\n typed contracts, and serves commands on the endpoint rails (\xA713).\n- **Broker**: the message router for a space. v0 assumes a single trusted broker.\n- **Delivery message**: a multicast, unicast, or anycast `CotalMessage`.\n- **Endpoint request**: a typed request/reply command addressed to an endpoint class or\n instance on the `ep` rails (\xA713). The v0 `ctl` control rail is deleted (\xA713.11).\n\n---\n\n## 2. Identity\n\nAn instance's wire identity is a **principal** = a pair of routing tokens `(owner, actor)`:\n\n- **`owner`**: the account that owns the instance: the human (or organization) an agent acts on\n behalf of. In an authenticated deployment it is a derived **owner token** (`u_` followed by 26\n base32-lower characters), a namespaced, nkey-disjoint token deterministically derived from the\n owner's stable identity (e.g. an IdP subject) by the deployment's identity adapter; the wire\n contract fixes the token *format*, not the derivation mechanism, which is a pluggable edge. In open\n dev mode the owner is the literal `local`.\n- **`actor`**: the instance's own handle within that owner (its agent id). Distinct actors under one\n owner are distinct principals and are confined from one another (\xA79), so one human's two agents\n cannot forge or read as each other.\n\nEach token is sanitized to `[A-Za-z0-9_]` (see \xA73) with `-` additionally reserved as the form\nseparator, so a principal has two unambiguous serializations: the **dot-form** `<owner>.<actor>` and\nthe **dash-form** `<owner>-<actor>`. The same principal MUST appear identically as: the\n`AgentCard.id` (\xA76, dot-form), the sender tokens in subjects (\xA73), the message `from.id` (\xA75,\ndot-form), the presence key (\xA76, dot-form), and the per-instance durable names (\xA78, dash-form).\n\n**The principal is distinct from the connection credential.** In the authenticated NATS binding the\nconnecting user is still an Ed25519 nkey (base32, 56 chars, prefix `U`, e.g. `UAQG...`), stable for\nthe lifetime of the connection, but it is **not** the wire identity. The nkey authenticates the\ntransport and scopes only the per-connection reply inbox `_INBOX_<connId>.>` (\xA710); the principal\nthat keys every subject, grant, and durable is carried by the minted grant, not by the nkey. This\nseparation is what lets a login (\xA79) mint a fresh connection whose nkey the client never sees while\nthe principal stays stable across reconnects.\n\n- A client that authenticates with a static credential MUST adopt the principal that credential's\n grant names; if a principal is also set explicitly (via the card) it MUST match, else the client\n MUST fail before publish.\n- A client that authenticates through the auth callout (user mode, \xA79) cannot know its connection\n nkey before connecting, so it chooses its own reply-inbox nonce (`connId`) and derives its\n principal from its bearer; the broker's minted grant, not the client's self-read, is the\n boundary.\n- Open dev mode MAY use `local` as the owner and an opaque stable actor, but open mode is outside\n the security claims in \xA79 and is not a conformant authenticated deployment.\n\nFuture binding, not v0: portable `did:key` identity plus signed envelopes so authenticity\nsurvives an untrusted relay. See the threat model in [docs/security.md](docs/security.md).\n\n---\n\n## 3. Subject layout\n\nEvery wire subject is rooted at `cotal.<space>`. `<space>` and every routing token are\nsanitized: any character outside `[A-Za-z0-9_-]` maps to `_`. Sanitization is lossy; tokens\nMUST NOT be decoded back into display names.\n\nThe **sender** of every delivery is a principal (\xA72), carried as **two adjacent tokens**\n`<owner>.<actor>`. Routed kinds (`inst`) also carry the recipient principal as two tokens.\n\n| Purpose | Subject | Sender tokens | Delivery |\n| --- | --- | --- | --- |\n| Multicast | `cotal.<space>.chat.<owner>.<actor>.<channel...>` | 3\u20134 | \xA74 multicast |\n| Unicast | `cotal.<space>.inst.<recipOwner>.<recipActor>.<sndOwner>.<sndActor>` | 5\u20136 | \xA74 unicast |\n| Anycast | `cotal.<space>.svc.<role>.<owner>.<actor>` | 4\u20135 | \xA74 anycast |\n| Endpoint rails | `cotal.<space>.ep.<one\\|all\\|inst\\|reply>.\u2026`, `cotal.<space>.ep<c\\|e\\|f\\|j\\|r\\|t\\|w\\|s>.\u2026` | see \xA713.2 | \xA713 control surface |\n| Trace | `cotal.<space>.trace.<instance>` | n/a | reserved |\n\nToken indexing is zero-based on `subject.split(\".\")`: `cotal` = 0, `<space>` = 1,\n`<kind>` = 2. The sender principal is recovered as the dot-form `<owner>.<actor>` (= the message\n`from.id`, \xA75), so a guard comparing `from.id` to the subject sender uses one value.\n\n**Two-token sender, and its asymmetry.** A reader MUST locate the sender by kind:\n\n- `chat`: sender owner at token 3, actor at token 4; the channel is everything after, tokens 5+,\n so it may be hierarchical (`team.backend`).\n- `svc`: route target at token 3; sender owner at token 4, actor at token 5.\n- `ep`: per-mode arities with the caller as the trailing identity tokens; \xA713.2 defines them.\n- `inst`: recipient owner+actor at tokens 3\u20134; sender owner+actor at tokens 5\u20136.\n\nThe two-token sender is what lets a native publish grant **forge-lock** the sender suffix (e.g.\n`inst.*.*.<myOwner>.<myActor>` permits a DM to anyone but only *as me*), so the broker enforces\nsender authenticity and a receiver need not re-verify a payload claim. A subject that does not match\none of these shapes (wrong prefix or wrong per-kind arity) MUST be treated as having no sender and\nMUST NOT be read as a delivery. `parseSubject` **splits only**: it recovers the tokens but does not\nvalidate that `<owner>` is a well-formed owner token; trust comes from the broker's forge-locked\ngrant, and a reader that surfaces content additionally rejects a non-principal owner token at the\nsurfacing boundary (\xA79). Reference implementation: `parseSubject` in\n`packages/core/src/subjects.ts`.\n\n**Channel tokens.** A channel is dotted; each segment is sanitized. The literal wildcards\n`*` and `>` are preserved only as whole segments for subscription and allow-list patterns;\n`>` is valid only as the final segment. A publish target MUST be concrete, with no `*` or\n`>`; a subscription MAY be wildcard.\n\n**Reserved prefixes.** Application messages MUST NOT use subjects beginning with `$JS.`,\n`$KV.`, `$SYS.`, `$O.`, or `_INBOX.`. (`$O.` is the Object Store data/meta subject prefix\nper ADR-20, `$O.<bucket>.C.>` / `$O.<bucket>.M.>`; `OBJ_<bucket>` is a stream NAME, not a\nsubject prefix.)\n\n---\n\n## 4. Delivery modes\n\n| Mode | Routing field | Semantics |\n| --- | --- | --- |\n| multicast | `channel` | delivered to every subscriber of the channel |\n| unicast | `to` | delivered to the named instance's inbox |\n| anycast | `toService` | delivered to one consumer of the named role |\n\nExactly one of `channel`, `to`, or `toService` MUST be set on a `CotalMessage` (\xA75).\n\n**Authenticated delivery kind.** A receiver MUST derive \"how was this addressed to me\"\nfrom the delivering subject kind (`chat` -> `channel`, `inst` -> `dm`, `svc` ->\n`anycast`), not from payload routing fields, which are advisory. (\"Delivery kind\", the\naddressing axis, is distinct from a channel's `live`/`durable` **delivery class**, \xA77.) A peer can put your id in\npayload `to`, but cannot publish on your private unicast subject. Reference:\n`MessageMeta.kind`.\n\n**Delivery guarantee: `live` and `durable` classes.** Channel delivery has two classes, fixed\nper channel and wire-observable (\xA77); the guarantee is defined here, its NATS realization is the\nbinding in \xA78. A receiver MUST derive its effective class from channel config (\xA77), not from\nper-message metadata (`MessageMeta` need not carry it); it MUST NOT assume one class.\n\n- **`live`** is native broker-subscription delivery and is **at-most-once**: a message reaches\n only the instances subscribed to the channel at publish time. An instance that is disconnected,\n busy, or not yet joined does not receive that message live and has no claim to the live copy\n later. There is no per-subscriber redelivery of the live copy.\n- **`durable`** is `live` plus a per-subscriber durable backstop and is **at-least-once for\n current members within retention**: the message is also retained for each member and delivered on\n that member's next connection or turn, remaining pending until acked. A crash or `ack_wait` expiry\n redelivers the durable copy. At-least-once is bounded by the channel's retention / `replayWindow`\n (\xA77): a message evicted by retention before ack may be lost; the guarantee is not unbounded.\n\nUnicast (`to`) and anycast (`toService`) are at-least-once via their own DM/TASK consumers (\xA78);\nthey have no channel membership and are not subject to the per-channel delivery-class mechanism. An\n`@mention` (\xA75) on a `live` channel additionally writes a durable copy to each mentioned target\n**authorized to read that channel** (its `allowSubscribe` covers the channel), so an authorized but\noffline target still receives it; an `@mention` MUST NOT deliver channel content to a target outside\nits read ACL. Durable mention routing resolves each lowercased name to a unique current instance id\nfrom presence at publish time; an ambiguous (multiple live matches) or unresolvable name yields no\ndurable copy, and authorization is checked against the resolved id's current `allowSubscribe`. A\ntarget authorized for a channel is **mention-reachable** there whether or not it is currently joined; this is intentional (an `@mention` can pull an authorized peer in) and is distinct\nfrom membership; a client SHOULD distinguish \"joined\" (actively subscribed) from \"readable /\nmention-reachable\" (in `allowSubscribe`) so an unjoined channel is not treated as \"cannot reach me\nhere.\"\n\nA message delivered both live and durable is **one logical delivery**: receivers MUST deduplicate\nby `id` across classes (\xA78); the durable copy owns ack/commit; and a previously seen `id` MUST NOT\nbe treated as authorization for a later durable copy (for example one that arrives after a leave).\nReceivers MUST tolerate the `live` gap and rely on the `durable` backstop for catch-up on\n`durable` channels. Malformed JSON, spoofed sender payloads, and unparseable delivery subjects are\npermanent anomalies and MUST be terminated, not retried.\n\n**Ordering.** Cotal does not define global ordering across modes, channels, or consumers.\nImplementations MUST NOT depend on cross-subject ordering. Per-consumer delivery is ordered\nby the backing stream except where redelivery or explicit backfill interleaves older\nmessages.\n\n---\n\n## 5. Envelopes\n\nDelivery messages are UTF-8 JSON objects with this shape (`CotalMessage`):\n\n| Field | Type | Req | Notes |\n| --- | --- | --- | --- |\n| `id` | string | MUST | unique message id; NATS binding also uses it as `Nats-Msg-Id` |\n| `ts` | number | MUST | epoch ms |\n| `space` | string | MUST | space name |\n| `from` | `EndpointRef` | MUST | `{ id, name, role? }` |\n| `channel` | string | one-of | multicast target |\n| `to` | string | one-of | unicast target instance id |\n| `toService` | string | one-of | anycast target role |\n| `mentions` | string[] | MAY | lowercased peer names; wakes the mentioned peer. On a `live` channel it also routes a durable copy to each mentioned target authorized to read that channel (\xA74); it never delivers content outside the target's read ACL and is not a routing substitute for `channel`/`to` |\n| `parts` | `Part[]` | MUST | content |\n| `replyTo` | string | MAY | id of the message replied to |\n| `contextId` | string | MAY | thread/conversation correlation id |\n\n`Part` is one of the two core shapes, or an extension object whose `kind` is namespaced\nas described in \xA711:\n\n- `{ \"kind\": \"text\", \"text\": string }`\n- `{ \"kind\": \"data\", \"data\": <any JSON value> }`\n- `{ \"kind\": \"<reverse-DNS extension kind>\", ... }`\n\n`EndpointRef` is `{ \"id\": string, \"name\": string, \"role\"?: string }`.\n\nOn receive, a client MUST verify `from.id` equals the subject sender (\xA73). On mismatch, a\nmissing `from`, or an unparseable delivery subject, the message MUST be rejected and never\nredelivered.\n\nEndpoint requests and replies (the control surface) use the versioned typed envelope of\n\xA713.3 (`EndpointRequest`/`EndpointReply`); they are not Cotal delivery messages. The v0\n`ControlRequest`/`ControlReply` shapes are deleted (\xA713.11).\n\nReceivers MUST ignore unknown object fields. Unknown conformant extension `Part.kind` values\nMUST be ignored unless the receiver explicitly supports that extension. Bare unrecognized\ncore-kind values are not conformant. Messages MUST fit the broker's configured maximum payload.\nv0 has no artifact transfer part; large payload transport is reserved for a future Object Store\nextension.\n\n**Schema.** The JSON Schema (draft-07) at\n[`spec/cotal.schema.json`](spec/cotal.schema.json) is **authoritative for message shapes**:\na conformant delivery message MUST validate against it, and where this document's field\ntables and the schema diverge on a shape, the schema wins. Delivery *semantics* (routing,\nguarantees, rejection) are defined by this document's prose. The schema is generated from\nthe reference source, [`packages/core/src/types.ts`](packages/core/src/types.ts)\n(`pnpm gen:schema`), and committed; the published copy lives at\n`https://docs.cotal.ai/cotal.schema.json`.\n\n**Rejection reasons.** The three permanent anomalies in \xA74 are terminated, never redelivered.\nThese reason tokens are advisory (for logs and error surfaces); the action is uniform:\n\n| Reason | Trigger |\n| --- | --- |\n| `malformed-subject` | the delivery subject does not parse (\xA73) |\n| `sender-mismatch` | `from` is missing, or `from.id` does not equal the subject sender (\xA75) |\n| `malformed-json` | the payload is not valid UTF-8 JSON |\n\n---\n\n## 6. Presence and discovery\n\nPresence is a per-space directory keyed by instance id. NATS binding: JetStream KV bucket\n`cotal_presence_<space>` (\xA78).\n\n`Presence`:\n\n| Field | Type | Req | Notes |\n| --- | --- | --- | --- |\n| `card` | `AgentCard` | MUST | identity record |\n| `status` | `PresenceStatus` | MUST | `idle`, `waiting`, `working`, or `offline` |\n| `activity` | string | MAY | freeform current activity |\n| `attention` | `AttentionMode` | MAY | global attention mode: `open` \\| `dnd` \\| `focus`. Advisory observability; `open`/absent \u21D2 receives everything. Reset: `open` published on `SessionStart`, removed on the offline sweep |\n| `lifecycleUid` | string | MUST in auth mode from v0.4 | the current managed-lifecycle UID (\xA713.1); distinguishes a live instance from a same-name successor. Advisory for display; authority checks use the trusted lifecycle mapping, not presence |\n| `channelModes` | `Record<string, ChannelMode>` | MAY | per-channel attention overrides (`ChannelMode` = `quiet` \\| `muted`), keyed by concrete channel name. Advisory, **not** access control (the broker still authorises and delivers); a receive-side preference, reset on restart |\n| `ts` | number | MUST | epoch ms of last heartbeat |\n\n`AgentCard`:\n\n| Field | Type | Req | Notes |\n| --- | --- | --- | --- |\n| `id` | string | MUST | instance id (\xA72) |\n| `name` | string | MUST | display name |\n| `kind` | `agent` or `endpoint` | MUST | participation class |\n| `role` | string | MAY | service role |\n| `description` | string | MAY | one-line summary |\n| `tags` | string[] | MAY | capability tags |\n| `skills` | `AgentSkill[]` | MAY | `{ id, name, description? }` |\n| `meta` | object | MAY | free-form display metadata; reserved keys include `connector` (host harness name) and `model` (pinned model), both advisory only |\n| `protocolVersion` | string | MUST from v0.4 | wire version spoken (\xA711); `\"0.4\"` for this revision. Advertisement is the marker at the v0.4 reachability boundary (\xA713.11): a participant that omits it is pre-0.4 (omission means the pre-0.4 line, where the field was optional) and MUST NOT be addressed on the `ep` rails. A change signal, not negotiation |\n\nAn instance MUST refresh its own presence entry on the heartbeat interval, default 2000 ms.\nThe liveness window defaults to 6000 ms. A peer whose `ts` is older than the liveness window\nis considered `offline`.\n\nLive clients MUST NOT heartbeat as `offline`. A graceful disconnect MAY publish one final\n`offline` presence record. Observers MUST also derive `offline` from stale timestamps and\nfrom KV delete/purge events. Offline peers MAY remain in local rosters for observability.\nAn instance MUST write only its own presence key, and the key MUST equal `card.id`.\n\n---\n\n## 7. Channels\n\nA channel is addressable as soon as it is published to. Channel config is optional and lives\nin the per-space registry bucket `cotal_channels_<space>`, keyed by the concrete channel\ntoken.\n\n`ChannelConfig`:\n\n| Field | Type | Notes |\n| --- | --- | --- |\n| `replay` | boolean | history replay-on-join; overrides the space default |\n| `replayWindow` | string | backfill horizon matching `^\\d+(s\\|m\\|h\\|d)$`, e.g. `\"24h\"` |\n| `deliveryClass` | `live` \\| `durable` | per-channel delivery class (\xA74); overrides the space default |\n| `description` | string | one-line purpose; max 200 chars |\n| `instructions` | string | advisory usage text; max 2000 chars |\n\nSpace-wide defaults (`ChannelDefaults`: `replay?`, `replayWindow?`, `deliveryClass?`) live under\nthe reserved key `=defaults`. Effective replay is `channel.replay ?? defaults.replay ?? true`.\nEffective delivery class is `channel.deliveryClass ?? defaults.deliveryClass ?? \"durable\"`.\n`defaults.deliveryClass` MUST be written at space creation from the deployment profile\n(local/self-hosted \u21D2 `durable`, persistence on by default; public/web-scale \u21D2 `live`, durability\nopt-in per channel), so the effective default is always discoverable on the wire, never inferred\nfrom out-of-band context. The same effective config MUST be the single source of truth for live\njoin, durable fan-out, history read, and membership surfacing; an implementation MUST NOT resolve\nthe class differently in different paths.\n\nJoin subscribes the instance to the channel; leave unsubscribes it. A join target MUST be within\nthe instance's read ACL (`allowSubscribe`, \xA79); a join outside it MUST be refused by the broker on\nsubscribe. A client MUST NOT publish to wildcard channels, but a wildcard read ACL (`team.>`)\nauthorizes subscribing to any one concrete channel under it **without enumerating channels in\nadvance**. In the NATS binding, join is a native `sub.allow`-bounded core subscription to the\nchannel subject and leave is the corresponding unsubscribe; **no privileged mediation is\nrequired**: the broker enforces every subscribe against `sub.allow`, so an instance whose ACL\npermits a channel joins and leaves it on its own, with no manager present. Open mode behaves the\nsame (the client subscribes directly). Leaving the last channel is permitted: under the core-sub\nbinding an empty subscription set subscribes to nothing (the v0.2 \"empty filter subscribes to all\"\nhazard and its last-channel-leave refusal were artifacts of the multi-filter durable and no longer\napply). On a `durable` channel, join additionally establishes durable membership, a separate\n**privileged** step: the instance requests durable membership from the server-side delivery daemon (a\ndurable-join command on the `delivery` endpoint, \xA713, carrying the channel and its captured join\ncursor) and the daemon writes the membership record. This is decoupled from the live subscribe, so a self-serve live join never depends\non it: a `durable` channel still delivers live with no privileged writer present, and only its\ndurable backstop requires one. A locally created subscription that the\nbroker later refuses (the permission violation is asynchronous in the NATS binding) is NOT a\nsuccessful join: an instance MUST treat a join as effective only once the broker has accepted the\nsubscribe, and MUST drop the channel from its joined set on a late refusal (\xA712). Leave removes the\nmembership (see membership below).\n\nReplay / catch-up on join:\n\n1. Record the channel join watermark (the CHAT frontier) before the subscription is active, so\n live tail and backfill do not double-deliver.\n2. Subscribe to the channel subject (`sub.allow`-bounded; \xA78). The live copy now flows.\n3. If effective replay is on, read retained messages for that channel up to the watermark,\n through a single-channel history read bounded by the current read ACL (`allowSubscribe`, \xA78),\n optionally limited by `replayWindow`. History is ACL-bounded, not membership-gated: an ACL-holder\n may read a channel's retained content whether or not it is a current member (it could self-join\n and read regardless), so the confidentiality boundary here is the ACL, consistent with the live\n read.\n4. Surface backfilled messages with `MessageMeta.historical = true`.\n5. Deduplicate by `id` across the live tail, the backfill, and (on `durable` channels) the durable\n backstop, so a message surfaces once.\n\n`replay=false` is noise control, not confidentiality. CHAT history is readable only within an\ninstance's read ACL (`allowSubscribe`, \xA79); confidential content MUST use DM or anycast.\n\nChannel membership governs **durable-delivery inclusion** (who receives fan-out copies into their\nper-subscriber backstop) and is broker-known, not self-reported. It is NOT a confidentiality\nboundary tighter than the read ACL: `allowSubscribe` bounds what content an instance may read (live\nand history, \xA79), and an ACL-holder can self-join, so membership adds delivery semantics, not read\nconfinement. In the NATS binding, membership is a privileged-written record in the space registry\nplane under a key the agent's profile cannot write (NOT the agent's presence key), carrying per-member\njoin/leave cursors so a publish concurrent with a join or leave orders deterministically; it is NOT\nderived from consumer topology, and an agent MUST NOT self-assert its own membership. It is written by\nthe server-side delivery daemon in response to a durable-join command on the `delivery` endpoint\n(\xA78, \xA713, Appendix B), distinct from and not required by the self-serve live subscribe. The implementation MUST re-authorize every\n**durable-backstop** read of `(instance, channel, message)` against the instance's current read ACL\nand membership before surfacing content, so a channel dropped from the ACL or **left** is no longer\nsurfaced from the backstop: **leave is a hard read boundary for the durable backstop** (it does not\nrevoke the ACL: an instance may still re-subscribe live, or read ACL-bounded history, within\n`allowSubscribe`). Membership remains observability data for liveness/roster purposes and MUST NOT be\nused as a send authorization gate.\n\nOn a `durable` channel, membership carries the member's **join cursor** (the CHAT frontier captured\nat join, the same watermark used to deconflict the live tail and the backfill) and, on leave, a\n**leave cursor/tombstone**. The durable backstop is at-least-once (within retention)\nfor messages whose stream sequence is **> the member's join cursor and \u2264 its leave cursor**, where each\ncursor is the CHAT frontier (the last sequence) captured at that transition; messages published before a\njoin or after a leave are not redelivered as durable and are reachable only via an ACL-bounded history\nread (within `allowSubscribe`). A rejoin takes a new join cursor, so messages published during the gap are not durably\nredelivered. A `durable` join is atomic across its two effects: the instance is durable-joined only\nonce BOTH the broker-confirmed live subscribe AND the membership write have succeeded, and on a late\nsubscribe refusal the membership record MUST be removed. If the live subscribe succeeds but durable\nmembership cannot be established (for example no privileged writer is present), the instance is\n**`joined live` with the durable backstop unestablished**: it MUST NOT be reported as `joined durable`,\nthe live subscription remains active, and the durable shortfall MUST be surfaced as an exceptional\ndelivery state (e.g. `durable backstop unavailable`), never silently.\n\n---\n\n## 8. NATS + JetStream binding\n\nBacking streams are created once at space setup. `STREAM.CREATE` is denied to agents in auth\nmode.\n\n| Stream | Captures | Retention | Required config |\n| --- | --- | --- | --- |\n| `CHAT_<space>` | `cotal.<space>.chat.>` | Limits | file storage, `max_msgs_per_subject=1000`, `discard=Old`, `allow_direct=true` |\n| `DM_<space>` | `cotal.<space>.inst.>` | Limits | file storage, no Direct Get |\n| `TASK_<space>` | `cotal.<space>.svc.>` | WorkQueue | file storage, no Direct Get |\n\nChannel **live** delivery is a native core-NATS subscription to `cotal.<space>.chat.*.*.<channel>`\n(wildcard sender owner+actor) bounded by `sub.allow` (\xA79), not a durable consumer; join/leave is the\nsubscribe/unsubscribe and needs no privileged mediation. The legacy v0.2 `chat_<owner>-<actor>`\nlive-tail durable is removed from this binding (it MAY coexist transiently during migration behind\n`id` dedup, but is not part of the contract).\n\nDurable consumers. Per-instance durables are keyed on the principal's **dash-form** `<owner>-<actor>`\n(a `.` is illegal in a durable name; see \xA72), so a durable name-scopes to exactly one principal:\n\n| Durable | Stream | Filter | Policy |\n| --- | --- | --- | --- |\n| `chathist_<owner>-<actor>-<uid>` | CHAT | one `cotal.<space>.chat.*.*.<channel>` per read | transient single-filter consumer for history reads (join-backfill / focus-recall); created per read scoped to one channel in `allowSubscribe`, then deleted; `AckNone`. History is ACL-bounded by the pinned filter, not membership-gated (\xA77, \xA79) |\n| `dm_<owner>-<actor>-<uid>` | DM | `cotal.<space>.inst.<owner>.<actor>.>` | provisioner-created in auth mode at lifecycle activation; bind only; `DeliverPolicy.ByStartSequence` with `OptStartSeq = activationFrontier + 1`, where the **activation frontier** is the DM-stream's last sequence captured at activation (`0` on an empty stream, so the start is `1`): `ByStartSequence` is inclusive and the lifecycle interval is half-open, so the consumer starts strictly AFTER the frontier, never `All`, which would replay a recycled alias's history and the inactive-gap backlog; `AckExplicit`; `ack_wait=60000ms` |\n| `svc_<role>` | TASK | `cotal.<space>.svc.<role>.>` | provisioner-created in auth mode; bind only; `AckExplicit`; `ack_wait=60000ms`. **Intentionally role-shared, not lifecycle-scoped**: anycast work belongs to the role, and successive holders draining one pool is the contract |\n\nFrom v0.4, each lifecycle's durable state lives in the **half-open interval**\n`(activationFrontier, retirementFrontier]` per stream: consumers start strictly after the\nactivation frontier (`OptStartSeq = frontier + 1`, table above; the frontier is captured\nAFTER any inactive alias gap), and terminal retirement records the\nretirement frontier before the alias is freed, so a successor lifecycle never receives the\npredecessor's pending backlog nor messages published while no lifecycle was active (\xA713.1).\n\nPer-instance durable names use the principal's dash-form `<owner>-<actor>` (both tokens\nfail-loud-validated, not lossily sanitized), so a durable name-scopes to exactly one principal (\xA72).\nThe authenticated wire identity is the principal, not the connection nkey. From v0.4, in auth mode,\nper-instance durable state is additionally **lifecycle-scoped** (\xA713.1): durable consumer names,\npending delivery cursors, membership rows, and ACL/ledger rows key on\n`(principal, lifecycleUid)` (dash-form `<owner>-<actor>-<lifecycleUid>`), terminal retirement\nrecords per-stream sequence cutoffs before an alias is reused, and a same-name successor\ninherits none of its predecessor's pending state: its consumers start after its OWN\nactivation frontier (which is \u2265 the predecessor's retirement cutoff), the cutoffs bound the\npredecessor's interval, they are never the successor's start.\n\n**Durable backstop (\xA74).** The per-subscriber durable copy is a delivery contract, not a pinned\nlayout: each member has a private durable store, written on publish for a `durable` channel's current\nmembers and, for an `@mention` on a `live` channel, for each mentioned target authorized to read that\nchannel (its `allowSubscribe` covers it), so an authorized but offline target still receives it. The\nagent holds **no content-bearing read** on this mixed store. A **trusted reader** (the server-side\ndelivery daemon) pulls each pending entry, re-authorizes `(instance, channel, message)` against the\nmember's **current read ACL** and, for `durable`-channel fan-out entries, its **membership interval**\n(the message's CHAT sequence is `> joinCursor` and `\u2264 leaveCursor`; \xA77), not a current-member boolean,\nso a pre-leave entry stays deliverable and a post-`leaveCursor` one does not,\nand delivers each authorized copy to the member over an **at-least-once** handoff (its own\n`dlv_<owner>-<actor>-<uid>` DELIVER consumer, carrying the same ack semantics, not a fire-and-forget publish). The trusted reader MUST NOT ack or\ndelete the backstop entry until the member has confirmed the copy was surfaced or handled (or it has\nbeen transferred to an equivalent per-member at-least-once mechanism with the same ack semantics); on a\ndownstream nak, timeout, or crash before that confirmation, the entry remains pending and redelivers, so\na crash between the `dlv` handoff and the member surfacing the message cannot lose it, and `durable`\nstays at-least-once end-to-end, not maybe-once. Content\nfor a channel dropped from the ACL, or (for a durable channel) left, is never surfaced (at-least-once for\nthe member within retention; **leave is a hard read boundary for the backstop**); a `live`-channel\n`@mention` copy is delivered and `id`-deduped the same way. The read MUST run in this trusted component\nthe agent cannot bypass, because a self-bound consumer has no server-side per-message ACL/membership\nfilter. The store's stream/subject layout, the fan-out writer, the trusted reader, and the membership\nregistry are reference-implementation, not normative; a conformant deployment MAY realize the backstop\ndifferently as long as the \xA74 guarantee and the \xA79 checks hold.\n\nPublishers MUST publish channel, unicast, and anycast delivery messages through JetStream and set\nthe JetStream message id to `CotalMessage.id` (`Nats-Msg-Id` on the wire). A JetStream publish is\nan ordinary subject publish that the stream also captures, so the same message reaches core\nsubscribers live (\xA74 `live`) and is retained for history and the durable backstop in one publish;\nthe publish path is unchanged from v0.2; only the live *read* moves to a core subscription.\nAck/nak/term semantics apply to JetStream-consumed copies (history, DM, anycast, and the durable\nbackstop): receivers MUST ack only after a message has actually been surfaced or handled, MAY nak\ntransient failures, and MUST term permanently invalid messages. The at-most-once `live` copy is not\nacked.\n\nHistory on join uses the pinned single-filter `chathist_<owner>-<actor>-<uid>` consumer create above, bounded to\n`allowSubscribe`; agents are not granted unfiltered Direct Get. DM and TASK MUST NOT enable Direct Get\nbecause it would bypass the consumer-create deny that is part of the confidentiality boundary.\n\nKV buckets are also streams and are pre-created:\n\n| Bucket | Holds | TTL |\n| --- | --- | --- |\n| `cotal_presence_<space>` | presence (\xA76) | 6000 ms |\n| `cotal_channels_<space>` | channel registry (\xA77) | none |\n| `cotal_membership_<space>` | derived channel-membership feed (below) | none |\n\n**Derived channel-membership feed (observability).** `cotal_membership_<space>` is a per-agent\n(key = `card.id`) derived view of who is subscribed to each channel: the **union** of an agent's\n`live` core-subscriptions (read by a privileged daemon from the broker's connection view) and its\n`durable` memberships (the members registry), each value `{ live: string[], durable: string[],\nobservedAt }` with `live` keeping subscription patterns (wildcards) the consumer expands at read time.\nIt exists so an observer can show silent readers and `live`-channel membership without a broker-admin\ncredential in the dashboard tier; it is written by a scoped privileged daemon and read by the\nadmin/observer profile only. It is **DISPLAY-ONLY and broker-derived**: it MUST NOT be an input to any\ndelivery, ACL, or authorization decision (authority for those stays the broker's `sub.allow` and the\nmembers registry), and it is not part of the normative wire contract a client must implement.\n\n---\n\n## 9. NATS + JetStream security and authorization\n\n**On by default.** A space is provisioned with decentralized JWT auth. Open unauthenticated\ndev mode is available but out of scope for the security claims here. *(Informative\noperator-facing views of this section: [docs/identity-and-auth.md](docs/identity-and-auth.md),\n[docs/channels-and-permissions.md](docs/channels-and-permissions.md); the threat model is\n[docs/security.md](docs/security.md).)*\n\n- **Account = space, user = agent.** A space is one NATS account. A per-space operator signs\n the account; an account signing key mints per-agent user JWTs.\n- **Profiles are default-deny allow-lists.** Subject, stream, durable, and KV names are built\n from the same builders as \xA73 and \xA78. Exact profile shapes are in Appendix B.\n- **An agent's channel scope is three concepts**, each a list of channel names or wildcard\n subtrees (`team.>`): `subscribe`, the active read set, the channels it subscribes to at boot\n (now native core subscriptions; mutable at runtime by direct subscribe/unsubscribe with no\n mediation); it MUST be a subset of `allowSubscribe`. `allowSubscribe`, the read **ACL**, the\n channels it MAY read (default = `subscribe`), minted as native `sub.allow` subscribe grants over\n `cotal.<space>.chat.*.*.<channel>` (wildcards preserved, so an open ACL needs no enumeration) and\n as the matching per-channel history-consumer create grants. `allowPublish`, the post **ACL**,\n the channels it may publish to; **default-deny** (a chat publish grant is minted only for a\n declared channel).\n\nEvery grant below is keyed on the agent's **principal** `<owner>.<actor>` (\xA72), except the reply\ninbox, which is keyed on the **connection** `<connId>`: the connection nkey (static mode) or the\nclient-chosen nonce (user mode, \xA79). This is the one place the wire identity and the connection\ncredential diverge (\xA72): the principal keys subjects/durables/presence; the connId keys the inbox.\n\n| Profile | Application publish | Read surface | Notes |\n| --- | --- | --- | --- |\n| `agent` | own `chat.<owner>.<actor>.<ch>` for each `allowPublish` channel (post ACL, default-deny), `inst.*.*.<owner>.<actor>`, `svc.*.<owner>.<actor>`; endpoint request forms per minted capability (`ep.one`/`ep.all`/`ep.inst` with the capability's authz-mode/target pattern, caller triple `<owner>.<actor>.<uid>` pinned; `describe` by default; `epj` submissions for journaled capabilities; \xA713.9); own presence key | own `_INBOX_<connId>.>` + own endpoint reply rail (`ep.reply.*.*.*.<owner>.<actor>.<uid>.*`, exact arity); channel live tail via native `sub.allow` subscriptions to `chat.*.*.<channel>` per `allowSubscribe` (wildcards preserved); CHAT history via single-filter `chathist_<owner>-<actor>-<uid>` creates, one per `allowSubscribe` channel (ACL-bounded); own lifecycle-scoped `dm_\u2026`/`svc_\u2026` bind-only; durable backstop via own bind-only lifecycle-scoped `dlv_\u2026` DELIVER consumer, **no** grant on the mixed pre-auth fan-out stream; granted record-key/event-topic read subtrees per capability | read bounded by `allowSubscribe`; durable copies re-authorized (current ACL + membership + lifecycle) by the trusted reader before the `dlv` handoff; no Direct Get; DM/TASK/DLV create denied |\n| `observer` | none | chat, CHAT history, presence, channel registry | DMs invisible |\n| `admin` | none | whole space live tap plus DM history | plaintext god-view, opt-in |\n| scoped host profiles | least-privilege per function | least-privilege per function | The former allow-all `manager` is **deleted**; its host duties split into scoped, single-function creds (`supervisor`, `provisioner`, `delivery`, `membership-rw`, `operator`, `purger`, `teardown`, `channel-writer`, \u2026). No allow-all credential exists. Appendix B summarizes them; the concrete grant lists are **generated from the \xA713.9 ownership matrix** into `provision.ts` (the matrix is the single oracle; `provision.ts` is its artifact, Appendix B its summary). |\n\nDM and TASK confidentiality, and the CHAT read boundary, close the leak paths:\n\n1. Replies and pull responses ride a per-connection inbox prefix, `_INBOX_<connId>.>`, which\n `sub.allow` permits alongside the agent's channel read grants (next item) and nothing else. In user\n mode the client picks `<connId>` (a nonce) and the callout scopes the inbox to it, so a\n wildcard-inbox subscribe that would sniff peers' DM deliveries is refused. Re-authorized durable\n copies do NOT ride the inbox; they ride the agent's own lifecycle-scoped `dlv_<owner>-<actor>-<uid>` DELIVER consumer\n (item 5, \xA78).\n2. **Channel live reads are bounded by `sub.allow`.** `allowSubscribe` is minted as native subscribe\n grants over `cotal.<space>.chat.*.*.<channel>` (wildcards preserved); the broker refuses, per\n subscribe, any channel subject outside the ACL. There is no per-channel consumer name to confine,\n so an open ACL (`team.>`, `>`) grants selective single-channel join with no enumeration and no\n read-breakout. A `>` grant is read-all chat in the space by design (credential compromise reads\n all chat), so it suits trusted/local deployments, not least privilege.\n3. A consumer create on the bare/multi-filter subject is not ACL-constrainable, so the provisioner\n pre-creates `dm_<owner>-<actor>-<uid>`, `svc_<role>`, and the per-member `dlv_<owner>-<actor>-<uid>` handoff\n durables. Agents bind their own `dm_\u2026-<uid>`/`svc_<role>`/`dlv_\u2026-<uid>` only (never\n create); the mixed pre-auth fan-out store is read by a trusted reader, not the agent (\xA78, item 5).\n Those bare/multi-filter create forms are not granted to agents (default-deny), with explicit\n create-denies on `DM_<space>`, `TASK_<space>`, and the `DLV` stream; on `CHAT_<space>` the only\n consumer-create an agent holds is the pinned single-filter history create (next item), so a broad\n CHAT create-deny is intentionally absent: it would also deny that pinned create.\n4. CHAT history reads are bounded to `allowSubscribe`: a consumer create on the extended subject\n `$JS.API.CONSUMER.CREATE.<stream>.<name>.<filter>` carries a single filter the server pins to the\n request body, so an agent is granted exactly one such create-subject per `allowSubscribe` channel\n and can read history of no other channel. The unfiltered Direct Get grant is not given to agents.\n5. **The durable backstop is read by a trusted reader, not the agent.** The agent holds no\n content-bearing read on the mixed pre-auth fan-out store; a trusted reader (the server-side delivery\n daemon) MUST re-authorize `(instance, channel, message)` against the member's current read ACL and,\n for `durable`-channel fan-out entries, its current membership, before handing the authorized\n copy off to the member's own lifecycle-scoped `dlv_<owner>-<actor>-<uid>` DELIVER consumer:\n broker ownership of an inbox (\"this is agent A's\") is not authorization, since the store can hold\n messages for channels A has since dropped from its ACL or left, and a self-bound consumer cannot\n filter per-message on membership. Fan-out-on-write is routing, not an authorization check; for a\n durable channel a `leave` is a hard read boundary on the backstop. History/backfill reads are instead\n self-served and bounded by the current read ACL (the pinned single-filter create above), consistent\n with the live read. An `@mention` durable copy is written only to a target authorized to read the\n channel, so `mentions` cannot carry content outside a target's read ACL.\n6. **\"Current read ACL\" is the effective broker-accepted credential.** An ACL narrowing takes effect\n when the credential/permissions are updated and enforced by the broker (re-mint / reconnect /\n revocation), not as an instantaneous global value; until then an existing broad credential remains\n broad. Both the broker `sub.allow` checks and the trusted-reader re-checks are evaluated against that\n effective credential.\n\nThis binding provides containment and authenticity under a single trusted broker: an agent\ncan emit only as itself and only to its declared `allowPublish` channels, and read only its own\nDMs and chat *content* within `allowSubscribe` (and, for `durable` content, its current\nmembership), enforced by the server. It does not provide\nnon-repudiation, does not survive an untrusted relay, and DMs are plaintext to the broker and\nto `admin`. The read bound is on **content**, not metadata: agents hold `STREAM.INFO` on CHAT\n(for the join watermark, the recall drop-marker, and channel-list counts), so a `subjects_filter`\nquery leaks chat subject *metadata* (channel names, sender ids, and per-subject counts) for\nchannels outside `allowSubscribe` (channel names are already public via the registry). Hiding\nthat metadata is deferred strict-containment work. See [docs/security.md](docs/security.md).\n\n**Consumer-delivery confused deputy on the read grants.** A JetStream consumer delivers stored\nbytes to a **caller-chosen destination the broker does NOT confine to the requester's\n`pub.allow`**: a push consumer's `deliver_subject`, and a pull `MSG.NEXT`/`DIRECT.GET`\nrequest's reply subject, are set in the request body and the server's internal client publishes\nthere regardless of the requester's publish permissions. The v0.3 read grants above,\nCHAT-history `CONSUMER.CREATE`, the bind-only DM/DLV/TASK `MSG.NEXT`, and the KV watch creates\n(Appendix B); therefore let an agent redirect content it may legitimately READ onto a subject\nit may NOT publish to: e.g. replay a stored CHAT message whose `from.id` is another sender onto\n`inst.<victim>.<thatSender>`, where the recipient derives the DM sender from the subject and\nsurfaces it as a genuine DM from a principal who never sent it. The \xA713.9 \"Mediated reads\" rule\napplies here: **no untrusted agent holds a raw consumer `CREATE`/`MSG.NEXT` or `DIRECT.GET` on\n`CHAT`/`DM`/`TASK`/`DLV` or the KV buckets**; those reads are served by the trusted\nreader/mediator (\xA78) onto the agent's own confined rail. Which of these read paths require\nmediation and which are provably safe depends on whether a redelivered message retains its\noriginal captured subject and how the receiver's subject-derived kind check (\xA712) then\nclassifies it; the reference implementation determines this by test and pins the exact grants.\nOn the v0.3 rails without this mediation, read containment holds only against a *conforming*\nclient; the broker does not enforce it.\nSee [docs/security.md](docs/security.md).\n\n---\n\n## 10. Connection and onboarding\n\nJoin link grammar:\n\n```text\ncotal://[token@]host[:port]/space[?channel=a,b] plaintext\ncotals://[token@]host[:port]/space[?channel=a,b] TLS required\ncotal://user:pass@host/space user/password auth\n```\n\n- Default port is `4222`.\n- `channel` and `channels` query parameters are equivalent comma-separated channel lists.\n- Credentials in `userinfo` are parsed out and passed to the NATS client as connect options;\n they are not left inside the server URL.\n- Bare `userinfo` with no `:` is a token. `user:pass` is username/password.\n- `cotals://` means `nats://host:port` plus TLS-required connect options.\n- Credentials (`creds`) are mutually exclusive with token and username/password auth.\n- A client MUST set `inboxPrefix` to `_INBOX_<connId>` before any request, pull consumer, or KV\n watch operation, where `<connId>` is the connection identifier (the connection nkey in static\n mode; the client-chosen nonce in user mode, \xA72/\xA79), NOT the owner+actor principal, which the\n client may not know pre-connect.\n\nAuthenticated onboarding has two bindings. **Out-of-band credential minting** provisions a per-agent\ncredential ahead of connect (the static path). **Auth-callout onboarding** validates a user bearer at\nconnect time and mints the scoped data-account JWT then (user mode, \xA72/\xA710): the client presents a\ndeny-all sentinel credential plus its bearer, the callout derives the owner+actor principal and grants,\nand re-binds the connection into the data account. The owner-token *derivation* (how a bearer maps to\nan owner token) is a pluggable identity adapter (any OIDC/IdP via a thin bridge), not fixed by this\ncontract; the callout *mechanism* and the resulting grants are. From v0.4 every minted connection also carries its **lifecycle UID** (\xA713.1): the manager\nmints it for managed agents at provision, and the callout/exchange attaches it as a claim at\nconnect for user-mode connections, so the caller-UID token in every endpoint-rail grant is\nauthority-assigned, never client-chosen. Every bearer additionally carries its incarnation's\n**root credential id** (`act.credentialId`, \xA713.1). The exchange ensures the ACTIVE\n`cred.<lifecycleUid>.<credentialId>` ledger row exists BEFORE the bearer bytes are released\n(the row durable first, the issuance-gate finalize CAS, the lifecycle head's current-root CAS\nlast), and the connect authority proves the presented id against the LIVE row, leader-served\nfrom the shape-proved primary auth store: the row MUST be `active`, unexpired, and bound to the\nconnecting principal and lifecycle, and a root-issued credential MUST additionally equal the\nlifecycle head's current root credential. A claimless bearer, a revoked, expired, or absent row,\nand an unreadable authority store all DENY the connect. The root credential is\n**incarnation-wide**: ONE `cred.<lifecycleUid>.<credentialId>` row per incarnation, re-stamped\n(the same id) on every exchange for the incarnation's lifetime, never a fresh id per exchange.\nRevoking that one row is the per-credential revocation lever and denies EVERY bearer of the\nincarnation at the next connect (deny-new; evicting an already-live connection is the lifecycle\nbarriers' job, \xA713.1). Because the id is incarnation-stable, a crash after the head's current-root\nCAS re-exports the SAME id on the next exchange (that id IS the incarnation's live root, so there\nis nothing unobserved to revoke); the only pre-release crash window is a durable active-but-\nunstamped row, which the head-equality check denies. Rotating an incarnation's root credential is\nexclusively a lifecycle barrier's job, never a bare re-mint. A bearer MAY carry a server-authored\n**view** claim, minted only by the deployment's signed-in human exchange (never accepted from the\nclient or from a managed agent-secret exchange) and re-authorized against the live grant ledger at\nevery connect: the callout then mints the connection as the named elevated profile (Appendix B:\n`admin`, or a scoped host profile such as `purger`, `channel-writer`, `deployer`) instead of `agent`.\n\n---\n\n## 11. Versioning and extensibility\n\n- Wire contract version is v0.2 as advertised today. `AgentCard.protocolVersion` (\xA76) carries\n this string. The two v0.3 binding revisions (channel live delivery and owner+actor identity,\n see the header) and the **v0.4 endpoint control surface** (\xA713) are the normative targets the\n reference implementation is converging to. The control surface is an intentional **hard\n cut on the pre-1.0 line** (\xA713.11): the v0.3 control grammar and envelope are removed from\n this contract, not dual-served, a breaking revision, permitted pre-1.0, shipping under an\n explicit new version marker per this section's rule; the marker is the disjoint endpoint\n subject grammar and versioned envelope. The advertised `protocolVersion` bumps to `0.4` when\n the control-surface migration completes (one campaign, one merge); a version string is not a\n per-surface cutover claim. **`1.0` is deliberately deferred**: it is a stability declaration\n to outside implementers, made separately once the contract has settled (further pre-1.0\n arcs (presence/addressing, multi-space, federation) may still break the wire). **The wire `protocolVersion`\n is the compatibility signal**; dated document snapshots (below) are navigation artifacts, not\n negotiation; an implementation MUST NOT treat a document date as an interop key.\n- v0 has no in-band capability negotiation. Deployments MUST agree on the binding and\n version out of band. A participant advertises the version it speaks via\n `AgentCard.protocolVersion` (\xA76) as a one-way change signal, optional before the v0.4\n marker, MUST from v0.4 (\xA76, \xA713.11); v0 defines no behavior on a mismatch beyond rejecting\n messages it cannot parse.\n- New message families, subjects, and routing kinds are added in the core contract,\n generalized for all deployments, not in one example.\n- Receivers MUST ignore unknown object fields and MUST NOT treat an unknown field as an\n error.\n- A future v1 MUST either keep v0 subjects backward-compatible or use an explicit new\n version marker in subjects, credentials, or deployment config.\n\n**Document snapshots.** Published revisions of this document are dated snapshots\n(`YYYY-MM-DD`, the **Last updated** date above): the current revision is canonical, and a\nsuperseded one stays retrievable from the repository history (the git history and tagged\nreleases of `SPEC.md`), so a client built against it can still be audited. The snapshot\ndate advances on any normative change; the wire `protocolVersion` moves only per the\nchange process below.\n\n**Change process.** This document is the change-control point: a change lands here first,\ngeneralized into `core`, and the reference implementation follows. Additive changes (a new\noptional field, a new namespaced `Part.kind`, a new subject) are backward-compatible and ship as\na minor bump, since receivers ignore what they do not recognize. Changing the meaning of an\nexisting field or subject, or removing or renaming one, is breaking. **Pre-1.0**, a breaking\nchange ships as a minor bump of the v0.x line under an explicit new version marker in\nsubjects, credentials, or deployment config (the v0.4 endpoint grammar is such a marker);\n**post-1.0**, it ships as a major bump. `1.0` itself is a stability declaration, made\ndeliberately and separately from any wire change.\n\n**Extension namespacing.** Core `Part.kind` values, `meta` keys, and `tags` are bare and reserved\nto this spec (`text`, `data`, and future core additions). A non-core extension MUST namespace its\ncustom `Part.kind` values and `meta` keys reverse-DNS, under a domain its author controls, e.g.\n`{ \"kind\": \"com.acme.snapshot\" }` or `meta[\"com.acme.region\"]`; Cotal's own non-core extensions\nuse `ai.cotal.*`. This keeps third-party names from colliding with each other or with future core\nnames, with no central registry.\n\nReserved future work: signed envelopes, `did:key` identity, artifact/object-store parts,\nauth-callout bootstrap tokens, manager profile scoping, and federated/untrusted relay\nbindings. (Revocation/TTL for minted credentials is no longer future work on the control\nsurface: v0.4 defines it normatively via the credential ledger and the lifecycle barriers,\n\xA713.1.)\n\n---\n\n## 12. Conformance\n\n*(An informative build-order walkthrough of this checklist is\n[docs/build-a-client.md](docs/build-a-client.md).)*\n\nA conformant authenticated NATS client MUST:\n\n1. Use one stable principal `<owner>.<actor>` as its wire identity everywhere: subject sender\n tokens (\xA73), `from.id` (\xA75), presence key (\xA76), durable names (dash-form, \xA78); and treat the\n connection credential (nkey) as distinct, keying only its reply inbox (\xA72).\n2. Publish only on subjects whose sender tokens are its own principal `<owner>.<actor>` (\xA73).\n3. Publish delivery messages as UTF-8 JSON through JetStream with `msgID = id` (\xA78).\n4. Set exactly one routing field on each delivery message (\xA75).\n5. Reject any received delivery message whose `from.id` does not match the subject sender, and whose\n subject `<owner>` is not a well-formed principal owner token: a subject that split-parses but\n carries a non-owner in the owner slot (e.g. a raw nkey, an old-shape alias) MUST NOT be surfaced\n as a delivery (\xA73, \xA75).\n6. Derive delivery kind (channel/dm/anycast) from the subject, not payload routing fields (\xA74).\n7. Ack only surfaced/handled messages and terminate permanent anomalies (\xA74, \xA78).\n8. Write only its own presence key on the heartbeat interval (\xA76).\n9. Set the per-instance inbox prefix before transport operations (\xA710).\n10. Treat unknown fields as ignorable (\xA711).\n11. Resolve a channel's effective delivery class (`live`/`durable`) from channel config, not from a\n deployment assumption, and use one resolution across live join, durable fan-out, history read,\n and membership surfacing (\xA74, \xA77).\n12. On a `durable` channel, tolerate the at-most-once `live` gap and catch up via the durable\n backstop; deduplicate by `id` across the live, backfill, and durable copies (\xA74, \xA78).\n13. Join and leave a channel's **live** subscription by subscribing/unsubscribing under `sub.allow`\n with no privileged mediation; treat a live join as effective only once the broker accepts the\n subscribe, and drop it on a late permission refusal. On a `durable` channel, additionally establish\n durable membership via the privileged provisioner; if it cannot be established, report `joined live`\n with the durable backstop unestablished, never `joined durable` (\xA77, \xA79).\n14. Bound history/backfill reads by the current read ACL, and re-authorize every durable-backstop read\n against the current read ACL (and, for `durable`-channel entries, membership) before surfacing\n content, treating a leave as a hard read boundary on the backstop (\xA77, \xA79).\n\nTest vectors use these sample principals (`<owner>.<actor>`); `<ownerA>` = `u_aaaaaaaaaaaaaaaaaaaaaaaaaa`,\n`<ownerB>` = `u_bbbbbbbbbbbbbbbbbbbbbbbbbb` (owner tokens are `u_` + 26 base32-lower, \xA72):\n\n- Alice: `<ownerA>.alice`\n- Bob: `<ownerB>.bob`\n- Reviewer role: `reviewer`\n\nSubject parsing. `parseSubject` **splits only** (\xA73): it recovers tokens by prefix and per-kind arity\nbut does NOT validate the owner token: a well-formed *split* is necessary, not sufficient, for a\nsubject to be surfaced as a delivery. The last row shows an old-shape alias that split-parses yet MUST\nbe dropped at the surfacing boundary (\xA79):\n\n| Subject | Result |\n| --- | --- |\n| `cotal.main.chat.<ownerA>.alice.team.backend` | `kind=chat`, `sender=<ownerA>.alice`, `rest=team.backend` |\n| `cotal.main.inst.<ownerB>.bob.<ownerA>.alice` | `kind=inst`, `sender=<ownerA>.alice`, `rest=<ownerB>.bob` (recipient) |\n| `cotal.main.svc.reviewer.<ownerA>.alice` | `kind=svc`, `sender=<ownerA>.alice`, `rest=reviewer` |\n| `cotal.main.ctl.manager.<ownerA>.alice` | no sender; v0 control subject, retired (\xA713.11): nothing serves it and it MUST NOT be handled |\n| `cotal.main.chat.<ownerA>.alice` | no sender; malformed (owner+actor but no channel token) |\n| `cotal.main.chat.UAQGWOEVJKMIO4WXSYOTLARXYOZTCXFK67JASEH6AFFFYK6FOPSKQCAD.team.backend` | split-parses (`kind=chat`, `owner=UAQ...QCAD`, `actor=team`, `rest=backend`) but MUST be dropped: `UAQ...QCAD` is not a principal owner token (\xA73, \xA79) |\n\nSample multicast message:\n\n```json\n{\n \"id\": \"018f1d0a-0000-7000-9000-000000000001\",\n \"ts\": 1710000000000,\n \"space\": \"main\",\n \"from\": {\n \"id\": \"u_aaaaaaaaaaaaaaaaaaaaaaaaaa.alice\",\n \"name\": \"alice\",\n \"role\": \"planner\"\n },\n \"channel\": \"team.backend\",\n \"mentions\": [\"bob\"],\n \"parts\": [{ \"kind\": \"text\", \"text\": \"Can you review this?\" }],\n \"contextId\": \"ctx-1\"\n}\n```\n\nSample unicast message changes only the routing field:\n\n```json\n{\n \"id\": \"018f1d0a-0000-7000-9000-000000000002\",\n \"ts\": 1710000001000,\n \"space\": \"main\",\n \"from\": {\n \"id\": \"u_aaaaaaaaaaaaaaaaaaaaaaaaaa.alice\",\n \"name\": \"alice\"\n },\n \"to\": \"u_bbbbbbbbbbbbbbbbbbbbbbbbbb.bob\",\n \"parts\": [{ \"kind\": \"text\", \"text\": \"Direct note.\" }]\n}\n```\n\nInterop scenario:\n\n1. Provision a space and credentials for Alice and Bob.\n2. Alice and Bob connect with inbox prefixes `_INBOX_<connId>` (per-connection, \xA72).\n3. Both write presence and join `team.backend`.\n4. Alice multicasts on `team.backend`; Bob receives with `kind=channel`.\n5. Alice unicasts to Bob; Bob receives with `kind=dm`.\n6. Alice anycasts to `reviewer`; exactly one reviewer receives with `kind=anycast`.\n7. A late joiner joins `team.backend`; replayed messages arrive with `historical=true` and\n live-tail duplicates at or below the join watermark are ack-dropped.\n\n---\n\n## 13. Endpoint control surface (v0.4)\n\nEverything on the mesh that serves structured commands (the manager daemon, the delivery\ndaemon, a wrapped MCP server, a third-party service) is an **endpoint**: a daemon that\nregisters a service identity, publishes its contracts, and answers `describe`. There is no\nspecial-cased service in this contract: `manager` and `delivery` are endpoint names like any\nother, and no subject or envelope in this section knows them. This section supersedes and\n**deletes** the v0 control rail (`ctl.<service>.<owner>.<actor>`, `ControlRequest`/\n`ControlReply`, the `self`/`manager`/`admin`/`delivery`/`delivery-admin` service tiers, and the\nreserved `control.<instance>` subject). The cut is hard (\xA713.11): no v0 control subject,\nenvelope, handler, or grant survives, and a pre-cut control credential cannot reach a post-cut handler.\n\nLayering: identity and transport are \xA72/\xA73, extended by the lifecycle identity below; \xA713.1\nidentity; \xA713.2 grammar; \xA713.3 envelope; \xA713.4 delivery contracts; \xA713.5 verbs; \xA713.6\ncomposites; \xA713.7 contracts and discovery; \xA713.8 distributed guarantees; \xA713.9 authority\nboundary; \xA713.10 receipts and signing anchors; \xA713.11 the hard cut; \xA713.12 the NATS binding;\n\xA713.13 plane ownership; \xA713.14 conformance.\n\n### 13.1 Lifecycle identity\n\nThe principal `owner.actor` (\xA72) is a **recyclable routing alias**: despawning an agent frees\nits actor name, and a later spawn may legitimately reuse it. An alias is therefore never\nsufficient *authority* identity on this surface. Two further identity components exist:\n\n- **Lifecycle UID** (`lifecycleUid`, one token `[a-z0-9]{26,32}`, \u2265128 bits of CSPRNG\n entropy in a fixed canonical encoding): an unguessable, never-reused\n identifier of one managed lifecycle under a principal. The UID is entropy, never order:\n no allocator counter exists, and what is durable and monotonic is only the never-used\n set. Before anything else, the minting authority (the manager for managed agents; the\n provisioner for endpoint daemons and operator credentials) **reserves the candidate UID\n space-globally**: a create-only write of the reservation key `uid.<lifecycleUid>`\n (\xA713.7), never deleted for the life of the space. A create conflict burns the candidate\n and draws a fresh one (the alias head alone cannot reject the same UID under a different\n alias, and the `gate.`/`cred.` families key by UID alone, so uniqueness must be\n space-wide); a DEL/PURGE marker on a reservation is corruption, never reusable absence.\n Only then does it mint **before the entity is reachable**, persisting a CAS-fenced\n mapping\n `{ owner, actor, lifecycleUid, managerInstance, processEpoch,\n state: active | retiring | retired, currentCredentialId?, lastTakeoverOpId?, op? }` (closed\n schema; the\n embedded `owner`/`actor` MUST equal the key's alias tokens, so a key-mismatched row\n never authorizes; `currentCredentialId` is absent until the credential ledger releases\n a root under the reopened gate; `lastTakeoverOpId` is the opId of the takeover operation\n that LAST advanced `processEpoch` (the epoch advance and this stamp are ONE head CAS, so a\n completion is bound to exactly one operation: a resuming barrier confirms the completed head\n carries ITS opId, and a LOSING concurrent takeover that captured the same pre-takeover\n coordinates finds a foreign opId and refuses, never claiming the winner's completion; absent\n until the first takeover); `op` is required at `retiring` and forbidden elsewhere)\n under the alias's **CAS head key** (\xA713.7:\n the **unsplit** `lifecycle.<owner>.<actor>` head key HOLDS this mapping as one atomic\n record, the single authoritative current mapping and the only source of `mappingRevision`,\n \xA713.9; the UID-suffixed `lifecycle.<owner>.<actor>.<lifecycleUid>` key is optional\n append-only audit, never the authority). `mappingRevision` IS the head key's store\n revision, learned from the publish ack or from the leader-served read that returned the\n mapping (one read returns `{ mapping, revision }`); the value carries NO revision field,\n and a body-supplied revision is never a CAS coordinate. Head states: `active` is the\n ONLY current state. `retiring` is the containment phase of the terminal barrier (below),\n bound to the retirement operation's `op.opId`; it is non-current and NOT replaceable.\n `retired` is terminal and asserts the barrier COMPLETED (the cleanup proof), which is\n what makes replacing a retired predecessor safe. **Every currency seam fails closed on\n both non-`active` states**: target resolution, the process-epoch reads gating\n record/status writes, admission/start, and supervision derive current authority only\n from `state: \"active\"`; `retiring` and `retired` alike yield no current mapping and no\n current epoch. Activation is the head CAS (create-only for a virgin alias;\n revision-pinned from a `retired` predecessor), so two concurrent mints for one alias\n serialize there and exactly one activates; the loser terminalizes its own orphan gate\n and burns its reserved UID, never deleting either (`currentCredentialId` is a public key\n identifier/fingerprint plus authority epoch, never secret material). A supervised restart\n of the same entity **preserves**\n the UID (revoking/rotating the connection credential and advancing the process epoch); a\n terminal despawn, explicit stop, or supervision escalation retires the UID through the\n terminal barrier *before* the alias is freed. A retired UID is never reactivated\n (`retired \u2192 active` for the SAME UID is forbidden; only the ALIAS is replaceable, by a\n freshly reserved UID); recycling cannot move to the reservation, which is never freed.\n- **Process epoch** (`incarnation`, an unsigned integer): the fenced ownership epoch of the\n process currently animating an identity, advanced by CAS on every takeover or restart. At\n most one live epoch owns an identity; a superseded process MUST stop serving and its commits\n are rejected (\xA713.8). **The epoch fences egress only**: reply, event, timer, session, and\n record-write-ingress publish grants pin it (\xA713.9), but request subjects deliberately omit it; a caller cannot\n know the serving epoch, so **no subject-level fence for ingress exists or can exist**. An\n un-revoked superseded serve credential remains a member of the class queue group and can\n consume (and externally effect, and never validly answer) one call in N. Takeover therefore\n carries a **normative barrier, in order**: freeze issuance for\n the lifecycle in the credential ledger (below) \u2192 revoke EVERY active credential-ledger\n row under the lifecycle prefix, every root (the superseded `currentCredentialId` and any\n earlier unexpired root: each root mint, initial or rotation, writes its own ledger row)\n and every ledgered descendant (handle-redemption-minted and per-session credentials,\n \xA713.6), via the deployment's auth\n authority, verifying the updated revocation state is enforced on EVERY server of the\n cluster before proceeding (fail-closed on partial acknowledgment: an unrevoked-anywhere\n credential can reconnect there) \u2192 evict the live connections of every revoked\n credential's `holderPrincipal` (from its ledger row, above)\n cluster-wide and verify the re-scan found none, the barrier executor (the trusted auth\n path) holds the delivery endpoint's `evictPrincipal` capability for exactly this step\n (Appendix B: granted to the barrier executor, not only `supervisor`); `evictPrincipal`:\n system-account CONNZ scan \u2192 per-server KICK \u2192 re-scan verify, fail-closed on partial\n scans; Appendix B) \u2192 **only THEN advance the process epoch by CAS (N\u2192N+1), reopen the gate\n at the new generation, and activate the successor's serve subscription**. The epoch CAS is\n LAST, not first: a superseded process is revoked and evicted before the successor's epoch\n exists, so it cannot publish a reply or event in a window between the CAS and the eviction;\n the egress epoch is honest attribution precisely because no live predecessor egress survives\n the barrier. (A reply the predecessor emitted for an in-flight call before eviction reaches\n a caller only within that caller's own deadline and from a not-yet-evicted process; the\n barrier's job is that no such process remains once the successor answers.) Where\n revocation or verified eviction is unavailable (e.g. static credential material\n pre-rotation, Appendix B), takeover MUST fail loud rather than proceed.\n\n**Credential ledger (normative).** Ingress has no epoch fence, so revocation is only as\ncomplete as the set of credentials it covers, and the lifecycle's `currentCredentialId` is\nnot that set. Every credential the trusted auth path mints **derived from** a lifecycle (the\nshort-lived credential of a handle redemption, the two per-session credentials of a session\nredemption, \xA713.6) is recorded at mint time in a durable, auth-owned **credential ledger**\nrow `{ credentialId, holderPrincipal (the `<owner>.<actor>` whose connections the barrier evicts; the credential id is NOT the principal, and eviction is by principal), lifecycleUid (the holder's), sourceChain: [root |\nhandle.<issuerKeyId>.<id>\u2026 | session.<sessionId>], the FULL verified lineage: for a\nhandle redemption, EVERY handle in the presented `parentDigest` chain (\xA713.6), never only\nthe leaf, state: active | revoked (monotonic), exp }`, keyed\n`cred.<lifecycleUid>.<credentialId>` so both barriers enumerate a lifecycle's full descendant\nfamily by key prefix. Each mint additionally writes one reverse-index key\n`bysrc.<issuerKeyId>.<id>.<lifecycleUid>.<credentialId>` per chain member, so **revoking a\nsturdy handle revokes every credential minted under it or under any of its descendant\nhandles**; a credential redeemed through a child handle carries the parent in its\n`sourceChain`/`bysrc` keys, so parent revocation reaches it without walking handle records.\n**Source gates.** The same fence applies per issuing handle, because a handle's revocation\nstate lives in the records bucket while credential indexes live here, and two buckets share\nno order: each sturdy handle has an auth-bucket gate `srcgate.<issuerKeyId>.<id>`\n(`{ state: open | frozen }`, CAS). Handle revocation CASes the source gate to `frozen`\n**before** it enumerates `bysrc.`, and a redemption, after writing its `cred.`/`bysrc.`\nrows, revision-pinned-CASes the source gate of EVERY handle in the presented chain (plus the\nlifecycle gate below), releasing only if all are still `open` at their observed revisions. An\nin-flight redemption under a handle being revoked therefore either finishes before the freeze\n(its rows are in the enumeration) or loses a CAS and never releases. **Handle revocation\ncarries the SAME cluster-wide eviction as a lifecycle barrier** (\xA713.9 `evictPrincipal`):\nafter freezing the source gate and enumerating `bysrc.`, revocation revokes every descendant\ncredential AND verifies revocation enforced on every server, then evicts and re-scans the live\nconnections of every revoked credential's principal, fail-closed, an already-connected\ndescendant credential is never silently left with live grants. The handle status write is\nacked only after that eviction is verified complete.\n\nAn unledgered mint MUST NOT occur (the ledger write precedes credential\nrelease, fail-closed), and the rule carries a mechanical audit invariant in the style of the\n\xA713.9 matrix grep test: every credential the auth authority has ever released MUST resolve\nto a `cred.<lifecycleUid>.<credentialId>` row; an issuance path that cannot show its ledger\nrow is non-conformant, auditable by diffing issued-credential ids against the ledger.\n\n**Issuance gate (normative).** \"Freeze issuance\" is a durable transition, not an assertion:\neach managed-agent lifecycle has a gate key `gate.<lifecycleUid>` in the same auth KV,\n`{ state: open | frozen | retired, generation, op? }` (CAS). A `frozen` gate MUST carry a\ndurable **operation intent** `op = { opId, kind: activation | takeover | registration |\nretirement, successor? }`: after a crash the intent alone\ndecides WHICH operation a frozen gate belongs to and what may advance it, a retry or\nreconciler resumes the SAME `opId`, and a writer that is not that operation's executor\nMUST NOT advance, reopen, or terminalize the gate. A `retired` gate RETAINS the\nterminalizing operation's intent as audit, and an idempotent terminal retry succeeds only\nfor that SAME operation. **Successor coordinates are per-kind and derivable, never loose\nprose**: an `activation` or `retirement` intent carries NO `successor` (an activation's\nsuccessor IS the head mapping the same operation writes; a retirement has none); a\n`takeover` or `registration` operation's successor artifacts are durably keyed by its own\n`opId` (the `stage.<opId>.` staging family and the operation's audit rows), so\n`{ opId, kind }` alone resumes deterministically. The gate MAY carry a `successor` summary\ntoken for those two kinds, but the staged rows are authoritative and a resumer MUST NOT\nact on a summary that the staged rows do not corroborate. **Allowed transitions are also\nper-kind**: a gate is BORN `frozen` only under an `activation` intent (and only for a UID\nwhose `uid.` reservation already exists); `open \u2192 frozen` belongs to `takeover`,\n`registration`, and `retirement`; `frozen \u2192 open` (reopen) belongs to `activation`,\n`takeover`, and a `registration` abort, NEVER `retirement` (a retirement freeze never\nreopens); `frozen \u2192 retired` belongs to `activation` (a head-CAS loser terminalizing its\nown orphan gate) and `retirement`, NEVER `takeover` or `registration` (those abort by\nreopening). An implementation MUST refuse a transition whose gate op kind is outside these\nsets, before any CAS is attempted. The `opId` is an identifier, never a\nbearer capability: a resumer re-authenticates as the operation's executor, and possession\nof the id alone grants nothing. `retired` is terminal, a retired\nlifecycle never mints again. `frozen` is **not** terminal, because a supervised restart\npreserves the UID (\xA713.1) and must mint the successor process's root credential: the\ntakeover barrier freezes at generation `G`, completes revoke + verified eviction of the\nfamily, and only then CASes the gate to `open` at generation `G+1`; the reopen is the\nbarrier's own final step, so no credential of generation `G` is ever live when generation\n`G+1` mints. A gate reopen by anyone but the completing barrier is non-conformant.\n**Endpoint instances use a disjoint gate family, distinguished by explicit prefix and\nnever by token arity**: the endpoint issuance gate is `epgate.<endpoint>.<instanceId>`,\n`{ state: open | frozen | retired, generation, processEpoch, registrationRevision,\nnameAuthorityRevision, principal, op? }` (the endpoint fence coordinates of \xA713.5/\xA713.7, plus\n`principal`: the serving instance's own CONNZ-attributable connection principal, recorded at\nregistration), and\nendpoint-derived credentials ledger under `epcred.<endpoint>.<instanceId>.<credentialId>`\nwith the same row schema, mint protocol, gate discipline, and never-delete rules as\n`cred.`/`gate.`. **`holderPrincipal` is ALWAYS a CONNZ-attributable `<owner>.<actor>` in\nBOTH families** (the barrier KICKs it; an endpoint NAME is not attributable and never sits\nthere): in `cred.` it is the caller principal; in `epcred.` it is the serving instance's own\nconnection principal, copied from the endpoint gate's `principal`, while the endpoint NAME that\nforms the `epcred.` KEY is a SEPARATE row field, so the key identity and the eviction target\nstay disjoint (an `epcred` row that put the endpoint name in `holderPrincipal` could never be\nKICKed). The `cred.`/`epcred.` families hold ONLY conformant ledger rows:\nimplementation staging, half-minted state, and tombstone fences live in a distinct\n`stage.` family, never under a ledger prefix a barrier enumerates.\n\n**A read is never a fence; only a CAS write is.** JetStream `DIRECT.GET` may be served by a\nfollower or mirror and gives NO read-your-writes guarantee (a mint that *reads* the gate can\nobserve a stale `open` after a barrier froze it on the leader), so the auth bucket sets\n`allow_direct=false` (\xA713.12) and every fence here is a leader-served, revision-pinned CAS\nwrite. The mint protocol is **observe gate \u2192 write rows \u2192 CAS the gate \u2192 release**: the auth\npath reads the gate (recording `state`, `generation`, and KV `revision`), writes the\n`cred.`/`bysrc.` rows, then performs a **revision-pinned CAS update of `gate.<lifecycleUid>`\nitself at the observed revision**; a leader write that fails if the gate changed at all,\nand releases the credential only on CAS success with the gate still `open` at the same\ngeneration. On CAS failure, `frozen`/`retired`, or any generation advance it aborts and marks\nits own row revoked, never releasing. A barrier CASes the gate to `frozen` FIRST and only then\nenumerates the family. The race is closed by **serialization on one key**, not by timing or\nread freshness: freeze and mint-finalize are both CAS writes to the SAME gate key, so one\nloses; a mint that wins wrote its rows before its winning CAS, so the barrier's later\nenumeration sees them; a mint that loses never released. The ledger is written only by the\ntrusted auth path (\xA713.9 matrix; NATS binding: the auth KV, \xA713.12).\n\n**Every lifecycle operation is a cross-bucket saga, never an implied transaction.** The\nrecords head and the auth gate/ledger live in different buckets with no shared order, so\neach operation persists its durable intent (the gate `op`, above) before touching the\nsecond bucket, every crash boundary resumes the SAME operation from that intent, and the\nsafe orders are normative. **Initial activation, in order**: reserve the UID (create-only\n`uid.<lifecycleUid>`, above) \u2192 create the issuance gate `frozen` carrying the activation\n`op` (unmintable from birth; no credential is ever released under a frozen gate, per the\nunledgered-mint rule) \u2192 CAS the alias head to the new mapping (`active`) \u2192 reopen the gate\nat its first mintable generation as the operation's LAST step. A head-CAS loser\nterminalizes its own orphan gate and burns its reserved UID (never deleting either); a\ncrash after the head CAS leaves the lifecycle active-but-unreachable, and recovery resumes\nthe same activation `opId`, never minting a second UID for one activation. **Takeover**\nkeeps the barrier order above (freeze \u2192 revoke + verified-evict \u2192 epoch head CAS LAST \u2192\nreopen). **Terminal retirement** keeps the barrier order below. No other head transition\nexists: the head advances only inside these operations, and no epoch-advance or retire\nseam is exposed outside the operation that completes its barrier.\n\nBinding rule (normative): **durable** authority and state; sturdy handles, accepted goals,\ncheckpoint tokens and resumes, durable consumers and delivery state, ledger rows, bind\n`(principal, lifecycleUid)` and survive supervised restart. **Live** authority, session\ngrants, reply attribution, serve/commit ownership, additionally binds the process epoch and\ndies on restart. The alias alone authorizes nothing: a delayed or redelivered request, handle,\nor teardown that names a recycled alias fails against the replacement because the lifecycle\nUID differs. Endpoint daemons carry the same triple, with the **stable logical instance id**\n(`instanceId`, `[a-z0-9]{26,32}`, \u2265128 bits of CSPRNG entropy, persisted for the endpoint\nlifetime) as their routable identity component. `instanceId` is **minted by the provisioner,\nnever reused, and unique within `(space, endpoint)`**, the allocator records it in the\ninstance's service record by create-only CAS and rejects collisions durably. Reply\nattribution, scatter deduplication, queue ownership, and the event/timer planes all key on\nit, so its uniqueness and entropy are load-bearing, not cosmetic. `instanceId` is to an\nendpoint what `lifecycleUid` is to a managed agent, and both follow the same\nrestart-preserve / terminal-retire / epoch-fence rules.\n\n**Cross-plane scoping.** Chat/DM/presence *subjects* keep the \xA73 grammar (the alias), but\ntheir backing state is lifecycle-scoped: presence carries the current `lifecycleUid` (\xA76);\nper-instance durable consumers, pending delivery cursors, durable memberships, history\ncutoffs, and ACL/ledger rows key on `(principal, lifecycleUid)` (\xA78, \xA79). The DM subjects\n(`inst.>`) DELIBERATELY stay alias-keyed; a second implementer MUST NOT uid-scope them; the\nsuccessor cut for DMs is the ACTIVATION FRONTIER (the DM stream sequence captured at the\nlifecycle's provisioning, delivery starting at frontier+1, \xA78), and that frontier capture is\na leader-served read (the \xA713.9 read-service class), never a follower get. Explicit same-name\nrecreation inherits **no** predecessor authority or content: terminal retirement records\nper-stream sequence cutoffs before the alias is freed, messages published while no lifecycle\nis active do not flow to a later replacement, and retirement across streams is ordered and\nreconciled (never assumed atomic). **Destructive cleanup is broker-enforced where the resource is broker-addressable**: durable\nconsumer names, ACL rows, KV record keys, and membership rows are lifecycle-keyed, the UID\nis part of the resource NAME, and the teardown credential (the deprovisioner) is minted\ntarget-pinned to `(principal, lifecycleUid)` by exact name, so a credential minted for\nlifecycle A cannot even NAME lifecycle B's resources; the broker denies the stale delete\noutright. Only resources the broker cannot see (the manager's local credential/token/health\nfiles) fall back to a handler-side **delete-if-current** check carrying the retiring UID +\nexpected ownership revision. In both regimes the alias stays reserved until retirement and\ncleanup have durably completed, so a stale detached teardown can never destroy a same-name\nsuccessor. **Terminal retirement is additionally a credential barrier, in order**: CAS the issuance\ngate `open \u2192 frozen` carrying the durable retirement `op` FIRST (the bar: a staged mint\nloses the gate CAS, exactly the mint-protocol race above; the gate revision moves, so a\nmint that observed `open` cannot finalize) \u2192 CAS the head `active \u2192 retiring` bound to the\nsame `op.opId` (from this point every currency seam yields no current mapping and no\ncurrent epoch, and the alias is NOT replaceable) \u2192 revoke every\nactive credential-ledger row under the lifecycle prefix (all roots and all descendants,\ncredential ledger above), verifying revocation enforcement on every server as in the\ntakeover barrier \u2192 cluster-verified eviction of every revoked credential's live connections\n(`evictPrincipal`, as in the takeover barrier above) \u2192 **drain the target's acceptance\nobligations to quiescence** (\xA713.8: enumerate `oblig.<targetUid>.>`, settle every\nunresolved row through its decision coordinate, and re-enumerate until an enumeration\nfinds none unsettled; every writer that observed the pre-`retiring` mapping is settled\nHERE, before the cleaner below runs and before any frontier closes) \u2192 **fence the drain's\nper-op repair principals** (the commit applier, pool-route reconciler, and effects canceller\nminted inside the drain, `local.{epapl|eprec|epcan}_<opId-hash>`): cluster-verify eviction of\nany live connection under each BEFORE the cleaner and BEFORE any frontier \u2014 the applier\nespecially, whose records-KV last-value write is returned to a normal reader regardless of the\nper-stream frontier cutoff. These are self-minted data-account bearers with NO credential-ledger\nrow, so there is no connect-time deny-new: the guarantee here is **kill-live** (verified eviction\nof currently-connected principals), NOT reconnect prevention; a fresh connect within the\nbearer's TTL is the accepted residual NAMED per drain-repair profile in the \xA713.9 matrix (each\n\"RETIREMENT-FENCE residual\" row), of the same kill-live-not-deny-new class \xA713.13 fences for the\nplane connections (repair connections MUST be minted non-reconnecting so a verified eviction is\ndurable) \u2192 the trusted terminal **pool\ncleaner** settles the lifecycle's expired and orphaned pool work under a DISTINCT,\nseparately minted, exact-pool scoped profile whose pool set is this operation's **effective\ninventory**: the target's accepted `oblig.<lifecycleUid>.>` pool routes enumerated from the\nSAME drained, now-`retiring` obligation set (so no new row can appear and the enumeration is\ndeterministic across resumes). The inventory is DISCOVERY-ONLY: the barrier takes no\ncaller-supplied pool hint, so every inventory entry is an obligation-discovered pool this target\nholds accepted work on, and no pool ever enters the cleaner/executor grant without a backing\nobligation. Confinement is the EXACT per-pool effective-inventory grant plus the\nexecutor's per-item decision/horizon/retire-target checks (which bind HONEST execution, not a\ncompromised bearer): (\xA713.9\nmatrix row: bind-only on the pool's\npre-created durable, terminal-only ACK after the item's durable terminal fact, no consumer\ncreate/update/delete, no raw stream DELETE; it never holds, reuses, or impersonates the\nrevoked owner's authority, which this barrier just killed) \u2192 **retire the cleaner\ncredential itself, verified, BEFORE any frontier closes**: once the cleaner has settled the\npool and proven it quiescent (every pre-existing owner ACK drained through `AckWait`, and a\nfresh consumer read shows zero `num_pending` and zero `ack_pending`; a fire-and-forget ACK\nis confirmed with `AckSync` or re-proven, never assumed), the barrier REVOKES the cleaner's\nown bounded-lived credential and cluster-verifies eviction of its principal (`evictPrincipal`,\nexactly as for the owner above), so no in-flight cleaner can ACK a redelivery or write a\nterminal after the alias is reused; the cleaner's authority MUST be dead before the frontier\nrecords \u2192 record the\nper-stream retirement frontiers (the create-only, never-deleted `frontier.<lifecycleUid>`\nrecord, \xA713.7: one key per retired lifecycle, recorded once under this operation's `opId`) \u2192\nCAS the gate `frozen \u2192 retired` (terminal; unlike\ntakeover, retirement never reopens it) \u2192 CAS the head `retiring \u2192 retired` \u2192 only then\nfree the alias, and a successor activates only with a freshly reserved UID. `retired` on\nthe head therefore ASSERTS completed cleanup: replacing a retired predecessor needs no\nfurther proof, because nothing reaches `retired` without the barrier. Every boundary of\nthis sequence is crash-resumable through the durable `op` intent, and only the same\noperation resumes it. Chat/DM/presence subjects stay\nalias-keyed, so without the revoke-and-verified-evict step a still-connected stale process\ncould keep speaking as the recycled alias. Where the deployment cannot revoke the credential\nor cannot verify eviction, alias reuse is **forbidden**: a same-name respawn fails loud.\nSupervised restart of the same UID retains all of it.\nIntentional role-mailbox continuity across lifecycles is only available as an explicit,\nseparately authorized transfer operation, never an accidental consequence of string reuse.\n\n### 13.2 Grammar\n\n**Endpoint names.** An endpoint name is one or more DNS-shaped labels, each matching\n`[a-z0-9]([a-z0-9-]*[a-z0-9])?` (no leading/trailing dash, no bare dashes; `_` MUST NOT\nappear in a label). Single-label names (`manager`, `delivery`) are reserved for\nendpoints shipped by this contract's reference implementation and require the space operator's\nprovisioning authority to serve; a third-party endpoint name MUST be reverse-DNS (two or more\nlabels under a domain its author controls, e.g. `com.acme.deploy`) and is mintable only under\nthe owner that registered that domain claim. In a wire subject the name is one token with `.`\nreplaced by `_` (`com_acme_deploy`); because `_` cannot appear in a label the mapping is\nbijective. Name authority is the credential, never the registry (\xA713.9). Endpoint-name\ntokens may contain `-` inside labels; they are never used to derive principal dash-form\nnames; control-surface consumer names are the \xA713.9 pinned grammars, each carrying a\nstated collision-freedom argument, and none is ever parsed back into its components, so\nthe \xA72 dash-form separator stays unambiguous.\n\n**Command tokens.** A command name is one token `[a-z0-9-]{1,32}`. The command is a validated\nsubject token so the broker enforces per-command authority (\xA713.9). `describe` and `cancel`\nare reserved command names (\xA713.7, \xA713.6).\n\n**Request subjects.** Three **addressing modes** under one kind `ep`, the mode token says\nwhere a request routes, never which verb it is (the verb rides the envelope, \xA713.3/\xA713.5):\n`one` (queue-group anycast: exactly one class member), `all` (scatter: every instance),\n`inst` (one instance by its stable triple). The `one` rail's queue group is canonically\nnamed by the endpoint-name token, and serve subscriptions to it are **queue-qualified\nonly** (\xA713.9): no credential can plain-subscribe the class rail, which is what keeps\nper-request nonces visible only to the queue-selected instance. Every request carries the caller as **three**\nforge-locked tokens `<owner>.<actor>.<uid>` (principal + lifecycle UID, \xA713.1) followed by a\ncaller-chosen unguessable **nonce** token (`[A-Za-z0-9_-]{22,64}`, \u2265128 bits of CSPRNG\nentropy; one outstanding call per nonce; reuse before the prior call resolves is a caller\nerror and the reply rail MUST treat the earlier subscription as dead); always, on calls and\ncasts alike, so one grant row covers both verbs and no shape is distinguished by counting. A\ncommand whose contract declares it **targeted** carries an **authorization-mode token** and,\nper mode, zero to three pinned target tokens between the command and the caller:\n\n| Form | Subject | Tokens |\n| --- | --- | --- |\n| Class, untargeted | `cotal.<space>.ep.one.<endpoint>.<command>.<owner>.<actor>.<uid>.<nonce>` | 10 |\n| Class, `self` | `cotal.<space>.ep.one.<endpoint>.<command>.self.<owner>.<actor>.<uid>.<nonce>` | 11 |\n| Class, `owner`/`any` | `cotal.<space>.ep.one.<endpoint>.<command>.<authz>.<tOwner>.<owner>.<actor>.<uid>.<nonce>` | 12 |\n| Class, `child`/`ledger` | `cotal.<space>.ep.one.<endpoint>.<command>.<authz>.<tOwner>.<owner>.<actor>.<uid>.<nonce>` | 12 |\n| Class, `handle` | `cotal.<space>.ep.one.<endpoint>.<command>.handle.<tOwner>.<tActor>.<tUid>.<owner>.<actor>.<uid>.<nonce>` | 14 |\n| Scatter | as class forms with mode token `all` | 10-14 |\n| Instance | `cotal.<space>.ep.inst.<endpoint>.<instanceId>.<command>[.<authz>[.<target tokens per mode>]].<owner>.<actor>.<uid>.<nonce>` | 11-15 |\n| Reply | `cotal.<space>.ep.reply.<endpoint>.<instanceId>.<epoch>.<owner>.<actor>.<uid>.<nonce>` | 11 |\n\n**Single-owner endpoint names (normative).** An endpoint name binds to exactly ONE owner\n(\xA713.9: operator-provisioned core names, domain-owner-bound reverse-DNS names), so the name\ntoken alone determines the serving owner and instance-addressed subjects carry **no owner\ntokens**: `(endpoint, instanceId)` is the complete routable instance address. Two parties\nwanting the \"same\" name use their own reverse-DNS names; an owner-qualified shared-name form,\nif ever wanted, would be a later additive subject form, not a change to these. This trades an\nalready-forbidden expressiveness for structurally smaller subjects and credentials.\n\nThe target's **lifecycle UID is body-carried, not a subject token** (`target.lifecycleUid`,\n\xA713.3): a grant could only ever wildcard it (targets are dynamic; the UID is unknowable at\nmint time), so a token there would add zero broker enforcement while costing every targeted\ngrant row a token, the trusted validator, not the broker, compares the expected UID against\nthe current mapping (\xA713.1). The one exception is `handle` mode: at handle redemption the\ntarget's UID IS known and current, so the redemption-minted form pins the full target triple\nas subject tokens (below); pin what is knowable at mint time; body-carry only what is not.\nEvery form stays within the NATS 16-token recommendation.\n\n**Explicit discrimination (never arity counting).** The forms are distinguished by the token\nafter `<command>`: it is either one of the six reserved authorization-mode tokens (`self`,\n`owner`, `any`, `child`, `ledger`, `handle`) or the caller's owner token, and the two sets\nare disjoint by construction, because an owner token is `local` or `u_`+base32 (\xA72), never a\nbare mode word. The target-block arity then follows the mode (`self`: none;\n`owner`/`any`/`child`/`ledger`: one `<tOwner>` token; `handle`: three,\n`<tOwner>.<tActor>.<tUid>`); a closed set at a fixed position, exactly the property that\nmakes per-mode arity safe. A parser dispatches on that set; a subject matching no defined shape\nhas no sender and MUST NOT be handled.\n\n**Token bounds (normative).** On the endpoint rails every identity token is bounded:\n`owner` \u2264 64, `actor` \u2264 64, `command` \u2264 32, `endpoint` \u2264 64, nonce and ids \u2264 64 characters;\n`lifecycleUid` and `instanceId` are bounded by their single defining grammar\n`[a-z0-9]{26,32}` (\xA713.1); deliberately not restated here, so the bound cannot drift from\nthe definition. A total request or reply subject MUST NOT\nexceed 1024 bytes; implementations validate fail-loud at build time. (Transport headroom:\nthe reference deployment raises `max_control_line` to 64 KiB; the PUB line is never the\nbinding constraint; minted-credential size is, \xA713.9.)\n\n**The authorization-mode token** (`<authz>`) makes the authority gradient explicit and\nbroker-enforced where it is statically expressible, and honestly validator-primary where it is\nnot. Six modes:\n\n- `self`, the target IS the caller: the form carries **no target tokens and no body\n `target`** (a supplied one is `target-mismatch`, never ignored); the endpoint derives the\n target from the broker-authenticated caller triple in the same subject. Fully\n broker-confined, including the lifecycle UID, because the caller's own `<uid>` token is\n the target's UID, forge-locked by the mint: a stale lifecycle's credential cannot even\n publish the successor's subject.\n- `owner`, owner-domain: the target block is `<authz>.<tOwner>` (ONE target token); grants\n pin `<tOwner>` to the caller's own owner (standing mints; a handle redemption instead pins\n the issuer-signed target owner, \xA713.6). The target actor and expected lifecycle UID are\n body-carried (`target`) and validator-checked against the current mapping, the broker\n cannot express \"any actor under my owner, currently mapped to this UID\". An `owner`-mode\n grant is NEVER minted with a wildcard target owner. Broker-confined on the owner; validator\n on the rest.\n- `any`, unrestricted target owner (`<authz>.<tOwner>` with `*`): a distinct mode mintable\n only for operator/admin capabilities, so no widening of an `owner` grant can ever reach\n it. Validator-checked target as for `owner`.\n- `handle`, **redemption-minted only** (\xA713.6): the target block is\n `handle.<tOwner>.<tActor>.<tUid>` (THREE target tokens), each a literal pinned at\n redemption from the issuer-signed grant against the then-current mapping. Never a standing\n capability, never wildcarded. Broker-confined on the full target triple; the validator\n re-checks only currency; a subject `<tUid>` that no longer matches the current mapping is\n `expired`.\n- `child`, static-mesh own-child (`spawner == caller`): a **distinct trusted-validator form**.\n The grant means \"may ask this validator\", not \"already authorized\"; the handler MUST\n fresh-check the immutable spawner relation against durable state and fail closed. Its\n `<tOwner>` ceiling is the caller's own owner, as for `owner` mode (a static-mesh child\n shares its spawner's owner).\n- `ledger`, fresh-ledger escalation: a distinct trusted-validator form; the handler MUST\n fresh-read the authorization ledger and fail closed on lookup failure, timeout, or absence.\n Its grants pin literal `<tOwner>` values named at mint; a wildcard target owner in `ledger`\n mode is mintable only for operator/admin profiles.\n\n`any`, `child`, `ledger`, and `handle` are never wildcard-reachable from a `self`/`owner`\ngrant (distinct token \u21D2 distinct subject \u21D2 distinct grant row). A handler MUST resolve the target (the\nrevision-pinned `(alias, lifecycleUid)` mapping, \xA713.1) immediately before effect and reject\nany request whose body target disagrees with the subject target tokens (`target-mismatch`) or\nwhose expected target lifecycle UID does not match the current mapping (`expired`). The\nsubject, never the body, is the authorization boundary; handler policy only narrows.\n\n**Replies.** Every reply rides the dedicated reply rail above, **deterministically derived\nfrom the authenticated request subject**: the responder copies the caller triple and nonce\nfrom the request subject and prefixes its own endpoint/instance/epoch tokens (the owner is\ndetermined by the endpoint name; no owner tokens appear). A responder\nMUST ignore any transport- or payload-supplied reply target (the confused-deputy boundary).\nThe grants are exact-arity, no `>` tail admits subjects outside the grammar: the caller's\nread grant is its own rail (`ep.reply.*.*.*.<owner>.<actor>.<uid>.*`), so it reads only\nreplies addressed to it; the responder's publish grant pins its own instance triple and\nepoch (`ep.reply.<endpoint>.<iId>.<epoch>.*.*.*.*`), so the answering instance and\nepoch are read off the broker-authenticated reply subject, never trusted from the payload.\nTwo properties, enforced differently, stated precisely: **attribution** (who answered) is\nbroker-enforced by the responder's pinned prefix; **addressing** (whom a responder may\nanswer) is capability-by-secret, the responder's grant spans all caller suffixes, and what\nconfines it to the requester is possession of the unguessable per-request nonce, which only\nthe request's recipients hold. A stale process (superseded epoch) publishes attributably\nstale replies that callers reject; scatter gathers additionally reject replies from\ninstances outside the frozen expected set (\xA713.5). The **caller's** process epoch is\ndeliberately NOT encoded in the rails: reply consumption binds to the requesting process\nbecause a caller MUST subscribe the exact concrete nonce subject before publishing a call\nand MUST NOT persist nonces; a restarted successor never holds the predecessor's nonce\nsubscriptions, so in-flight calls die with the process (they are ephemeral by definition)\nand a late reply is unreadable rather than misdelivered.\n\n**Event and journal subjects.** Endpoint-published planes, captured by per-space streams\n(\xA713.12); the publishing instance's identity is forge-locked into the subject:\n\n| Plane | Subject |\n| --- | --- |\n| Events | `cotal.<space>.epe.<endpoint>.<instanceId>.<epoch>.<topic...>` |\n| Canonical facts | `cotal.<space>.epf.<endpoint>.<topic...>` |\n| Submissions | `cotal.<space>.epj.<endpoint>.<command>[.<authz>[.<target tokens per mode>]].<owner>.<actor>.<uid>` |\n| Timers | `cotal.<space>.ept.<endpoint>.<instanceId>.<epoch>.<timerId>.<schedule\\|armed\\|fire>` |\n| Record writes | `cotal.<space>.epr.<endpoint>.<instanceId>.<epoch>.<kind>.<qualifier...>` (mediated record-writer ingress; the instance's epoch-pinned rail for `svc`/`goal`/`cp` status writes; consumed ONLY by the record writer, which reads the writing epoch from the broker-authenticated subject, never from payload, \xA713.9) |\n| Contract artifacts | `cotal.<space>.epc.<digest-hex>` (one immutable artifact per subject; `<digest-hex>` is the artifact's SHA-256 hex, 64 chars; the `sha256:` prefix is not a subject token; \xA713.7) |\n| Work pools | `cotal.<space>.epw.<endpoint>.<pool>.<cOwner>.<cActor>.<cUid>.<id>` (one item per subject; the trailing four tokens are the item's **acceptance identity**; the accepted submission's caller triple + request id, \xA713.6) |\n| Sessions | `cotal.<space>.eps.<endpoint>.<sessionId>.<epoch>.<in\\|out>` |\n\nEvents carry the publishing instance's **epoch as a subject token**, pinned by the serve\ngrant, so a superseded process cannot emit progress indistinguishable from the current\nincarnation's; readers match the current (or goal-accepted) epoch and treat stale-epoch\nevents as attributably stale. A **targeted** journal command carries the same authz/target\nblock in its submission subject as its request forms, so the broker confines targeted\njournal work exactly as it confines calls; the canonicalizer additionally requires exact\nbody/subject agreement before acceptance. Timers use three forms: `.schedule` is the\ninstance-published **schedule request**, captured by a stream with message schedules\nDISABLED, so any client-set scheduling header is inert bytes, and the mediated timer writer\nrejects a request carrying one; `.armed` holds the **authoritative schedule message**,\npublished only by the mediated timer writer (\xA713.9), which derives the ADR-51\n`Nats-Schedule-Target`, the sibling `.fire` subject, from the broker-authenticated\nREQUEST subject's own tokens, never from any payload or header (a schedule's target MUST\ndiffer from its publish subject per ADR-51; replacement is the writer's same-subject\npublish on `.armed`); `.fire` is where fires appear. An instance's serve grant covers\n**only `.schedule`** (epoch-pinned); no client credential holds `.armed` or `.fire`\npublish; fired messages are written by the broker's scheduler alone, and the handler\nvalidates the carried `(timerId, generation)` against current status AND\n`now \u2265 the authoritative deadline` AND that the broker-authored scheduler-origin header\nnames its own exact sibling `.armed` subject (\xA713.12) before acting.\n\nReserved event topics: `ev.<cluster>.<event>` (cluster events), `goal.<cOwner>.<cActor>.\n<cUid>.<goalId>.<t>` (per-goal action progress; the caller identity in the subject gives\nmint-time read containment), `cp.<token>.<t>` (checkpoint transitions). Reserved fact topics:\n`dec.<cOwner>.<cActor>.<cUid>.<id>` (canonical decisions (accepted/rejected) caller-scoped, \xA713.4), `quar.<sourceSeq>` (poison quarantine, \xA713.4; its own family,\ndisjoint from the caller-id `dec` namespace by construction), `goal.<cOwner>.<cActor>.<cUid>.<goalId>.result` (terminal\nresults), `wrk.<pool>.<cOwner>.<cActor>.<cUid>.<id>` (per-work-item terminal results,\nkeyed by the item's acceptance identity, \xA713.5/\xA713.6), `eff.<cOwner>.<cActor>.<cUid>.<id>`\n(per-request effect-complete facts for non-action effects commands, \xA713.9), `cp.<token>` (one-use checkpoint\nresume, journaled by create-only CAS, \xA713.6),\n`receipt.<cOwner>.<cActor>.<cUid>.<id>.<sourceSeq>`\n(caller-scoped; request ids are caller-chosen, so an endpoint-wide `receipt.<id>` would\nlet two callers collide and read each other's receipts, and **execution-scoped**: the\naccepted submission's `sourceSeq` is unique per execution, so a request id lawfully reused\nafter its decision retention expires (\xA713.4) mints a NEW receipt subject instead of\nappending to the old one, where a last-by-subject read would have hidden the earlier\nreceipt for the rest of its 90-day retention). Submissions are publishable directly by capability holders\nand are **explicitly untrusted** (\xA713.4); canonical fact subjects are publishable only by\ntheir mediated writer (\xA713.9). `<id>`, `<goalId>`, `<timerId>`, `<token>`, `<sessionId>` are\nsingle tokens `[A-Za-z0-9_-]{1,64}`.\n\nThe v0 subjects `cotal.<space>.ctl.>` and `cotal.<space>.control.>` are retired: nothing\nserves them and no post-cut credential carries a grant on them. `trace.<instance>` remains reserved,\nunchanged. `<pool>` is a single token `[a-z0-9-]{1,32}` (command-token grammar).\n\n### 13.3 Envelope\n\nRequests, replies, submissions, events, facts, and progress payloads are UTF-8 JSON. The\nenvelope is versioned and typed; `ControlRequest`/`ControlReply` are deleted.\n\n`EndpointRequest`:\n\n| Field | Type | Req | Notes |\n| --- | --- | --- | --- |\n| `v` | `1` | MUST | envelope schema version (independent of the wire `protocolVersion`; the envelope starts at its own v1 inside the v0.4 revision); other values rejected (`unsupported-version`) |\n| `id` | string | MUST | caller-chosen request id, `[A-Za-z0-9_-]{1,64}`; the idempotency key at the declared scope (\xA713.8), realized on journaled planes by the caller-scoped decision CAS (\xA713.4), never by a transport header |\n| `op` | object | MUST | `{ endpoint, command, inputDigest, outputDigest }`; MUST agree with the subject (`op-mismatch`). The digests bind the invocation to the described contract and are **both REQUIRED on every command except `describe`** (the discovery bootstrap), unconditional, because every command declares both schemas: a side with no payload declares the canonical void schema (\xA713.7), whose digest exists like any other. A serving member rejects a missing digest (`contract-mismatch`) before any effect, and one that cannot honor a pinned digest replies `contract-mismatch`, never coerces |\n| `class` | `ephemeral` \\| `journal` | MUST | the submission's declared delivery contract; MUST equal the command's contract class (`class-mismatch`); immutable per submission. (`record` is a state contract, never a request class; the action composite is a command marker, not a class; an action command's submissions are `journal`) |\n| `replyExpected` | boolean | MUST | the verb: `true` = call (a reply is expected on the reply rail; `deadlineMs` required; the caller subscribes its exact nonce before publishing), `false` = cast (fire-and-forget; a responder MUST NOT reply). The subject shape is identical for both; the verb never changes the grammar |\n| `goalId` | string | action commands | MUST for a command whose contract declares the action composite: the client-generated goal id (\xA713.6); absent otherwise. `id` remains the per-request idempotency key |\n| `target` | object | per mode | `{ owner, actor, lifecycleUid, mappingRevision? }`. **Absent for `self`** (and for untargeted ops): a supplied one is `target-mismatch`, never ignored. **Required for `owner`/`any`/`child`/`ledger`/`handle`**: `owner` MUST equal the subject `<tOwner>` token (`target-mismatch`); `actor` and `lifecycleUid` are validator-compared against the current mapping (`expired` on mismatch), and in `handle` mode MUST additionally equal the subject `<tActor>`/`<tUid>` tokens (`target-mismatch`); `mappingRevision`, when present, additionally pins the exact mapping revision the caller observed |\n| `args` | object | MAY | validated against the input schema before any effect (`bad-request`) |\n| `from` | `EndpointRef` | MUST | as \xA75; `from.id` MUST equal the subject sender principal, and the sender UID token MUST match the caller's minted lifecycle UID (broker-enforced by the grant) |\n| `deadlineMs` | number | MUST for call/scatter and journal submissions | caller deadline budget; bounded, never unbounded. On a journal-class submission it is the **decision deadline**: the bound within which the caller expects its durable decision fact (\xA713.4) |\n| `correlation` | object | MAY | `{ traceparent?, tracestate?, baggage? }` per W3C Trace Context; propagated to downstream calls, events, facts, receipts |\n| `auth` | string | MAY | opaque signed authorization-context slot (capability handle, obligations, payment proof). Opaque to the transport, never to identity: its **`authDigest`** (\xA713.4 fingerprint) is `sha256:<hex>` over the UTF-8 bytes of this string **exactly as carried**; the slot is already a canonical signed artifact, so it is digested as bytes, never re-canonicalized, and is absent from the fingerprint iff `auth` is absent |\n\n`EndpointReply`:\n\n| Field | Type | Req | Notes |\n| --- | --- | --- | --- |\n| `v` | `1` | MUST | |\n| `id` | string | MUST | echoes the request `id` |\n| `ok` | boolean | MUST | |\n| `data` | any JSON | MAY | present iff `ok`; validated against the output schema |\n| `error` | object | iff `!ok` | `{ code, message, details?[] }`; codes below; `details[]` entries carry reverse-DNS `kind` |\n| `receipt` | string | MAY | opaque signed receipt slot (\xA713.10) |\n\nThe answering instance, its epoch, and the addressee are read from the **reply subject**\n(\xA713.2), not from payload fields; a payload claim of either is advisory display data only.\n\nEvery other plane is typed too: a journaled **submission** is an `EndpointRequest` (same\nenvelope, published to `epj`); an **event** (incl. per-goal progress) is\n`{ v: 1, topic, ts, data, correlation? }`; an **acceptance fact** is the `AcceptanceFact` of\n\xA713.4; a **terminal result fact** carries the goal's terminal state (one of the five\nterminal values of \xA713.6), outcome digest, and\nresult payload (or its digest-pinned reference). All are runtime-validated at their\nconsuming boundary.\n\n**Monotonic attenuation (invariant).** Envelope content, the `auth` slot, a handle,\nobligations; may only narrow what the presenting credential already permits, never widen it.\nA handler that honors envelope content as authority beyond the broker grant is non-conformant.\nAuthority *conferral* exists only as trusted redemption (\xA713.6 capability handle).\n\n**Error catalog.** `code` is one token: `bad-request`, `unsupported-version`, `op-mismatch`,\n`class-mismatch`, `target-mismatch`, `sender-mismatch`, `unauthenticated`,\n`permission-denied`, `not-found`, `already-exists`, `conflict` (CAS/fencing loss,\nfingerprint conflict, duplicate resume), `contract-mismatch`, `contract-invalid` (schema\noutside the profile / over budget at registration), `failed-precondition`,\n`deadline-exceeded`, `cancelled`, `expired` (lease, handle, lifecycle UID, epoch, token),\n`unavailable` (no responder), `unimplemented`, `resource-exhausted`, `internal`. Extensions\nadd codes only under reverse-DNS. A `code` (catalog or extension) is one token of at\nmost **64 bytes**, so every fact shape that embeds one (`RejectionFact`, `QuarantineFact`)\nstays bounded by construction and the \xA713.12 fact fixture is a true worst case.\n\n### 13.4 Delivery contracts\n\nThree delivery contracts, chosen per command class, declared in the contract, immutable per\nsubmission. Decision rule: crash means \"just re-ask\" \u2192 **ephemeral**; long-lived state\nsomething converges on \u2192 **record**; must survive restart, be audited, metered, or\ncompensated \u2192 **journal**. Wrong-class submission fails loud.\n\n**Ephemeral**, request/reply on the `ep` rails; no broker persistence; at-most-once effect\nunless the command is idempotent by `id`. No-responder is a loud `unavailable`.\n\n**Record**, a `{kind, schema, spec, status, meta}` resource in the per-space records bucket,\nstored as **two keys with independent revisions**: `<key>.spec` and `<key>.status`. The split\nis the broker-enforced writer boundary: the spec-writer and status-writer roles hold publish\ngrants on their own key only (per-kind writer table, \xA713.9). Writes use per-key CAS; a lost\nrace is a loud `conflict`. The merged logical read returns both\nrevisions and carries `status.observedSpecRevision`; a reader treats\n`observedSpecRevision < spec.revision` as a stale-but-valid level-triggered projection, not\nan error, and `observedSpecRevision > spec.revision` (a lagging spec read, possible across\nreplica freshness points) as its own signal to re-read the spec key, bounded retries until\ncaught up or the caller's deadline, never trusting the mismatched pair. Watch delivers\ncurrent values then deltas per key; a watcher that falls behind MUST re-read both keys and\nresume, never patch forward across a gap. Records are\nbounded (\xA713.8).\n\n**Journal**, an explicitly **untrusted at-least-once submission log** feeding **canonical\naccepted-fact subjects** with a mediated writer; effects consume only canonical facts, never\nraw submissions.\n\n1. A journaled submission is published to the submission plane (`epj`) as a **plain append**:\n submitters MUST NOT set `Nats-Msg-Id`, and native dedupe is **not relied upon**, the\n server does not accept a zero duplicate window (\xA713.12), so the reference config sets the\n server minimum and the guarantee rests on the header rule, not the window: a conformant\n submission carries no dedupe header and cannot be suppressed by one. Native broker dedupe\n keys on a caller-set header value compared\n **stream-wide**, so on a shared submissions stream any writer could pre-seed a predicted\n header value from its own allowed subject and silently suppress another caller's first\n submission for a full dedupe window, a cross-caller denial that no \"advisory\" framing\n makes safe; with the MUST NOT in force, a hostile header-bearing publish can suppress only\n another non-conformant header-bearing write. Transport retries therefore simply append\n again; the caller-scoped decision\n CAS below resolves every copy to one decision. Submission subjects and fact subjects are\n disjoint by construction (\xA713.2), so a submission credential cannot write a fact.\n2. The **semantic fingerprint** covers every effect-defining dimension, the fingerprint\n object is `{endpoint, command,\n class, authz?, target?: {owner, actor, lifecycleUid, mappingRevision?}, inputDigest,\n outputDigest, args, authDigest?, caller: {id, lifecycleUid}, goalId?, id}`, and the\n fingerprint VALUE is that object's `sha256:<hex>` content digest per \xA713.7 (strict\n RFC 8785 over I-JSON, the SAME canonicalization every contract artifact uses; one\n canonicalizer, never a second): absent optional fields are OMITTED from the object, never\n written `null`, so two implementations digest identical bytes, which also makes the\n fingerprint **computable for EVERY parseable submission**, however incomplete: a\n parseable envelope missing `class` or digests fingerprints the subset it carries and is\n rejected with that fingerprint. **\"Parseable\" here means canonicalizable I-JSON**, not\n merely syntactically valid JSON: bytes that parse but cannot be canonicalized, duplicate\n object names, a lone surrogate, a non-finite or out-of-I-JSON-range number; have no\n interoperable RFC 8785 form and therefore no fingerprint, so they take the quarantine\n path exactly as unparseable bytes and an invalid `id` do (\xA713.4 item 3: raw-byte digest,\n no fingerprint). Every submission thus has exactly one terminal path. Same id +\n same fingerprint is the same request (idempotent, first-wins); same id + different\n fingerprint (including the same args retargeted at a different lifecycle) is a loud\n `conflict`, never accepted or effected.\n3. The **canonicalizer**, the narrowly scoped mediated writer for this endpoint's facts\n (\xA713.9); consumes the submission plane through a **normative durable `AckExplicit`\n consumer** and acks a submission ONLY after a durable decision fact exists, and, for a\n pool-admitted acceptance, ONLY after the \xA713.6 EPW enqueue create has additionally\n succeeded (or lost its CAS to an already-present entry): a crash anywhere between\n acceptance and enqueue therefore redelivers the submission, and the reconciliation\n predicate resolves the redelivered copy; recovery never has to DISCOVER orphaned\n acceptances, because an acceptance without its enqueue is by construction an unacked\n submission that comes back. A crash before\n the fact redelivers the submission; a crash after it observes the CAS winner on\n redelivery. It validates each submission (schema, body/subject agreement incl. the target\n block, authorization per \xA713.6, and (for work-pool commands) pool admission/capacity\n BEFORE acceptance) and then decides each request exactly once by publishing a\n **decision fact** to the caller-scoped subject\n `epf.<endpoint>.dec.<cOwner>.<cActor>.<cUid>.<id>` with create-only CAS (expected last\n sequence on the subject = 0), so distinct callers can never squat each other's ids. **For\n an action command the canonicalizer additionally binds the goal before accepting**: it\n create-only-CASes a **goal-bind fact** `epf.<endpoint>.goal.<cOwner>.<cActor>.<cUid>.<goalId>.bind`\n carrying the accepted fingerprint, and rejects (`conflict`) any later submission whose\n `goalId` matches but whose fingerprint differs, so two distinct `id`s naming one `goalId`\n cannot both be accepted-and-effected (the decision CAS keys on `id`, which alone would let\n both through; the goal-bind CAS keys on `goalId`, which stops the second BEFORE acceptance\n and effect, not at the terminal-result stage where the effect has already happened).\n The decision is `accepted` or `rejected` (with the catalog error); **rejection is as\n durable, caller-readable, and idempotent as acceptance**, so a permanently invalid\n submission is distinguishable from a lost one. First decision wins atomically; a later\n attempt fails its CAS and reads the existing fact. There is no append-then-memo pair to\n crash between. The canonicalizer is a **singleton per endpoint** (one active principal,\n epoch-fenced like any serve identity, recovered through the \xA713.1 takeover barrier):\n admission checks (pool capacity for work-pool commands) are thereby serialized with the\n decisions they gate, so two canonicalizers cannot both admit the last slot; capacity is\n consumed by the acceptance itself, never checked apart from it. A submission that cannot\n yield a decision key; bytes that are not canonicalizable I-JSON (unparseable, duplicate\n object names, lone surrogate, out-of-range number), or no `id` within the token\n grammar; is\n **quarantined, never redelivered forever**: the canonicalizer publishes a\n **`QuarantineFact`** to the disjoint quarantine family\n `epf.<endpoint>.quar.<sourceSeq>` (\xA713.2); keyed by the source sequence, which exists\n for every stored copy by construction, in a family that shares no namespace with\n caller-chosen `dec` ids, so no legal request id can collide with a quarantine key, with\n create-only CAS, and terminally acks\n (`AckTerm`) the submission ONLY after that fact durably exists (or its CAS loss shows it\n already does), so a poison message cannot pin `MaxAckPending` and the\n fact-before-terminal-ack rule holds on the poison path exactly as on the decision path.\n `QuarantineFact` = `{ v: 1, decision: \"quarantined\", sourceSeq, submissionDigest (the\n `sha256:<hex>` digest of the raw stored bytes, \xA713.7), error: { code (catalog token),\n detail? (\u2264 256 bytes) }, caller?: { id, lifecycleUid } (from the broker-authenticated\n submission subject, when it parses), ts }`, every field bounded or fixed-size, so the\n fact fits by construction; it never carries the poison bytes themselves.\n4. Journal submissions set `replyExpected: false`; the caller **observes its decision** by\n watching/reading its own decision subtree (`epf.<endpoint>.dec.<its triple>.>`, a\n caller-scoped read grant minted with every journal capability). An action command's\n accept/reject is exactly its decision fact, expected within the submission deadline.\n5. The **acceptance fact is self-sufficient for effect and replay** (`AcceptanceFact`, the\n `accepted` decision): `{ v: 1, id, decision: \"accepted\", fingerprint, request: <the\n canonical EndpointRequest, args INLINE, bounded by the broker's max_payload; a submission\n too large is refused loudly with resource-exhausted, never spilled into storage>, caller:\n {id, lifecycleUid}, target?: {owner, actor, lifecycleUid, mappingRevision},\n contractDigests: {input, output}, authzDecision: {revision, epoch},\n route: \"effects\" | `pool.<pool>` (the acceptance's SINGLE execution route, decided by\n the canonicalizer at admission: a pool-routed acceptance is executed by the pool's\n worker path (\xA713.5) and the effects consumers MUST ack it without effect; an\n effects-routed acceptance is executed by exactly one instance off the shared effects\n durable (\xA713.9). No acceptance is ever executed twice, because the fact names its route),\n readinessDeadlineMs?: <the acceptance-relative readiness bound, present iff the command\n declares bounded readiness, \xA713.6; persisted HERE because it is goal state, not the\n request's decision deadline>,\n workExpiry?: <absolute expiry of a pool-routed item, present iff `route` is a pool, \xA713.8;\n survives reconciliation re-enqueue unchanged>, sourceSeq, ts }`. A `target`-bearing\n acceptance (work bound to a lifecycle) publishes ONLY after its target-indexed\n obligation row exists AND only under an unexpired admission proof the mediator issued\n for that row (\xA713.8: proof issuance is the post-create currency recheck, so a row whose\n target or policy moved between create and recheck never admits; the fact's durable\n address is caller-scoped, so the obligation row, keyed target-first, is the ONLY\n target-enumerable record a retirement barrier can drain;\n `target.mappingRevision` is provenance, never a fence). The\n canonicalizer preflights the **serialized decision fact**, not merely the inline args,\n against `max_payload`: a submission whose acceptance fact would not fit is rejected\n `resource-exhausted`, and the rejection fact always fits by construction: every field\n is bounded or fixed-size (the operator floor assertion covers the maximum serialized\n rejection/quarantine fact, \xA713.12):\n `RejectionFact` = `{ v: 1, id, decision: \"rejected\", fingerprint, error: { code (catalog\n token), detail? (\u2264 256 bytes) }, caller: {id, lifecycleUid}, authzDecision?: {revision,\n epoch}, sourceSeq,\n ts }`; the fingerprint and the catalog error, never the args (a parseable submission\n always yields the fingerprint; the unparseable/no-id case is the QuarantineFact above,\n which requires neither `id` nor `fingerprint`). Digest-pinned\n references inside a fact may name **only already-published public contract artifacts**,\n never per-request payloads: the contract store is public, immutable, and permanent,\n the opposite lifecycle of private, horizon-bounded request content (a large-payload\n facility, if ever needed, is its own future primitive with its own store, retention, and\n \xA713.9 rows). Effects and replay read the fact, never the raw submission (a TOCTOU re-read\n of the untrusted log is non-conformant).\n6. Decision facts/tombstones are retained at least the declared **idempotency horizon**\n (default 24h, space-configurable) AND longer than the maximum submission-log retention\n plus recovery/redelivery lag; otherwise a rebuilt canonicalizer could re-accept an old\n submission still sitting in the log as new work. The horizon is **realized by decision\n retention, not by a clock**: the create-only CAS returns the recorded decision for exactly\n as long as the fact exists, and a reused id becomes new work only once retention has\n evicted the old fact and freed its subject; there is no separate time rule for the CAS\n to disagree with. The \xA713.12 retention floor states the horizon by OUTCOME: no removal\n cause may drop a decision fact or tombstone before it. The canonical subjects are the authority (D12) for anything\n auditable, metered, compensated, effected, or replayed. Ordering is per-subject;\n consumers never assume cross-subject order.\n\n**Events are not facts.** Cluster events and per-goal progress (`epe`) are direct,\nepoch-fenced, instance-published notifications on a durable, ordered, replayable stream;\nthat is the sense in which they ride the journal contract. They do NOT pass through the\ncanonicalizer, carry no acceptance semantics, and MUST NOT drive effects that require\ncanonical acceptance; anything auditable/metered/compensated goes through submissions and\nfacts.\n\n### 13.5 Verbs\n\n- **call**, bounded request/reply (`replyExpected: true`, `deadlineMs` mandatory). On the\n `one` rail it is queue-group anycast; on `inst` it addresses one stable instance. No\n responder \u2192 `unavailable`.\n- **cast**, the same subjects and grants (`replyExpected: false`): fire-and-forget,\n at-most-once, the responder MUST NOT reply and the caller never reads the rail (the nonce\n is present but unused). A cast to a journaled command is `class-mismatch`; journaled work\n goes through submissions.\n- **watch**; observe a record (KV watch; fell-behind \u21D2 re-read, \xA713.4) or an event topic\n (live subscription within the read grant plus filtered replay from the event stream).\n Per-key and per-goal subjects carry read containment; a watch grant names the exact subtree.\n- **claim**, competitive at-most-one-winner acquisition from a durable work pool (`epw`),\n **owner-mediated**: the pool's owning endpoint holds the pool's single `AckExplicit` pull\n consumer (\xA713.12); workers hold **no** JetStream grant on the pool and acquire, renew, and\n settle work exclusively through the owning endpoint's reserved **`lease`** and **`commit`**\n commands on the ordinary `ep` rails. This is the only shape that satisfies both claim\n invariants at once: the delivery's ack token never leaves the party allowed to use it, and\n the attempt binding is **owner-recorded at assignment** rather than asserted by the worker\n (a worker-carried \"sequence + attempt\" proves nothing about delivery; an owner assignment\n does). The stored pool message is **work identity and input only, never the authoritative\n lease**: broker redelivery re-delivers the same stored bytes, so a token in the payload\n cannot fence, and the consumer's `ack_wait` is the broker's redelivery-to-owner timer only,\n never the lease. `lease` (call): the owner fetches the next stored item and records the\n lease `{item, sourceSeq, attempt: the delivery count, worker: the broker-authenticated\n caller (principal + lifecycle UID, plus epoch for endpoint workers), fencingToken,\n leaseDeadline}` in its `lease` record (key grammar \xA713.7, writer table \xA713.9) by\n **first-wins idempotent CAS per (item, attempt)**, a duplicate or\n delayed `lease` call for a still-current attempt returns the SAME lease; an attempt is\n superseded once redelivery advances the delivery count; `fencingToken` is CAS-incremented\n per attempt and `leaseDeadline` comes from the owner's own clock. Expiry revokes the claim\n at that deadline even before reassignment. Every Cotal-owned commit from claimed work is\n submitted through the reserved **`commit` command** carrying the exact lease tuple; the\n handler validates token currency AND unexpired lease against its own clock AND that the\n caller is the lease's bound worker, then performs an **atomic, idempotent per-item CAS to\n a cached terminal result**, the per-item terminal fact\n `epf.<endpoint>.wrk.<pool>.<acceptance identity>` (\xA713.2), create-only CAS per item,\n under its mediated writer credential (\xA713.9): a committed item\n can never be leased again, a duplicate commit returns the cached terminal outcome, and a\n raced commit loses loudly. Only after observing the committed terminal state does the\n owner ack the WorkQueue message; it holds the delivery natively, so the deletion\n capability is never transferred, and no worker-side ack can destroy an item whose commit\n was rejected. A lost owner ack merely redelivers the item to the owner, which observes the\n committed terminal state and acks again: **settled work is never re-enqueued as new** (the\n durable bridge is the acceptance fact plus the per-item terminal CAS; an accepted item\n with no terminal result and no live pool entry is the only re-enqueueable state, \xA713.6). A\n stale token, expired lease, or superseded worker is `expired`/`conflict`; workers hold no\n bypass write.\n- **scatter**, a request on the `all` rail. The caller freezes a **request-scoped expected\n set**, the live instances of the class from the service registry, each as\n `(instanceId, registrationRevision, epoch)`, where `registrationRevision` is the store\n revision of the instance's `svc\u2026.spec` record key (\xA713.7: it advances only on mediated\n registration writes, and the record read/watch grant that freezes it is a \xA713.9 matrix\n row), at send time. Gather accepts at most one\n terminal reply per expected `instanceId`, attributed from the reply subject **including its\n epoch** (\xA713.2): a second reply from the same `(instanceId, epoch)` is classified\n `duplicate` and **reported, never silently dropped** (first reply wins); a reply from a\n frozen `instanceId` at a different epoch, or an observed registration-revision advance;\n is classified `churn` (the instance restarted mid-scatter and may never have seen the\n request) and does not count toward completion; replies from outside the frozen set are\n classified `unexpected` and never count toward completion. Completion is\n all-expected-replied or deadline, in which case the result is explicitly partial with\n `missing` / `churn` / `unexpected` / `duplicate` / `late` classifications (a churned slot\n reports as `churn`, not `missing`). An empty or unreadable registry is\n `failed-precondition`, not an empty success. Deadline mandatory.\n\n### 13.6 Composites\n\nPatterns over the verbs and contracts; zero new transport.\n\n**Action**, a long-running command. `action` is a command **marker**, never a class: an\naction command's submissions are `class: journal` (\xA713.3).\n\n1. The caller submits with a client-generated `goalId` and the request fingerprint (\xA713.4).\n Accept/reject is the durable decision fact (\xA713.4), expected within the submission's\n decision deadline; there is no reply-rail answer to recover.\n **Authorization linearizes at acceptance**: the acceptance fact persists the caller and\n target lifecycle tuples, command + contract digests, and the authorization decision\n revision/epoch it was made under. A scope narrowing before acceptance rejects the goal;\n after acceptance it blocks *new* goals but an accepted goal continues, unless the\n command's contract declares **continuous reauthorization**, in which case each declared\n checkpoint re-validates and deterministically transitions to `cancelling`/`failed`\n (`permission-denied`) on narrowing. Handle expiry/revocation mid-goal follows the same\n declared policy.\n2. States: `accepted \u2192 running \u21C4 waiting \u2192 succeeded | failed | cancelled | expired |\n uncertain`, with\n `cancelling` between a cancel and its terminal state. This is the **single status\n vocabulary** for every long-running surface. All five of `succeeded`, `failed`,\n `cancelled`, `expired`, and `uncertain` (item 6) are **terminal**, and first-terminal-fact-wins\n applies uniformly: `uncertain` is not an absence of an outcome, it is the outcome\n \"this action's success signal did not arrive within its readiness deadline\".\n3. Progress rides per-goal events (`epe\u2026goal.<caller triple>.<goalId>.progress`), read-scoped\n to the caller at mint time. The goal's current state is a status-only record projection;\n the journal owns the facts.\n4. Cancel is the reserved `cancel` command: `graceful` (compensations, default) or\n `terminate`. Cancel of an unknown/terminal goal is `failed-precondition` with the cached\n outcome attached. Cancel races completion at the mediated commit point: first terminal\n fact wins; the loser observes it.\n5. The terminal result is a journal fact and is cached. The full payload is retained at least\n the declared result retention (default 24h); a **terminal tombstone**\n `{goalId, fingerprint, state, outcomeDigest}` at least the idempotency horizon (\u2265 result\n retention; outcome-stated by the \xA713.12 retention floor). Same goalId + fingerprint returns the cached outcome (after payload eviction:\n the tombstone summary, `data.evicted: true`); same goalId + different fingerprint is\n `conflict`; beyond the horizon a reused goalId is explicitly new work.\n6. **Bounded readiness (`uncertain`).** An action whose success signal may lawfully not\n arrive within its readiness bound declares a **readiness deadline**, a distinct,\n acceptance-relative bound persisted in the acceptance fact/goal state, NOT the\n submission's `deadlineMs` (which bounds only the decision, \xA713.3). Spawn readiness is\n the reference case: its readiness deadline is **30 s**, the migrated presence-or-exit\n backstop, D29; every legacy spawn-timeout consumer converges on this single bound. When\n the deadline passes without the signal, the owner records the goal's terminal **result\n fact** (`goal\u2026.result`, \xA713.2) with the outcome\n `uncertain`, and the goal IS terminal: `uncertain` is a terminal outcome like\n `succeeded`/`failed`, immutable, first-terminal-fact-wins as for any goal (there is no\n call and no reply rail here: an action is a journal submission, and the result fact IS\n the caller-visible outcome, item 5). The underlying ENTITY's later convergence\n (ready/exited) is observable on that entity's own status record (`svc\u2026.status`, the\n lifecycle mapping); a caller that needs the eventual answer watches the entity, never\n the goal; the goal is not rewritten and its status does not linger non-terminal.\n7. Goals bind the target's `(principal, lifecycleUid)` (\xA713.1): a goal accepted against a\n lifecycle is not redeemable, cancellable, or effectful against a same-name successor. A\n restarted instance (same `instanceId`/UID, advanced epoch) recovers its goals from journal\n + records; a superseded epoch cannot commit transitions.\n\n**Awaitable checkpoint**; one durable pause primitive (approvals, guard holds, payment\nauthorization). A waiting action mints a checkpoint: a durable token persisted with the goal,\na `waiting` status carrying the checkpoint id and its **deadline generation**, and a durable\ntimer (\xA713.12). Deadlines are mandatory. Heartbeat/extension CAS-advances the generation in\nstatus, then replaces the timer (a new `.schedule` request; the mediated timer writer's\nsame-subject `.armed` publish is the server rollup, \xA713.2/\xA713.12, the 2.14 atomic\nstop-plus-publish is NOT assumed at the 2.12 floor). A firing timer carries\n`(timerId, generation)`; the endpoint validates the generation against current status before\nacting, stale fires **no-op**. Because status and timer are two resources with no atomic\nbridge, a **durable reconciler** on the owning endpoint repairs the pair after crash or\nleadership change WITHOUT any status\u2194schedule read the no-read timer plane cannot serve: the\nreconciler **re-emits a `.schedule` request at the current generation for every `waiting`\nstatus it owns**, and a same-`(timerId, generation)` arm is **idempotent at the timer writer**\n(it re-derives the same `.armed` message; a duplicate is a no-op replacement), so\nover-emission is harmless and a missing schedule is repaired without the reconciler ever\nhaving to observe whether one exists. Stale-generation fires still no-op at the handler. Cancellation of a timer is cleanup, never the correctness boundary.\nTimer retention MUST exceed the maximum deadline plus a recovery margin. Resume: a `resume`\ncommand presenting the checkpoint token; resume authorization is **one-use** (journaled by\ncreate-only CAS on the checkpoint token; duplicate resume is `conflict`) and holder-bound\n(\xA713.10). Expiry fails the checkpoint closed.\n\n**Guard checkpoint**, the pre-effect authorization hook. A command carrying the governed\n`ai.cotal.guarded` trait MUST NOT effect until the guard endpoint named by the trait value\nanswered **allow** (class call). Answers: `allow | deny | hold` plus optional signed\nobligations (attenuations the endpoint MUST apply; monotonic). `hold` converts the action to\n`waiting` on a checkpoint owned by the guard decision. Timeout or unreachable guard is\n**deny** (fail closed). Ordering is guard-then-effect. Side-effecting guards own their own\nreconciliation.\n\n**Capability handle**, the one passable reference type: a signed JSON grant, RFC 8785\ncanonical, Ed25519-signed by a key in the trust-anchor registry (\xA713.10):\n\n`{ v: 1, id, space, issuer: { keyId }, holder: { id, lifecycleUid }, grants: [{ endpoint,\ninstanceId?, commands: [{ name, authz?, targetOwner?, targetActor?, targetLifecycleUid? }],\nreads?: [<record-key or event-topic subtree>] }], iat, nbf?, exp, parentDigest?, sturdy,\nepoch?, sig }`\n\nA grant entry carries **every subject-level dimension** a capability has (\xA713.9): a targeted\ncommand names its authorization mode and target components; read scopes name exact\nrecord-key / event-topic subtrees. The per-command target tuple is a **closed set of three\nlegal shapes**, no target components; `targetOwner` alone; or the full triple\n`{targetOwner, targetActor, targetLifecycleUid}`, and **every other combination is\nschema-invalid** (`contract-invalid`): in particular `targetActor` without\n`targetLifecycleUid` (a handle that pins a recyclable alias component MUST pin the lifecycle\nit means) and `targetLifecycleUid` without `targetActor` (a lifecycle restriction with no\ncompile target would otherwise be silently DROPPED into an owner-wide grant, a partial\ntuple never weakens into a broader one). The normative compiler maps a grant entry to\nexactly the subjects the equivalent minted capability would receive (never wider) it MUST\nconsume every present signed component (a component the compile target cannot express is\nschema-invalid, never ignored), and every legal entry HAS a compile target:\n\n- a **no-target** entry compiles to the untargeted or `self` form per the command's\n contract; an `authz` field on it is schema-invalid.\n- an **owner-domain** entry (`targetOwner` alone) compiles to the mode its `authz` field\n names, `owner` (the default), `child`, or `ledger`, and NOTHING else: each pins the\n signed `targetOwner` in that mode's own subject form (\xA713.2), **never collapsing `child`\n or `ledger` to `owner`** (the modes are distinct validator-primary rails and rewriting\n one into another widens authority), and **`authz: \"any\"` is schema-invalid in a handle\n grant entry** (`contract-invalid`): the `any` rail is operator-ceiling authority, minted\n only as a standing capability under an operator-scoped anchor (\xA713.10), never conferred\n or attenuated through a handle; a compiler therefore has no `any` case, and no\n implementation choice exists between rejecting, literalizing, or widening it.\n- an **actor-pinned** entry (the full triple) compiles to the `handle`-mode form pinning the\n full signed triple `<targetOwner>.<targetActor>.<targetLifecycleUid>` (\xA713.2); an `authz`\n field on it is schema-invalid (the triple IS the mode).\n- an **instance** entry compiles to\n the exact `ep.inst` rails; complete, because `(endpoint, instanceId)` is the whole instance\n address and instance ids are never reused (\xA713.1).\n\nA capability that cannot be represented in this shape MUST\nNOT be carried by a handle.\n\n- **Two uses, both fail-closed.** *Attenuation:* presented in the `auth` slot, a handle only\n narrows; the handler enforces `effective = presenter-cred \u2229 handle.grants \u2229\n issuer-authority`, and additionally requires any signed target triple to match the\n request's target and the current mapping (`expired` on mismatch); it never confers broker\n reach. *Conferral:* a handle grants reach only by **redemption through the trusted auth\n path** (the exchange/callout of \xA79/\xA710), which verifies the signed target triple against\n the current mapping **at redemption time** (`expired` on mismatch) and mints a short-lived\n credential whose grants are the intersection of issuer authority, handle grants, and the\n redeeming holder's current lifecycle + credential; actor-pinned grants compile to\n `handle`-mode subjects carrying the verified triple (\xA713.2), so a target lifecycle that\n rotates after mint is caught by the endpoint's currency check; no handler-side widening\n exists. The minted credential is **ledgered before release** in the credential ledger\n (\xA713.1), keyed under the redeeming holder's lifecycle with the FULL presented handle\n chain as its `sourceChain` (plus the per-ancestor `bysrc.` index keys), so\n takeover/retirement barriers revoke it with the family and revoking ANY handle in its\n lineage (parent or leaf) cascades to it. Chain verification itself checks the\n revocation status of EVERY sturdy link in the chain, not only the presented leaf,\n failing closed on any revoked ancestor.\n- **Holder-bound:** `holder` names the one `(principal, lifecycleUid)` that may present or\n redeem it; bearer transfer exists only as an explicit issuer-signed re-issue. `space` binds\n it to one space. A recycled alias cannot present its predecessor's handles (UID mismatch).\n- **Attenuation chain:** `parentDigest` references the parent handle; a child MUST be \u2286 its\n parent under the **normative containment order**, per grant entry: endpoint within the\n parent's endpoint/domain pattern; `instanceId` equal or newly pinned (never widened to\n absent); commands a name-subset with per-command mode never higher in `self < owner < any`\n (`child`/`ledger`/`handle` are grantable only where the parent names the same mode); target\n components equal or newly pinned; read subtrees subject-prefix-contained, and per\n envelope: same `space`, validity window within the parent's, `sturdy` only if the parent is\n sturdy. The issuer of a child is the parent's holder, anchor-registered with a `handles`\n role whose scope covers the child (\xA713.10); the same containment order defines issuer-scope\n coverage. Presentation carries the full chain inline (`parentDigest`-linked artifacts\n presented together, no ambient fetch); verification walks every link to a registered\n anchor, failing closed on widening, unknown/revoked keys, or expiry.\n- **Sturdy vs live:** live handles (`sturdy: false`) bind the current process `epoch`, are\n never persisted, `exp \u2264 24h`, and die on restart. Sturdy handles bind the lifecycle UID\n (surviving supervised restart), persist as issuer-namespaced `handle.<issuerKeyId>.<id>`\n records (spec create-only; status = revocation state, monotonic; \xA713.9 writer table), and\n verifiers MUST check revocation (fail closed if unreadable). Max sturdy TTL is\n space-configured (default 30d).\n- Handles are reusable within TTL unless a composite declares one-use (checkpoint resume);\n the replay matrix of \xA713.10 governs every signed artifact.\n\n**Session (bidirectional stream)**, the generic composite for interactive byte/frame\nstreams (terminal attach is its first consumer; nothing terminal-specific is normative). It\nis exactly D26's cast-ingress + watch-egress composed over dedicated per-session subjects,\nno new verb and no new transport: the `in` subject is a cast-only rail (caller publishes,\nendpoint subscribes) and the `out` subject is a watch rail (endpoint publishes, caller\nsubscribes). A session is established by an ordinary command whose answer is a **session\ngrant**: a one-use,\nholder-bound handle (live: bound to the caller's lifecycle AND current process epoch,\nlive authority dies on restart, \xA713.1, so redemption fresh-checks the holder epoch and an\nunredeemed grant does not survive the caller's restart, plus the serving instance epoch) naming a fresh\nunguessable `sessionId` and the epoch-pinned session subjects\n`eps.<endpoint>.<sessionId>.<epoch>.in` (caller \u2192 endpoint) and `\u2026.out` (endpoint \u2192 caller).\nSession subjects are **core-only**, never stream-captured; the bounded flow window lives in\nmemory and a dropped frame is the composite's problem, not retention's. Redemption mints\nexact asymmetric per-session credentials: the caller publishes `in` and subscribes `out`;\nthe serving instance the reverse; no third party holds either, and no standing wildcard EPS\ngrant exists. Frames are opaque; flow control is bounded (window declared in the grant;\noverflow is `resource-exhausted`, never unbounded buffering). Close is explicit, and\nrevocation has a **durable** named authority that survives the\nserving endpoint: the trusted auth path (the exchange/callout of \xA79/\xA710) persists a **session\nledger row** at redemption, key `session.<sessionId>` in the auth store (\xA713.12), value\n`{sessionId, endpoint, serving instance + epoch, holder (principal + lifecycleUid), both\nminted credential ids, per-credential revocation marks, state, exp}` (the endpoint is in the\nrow because an `instanceId` is unique only within its endpoint, so every serving-party\noperation authenticates against the full serving identity the row pins), create-only CAS per\n`sessionId` (this CAS IS the one-use\nredemption), state monotonic\n(`active \u2192 closed | expired | superseded | retired`, all terminal), and each per-session\ncredential is simultaneously a credential-ledger row under its holder's lifecycle (\xA713.1),\nwhich is the index the \xA713.1 barriers enumerate, and a barrier that revokes a\nsession-sourced credential MUST resolve its `session.<sessionId>` row, transition it\nterminal, and revoke BOTH per-session credentials, so either side's takeover or retirement\ntears down the whole pair, not its own half. Redemption's writes are ordered by a **finalize CAS**, so no half-issued session is ever\nusable: the create-CAS writes the session row in state `issuing` (this create IS the\none-use), then both per-session credential rows are written gate-checked (\xA713.1), then the\nredemption **CAS-finalizes the session row `issuing \u2192 active`**, fresh-checking BOTH the\nholder and serving process epochs and both lifecycle gates at that CAS, and releases the two\ncredentials only on finalize success. A credential is authority ONLY once its session row is\n`active`; an `issuing` row confers nothing. Close/expiry/either barrier CAS the row to a\nterminal state (`closed`/`expired`/`superseded`/`retired`) and revoke both credential ids by\nname (the ids are known from the row, whether or not both credentials were released) so a\ncrash mid-issue leaves an `issuing` row that the expiry sweep collects (revoking both ids and\ntombstoning), never a live half-pair, and a redemption racing a close loses its finalize CAS\nand releases nothing. A revocation mark is set only by a revoke that SUCCEEDED; a terminal\nrow with an unmarked credential is retried by every later sweep pass, exactly the unconfirmed\nids, until both marks confirm, so a transient revocation failure can never quietly leave half\na pair alive. The auth path revokes BOTH per-session\ncredentials with eviction (bounded\npropagation) on any of: an **authenticated close input** on the trusted auth path itself,\na defined operation of the SAME exchange/callout surface that redemption already uses\n(\xA79/\xA710, off-broker, so no broker grant row applies): the caller authenticates as one of\nthe session's two parties (its lifecycle or per-session credential) or as the operator and\nnames the `sessionId`; the auth path verifies party membership against the ledger row\nbefore transitioning it. The in-band close frame\nis an advisory peer signal, never the revocation authority, because EPS subjects are\ncore-only and captured by nothing; expiry per the handle rules (`exp` is enforced by the\nauth path's own timer, not by the endpoint), or the serving\nepoch's supersession / lifecycle retirement via the \xA713.1 barriers (either side's lifecycle:\nholder and serving rows both index the family). Neither side can keep a\nhalf-closed session alive, and a crashed serving endpoint cannot orphan one, the ledger, not\nthe endpoint, remembers what to revoke. Ledger rows are retained at least the maximum\nsession `exp` plus a recovery margin. The session dies with the serving instance's epoch\n(the epoch is in the subject, so a restarted instance cannot resume it; a durable session is\na new establishment). Routing is authenticated broker routing end to end; there is no loopback URL\nor out-of-band transport in the contract, and cross-machine reachability is exactly broker\nreachability.\n\n**Virtual endpoints.** An endpoint MAY be virtual: registered (`spec.activation = on-demand`)\nwith no live instance. A virtual endpoint's commands MUST be journal-class: the buffered\ningress path is the ordinary submission plane (`epj` is durable and needs no live\nsubscriber), and the canonicalizer, which for a virtual endpoint runs wherever its\nactivator/owning authority runs, checks pool admission BEFORE deciding (an over-capacity\nsubmission is rejected `resource-exhausted` as its durable decision fact, never accepted and\nstranded), then accepts and enqueues the work into the endpoint's `epw` pool. Admission\noccupancy is the pool consumer's `num_pending + num_ack_pending`, read fresh from the exact\nper-pool consumer INFO after reconciling the canonicalizer's own outstanding acceptances\nagainst the predicate below (a repaired item is inside the count new work competes under);\nthe read fails closed (an unreadable consumer is `unavailable`, never an empty pool), and the\nsum is honest only while the pool consumer's delivery ceiling is unlimited\n(`max_deliver = -1`) AND its filter is exactly the pool's own subtree; BOTH are editable after\ncreation, so both are pinned at creation AND re-proved at every read (a message that exhausts\na finite ceiling stays stored but leaves both counters; a narrowed or foreign filter reads\nempty while stored work remains). The admission capacity comes from the endpoint's REGISTERED\nactivation policy (declared as the registration's `spec.activation` block, a closed schema\nwhose `capacity` is required; the registration path publishes each version as an immutable\n`policy` record, \xA713.7, and the govern head's selector below names the enforced one), READ\nleader-served at each decision (the read is FENCING by use, so a\nfollower Direct Get is never used; a scoped canonicalizer executes it only through the\nconfined policy reader of \xA713.8, whose request subject binds the authenticated endpoint)\nand its enforced revision RE-PROVEN after the decision's\nlater reads and carried into the acceptance commit, never a free-standing argument; the\ncarried revision is provenance, and the FENCE against the policy or lifecycle moving while\nthe acceptance is in flight is the \xA713.8 obligation row, not the carried value. The\n**endpoint-wide policy coordinate** is not a new head: it is the governance head\n`govern.<endpoint>` (\xA713.7, the endpoint's registration linearization point). To make the\nenforced policy MACHINE-SELECTABLE by any second implementer (not inferable from prose), the\ngovern head value carries a normative **policy selector**: `{ enforcedPolicyKey (the exact\nrecords key of the immutable `policy` record currently governing, \xA713.7), enforcedPolicyRevision\n(that record's STORE revision), pendingPolicyKey?, pendingPolicyRevision? }`. A canonicalizer reads\ngovern leader-served, follows `enforcedPolicyKey`, and re-proves it is still at\n`enforcedPolicyRevision`, with no per-instance guesswork; `policyRevision` throughout this\nsection IS `enforcedPolicyRevision`. **`enforcedPolicyKey` MUST name an IMMUTABLE,\nREVISION-ADDRESSED policy record, not a mutable per-instance slot** (a bare\n`svc.<endpoint>.<instanceId>.spec` overwritten on every re-registration is disqualified: the\nrecords bucket keeps history 1, so once a mutation overwrites it the OLD `enforcedPolicyRevision`\ncan no longer be read, and the drain window's claim that \"the old policy keeps governing\" would\nbe unbacked). The normative immutable form is the **`policy` record kind** (\xA713.7):\n`policy.<endpoint>.<digest-hex>`, one unsplit, create-only, NEVER-DELETED key per policy\nversion, where `<digest-hex>` is the SHA-256 hex of the record's canonical value bytes: the\nkey is self-certifying (a reader re-digests the value and refuses a mismatch), so a\ndifferent-byte overwrite is caught on read, and BOTH the enforced and the pending revisions\nstay readable throughout the drain. Immutability is upheld by the sole writer's create-only\nCAS plus that read-time self-certification, not a broker-level subtraction (\xA713.9). A\ndeployment that cannot provide an immutable policy key MUST pause admission during the\nmutation rather than claim the old value remains readable.\nA policy mutation is a re-registration under the frozen registration gate that lands in TWO\nfenced govern-head CAS steps (\xA713.9): (1) **stage** records the new registration as\n`pendingPolicy{Key,Revision}` (a NEW immutable policy key) while `enforcedPolicy...` still\npoints at the OLD immutable record, so\nthe old policy keeps governing and stays readable; (2) **promote**, only after the mutation has **drained the\nendpoint's unresolved obligations to quiescence** (\xA713.8: enumerate `oblig.*.<endpoint>.>`,\nsettle every unresolved row pinning an older `enforcedPolicyRevision` through its decision\ncoordinate, re-enumerate until none remain), moves `pendingPolicy...` into `enforcedPolicy...`\nand clears the pending slot. Admission always pins the CURRENT `enforcedPolicyRevision`,\nand **while a `pendingPolicy\u2026` is staged, proof issuance for policy-admitted decisions\nREFUSES** (`failed-precondition`: the endpoint is inside its drain window; target-bound-only\nadmissions are unaffected). The pause is what makes the drain CONVERGE under load and makes\n\xA713.8's rule (a row created after the drain's final enumeration can never admit) hold for\npolicy movement exactly as it holds for retirement; rows admitted BEFORE the stage keep their\npinned old revision readable through the immutable key, so no admission is ever judged\nagainst a policy it did not pin. The stage/drain/promote order is a durable, resumable\ngovern-head sequence, never an implied transaction. The **restart-status commit is the same two-coordinate\nclass**: before its status CAS the supervisor obtains a `self`-class obligation (\xA713.8)\nthrough the same mediator, pinning the `enforcedPolicyRevision` its thresholds were read\nunder AND the complete commit intent `{ commitKey, commitBaseRevision, commitValue, commitDigest }`\nof the\nstatus record it will write; the status CAS is authorized only while that obligation is\n`accepted`, so a policy or lifecycle movement settles the obligation and the delayed commit\nloses a CAS, and a crash after `accepted` is finished deterministically from the pinned\nintent (\xA713.8 recovery), never a\ncarried-revision comparison. The\nrestart-intensity thresholds are read leader-served from the SAME registered policy, so neither\na caller nor a follower-stale read can loosen the window to suppress an escalation. A command\nname is declared ONCE across the whole closure; a cross-cluster duplicate is an ambiguous\nsurface and registration refuses it, and a command declared non-journal-class in ANY cluster is\nnon-journal for the on-demand registration check. The supervisor-owned status fields (the\nrestart history and the retirement mark) and the `escalated` state can be ORIGINATED only\nunder the supervisor's DISTINCT WRITE AUTHORITY (a package-private branded capability held by\nthe restart-note and the escalation reconciler, never an ambiently-mintable factory or the mere\npresence of a revision pin): an instance-side status write, whether it creates the first status\nor updates a later one, has them stripped and cannot originate `escalated`. The restart history\nand retirement mark are validated at every read boundary (a unique-epoch history, an integer\nmark present only on an escalated row), and a DEL/PURGE status marker fails closed on the\nretirement path (a deletion is never clean absence). Every status write operates on a validated DETACHED snapshot\ntaken before its first read, so a caller mutating a shared status object mid-write cannot split\nthe authenticated coordinate from the stored bytes. The activator's reply authority is its\nown CONNECTION-SCOPED inbox (`_INBOX_<connId>.>`), never the account-wide default, and its\noccupancy read re-proves the pool consumer's ack policy and pull mode alongside its editable\ndelivery ceiling and filter (a delete/recreate must not substitute a semantically different\nconsumer). A supervision clock behind the newest recorded restart is refused before the\nduplicate-note short-circuit, so a rolled-back clock never returns a stale count. The virtual endpoint's canonicalizer durable serializes admission\n(`max_ack_pending = 1`): one submission is in the count-decide-enqueue path at a time, so two\nsubmissions cannot both observe the same free slot; because MaxAckPending is also editable\nafter creation, every admission re-proves the live pin and refuses on drift rather than\ndeciding under a serialization it no longer has; pool-worker execution concurrency is an\nindependent knob, already inside the count via `num_ack_pending`. A virtual endpoint's\nregistration REFUSES if any declared command is not journal-class (an ephemeral surface\ncannot exist with no live instance). Acceptance and\nenqueue span two streams with no atomic bridge, so the enqueue is **idempotent, keyed by the\nacceptance identity, and reconciled against a decidable predicate**: the pool subject carries\nthe acceptance identity and the enqueue is a create (expected-last-sequence-for-subject 0),\nso a duplicate enqueue loses its CAS harmlessly; because the pool owner acks only after the\ncommitted terminal state (\xA713.5), an acceptance fact **with** a terminal result is settled\nand never re-enqueued, and an acceptance fact with **no** terminal result and **no** live\npool entry (a FENCING absence: the probe is the leader-served `STREAM.MSG.GET` last-by-subject\nread of the \xA713.9 work-pool reconciliation row, never a follower-servable Direct Get, because a stale\nfollower miss would re-arm settled work) is unambiguously never-enqueued-or-lost, the\nonly re-enqueueable state. A crash after the acceptance CAS but before the enqueue is\nrepaired by exactly that predicate; an enqueue without an acceptance fact cannot occur\nbecause only the canonicalizer holds the pool-write grant and it enqueues only from its own\naccepted decisions. The stored item bytes are the CANONICAL derivation of the acceptance \u2014\nthe RFC-8785 canonical JSON of exactly `{ v: 1, id, fingerprint, sourceSeq, workExpiry,\ncaller, request }` (work identity + input only; never a lease, token, or decision metadata) \u2014\nso any two conforming writers (a first enqueue and a crash repair) produce BYTE-IDENTICAL\nitems, and the create's same-subject-same-bytes idempotency holds across them; a differing\nbody under the same acceptance identity is a mixup and refuses loud. An ephemeral\ncall to a virtual endpoint with no live instance is an honest `unavailable`; nothing\nsilently buffers it. An **activator** (holder of its activation capability) watches the pool\nand starts an instance; single-writer per identity is fenced by instance-record CAS +\nepoch. The exact consumer INFO the activator watches is a request/reply snapshot with no\nbroker wakeup, so watching is bounded polling with backoff to a finite maximum interval, and\nan INFO failure is loud, never a silent skipped poll; the activator's broker authority is\nexactly that INFO read plus its mediated, target-bound start seam (no pool consume/ack, no\nstream read, no consumer create/update/delete). Passivation drains, updates status, exits;\ndurable reminders ride the timer plane.\nSupervision is restart-intensity escalation: more than `maxRestarts` (default 3) within\n`restartWindow` (default 60s) escalates; the instance stops restarting, status records\n`escalated`, the lifecycle retires terminally (\xA713.1), and the failure is loud. The restart\nhistory is DURABLE on the instance's own status record, SUPERVISOR-OWNED (the status writer\ncarries it forward through every ordinary instance-side write, so a successor's `ready`\nconvergence can neither reset nor forge it), and each note is a revision-pinned CAS: a\nsupervisor restart cannot amnesty the count and two concurrent notes cannot merge-lose a\nrestart. Each history entry is bound to the DYING PROCESS EPOCH (a real restart advances the\nepoch), so a replayed or duplicated notification of one restart is an idempotent no-op, never\na double count; and a supervision clock behind the newest recorded restart REFUSES rather\nthan silently truncating history. `escalated` is IRREVERSIBLE at the status writer (no later\nwrite, any epoch, replaces it), refuses further notes, and is excluded from every liveness\nderivation (a frozen scatter expected set never contains an escalated instance). The\nescalation commits before the lifecycle retirement runs; the retire seam MUST be idempotent,\na retirement failure leaves the escalation standing, and a reconciler retries retirement on\nalready-escalated rows until it completes, recording completion durably (nothing\nun-escalates).\n\n### 13.7 Contracts and discovery\n\n**Clusters.** An endpoint's surface is a set of composable **capability clusters**, each\n`{ urn, revision, attributes[], commands[], events[] }`:\n\n- `urn`, reverse-DNS cluster type URN (`ai.cotal.lifecycle`, `com.acme.deploy`).\n- `attributes`, readable/watchable state; each declares a name, value schema, and record\n derivation (which record key carries it). Attribute reads/subscribes ride the record\n contract, never ephemeral replies.\n- `commands`, each declares name, input/output schemas, `class`, `targeted` (and if so which\n authz modes it admits), its **capability requirement** (the named capability minting maps to\n subjects, \xA713.9), and optional traits.\n- `events`, name + payload schema; events ride the journal contract on the event plane\n (`epe\u2026.ev.<cluster>.<event>`), read-contained by event-topic grants.\n\nAn **endpoint type** is a conformance set of cluster URNs. `manager` and `delivery` are\nordinary conformance sets defined by the reference implementation; core knows only\n\"endpoint\".\n\n**Schemas.** Contract schemas are JSON Schema **2020-12**, validated by a real 2020-12\nvalidator (the reference implementation pins `ajv`), under this normative resource profile: a\nschema is a **closed resource bundle**, either fully self-contained (local `$defs`/`#/\u2026`\nrefs) or referencing other contract-store artifacts **by digest** only. `$id`/`$anchor`/\n`$dynamicRef` resolve deterministically within the bundle; ambient HTTP/file/URI resolution\nMUST NOT occur. Contract identity is the **closure digest** (above): the digest of the\nmanifest naming the complete resolved closure, not of the root document alone. Registration-time bounds (loud `contract-invalid`, distinct from\ninvocation-time `bad-request`): document \u2264 256 KiB, closure \u2264 1 MiB, nesting \u2264 32, ref chain\n\u2264 32, bounded pattern complexity, compile/validation time budgets, and a bounded compiled-schema cache (reference: 256-entry LRU) (\xA713.8). Runtime\nvalidation at the serving boundary is mandatory: args before any effect, replies against the\noutput schema. Authoring tooling is free (the reference implementation authors in Zod); the\nwire artifact and validation semantics are the JSON Schema documents themselves.\n**Every command declares BOTH an input and an output schema**: a side with no payload\ndeclares the **canonical void schema**, the artifact `{\"type\":\"null\"}`, whose RFC 8785\ndigest is therefore one fixed value, so both `op` digests exist for every command (\xA713.3)\nand no shape in this section is conditional on a missing side. Validation against the void\nschema means the side's payload is absent or `null`.\n\n**Content addressing.** A contract artifact (cluster document, schema bundle member, trait\ndefinition or attachment) is identified by the SHA-256 digest of its RFC 8785 canonical JSON\n(strict RFC 8785 over I-JSON; the reference implementation pins `json-canonicalize`'s strict\npath and gates on the RFC's published test vectors, including number-serialization and\nsurrogate edges). **Two digests, never conflated.** An **artifact digest** identifies ONE\ndocument's bytes and is the value that keys its subject and every by-digest reference. A\n**closure digest** identifies a whole resolved bundle, a cluster document or a schema\nclosure, and is the artifact digest of that bundle's **manifest**: the artifact\n`{ v: 1, root: <artifact digest>, members: [<artifact digest>, \u2026] }`, `members` being every\nartifact transitively reachable through by-digest references from `root`, sorted\nlexicographically and deduplicated. The manifest is itself an ordinary artifact on its own\ndigest subject, so a closure digest is an artifact digest, nothing dispatches on which kind\na digest is. Contract identity (\xA713.7 `contractDigest`, `clusterDigests[]`, and the\n`op.inputDigest`/`outputDigest` a caller pins) is always a CLOSURE digest; a `$ref`-by-digest\ninside a schema is always an ARTIFACT digest.\n\n**Every `*Digest` field in this section is one scalar shape**, `sha256:<hex>`, lowercase\nhex, and each names exactly one input, so no field's digest is implementation-defined:\n`inputDigest`/`outputDigest`, `contractDigest`, `clusterDigests[]` = the CLOSURE digest of\nthe named bundle (above); a schema's by-digest `$ref` = an ARTIFACT digest;\n`argsDigest`/`outcomeDigest`/`resultDigest` = over the strict RFC 8785 canonical JSON of\nthat value (absent iff the value is absent); `authDigest` = over the raw UTF-8 bytes of the\n`auth` slot as carried (\xA713.3); `submissionDigest` = over the raw stored submission bytes\n(\xA713.4). Integer fields on the wire (`sourceSeq`, `revision`, `epoch`, `ts`,\n`deadlineMs`, `readinessDeadlineMs`) are non-negative integers \u2264 2^53 \u2212 1, the I-JSON\ninteroperable range, so at most 16 decimal digits, which is what makes the \xA713.12\nmaximum-fact fixture a computable worst case rather than an estimate.\n\nArtifacts live in the per-space **contract stream**: one artifact per\ndigest-keyed subject `cotal.<space>.epc.<digest-hex>` (\xA713.2), published as a single\nmessage; possible because a document is bounded at 256 KiB (below) and the operator floor\nasserts `max_payload` covers it (\xA713.12); a closure is fetched artifact-by-artifact through\nits digest references, never as one blob. Reads are the subject-scoped last-by-subject\nDirect Get on the exact digest subject, no consumer, no replay machinery, and nothing\nbody-selected (\xA713.9). Readers MUST verify fetched bytes against the digest and fail loud\non mismatch. Publication is mediated and create-only (\xA713.9): artifacts are immutable once\npublished. A single-message digest subject is readable subject-confined; a chunked object\nstore is not, because chunk replay needs a consumer whose delivery target is body-selected\n(\xA713.9).\n\n**Record kinds and key grammar.** Every record kind is registered: core kinds are defined\nby this section (writer table, \xA713.9), and each kind's registry entry pins its **key\ngrammar** (the qualifier tokens between the kind token and the `.spec`/`.status` suffix),\nits writer roles, and its mediation class; grants and merged watches are derived from that\ngrammar, so two implementations always agree on which key carries what. The core kinds'\nkey grammars, pinned here (each key then splits `.spec`/`.status` per \xA713.4, EXCEPT the\nunsplit atomic keys the table marks: the `lifecycle` head, `govern`, `uid`, and `oblig`):\n\n| Kind | Key grammar |\n| --- | --- |\n| `svc` | `svc.<endpoint>.<instanceId>` |\n| `signer` | `signer.<keyId>` |\n| `handle` | `handle.<issuerKeyId>.<id>` |\n| `contracts` | `contracts.<endpoint>` |\n| `goal` | `goal.<endpoint>.<cOwner>.<cActor>.<cUid>.<goalId>` |\n| `cp` | `cp.<endpoint>.<token>` |\n| `lease` | `lease.<endpoint>.<pool>.<cOwner>.<cActor>.<cUid>.<id>` (the item's acceptance identity, \xA713.2) |\n| `lifecycle` | `lifecycle.<owner>.<actor>.<lifecycleUid>` (the \xA713.1 mapping detail) |\n| `lifecycle` head | `lifecycle.<owner>.<actor>`; the alias's **authoritative current mapping**, and the ONLY key `mappingRevision` (\xA713.3) counts: a **single unsplit key** (NOT `.spec`/`.status`-split; the mapping is one atomic record, and a handler's \"fresh current mapping\" read is one leader-consistent read of this key returning `{ mapping, revision }`, the revision being the STORE revision, never a value field), CAS-updated, NEVER-DELETED (the head discipline: no grant permits DEL/PURGE, true absence alone is virgin, a deletion marker refuses loudly as corruption). States `active | retiring | retired` (\xA713.1): the mapping is current ONLY at `active`; `retiring` is the op-bound containment phase, non-current and not replaceable; `retired` asserts the completed \xA713.1 barrier. Activation CASes it from none (create-only) or from a `retired` predecessor to a freshly reserved UID's mapping; two concurrent mints for one alias cannot both win the CAS; the terminal barrier CASes `active \u2192 retiring` at its bar and `retiring \u2192 retired` as its final head step. The per-UID `lifecycle.<owner>.<actor>.<lifecycleUid>` detail below is optional append-only audit, never the authority |\n| `uid` | `uid.<lifecycleUid>`; the \xA713.1 **space-global UID reservation**: a **single unsplit key**, create-only, NEVER-DELETED, value = `{ owner, actor, mintedBy }` (the reserving authority and intended alias, audit only; the KEY is the reservation). A key exists for every UID ever reserved, including burned candidates; a DEL/PURGE marker is corruption |\n| `policy` | `policy.<endpoint>.<digest-hex>`; the \xA713.6 **immutable admission-policy version**: a **single unsplit key** per policy version, create-only, NEVER-DELETED. `<digest-hex>` is the SHA-256 hex (64 chars) of the record's canonical value bytes, so the key is SELF-CERTIFYING: a reader re-digests the value it read and refuses a mismatch. Immutability is a TRUSTED-WRITER invariant (create-only CAS by the sole writer) BACKED by that read-time self-certification, not a broker subtraction (KV create/update/delete share the one subject, \xA713.9): a different-byte overwrite is refused on read, and the residual (a DEL or same-byte overwrite by a buggy/compromised writer destroying availability under history 1) fails admission closed rather than admitting a lost policy. `enforcedPolicyKey`/`pendingPolicyKey` on the govern head (\xA713.6) name keys of exactly this kind, which is what keeps BOTH the enforced and the pending policy readable through a mutation's whole drain window. Writer: the provisioner registration path ONLY (\xA713.9); a DEL/PURGE marker is corruption |\n| `oblig` | `oblig.<targetUid>.<endpoint>.<cOwner>.<cActor>.<cUid>.<id>`; the \xA713.8 **target-indexed acceptance obligation**: a **single unsplit key** whose grammar IS the deterministic acceptance identity (target lifecycle UID first, so a retirement barrier enumerates `oblig.<targetUid>.>`), create-only winner, monotonic value states, NEVER-DELETED. An admission under policy with NO target lifecycle keys the row with the fixed sentinel target token `ep` (which the \xA713.1 UID token grammar can never produce, so no collision exists): `oblig.ep.<endpoint>.<cOwner>.<cActor>.<cUid>.<id>`: excluded from retirement drains (it binds no lifecycle) and included, like every targeted row, in the endpoint's policy drain via the endpoint-position filter `oblig.*.<endpoint>.>` (\xA713.6/\xA713.8) |\n| `frontier` | `frontier.<lifecycleUid>`; the \xA713.1 **per-stream retirement frontiers**: a **single unsplit key** per retired lifecycle, create-only, NEVER-DELETED, value = `{ lifecycleUid, opId, streams }` where `streams` maps each lifecycle-bounded stream to its last sequence at retirement. Written by the terminal barrier AFTER the obligation drain, the drain's repair-principal fence, the pool cleaner, and the cleaner-credential revoke+evict, and BEFORE the gate/head terminals (\xA713.1 order), so a `retired` head implies its frontier exists. The cutoffs bound the predecessor's half-open interval `(activationFrontier, retirementFrontier]` (\xA78); they are never a successor's start (a successor captures its OWN activation frontier). Writer: the minting authority's retirement barrier ONLY; it records once, under its own operation (a foreign-op record refuses the barrier closed); a DEL/PURGE marker is corruption |\n| `govern` | `govern.<endpoint>`; the endpoint's **governance head**: a **single unsplit key** (NOT `.spec`/`.status`-split), value = the endpoint's MONOTONIC binding map, command to governed URN set, the NORMATIVE **admission-policy selector** `{ enforcedPolicyKey, enforcedPolicyRevision, pendingPolicyKey?, pendingPolicyRevision? }` (\xA713.6: `enforcedPolicyKey` is the exact records key of the immutable `policy` record currently governing admission and `enforcedPolicyRevision` its store revision, so any implementer selects the endpoint-wide enforced policy WITHOUT per-instance guesswork; a mutation stages `pendingPolicy\u2026` and promotes it into `enforcedPolicy\u2026` only after the endpoint's obligation drain, so the selector alone decides which revision governs during the drain window), plus whatever internal serialization state the provisioner's registration CAS needs (that state is non-normative: a second implementer may linearize registration with a different slot shape and conform, provided every registration contends on this head under its frozen gate through spec publication, the policy selector fields carry the meaning above, and the external guarantees hold). Enforcing the governed-attachment no-strip/no-downgrade mandate (Traits, below) is a HISTORY-bearing, ENDPOINT-WIDE property: a fresh instance, a remove-then-re-add, or a concurrent registration must not launder a governed binding away, so this head is also the endpoint's **registration linearization point**. Writer: the provisioner registration path ONLY (\xA713.9); NEVER-DELETED, per the `lifecycle`-head discipline |\n\nThird-party kinds\nregister under reverse-DNS kind names.\n\n**Descriptor and describe.** Each instance registers a **service record** (kind `svc`, key\n`svc.<endpoint>.<instanceId>`; the owner is determined by the name and recorded in the\nvalue): spec = `{ endpoint, owner, endpointType?,\nclusterDigests[], protocol: { v: 1 }, activation? }`, status = `{ epoch, state,\nobservedSpecRevision, \u2026 }` (writer table \xA713.9). The spec key's **store revision is the\ninstance's `registrationRevision`**, the value scatter freezes (\xA713.5): it advances only\nwhen the mediated registration path writes the spec key, so an advance during a scatter is\nexactly a re-registration. `describe` is a reserved untargeted\nephemeral command every endpoint MUST serve, returning the descriptor with clusters inline or\nby digest. **Authorization-scoped answers use a trusted authorization source only**: the\nanswer is intersected against a fresh view of the caller's authority obtained from the\ndeployment's authorization ledger/callout (\xA79/\xA710), keyed by the broker-authenticated caller\nidentity, never against payload- or slot-asserted scope, which is ignored. If the trusted\nview is unavailable or stale beyond its declared freshness bound, describe fails closed\n(`unavailable`) rather than answering from a weaker source; deployments MAY declare an\nendpoint's descriptor public, in which case no view is consulted and the answer says so.\nDescriptor visibility is never inferred from reachability of `describe` alone. A KV browse\nindex (record kind `contracts`) is an advisory convenience copy; `describe` is authoritative.\n\n**Invocation binding.** The digests are not caller courtesy but a two-sided requirement\n(\xA713.3): a caller MUST pin `op.inputDigest`/`op.outputDigest` on every command except\n`describe` (the discovery bootstrap), and a serving member MUST reject their absence\n(`contract-mismatch`) before any effect; an unpinned invocation cannot silently bypass the\ndescribe\u2192invoke binding, and MUST honor pinned digests or reject `contract-mismatch`. Rolling updates keep classes contract-homogeneous: an incompatible\ngeneration registers a distinct routable identity (new endpoint name or explicit version\nlabel) until homogeneous.\n\n**Traits.** A trait attaches governed metadata to a cluster, command, attribute, or event.\nA **trait definition** `{ urn, valueSchema (digest), selector, breakingChanges, authority }`\nis content-addressed and signed: `ai.cotal.*` definitions by the space-operator authority;\nthird-party definitions by their defining owner's registered key. **Attachment authority is\ndistinct from definition authority**: every *required/governed* attachment (this revision governs\nexactly `ai.cotal.guarded` and `ai.cotal.priced`) is separately signed by the definition's\nnamed authority over `{ endpoint, command, contractDigest (the cluster document's complete\nclosure digest), traitUrn, value }`, so a self-published descriptor cannot strip, forge, or downgrade a governed\nannotation; removal or downgrade is an authorized contract revision. Enforcement is\nfail-closed at the pre-effect seam: missing, unverifiable, or stale governed attachments\nrefuse before effect. Non-governed traits are unsigned vocabulary.\n\n**Compatibility.** Cluster evolution is BACKWARD by default: within a revision line, changes\nMUST be additive and added fields MUST carry defaults; removal, rename, or semantic change\nmints a new cluster URN version. A push-time JSON-native compatibility differ + review gate\nenforce this in the reference workflow (repository tooling under `scripts/`, not shipped\nclient code). The discovery protocol itself is versioned additively under `protocol.v`.\n\n### 13.8 Distributed guarantees\n\n- **Idempotency scope.** Ephemeral idempotent commands by `id` (handler-local, within result\n retention); journaled submissions and actions by `id`/`goalId` + fingerprint within the\n declared horizon. Exactly-once is bounded honestly: delivery is at-least-once; Cotal\n guarantees idempotent submission/fact recording and fenced commits of Cotal-owned state; an\n external side effect is exactly-once only when the external API honors the propagated\n idempotency key or fencing token, else the contract documents at-least-once effects.\n- **Fencing and mediated commits.** Every Cotal-owned authoritative transition flows through\n its mediated writer (\xA713.9) carrying `(fencingToken | lifecycleUid | epoch)` as applicable;\n the writer validates token currency, unexpired lease against its own clock, lifecycle\n currency, and epoch currency. Value-carried tokens + CAS stop conforming-but-stale writers;\n scoped credentials + mediation stop everything else. The threat boundary of any\n direct-owner write is explicitly downgraded (\xA713.9).\n- **CAS conflict.** Any lost CAS is a loud `conflict`; the loser re-reads and re-decides.\n- **Authority-head reservation/drain.** An authority head (the \xA713.1 lifecycle head; the\n \xA713.6 registered admission policy) and a durable acceptance/start fact live in different\n streams; no cross-stream CAS exists, and a revision carried inside a fact is provenance,\n never a fence. Any durable acceptance or start that creates work bound to a lifecycle,\n or admits work under a policy read, therefore contends with the head's movement on ONE\n durable serialization coordinate: the **target-indexed obligation row** (kind `oblig`,\n \xA713.7). In order: (1) BEFORE the EPF decision publish, the writer obtains the obligation\n through the **admission mediator**. The mediator owns the `oblig.` prefix (the\n canonicalizer holds no raw write on it), derives the coordinate from the\n broker-authenticated request subject (never from a body field), and IMMEDIATELY before\n the create performs the FENCING currency reads it will pin: for a target-bound\n admission a leader-served read of the target's lifecycle head, REFUSING unless the state\n is `active` (a `retiring` or `retired` target admits nothing); for a policy-admitted\n decision a leader-served read of the governance head (\xA713.6) that FIRST refuses if a\n `pendingPolicyKey` is present (the endpoint is inside its drain window; the drain-window\n admission pause is a normative step of THIS algorithm, not only a \xA713.6 property, so any\n conforming mediator refuses without needing to infer it) and only then follows\n `enforcedPolicyKey`, self-certifies it (\xA713.7), and pins its `enforcedPolicyRevision` as\n `policyRevision`. Refusing at the create-fence (not only at the post-create recheck) is\n also what bounds the row set: a request that could not create its row leaves no\n never-deleted `oblig` debt behind, so a long or crashed drain cannot accumulate an\n unbounded set of rejected rows. An admission with no target lifecycle keys the\n row under the fixed sentinel target token `ep` (\xA713.7). It then creates the row\n create-only at the deterministic acceptance-identity\n key `oblig.<targetUid>.<endpoint>.<cOwner>.<cActor>.<cUid>.<id>`. The KEY never contains\n `sourceSeq`, delivery attempt, mapping revision, or writer op id (a redelivery of the\n same logical acceptance MUST land on the SAME key); where a digest stands in for the\n tuple it is a versioned, collision-resistant digest of exactly that tuple, never\n delimiter-ambiguous concatenation. The VALUE pins the first winner under a CLOSED\n per-class schema: every row carries `{ state: provisional | accepted | rejected |\n terminal, decision: epf | self, opId }` plus the currency pins taken above\n (`mappingRevision` iff target-bound, `policyRevision` iff policy-admitted; at least one\n present); an `epf`-class row (a canonical acceptance) adds `{ fingerprint, sourceSeq,\n route }`; a `self`-class row (a guarded record commit, e.g. the restart-status CAS,\n \xA713.6) adds the COMPLETE commit intent `{ commitKey, commitBaseRevision, commitValue,\n commitDigest }`: the exact record key its accepted state authorizes, the store revision of\n that record the commit CASes FROM, the value it commits, and that value's digest.\n `commitValue` is a CLOSED discriminated union, so two implementations resolve and replay the\n SAME value: `{ enc: \"b64u\", bytes }` carries a JSON encoding of the committed value,\n base64url-encoded (RFC 4648 \xA75, no padding), or `{ enc: \"ref\", key }` names an\n IMMUTABLE, create-only records key (the \xA713.7 `policy` kind or another never-overwritten\n key) whose stored value IS the commit value; a mutable or absent `ref` target\n refuses at recovery, fail-closed. Never only a digest (a digest cannot reconstruct the\n value a crash recovery must re-write). `commitDigest` is the RFC-8785 CANONICAL content\n digest of the committed value, `sha256:<hex>` (the same `*Digest` scalar shape \xA713.7 uses\n everywhere; over the CANONICAL value, never a non-canonical storage stringify, so the\n landed/not-landed comparison is insensitive to how the store serializes the record). A\n crashed writer's commit is thus deterministically finishable from the row alone (below). The\n `decision` class is fixed by the TRUSTED operation kind, never caller-selectable. A\n create loser leader-reads the winner: the FULL pinned identity must match to join (an\n `epf`-class row on coordinate + fingerprint + route; a `self`-class row on the ENTIRE commit\n intent `commitKey` + `commitBaseRevision` + `commitDigest`, so two different desired values\n or base revisions never join under one `commitKey`); any\n mismatch is `conflict`, never a second obligation. (2) **Proof issuance is a post-create\n currency recheck, and admission is proof-gated**: after winning or joining the create,\n the mediator leader-reads the SAME coordinates AGAIN, and only if the target head is\n still `active` at the pinned `mappingRevision` AND (for a policy-admitted decision) the\n governance head STILL stages no `pendingPolicyKey` and the enforced policy is still at\n the pinned `policyRevision` does it return the opaque admission proof; otherwise it\n IMMEDIATELY settles its own provisional through the row's decision coordinate (below) and\n refuses. The recheck reads the SAME govern head the create-fence read, so a\n `pendingPolicy` staged in the window between the create and the recheck also fails\n proof issuance, not merely a moved `enforcedPolicyRevision`.\n No target-bound or policy-admitted EPF acceptance may publish, and no `self`-class\n guarded commit may run, without an unexpired proof issued under this rule. This is the\n structural half of the head fence: an obligation created in the window between a fresh\n `active` read and a head or policy movement exists durably, but its proof can never\n issue, so it can never admit; it is inert cleanup debt any later drain settles. (3) The\n EPF decision CAS runs as\n specified (\xA713.4), publishing with the WINNER's pinned acceptance identity and\n `sourceSeq`, whichever delivery is processing; a `self`-class writer instead advances\n its own row `provisional \u2192 accepted` (revision-pinned) and performs its guarded commit\n only while the row is `accepted`. (4) On acceptance the SAME key advances\n `provisional \u2192 accepted` and is retained until the accepted route is\n terminal and cleaned: the only enumerable record of accepted work is never\n erased at the moment it wins. States are monotonic (`provisional \u2192 accepted \u2192\n terminal`, or `provisional \u2192 rejected`), the row is NEVER-DELETED, and a DEL/PURGE\n marker is corruption. The stored `opId` is not a bearer capability: a resuming writer\n re-authenticates as the same endpoint-scoped principal through the mediator and joins\n by acceptance identity + fingerprint; any opaque reservation token the mediator issues\n is target/endpoint/connection-bound, bounded-lived, and checked against the CURRENT\n obligation state; the durable obligation is the authority, never possession of its\n identifier. **The decision coordinate is per-class** and is where every unresolved row\n settles: an `epf`-class row settles through the EPF decision subject's create-only CAS\n (read the winner; if absent, create-only publish the terminal rejection so a delayed\n acceptance CAS loses; the mediator holds that rejection-publish authority and executes\n it for its own recheck refusals and on behalf of the drains, \xA713.9); a `self`-class row\n settles on ITSELF: while still `provisional`, the drain CASes `provisional \u2192 rejected`\n (the writer's `provisional \u2192 accepted` CAS and the drain's rejection contend on the ONE\n row, exactly one wins, and a delayed guarded commit finds its authority gone). An\n `accepted` `self`-class row is NOT stuck and does NOT block quiescence: because the row\n pins the complete commit intent `{ commitKey, commitBaseRevision, commitValue, commitDigest }`,\n either\n the writer's own resume OR a drain reconciler drives it `accepted \u2192 terminal`\n deterministically. Read the record at `commitKey`: if its value canonically digests to\n `commitDigest` the commit landed, CAS the row `accepted \u2192 terminal`; if it is still at\n `commitBaseRevision` the commit did not run, re-apply it by CASing the resolved\n `commitValue` (decode `b64u`, or leader-read the immutable `ref` key's value, verifying its\n canonical digest against `commitDigest` BEFORE writing) at\n `commitBaseRevision` then CAS the row terminal; if the\n record has moved PAST\n `commitBaseRevision` to a foreign value the intended commit can never land (the guarded\n CAS would lose), so CAS the row straight to `terminal` as superseded. Quiescence therefore\n means NO `provisional` and NO un-driven `accepted` `self`-class rows remain: an accepted\n commit is always completable from the row alone, never an unrecoverable orphan. **Reclamation is never\n clock-only**, and because the EPF writer need not be the retiring lifecycle (a\n cross-endpoint canonicalizer publishes decisions bound to a foreign target, and revoking\n the TARGET's credential family disarms nothing that writer holds), target-side\n revocation alone is NEVER the reclamation condition. An unresolved `provisional` is\n reclaimed only by: settling it through its decision coordinate; or revoking +\n verified-evicting the WRITER's own commit authority; or the target head being\n non-current AND the drain below having completed to quiescence under the create fence +\n proof gate. A timeout alone never frees a slot\n while the writer retains publish authority. **Drain to quiescence**: after the head\n CASes to `retiring` (\xA713.1), and equally when a policy mutation must enforce a new\n revision (\xA713.6, enumerating `oblig.*.<endpoint>.>`), the drain enumerates the prefix\n (`oblig.<targetUid>.>` for retirement), settles every\n unresolved row through its decision coordinate, completes accept-side reconciliation\n (enqueue/goal/terminal, \xA713.6) for accepted rows, then RE-ENUMERATES, and records its\n cleaner and frontier completion (or treats the new policy as enforced) only when an\n enumeration finds no unsettled row. A provisional whose pinned `mappingRevision` or\n `policyRevision` is no longer the live coordinate is settled as REJECTION, never treated\n as still open for acceptance. A row created after the final enumeration cannot admit\n (its proof can never issue, step 2) and is settled by any later enumeration;\n an acceptance published after the recorded cleanup frontier from a\n stale `active` read is non-conformant even if later effect resolution would reject it.\n Whether the obligation is released once the route is settled under ordinary policy\n movement (`release-after-accept`) or survives as cleanup debt the terminal barrier must\n observe (`promote-to-lifecycle-obligation`) is fixed by the TRUSTED operation kind,\n never caller-selectable. The admission-policy specialization additionally binds\n identity at the read: the confined policy reader's request subject pins the\n authenticated canonicalizer endpoint AND the requested policy endpoint, requires their\n equality, derives the reply rail from that authenticated subject, and returns\n `{ policy, revision }` with an opaque proof binding `{ space, endpoint, policy\n revision, obligation/op id }`; endpoint A can never obtain, or replay, endpoint B's\n admission proof.\n- **Retry/backoff.** Only idempotent-at-scope operations are retried: exponential backoff,\n base 250 ms, factor 2, cap 15 s, full jitter, bounded by the caller deadline.\n- **Deadlines.** Mandatory on call, scatter, claims, checkpoints, timers, sessions. Reference\n default call deadline 15 s; defaults are overridable, never removable.\n- **Cancellation ordering.** First terminal fact at the mediated commit point wins.\n- **Watch recovery.** Fell-behind \u21D2 snapshot re-read then resume; bounded relist; no silent\n gap-skipping.\n- **Ordering/partitioning.** Per-subject only; the subject is the partition key.\n- **Retention floors.** Submissions \u2265 recovery/redelivery lag (\xA713.12; native dedupe is not\n relied upon, \xA713.4); facts/tombstones \u2265 idempotency horizon;\n results \u2265 result retention; receipts \u2265 receipt retention; timers \u2265 max deadline + recovery\n margin. **Pool coupling:** every accepted pool item carries an **absolute work expiry**\n (`workExpiry`, set at acceptance in the AcceptanceFact, NOT a per-message age a\n reconciliation re-publish would reset; a re-enqueue re-publishes with the SAME `workExpiry`,\n and the item is dead once it passes, leased or not). The EPW stream's max age is \u2265 the\n maximum `workExpiry` + recovery margin, and a pool item's decision and `wrk` terminal facts\n are retained \u2265 that same bound, so a live (or crash-recovering) item can never outlive the\n facts that identify it as accepted or settled: a decision that expired under a still-live\n item would let a reused id collide with the old enqueue, and an expired `wrk` under a\n lost owner ack would make settled work unrecognizable on redelivery. A reused `id` becomes\n new work only after the old item's `workExpiry` AND its facts' retention have both passed.\n An endpoint MUST refuse to start against a store below its declared floors.\n- **Backpressure and budgets.** Bounded consumer pending (default 1024), bounded\n virtual-endpoint pools and session windows, flow control on watches; overload is\n `resource-exhausted`. Schema compile/validate budgets (reference: 100 ms / 10 ms) and\n bounded regex; over budget is `contract-invalid`/`bad-request`.\n- **Timers.** Broker message schedules at the 2.12 floor; same-subject replacement only (at\n the mediated `.armed` subject, \xA713.12); generation- and scheduler-origin-validated firing\n (stale or foreign-origin \u21D2 no-op); durable reconciliation repairs\n status\u2194schedule divergence; replication and offline-assets downgrade fail loud at the\n broker floor gate.\n\n### 13.9 Authority boundary\n\nThe credential is the coarse boundary; every subject in \xA713.2 is default-deny. Every\n**statically expressible** authorization dimension is broker-enforced through the subject\ngrammar: caller identity + lifecycle, endpoint,\ncommand, the target components each mode pins statically (\xA713.2: the full triple for `self`,\nthe caller's own, and for `handle`, redemption-pinned; the owner for\n`owner`/`any`/`child`/`ledger`), serve identity, reply\n**attribution**, and plane writer ownership.\nReply **addressing** is the one deliberate exception: it is capability-by-secret (the\nper-request nonce, \xA713.2), not a broker grant, and it is sound precisely because serve\ncredentials cannot plain-subscribe the class rail (queue-qualified grants, \xA713.2), so nonces\nare visible only to the instance the queue selected (plus every instance on a scatter, which\nis scatter's definition). Target enforcement is stated per mode, never as a blanket claim:\n`self` is broker-confined end to end including the lifecycle UID; `handle` is broker-confined\non the full redemption-pinned target triple, with the validator re-checking only mapping\ncurrency; `owner`/`any` are broker-confined on the target owner and validator-primary on the\nactor and UID currency; `child`/`ledger` are validator-primary within their distinct broker\nrails. The **named dynamic relations** (static-mesh\nown-child, fresh-ledger escalation, target-mapping currency, authorization epochs after\nacceptance) are trusted-validator-primary by design, fail-closed, and operate only within\nthe broker ceiling. Handlers only narrow. **The process epoch fences only the five planes\nwhose subjects carry it** (reply, `epe`, `ept`, `eps`, `epr`). Request-ingress subjects and durable record\nkeys cannot carry it; the caller cannot know it, and a restart-stable key must not change,\nso those two classes are fenced by the mechanism each admits: records by mediation (writer\ntable below), ingress by credential revocation with verified eviction (\xA713.1), never by\nsubject.\n\n**Caller grants.** Minting maps each named capability to exact endpoint+command subjects:\npublish on the request forms (class + instance) with the authz-mode/target pattern the\ncapability specifies, subscribe on the caller's own reply rail, publish on matching `epj`\nsubmission subjects for journaled commands, and the exact record-key / event-topic subtrees\nfor attribute/event read capabilities (per-goal containment rides the caller triple in the\ntopic). The caller's lifecycle UID token is pinned in every granted subject, so a credential\nis dead against its principal's next lifecycle by construction. Wildcards are bounded: `*` in\nthe command position only when the capability covers every command of the endpoint; `*` in\nthe endpoint position never, outside operator/admin profiles; `child`/`ledger` mode subjects\nare never covered by an `owner`-mode wildcard. `describe` is granted by default for all\nendpoints; a space MAY narrow it. Because the subject shape is verb-invariant (\xA713.2), one\npublish row covers call and cast of a command. Minted credentials MUST stay within the\ndeployment's JWT size envelope, and the envelope is validated against a **normative\nmaximum-capability fixture**, not an adjective: the reference fixture is an agent holding\nevery baseline grant plus capabilities on 3 endpoints x 12 commands each, each targeted\ncommand in both `self` and `owner` modes, plus journaled submissions and per-goal read\nscopes for all of them. Minting MUST fail loud before emitting a credential that exceeds the\npolicy gate (reference: 16 KiB); the transport bound is the CONNECT control line\n(`max_control_line`, \xA713.12) and the policy gate MUST be the tighter of the two. The fixture\nset additionally includes a **maximum-command serve credential** (a 12-command endpoint's\nper-command rows, below); the \xA713.12 operator assertion uses the largest encoded CONNECT\nline in the set.\n\n**Serve grants.** Serving is granted authority, dual to calling. On the **subscribe side**\nan instance's credential binds its registered service name, stable instance id, and\n**registered command set**, one queue-qualified subscribe row per registered command\n(matrix below), never a bare `>` tail spanning commands the instance did not register. The\nper-command enumeration is affordable precisely where the caller-side equivalent is not:\nserve credentials are one per instance, a handful per space, with no capability-count\nscaling pressure. The subscribe side deliberately does NOT bind the epoch; a caller cannot\nname the serving epoch, so no request subject carries it and **ingress cannot be\nepoch-fenced by subject**; the fence for a superseded subscriber is the \xA713.1 takeover\nbarrier (revoke + cluster-verified eviction), not a grant shape. On the **publish side** the\ncredential binds the epoch everywhere it is real: the epoch-pinned reply prefix, the\nepoch-pinned `epe` event plane, its `ept` timer schedule requests, and its `epr`\nrecord-write ingress. Session subjects are\ndeliberately absent from the standing serve grant: both sides of a session hold only\nredemption-minted per-session credentials (\xA713.6); no standing EPS grant exists on either\nside. The credential also carries the record keys the writer table assigns it and, where\nthe endpoint owns a work pool, the pool's consumer + ack grants (\xA713.5; matrix below).\nNothing else. Every \"binds X\" in this paragraph has a matrix row below that actually binds\nX. Serve\ncredentials are re-minted on takeover (new epoch, \xA713.1 barrier); a superseded credential's\nreplies and commits are rejectable by epoch. Core names require operator provisioning\nauthority; reverse-DNS names bind to their registered owner. The registry is discovery; the\nserve grant is the authority: a foreign credential cannot subscribe a class rail, answer as\nan instance, or enter a frozen scatter set.\n\n**The ownership matrix (normative).** Every profile \xD7 resource \xD7 transition is classified\n**mediated** or **direct**, in an independently reviewed matrix from which grants are\ngenerated (never the reverse). Each row names the writer PROFILE, the exact subject/API\nnamespace (including the queue qualifier where one applies; the grant grammar has a queue\ndimension, \xA713.2), the operation, and the enforcement class; **read, consume, ack, and\ndelete authority are rows in the same table**, never prose that \"follows\" it. Every\ncredential and every audit probe is generated from these rows.\n\n**Consumer-name grammar (normative).** Every consumer a row names has a pinned name grammar\n(dash-form, \xA72; `<e>` is the endpoint-name token, `<uid>` the holder's lifecycleUid or\ninstanceId): `canonD = canon_<e>` (the canonicalizer durable), `poolD = pool_<e>_<pool>`\n(the pool durable, **pre-created by the provisioner** with exact filter\n`cotal.<space>.epw.<e>.<pool>.>`, the \xA78 item-3 pattern: the bare create form is\nbody-filter-selectable and is granted to NO ONE on control-surface streams), `timerD =\ntimerw_<space>` (the timer writer durable), `recwD-k = recw_<space>-<kind>` (one record\nwriter durable PER RECORD KIND, \xA713.9), `effD = eff_<e>` (the endpoint's ONE shared\neffects durable; below), `goalD = goal_<uid>-<e>` (the caller's own goal-result durable).\nEvery composite name is **collision-free by construction**, and\neach derivation states why: `pool_<e>_<pool>` parses uniquely from its LAST `_` because a\npool token contains no `_` (`[a-z0-9-]`) while `<e>` may (a dash separator would be\nambiguous, both tokens admit `-`); `dec_<uid>-<e>` parses from its FIRST `-` because\n`<uid>` is `[a-z0-9]` and contains none, and `goal_<uid>-<e>` likewise; `eve_<uid>-<e>-<gid>-<n>`\ncarries TWO `-`-adjacent soft components (`<e>` and `<gid>`), so `<gid>` is constrained\nSEPARATOR-FREE (`[a-z0-9]`, no `-` or `_`): then `<uid>` (leading, `-`-free), `<n>` (trailing\ndigits) and `<gid>` (separator-free) are each a single token off their edges, leaving `<e>` as\nthe only `-`-bearing component with an unambiguous extent (`eve_<uid>-a-b-c-0` can ONLY be\nendpoint `a-b`/gid `c`, never endpoint `a`/gid `b-c`). `rec_<uid>-<gid>-<n>` has one soft\ncomponent `<gid>` bounded by `-`-free `<uid>` and digit `<n>`. Without the separator-free `<gid>`\nthe two grants above would collide on one durable name. A derivation that cannot state its\ncollision-freedom argument is non-conformant. Reader consumers use **mint-time-enumerated LITERAL names**, and every one\nis **pre-created by the provisioner at capability mint as a PULL durable with its exact\nfilter; the holder receives BIND-ONLY grants** (INFO/MSG.NEXT/ACK, never CREATE or\nDELETE): `decD = dec_<uid>-<e>` (one per journal capability), `goalD = goal_<uid>-<e>`\n(one per action capability),\n`eveD = eve_<uid>-<e>-<gid>-<n>` and `recD = rec_<uid>-<gid>-<n>` (one per granted subtree;\n`<gid>` is the **grant id**, a short stable SEPARATOR-FREE (`[a-z0-9]`) id the provisioner\nassigns per minted capability grant, so two independent capability mints for one lifecycle UID\nnever collide AND the `<e>`/`<gid>` boundary stays unambiguous, and `<n>` is\nthe subtree's zero-based index within THAT grant, sorted lexicographically at mint; the\ndeprovision key is `<uid>-<gid>`, so revoking one capability deletes exactly its own reader\ndurables and cannot reach a sibling capability's). Two reasons, both\nload-bearing. A NATS wildcard replaces a\nWHOLE dot-separated token and never matches inside one, so an embedded `*` in a name token\n(e.g. `dec_<uid>-*`) is a literal character, not a glob; every name token in a grant is\nfully literal.\n\n**Mediated reads (normative).** No untrusted capability holder is granted **any** raw\nJetStream read of a control-surface stream, not a consumer create, not a bind-only pull,\nnot a `DIRECT.GET`. Every JetStream read is request/reply where the server delivers stored\nbytes to a **caller-chosen destination the broker does not confine to the caller's\n`pub.allow`**: a push consumer's `deliver_subject`, a pull `MSG.NEXT` request's reply\nsubject, and a `DIRECT.GET` request's reply subject are all set in the request body, and the\nserver's internal client publishes there regardless of the requester's publish permissions.\nA holder with only `MSG.NEXT` or\n`DIRECT.GET` on its own filtered reader can therefore route stored bytes onto a victim's DM,\nreply, or record subject, a confused deputy no filter tail, literal name, or pull-vs-push\nchoice prevents, because the destination is the vulnerable field, not the filter. Untrusted\ncallers instead read exactly as the \xA78 durable backstop already does, through a **trusted\nread path**, never a self-bound consumer: a caller receives its decisions, goal results,\nevent catch-up, and record reads over its OWN confined rails, a live core subscription to a\nsubject inside its `sub.allow` (bytes land only on the caller's own subscription), or a\nmediator that owns the reader consumer, re-authorizes each read against the caller's current\ngrants, and returns bytes over the caller's own attribution-pinned reply rail\n(`ep.reply.\u2026<caller triple>.<nonce>`: the mediator holds the publish grant, the caller the\nread grant, and the nonce confines addressing, \xA713.2). The mediator IS a trusted\nsingle-purpose principal (the delivery/read daemon, \xA78/Appendix B) that delivers only to the\nre-authorized caller and never proxies to an arbitrary subject; raw\nconsumer/`DIRECT.GET`/`STREAM.MSG.GET`\nauthority stays with trusted single-purpose infra principals (canonicalizer, commit\nprincipal, record writer, timer writer, the read mediator, the auth path) that deliver to\nthemselves. This contract fixes the boundary; untrusted callers never hold raw reads; reads\nare mediated onto confined caller rails, and leaves the read-command wire shape (batching,\ncursors, flow control) to the reference implementation.\n**Subject convention:**\napplication subjects in rows are written relative and are prefixed `cotal.<space>.` on the\nwire; **JetStream API tails (extended-create filter tails and `DIRECT.GET` subject\ntails) are always spelled in FULL** (`cotal.<space>.\u2026`/`$KV.\u2026`/`$O.\u2026`), because the API\nsubject embeds the stored subject verbatim and a relative tail matches nothing (the\nstreams capture `cotal.<space>.ep*.>`, \xA713.12).\nThe grep tests the matrix MUST pass: the only `CONSUMER.CREATE` grants below belong to\ntrusted provisioning/infra profiles and each carries a full literal filter tail; every\nconsumer-name token in a grant is a LITERAL (no embedded `*`); every filter or Direct-Get\ntail is fully qualified; **no UNTRUSTED profile (agent/observer/admin) holds any\n`CONSUMER.CREATE`/`MSG.NEXT`/`DIRECT.GET`/`STREAM.MSG.GET` on a control-surface resource** (an\naudit MUST run this over Appendix B too, not only this matrix; the profile tables are\ngenerated from these rows, so a generated grant that contradicts the matrix fails the build);\nand the ONLY `STREAM.MSG.GET` (body-selected) grants that exist at all are the leader-served\nreads of named TRUSTED single-purpose profiles, each granted to no other profile - every one\na FENCING read (read service, below) except where its row names it a CAS-PINNING read, a\nleader-served currency read whose FENCE is the pinned CAS write it feeds (\xA713.1: a read is\nnever a fence): the auth path on `KV_cotal_auth_<space>`, the lifecycle mapping-reader and\nthe provisioner-registration principal on the `cotal_records_<space>` heads, the endpoint's\ncanonicalizer on `EPF_<space>`/`EPW_<space>`, the endpoint's commit principal on its own\n`EPF_<space>` fact families AND on `KV_cotal_records_<space>` (its goal/checkpoint FENCING\nspec-and-currency reads: the terminal-commit's spec read and the epoch/deadline reads the\nread-service clause names), each record kind's spec/status writer principal on\n`KV_cotal_records_<space>` (its fresh lifecycle-mapping `processEpoch` currency read, the\nwriter-table stale-writer fence; per \xA713.1 a mapping yields a current epoch ONLY at\n`state: \"active\"`, and `retiring`/`retired` alike refuse the write), and the space's timer writer on\n`KV_cotal_records_<space>` (its fresh generation/deadline check before arming, a FENCING\nread) and on `EPT_<space>` (`$JS.API.STREAM.MSG.GET.EPT_<space>`, the armed-subject's own\nlast-by-subject sequence read: CAS-PINNING, the leader-served input to the arm's\n`Nats-Expected-Last-Subject-Sequence` publish, whose broker CAS - not the read - is the\nfence, the same \xA713.1 complementarity class as the FIRE handler's status CAS). The timer\nFIRE handler holds no records `STREAM.MSG.GET`: its settlement is a revision-pinned status\nCAS, so a stale read loses the CAS loudly (\xA713.1 complementarity), never mis-fires (the\nmatrix rows below). The body-selected form is not\nsubject-confinable by the broker, so each of these grants trades broker confinement for\nprofile trust; the trade is acceptable exactly because every holder IS a trusted\nsingle-purpose principal for whom read-your-writes is a correctness requirement, not a\nhazard (on the `allow_direct=false` buckets a leader-consistent get is precisely a\n`STREAM.MSG.GET`). Every OTHER subject-scoped read is NON-fencing and uses the\nlast-by-subject `DIRECT.GET.<stream>.<subject>` form, which the broker confines by subject\ntokens. (The pre-v0.4 messaging-surface CHKV/DLVKV reads in Appendix B are the v0.3 binding,\noutside this matrix; their confused-deputy exposure is the \xA79 in-scope-for-v0.4 remediation.)\n\n**Read service (fencing reads are leader-served).** A read is FENCING when its result, a\nvalue, a revision, OR an authoritative ABSENCE, gates a subsequent CAS or authorizes an\neffect; fencing is defined by USE, never by subject family. A CAS loser reading the winner,\na terminal-commit's spec read, and the work-pool re-enqueue predicate (accepted, with the\nauthoritative absence of BOTH a committed terminal and a live `EPW` entry, \xA713.6) are all\nfencing: a stale follower read that misses a committed terminal while the `EPW` entry is\nlegitimately absent re-arms settled work. A fencing read MUST be leader-served, meaning one\nof `STREAM.MSG.GET`, a get against a bucket with `allow_direct=false`, or delivery\nserialized by the authoritative primary stream/consumer (an authoritative `MSG.NEXT`, e.g.\nthe accepted-fact effects row and the auth path's snapshot enumeration below), and it MUST\nbe served against the AUTHORITATIVE stream or bucket for its key, never a mirror, a sourced\nstream, or a cross-space replica (\"leader-served\" means that authoritative primary; a\nmirror's own leader can lag its source). `allow_direct=true` and Direct Get exist for\nNON-fencing, subject-confined reads only; a client MUST NOT let a fencing read silently\nride Direct Get because the bucket allows it. This does not weaken \xA713.1's rule that a read\nis never a fence: the fence itself stays a CAS or create-only write; leader service is what\nkeeps the read's result from silently falsifying the CAS or effect it feeds.\n\n| Transition | Writer profile | Exact namespace (per space/endpoint) | Class |\n| --- | --- | --- | --- |\n| Request publish | capability holder (agent, per capability) | per \xA713.2 form: `ep.{one,all}.<endpoint>.<command>[.<mode>[.<target tokens per mode>]].<cO>.<cA>.<cUid>.*` and `ep.inst.<endpoint>.<instanceId>.<command>[.<mode>[.<target tokens per mode>]].<cO>.<cA>.<cUid>.*`, mode/target tokens literal per the minted capability (`handle`: the full redemption-pinned triple) | direct, untrusted input, broker-confined |\n| Reply subscribe (caller) | capability holder | `ep.reply.*.*.*.<cO>.<cA>.<cUid>.*` (exact arity) | direct read; own rail only |\n| Serve subscribe | the endpoint's serve credential | per registered command: `\"ep.one.<endpoint>.<command>.> <endpoint>\"` (queue-qualified ONLY), `ep.all.<endpoint>.<command>.>` plain, `ep.inst.<endpoint>.<instanceId>.<command>.>` exact (never a cross-command `>` | direct) name/instance/command-pinned; epoch deliberately absent (\xA713.1 barrier is the fence) |\n| Reply publish | the endpoint's serve credential | `ep.reply.<endpoint>.<instanceId>.<epoch>.*.*.*.*` | direct; attribution-pinned; addressing by nonce |\n| Journal submission append | capability holder | `epj.<endpoint>.<command>[.<mode>[.<target tokens per mode>]].<cO>.<cA>.<cUid>` | direct, explicitly untrusted input |\n| Canonicalizer consume | the endpoint's canonicalizer principal (singleton, \xA713.4) | its durable on `EPJ_<space>`: `$JS.API.CONSUMER.CREATE.EPJ_<space>.<canonD>.cotal.<space>.epj.<endpoint>.>` (full-tail single filter), `$JS.API.CONSUMER.INFO.EPJ_<space>.<canonD>`, `$JS.API.CONSUMER.MSG.NEXT.EPJ_<space>.<canonD>`, plus `$JS.ACK.EPJ_<space>.<canonD>.>` (ack/term after durable decision only, and, for pool-admitted acceptances, after the enqueue, \xA713.4) | mediated |\n| Canonical decisions + quarantine + goal-bind | the endpoint's canonicalizer principal | publish `epf.<endpoint>.dec.>`, `epf.<endpoint>.quar.>`, and `epf.<endpoint>.goal.*.*.*.*.bind` (the per-goal first-wins bind, \xA713.4, create-only CAS per subject; the `.bind` leaf is disjoint from the commit principal's `goal\u2026.result`/status writes, so no writer overlap) | mediated |\n| Canonicalizer CAS-winner + terminal read | the endpoint's canonicalizer principal | leader-served `$JS.API.STREAM.MSG.GET.EPF_<space>` (body-selected `last_by_subj`; these reads are FENCING, read service above, so the follower-served `$JS.API.DIRECT.GET.EPF_<space>.\u2026` form is NOT granted; the body-selected form is the broker-confinement-for-profile-trust trade above) over exactly its families: `epf.<endpoint>.dec.>` + `epf.<endpoint>.quar.>` (observes the winning fact on redelivery, \xA713.4) + `epf.<endpoint>.wrk.>` (READ-ONLY: the reconciliation predicate's terminal probe, \xA713.6; `wrk` writes stay with the commit principal, row below) + `epf.<endpoint>.goal.*.*.*.*.bind` (the goal-bind CAS winner: on a lost `.bind` create the canonicalizer reads the existing bind to decide same-fingerprint retry vs. `conflict`, \xA713.4) | mediated |\n| Caller durable reads (decisions, goal results, receipts, event catch-up, record reads/watches) | the **read mediator** owns the reader consumers; the **caller** holds only its own reply rail | **Mediated (normative above).** The caller holds NO consumer/`DIRECT.GET` grant on EPF/EPE/EPC/records. It issues a read command and receives its own caller-scoped facts (`dec`/`goal\u2026result`/`receipt` under its triple, \xA713.2), event catch-up, and record snapshots over its attribution-pinned reply rail `ep.reply.\u2026<cO>.<cA>.<cUid>.<nonce>`; the mediator re-authorizes each read against the caller's current grants before delivering. Live progress is the caller's own core subscription to granted `epe` subtrees within `sub.allow` (bytes land only on its own sub). Reader consumers (`decD`/`goalD`/`eveD`/`recD`) are owned and bound by the mediator, never the caller | mediated read; confined to the caller's own rails |\n| Accepted-fact consume (effects) | every instance's serve credential, on the endpoint's ONE shared durable | **bind-only** on the provisioner-pre-created pull durable `effD = eff_<e>` (exact filter `cotal.<space>.epf.<endpoint>.dec.>`, `AckExplicit`): `$JS.API.CONSUMER.INFO.EPF_<space>.<effD>`, `$JS.API.CONSUMER.MSG.NEXT.EPF_<space>.<effD>`, `$JS.ACK.EPF_<space>.<effD>.>`; instances **pull-compete on the shared durable** so each accepted decision is delivered to exactly one live instance (at-least-once): a per-instance consumer over the class-wide decision subtree would be broadcast, and every instance would duplicate the external effect. Effects consume canonical facts, never raw submissions (\xA713.4); a rejected/quarantined decision is ack-skipped, and so is any acceptance whose `route` is a pool (\xA713.4, the pool's worker path executes it; effects MUST NOT). **Ack barrier:** an effecting instance MUST ack a `dec` message ONLY after its effect is durably recorded, for an action command the terminal `goal\u2026.result` fact; for a **non-action `route:\"effects\"` journal command** a generic per-request **effect fact** `epf.<endpoint>.eff.<cO>.<cA>.<cUid>.<id>` (create-only CAS, written by the effecting instance's commit path before ack; every `route:\"effects\"` acceptance has exactly this durable effect-complete marker), never before; an ack-before-effect would let a crash drop journal work the at-least-once contract promised. A crash before the ack redelivers the decision to another competing instance, which observes the existing terminal fact (idempotent) or effects it | direct read, endpoint-scoped, work-shared |\n| Result/receipt/terminal/resume facts | the endpoint's commit principal | enumerated fact families, no subtraction and **never `dec.>`/`quar.>`** (canonicalizer-only): publish `epf.<endpoint>.goal.*.*.*.*.result` (the goal terminal result; the `.bind` leaf under `goal.>` is the canonicalizer's, row above), `epf.<endpoint>.eff.>` (per-request effect-complete fact for non-action `route:\"effects\"` commands, create-only CAS, \xA713.9 ack barrier), `epf.<endpoint>.receipt.>` (caller-scoped subjects, \xA713.2), `epf.<endpoint>.wrk.>` (per-item terminal, create-only CAS), `epf.<endpoint>.cp.>` (one-use resume CAS); read-back is FENCING (read service above: it gates create-only CAS emission and idempotent re-commit decisions), leader-served `$JS.API.STREAM.MSG.GET.EPF_<space>` (body-selected `last_by_subj` over exactly these five families; the follower-served per-family `DIRECT.GET` form is NOT granted) | mediated |\n| Live event progress (caller) | capability holder (per read capability) | a caller-owned **core subscription** to the granted `epe` subtrees (fully-qualified `cotal.<space>.epe.\u2026` in `sub.allow`, Appendix B), incl. per-goal `epe.<endpoint>.*.*.goal.<cO>.<cA>.<cUid>.>`; safe because a core sub delivers only to the caller's own subscription, never a caller-chosen subject; durable catch-up/replay is the mediated read above, not a self-bound consumer | direct read; own subscription only |\n| Claim / action / checkpoint commits | the owning endpoint's commit path | its own record keys (`goal`/`cp`/`lease` grammars, \xA713.7, per the writer table) + the enumerated commit fact families of the Result row above, never `dec.>`/`quar.>`; its goal/checkpoint FENCING reads (the terminal-commit's spec read, epoch/deadline currency) are leader-served `$JS.API.STREAM.MSG.GET.KV_cotal_records_<space>` (read service above; the records bucket's Direct Get is NON-fencing only) | mediated (validates fencing, lease clock, lifecycle, epoch) |\n| Contract-artifact publication | the contract publisher principal | publish `epc.<digest-hex>` (`epc.*`), create-only per subject (`Nats-Expected-Last-Subject-Sequence: 0`; a digest subject is written at most once); read-back via the reader row below | mediated, immutable once published |\n| Contract-artifact read | trusted infra directly (`DIRECT.GET.EPC_<space>.cotal.<space>.epc.>`); untrusted callers via the read mediator | contract artifacts are content-addressed and public (verify-on-read is the tamper boundary, \xA713.7), so exposure is not the risk; the confused-deputy INJECTION is, so an untrusted caller's artifact fetch is mediated onto its own reply rail exactly like any other read; trusted infra fetches directly | mediated for callers / direct for infra |\n| Record write ingress (`epr`) | the owning instance | publish `epr.<endpoint>.<instanceId>.<epoch>.<kind>.<qualifier...>`; the instance's ONLY path to `svc`/`goal`/`cp` status writes; the epoch token is pinned by the serve credential, so the record writer reads the writing epoch from the broker-authenticated subject, never from payload | direct; epoch-pinned ingress to the mediated writer |\n| Record writer consume + `spec`/`status` writes | the kind's separately scoped spec/status writer principal (writer table); **one principal and one consumer PER KIND**, never a single writer draining every kind | consume: `$JS.API.CONSUMER.CREATE.EPR_<space>.<recwD-k>.cotal.<space>.epr.*.*.*.<kind>.>` (full-tail single filter on the `<kind>` token of \xA713.2's `epr` grammar; `recwD-k = recw_<space>-<kind>`) + `$JS.API.CONSUMER.INFO.EPR_<space>.<recwD-k>` + `$JS.API.CONSUMER.MSG.NEXT.EPR_<space>.<recwD-k>` + `$JS.ACK.EPR_<space>.<recwD-k>.>`; write: `$KV.cotal_records_<space>.<that kind's \xA713.7 key grammar>.{spec,status}`; its writer-table stale-writer fence (the FRESH lifecycle-mapping `processEpoch` currency read; current ONLY at `state: \"active\"`, \xA713.1, so a `retiring` or `retired` mapping refuses the write) is leader-served `$JS.API.STREAM.MSG.GET.KV_cotal_records_<space>` (a FENCING read, read service above); the kind token in the ingress subject is what keeps the writer separation the writer table declares | mediated per kind below, no row left open |\n| Reader/pool/effects consumer provisioning (one-shot, at capability mint / endpoint setup) | the provisioner | exact full-tail extended creates for every pre-created durable this matrix names: `$JS.API.CONSUMER.CREATE.EPW_<space>.<poolD>.cotal.<space>.epw.<e>.<pool>.>`, `$JS.API.CONSUMER.CREATE.EPF_<space>.<effD>.cotal.<space>.epf.<e>.dec.>`, `$JS.API.CONSUMER.CREATE.EPF_<space>.<decD>.cotal.<space>.epf.<e>.dec.<cO>.<cA>.<cUid>.>`, `$JS.API.CONSUMER.CREATE.EPF_<space>.<goalD>.cotal.<space>.epf.<e>.goal.<cO>.<cA>.<cUid>.>` (per action capability), `$JS.API.CONSUMER.CREATE.EPE_<space>.<eveD-n>.<granted full-tail subtree>`, `$JS.API.CONSUMER.CREATE.KV_cotal_records_<space>.<recD-n>.$KV.cotal_records_<space>.<granted subtree>` (the reader-config seam is an ALLOWLIST: the `<granted subtree>` kind token MUST be a registered caller-readable record kind, so it REFUSES every authority-control kind (`oblig` above all, plus `govern`/`policy`/`uid`/`frontier`) and every unregistered kind, and for a dual-token kind whose atomic head is authority (`lifecycle`, head `lifecycle.<owner>.<actor>`) it admits only a filter strictly deeper than the head, never one that can match the head key itself; so no reader durable is ever pre-created over the `oblig.` subtree the sealed records scanner owns nor over an authority head, nats-server#8274), every create PULL, every filter a full literal tail; plus matching `CONSUMER.DELETE` for deprovisioning (lifecycle-keyed names, \xA713.1) | mediated, trusted provisioning only |\n| Events | the owning instance | `epe.<endpoint>.<instanceId>.<epoch>.>` | direct; subject-confined, epoch-pinned |\n| Timer schedule request | the owning instance | publish `ept.<endpoint>.<instanceId>.<epoch>.*.schedule` (never `.armed`/`.fire`); a request carrying any scheduling header is rejected by the timer writer (\xA713.2) | direct; epoch-pinned; captured by the schedules-DISABLED request stream |\n| Timer request consume + arm | the space's timer writer principal (singleton infra, like the delivery daemon) | consume: `$JS.API.CONSUMER.CREATE.EPT_REQ_<space>.<timerD>.cotal.<space>.ept.*.*.*.*.schedule` (full-tail single filter) + `$JS.API.CONSUMER.INFO.EPT_REQ_<space>.<timerD>` + `$JS.API.CONSUMER.MSG.NEXT.EPT_REQ_<space>.<timerD>` + `$JS.ACK.EPT_REQ_<space>.<timerD>.>`; arm: publish `ept.*.*.*.*.armed`, deriving `Nats-Schedule-Target` = the sibling `.fire` from the authenticated request subject tokens ONLY, stripping/rejecting every client scheduling header, and **fresh-checking the authoritative timer generation/deadline before arming** (a FENCING read: leader-served `$JS.API.STREAM.MSG.GET.KV_cotal_records_<space>` on the checkpoint record, read service above); the arm also reads the armed-subject's own last sequence via `$JS.API.STREAM.MSG.GET.EPT_<space>` and publishes with `Nats-Expected-Last-Subject-Sequence` pinned to it - that read is CAS-PINNING, not fencing: the broker CAS is the fence and a delayed writer's stale read loses it loudly (\xA713.1 complementarity, the FIRE handler's class); a redelivered or delayed stale-generation request is discarded, never armed, so it cannot overwrite the current schedule and silently lose the live deadline (\xA713.2, \xA713.6, \xA713.12) | mediated |\n| Timer fire consume | the owning instance | its own `ept.<endpoint>.<instanceId>.<epoch>.*.fire` (fired messages validated against its authoritative schedule state AND the broker-authored scheduler-origin header = its exact sibling `.armed`, \xA713.12); no client credential holds `.armed` or `.fire` publish | direct read |\n| Session `.in` publish | the session's caller (per-session credential) | `eps.<endpoint>.<sessionId>.<epoch>.in` exact | direct |\n| Session `.in` subscribe | the serving instance (per-session credential) | `eps.<endpoint>.<sessionId>.<epoch>.in` exact | direct read |\n| Session `.out` publish | the serving instance (per-session credential) | `eps.<endpoint>.<sessionId>.<epoch>.out` exact | direct |\n| Session `.out` subscribe | the session's caller (per-session credential) | `eps.<endpoint>.<sessionId>.<epoch>.out` exact | direct read |\n| Session ledger (one-use redemption, credential ids, revocation state, authenticated close) | the trusted auth path (\xA79/\xA710) | `$KV.cotal_auth_<space>.session.<sessionId>`, create-only CAS per `sessionId`, monotonic state (\xA713.6) | mediated |\n| Credential ledger (issuance gate, descendant enumeration, lineage index, revocation) | the trusted auth path (\xA79/\xA710) | writes: `$KV.cotal_auth_<space>.cred.<lifecycleUid>.<credentialId>` + `\u2026.gate.<lifecycleUid>` (the issuance gate, revision-pinned CAS is the mint fence, \xA713.1) + `\u2026.epgate.<endpoint>.<instanceId>` + `\u2026.epcred.<endpoint>.<instanceId>.<credentialId>` (the disjoint endpoint gate/credential families, \xA713.1: same protocol, explicit prefixes, never arity) + `\u2026.stage.>` (implementation staging/tombstone fences; NEVER under `cred.`/`epcred.`, \xA713.1) + `\u2026.srcgate.<issuerKeyId>.<id>` (per-handle source gate, \xA713.1) + `\u2026.bysrc.<issuerKeyId>.<id>.<lifecycleUid>.<credentialId>` (the per-ancestor lineage index) + `\u2026.session.<sessionId>` (create-CAS `issuing`, finalize-CAS `active`, \xA713.6) + `\u2026.plane` (the ONE plane-ownership claim row, \xA713.13: create/revision-CAS by the barrier profile only, exact arity, never `plane.>`); reads: **leader-served `$JS.API.STREAM.MSG.GET.KV_cotal_auth_<space>`** (with `allow_direct=false` a KV get is exactly this body-selected `last_by_subj` call against the stream LEADER; read-your-writes, not a follower-served `DIRECT.GET`; the body-selection is safe here because this profile IS the trusted auth path, and it is granted to no other profile) for gate/session/row state, which is why the mint and session fences are revision-pinned CAS *writes* rather than reads (a read is never a fence, \xA713.1); and **fence-free prefix enumeration through the SEALED auth-ledger scanner, never a runtime consumer create**: no standing or runtime-reachable auth credential (the takeover/retirement/handle-revocation barrier, the session sweep, any replayable executor) holds `$JS.API.CONSUMER.CREATE` on `cotal_auth_<space>`, because a consumer-create request BODY is not subject-ACL confinable: an extended `CONSUMER.CREATE.<stream>.<name>.<filter>` grant still admits a body with `durable_name` (equal to the subject name token) and a push `deliver_subject`, a DURABLE exporter of every current and future row that SURVIVES the credential's connection close and revocation; a subject ACL cannot constrain that body, so the only safe runtime grant is none. The dynamic-enumeration `CONSUMER.CREATE` lives in exactly ONE profile, a SEALED scanner the trusted auth process opens for itself and NEVER hands out: its credential, connection, and identity seed reach no caller, child, log, or persistence (a process-memory compromise reaches it, the SAME residual class as the account signing seed the process already holds; never broker confinement, never a network-reachable JWT). The scanner is pinned to ONE literal consumer name under a FORCED config: pull (no `deliver_subject`), ephemeral (no `durable_name`), `AckPolicy.None`, `DeliverPolicy.LastPerSubject`, memory storage, bounded inactivity; re-read and bind-verified before use and unconditionally deleted after, with every scan over the stream serialized on that one name, and the injected scanner bonded to its exact space so a hand-assembled or foreign-space scanner never enumerates. The scan is FENCE-FREE by construction: under the history=1 store a same-subject `active\u2192revoked` overwrite EVICTS the pre-scan revision, so a sequence/`STREAM.INFO` cutoff would DROP that subject and leave its holder un-revoked; a LastPerSubject read carries no upper cutoff and, draining to a freshly re-observed zero pending (never a stale local count), returns each subject's CURRENT last, so a concurrent overwrite is SEEN, never dropped. It enumerates exactly `cred.<lifecycleUid>.>`, `bysrc.<issuerKeyId>.<id>.>`, `stage.>` (operation-intent discovery), or `session.>`. The barrier's family enumeration and the expiry sweep are executable reads, not prose. No profile OTHER than the sealed scanner and this trusted write path holds ANY grant on `cotal_auth_<space>` | mediated |\n| Auth-ledger enumeration (the SEALED scanner profile, the credential-ledger row's enumeration seam) | the trusted auth process's DEDICATED self-minted scanner principal; opened for the process itself, NEVER handed out (full rationale in the credential-ledger row above) | exactly `$JS.API.INFO` + `$JS.API.STREAM.INFO.KV_cotal_auth_<space>` + `$JS.API.CONSUMER.CREATE.KV_cotal_auth_<space>.cotal-ledger-scan.$KV.cotal_auth_<space>.>` + `$JS.API.CONSUMER.INFO.KV_cotal_auth_<space>.cotal-ledger-scan` + `$JS.API.CONSUMER.MSG.NEXT.KV_cotal_auth_<space>.cotal-ledger-scan` + `$JS.API.CONSUMER.DELETE.KV_cotal_auth_<space>.cotal-ledger-scan` + its connection-scoped `_INBOX_<connId>.>` subscribe, and NOTHING else (no records-stream grant, no KV write, no `DIRECT.GET`, no `$JS.ACK`: an `AckPolicy.None` scan acks nothing); `cotal-ledger-scan` is the ONE pinned literal consumer name every auth-stream scan serializes on, and this profile plus the records scanner below are the ONLY DYNAMIC-ENUMERATION `CONSUMER.CREATE` holders on the two authority streams (the provisioning row's pre-created full-tail reader durables, CREATE+DELETE by the provisioner and INFO/MSG.NEXT/ACK bind by the read mediator, are the one other records-stream consumer authority, and the reader-config seam REFUSES an authority-control record kind so no reader durable can target the `oblig.` subtree the records scanner owns), re-audited mechanically per this section's closing clause | mediated |\n| Obligation enumeration (the SEALED records scanner profile, the acceptance-obligation row's enumeration seam, ONE instance per space) | the trusted process's DEDICATED self-minted records-scanner principal; opened for the process itself, NEVER handed out (full rationale in the acceptance-obligation row below; every scan over the literal name serializes process-wide per space, so a second instance can never interleave with a live scan and hand back a partial result, and the scanner handle is immutable once branded) | exactly `$JS.API.INFO` + `$JS.API.STREAM.INFO.KV_cotal_records_<space>` + `$JS.API.CONSUMER.CREATE.KV_cotal_records_<space>.cotal-records-scan.$KV.cotal_records_<space>.oblig.>` (the CREATE filter is confined to the `oblig.` subtree) + `$JS.API.CONSUMER.INFO.KV_cotal_records_<space>.cotal-records-scan` + `$JS.API.CONSUMER.MSG.NEXT.KV_cotal_records_<space>.cotal-records-scan` + `$JS.API.CONSUMER.DELETE.KV_cotal_records_<space>.cotal-records-scan` + its connection-scoped `_INBOX_<connId>.>` subscribe, and NOTHING else; `cotal-records-scan` is the ONE pinned literal consumer name, disjoint from the auth scanner's (one scanner instance, lock, and literal name PER STREAM) | mediated |\n| Work-pool enqueue | the endpoint's canonicalizer (from accepted decisions only) | `epw.<endpoint>.>` publish, create-per-subject (`Nats-Expected-Last-Subject-Sequence: 0`; the acceptance identity is the subject, \xA713.2) | mediated |\n| Work-pool reconciliation probe | the endpoint's canonicalizer | leader-served `$JS.API.STREAM.MSG.GET.EPW_<space>` (body-selected `last_by_subj` on the exact item subject; the probe is FENCING, read service above: a follower-served `DIRECT.GET` that misses the live entry re-arms settled work, so that form is NOT granted) + the CAS-winner read row above (`dec` + `wrk` last-by-subject), together they decide the \xA713.6 predicate: accepted, **`now < workExpiry`** (an expired item is never re-enqueued; it is terminally settled `expired` with its `wrk` fact and acked without effect), no terminal, no live entry \u21D2 re-enqueue for the item's REMAINING TTL; a worker likewise MUST check `now < workExpiry` before lease/effect and refuse expired work | mediated |\n| Virtual-endpoint activation watch | the endpoint's activator principal (holder of its activation capability, \xA713.6) | exactly `$JS.API.CONSUMER.INFO.EPW_<space>.<poolD>` (the per-pool occupancy snapshot; request/reply, so watching is bounded polling) PLUS its own connection-scoped reply inbox `_INBOX_<connId>.>` (never the account-wide default); the instance START is a mediated, target-bound seam resolved by the supervisor's own authority, never a broker grant; NOTHING else: no `CONSUMER.MSG.NEXT`/`$JS.ACK` (watching is never draining), no `STREAM.MSG.GET.EPW_<space>` (no reconciliation authority), no consumer create/update/delete, no `epw.>` publish | mediated |\n| Work-pool consume + ack | the pool's owning endpoint ONLY (workers hold NO pool grant, \xA713.5) | **bind-only** on the provisioner-pre-created exact-filter `poolD` (grammar above): `$JS.API.CONSUMER.INFO.EPW_<space>.<poolD>`, `$JS.API.CONSUMER.MSG.NEXT.EPW_<space>.<poolD>`, `$JS.ACK.EPW_<space>.<poolD>.>` (ack only after committed terminal state); NO consumer create, NO stream-wide read | mediated |\n| Lease issue / fencing advance | the pool's owning endpoint (`lease` command) | its `lease` record keys (\xA713.7 grammar), via the record-writer seam | mediated |\n| Lifecycle mapping / teardown | minting manager's commit path; lifecycle-pinned deprovisioner | the **unsplit** alias CAS head `$KV.cotal_records_<space>.lifecycle.<owner>.<actor>` (one atomic key, NOT `.spec`/`.status`-split; the authoritative current mapping and the only `mappingRevision` source, activation/retirement serialize here by CAS, \xA713.7; NEVER-DELETED, three states `active | retiring | retired`, transitions only inside the \xA713.1 operations) + the create-only space-global UID reservation `$KV.cotal_records_<space>.uid.<lifecycleUid>` (\xA713.1: won BEFORE any gate or head write; NEVER-DELETED); leader-consistent current-mapping read `$JS.API.DIRECT.GET` is NOT used for authority reads of this key (the records bucket may follower-serve; a fresh mapping read is a leader-served `$JS.API.STREAM.MSG.GET.KV_cotal_records_<space>` last-by-subject get on the head key; leader-served for read-your-writes, granted to the trusted mapping-reader/mediator profile, not a follower-served `DIRECT.GET`; that reader profile ALSO holds exactly `$JS.API.STREAM.INFO.KV_cotal_records_<space>` so it can shape-prove at bind time that the stream it leader-reads is the primary, un-mirrored, non-evicting records store (\xA713.12); a reader that cannot prove its store's shape MUST refuse to serve authority reads); optional append-only per-UID audit `$KV.cotal_records_<space>.lifecycle.<owner>.<actor>.<lifecycleUid>`; teardown: exact lifecycle-keyed names only | mediated / broker-pinned delete |\n| Acceptance obligation (reservation/drain, \xA713.8) | the admission mediator (per endpoint; the canonicalizer holds NO raw `oblig.` grant) | create-only winner + monotonic revision-pinned CAS on `$KV.cotal_records_<space>.oblig.<targetUid>.<endpoint>.<cO>.<cA>.<cUid>.<id>` (\xA713.7; the key derives from the broker-authenticated request subject plus the create-fence currency reads of \xA713.8, never from a body field; proof issuance only after the post-create recheck); its winner/settle reads are FENCING, leader-served `$JS.API.STREAM.MSG.GET` on the obligation key and on the EPF decision subject; its currency reads are FENCING, leader-served `$JS.API.STREAM.MSG.GET` on the target's `lifecycle` head AND on the endpoint's `govern` head (\xA713.6: the govern head read is what surfaces both a staged `pendingPolicyKey` (which pauses policy-admitted proof issuance) and the enforced policy selector the mediator follows to the immutable `policy.<endpoint>.<digest-hex>` version; the mediator reads govern and policy for its OWN endpoint only, the confined-reader identity bind) PLUS the immutable `policy.<endpoint>.>` version it names; PLUS create-only publish on the endpoint's EPF decision subjects for the TERMINAL REJECTION settle only (\xA713.8: its own recheck refusals and the retirement/policy drains, which settle through it); the broker cannot distinguish a rejection payload from an acceptance, and rejection-only is NOT subject-expressible (both decisions MUST share the create-only decision subject for first-wins settlement), so this grant's residual is explicit per D32: a compromised mediator can forge a decision for ITS endpoint INCLUDING AN ACCEPTANCE, an escalation to injecting executed work, never merely reject/stall (the same class of trust already placed in that endpoint's canonicalizer), and never beyond its endpoint (the decision-publish row is endpoint-literal); obligation enumeration (the \xA713.1 retirement barrier's `oblig.<targetUid>.>` discovery + quiescence recheck, and the mediator's own `oblig.*.<endpoint>.>` policy-movement drain, \xA713.6) runs through a SEALED records scanner, the same seal as the auth-ledger scanner above: this profile holds NO `$JS.API.CONSUMER.CREATE` (nor INFO/MSG.NEXT/DELETE) on `cotal_records_<space>`, because a consumer-create request BODY is not subject-ACL confinable: an extended `CONSUMER.CREATE.<records>.<name>.<oblig filter>` grant still admits a body with `durable_name` and a push `deliver_subject`, a DURABLE exporter of the whole `oblig.` subtree that SURVIVES the credential's connection close and revocation (nats-server#8274; reproduced live against the prior grant). The fence-free `LastPerSubject` enumeration `CONSUMER.CREATE` lives in exactly ONE profile: a sealed records scanner the trusted process opens for itself and NEVER hands out (its credential, connection, and seed reach no caller; the same process-memory residual class as the auth-ledger scanner), pinned to ONE literal consumer name under a FORCED pull/ephemeral/`AckPolicy.None`/`DeliverPolicy.LastPerSubject`/memory config, bind-verified before use and unconditionally deleted after, its CREATE filter confined to the `oblig.` subtree, and the injected scanner bonded to its exact space so a hand-assembled or foreign-space scanner never enumerates; its fencing `STREAM.MSG.GET` rows are stream-level grants whose read exposure is space-wide, explicit per D32 (the terminal-cleanup row's same read residual); its reply inbox is connection-scoped (`_INBOX_<connId>.>`, never the account-wide default); the rows are NEVER-DELETED, a WRITER discipline the broker cannot fully enforce: the raw KV publish grant is operation/header-blind, so a compromised mediator can overwrite its own endpoint's row to a valid `terminal` value (hiding cleanup debt) or emit DEL/PURGE markers, where every reader refuses a deletion marker loud as corruption (\xA713.12 retention floor) and the records stream denies stream-API message-delete/purge, leaving the valid-row overwrite as a second explicit D32 residual, exactly parallel to the decision-forge residual and confined the same way (its own endpoint's rows only) | mediated |\n| Terminal pool cleanup (\xA713.1 barrier) | the retirement cleaner profile: minted per (retirement `op` \xD7 endpoint), its grant listing the EXACT pools of this operation's EFFECTIVE INVENTORY, DISCOVERY-ONLY: the target's accepted `oblig.<lifecycleUid>.>` pool routes (the barrier takes no caller-supplied hint, so every listed pool is one the target holds accepted work on), never a pool wildcard, never space-wide EPW rights, DISTINCT from every owner/agent/endpoint profile (never the revoked owner's credential), bounded-lived and, once the pool is proven quiescent (every prior owner ACK drained through `AckWait`, and a fresh consumer read shows zero `num_pending`/`ack_pending`; a fire-and-forget ACK confirmed with `AckSync`, never assumed), REVOKED and cluster-verified-EVICTED (its own principal) BEFORE any frontier records (\xA713.1 order), so no in-flight cleaner can ACK a redelivery after the alias is reused | runs only AFTER the target's obligation drain reached quiescence (\xA713.1 order) and BEFORE the frontiers; bind-only on each named pool's provisioner-pre-created durable: `$JS.API.CONSUMER.INFO.EPW_<space>.<poolD>`, `$JS.API.CONSUMER.MSG.NEXT.EPW_<space>.<poolD>`, `$JS.ACK.EPW_<space>.<poolD>.>` (re-proving at bind, per the work-pool row, that the durable's filter is exactly the named pool's subtree, pull mode, unlimited delivery ceiling), plus its own connection-scoped reply inbox `_INBOX_<connId>.>` (never the account-wide default) and leader-served terminal-observe reads `$JS.API.STREAM.MSG.GET.EPF_<space>` on `wrk.>`/`dec.>` item subjects, a STREAM-level grant whose read exposure is space-wide, explicit per D32; the cleaner holds NO lease or records authority, NO `wrk` (or any EPF/EPW) publish, NO consumer create/update/delete, NO raw stream DELETE: for each delivered message it hands the item's coordinates and requested disposition to the retirement settlement executor (next row; cleaner-supplied coordinates never authorize, the executor re-derives them from the durable acceptance), then re-reads and codec-validates the executor's lease-derived terminal, and ACKs ONLY a message whose item is durably terminal (a live, unexpired, foreign-target item is NEVER settled or ACKed, and the barrier refuses to close frontiers while one remains unsettled); this profile's explicit D32 residuals are terminal-free ACK suppression across its WHOLE EFFECTIVE INVENTORY (every discovered pool: a raw `$JS.ACK` cannot be broker-conditioned on a prior terminal, so compromise can silently drop effective-inventory-pool deliveries without settlement) and the space-wide `STREAM.MSG.GET` read exposure; it can forge NO terminal and mutate NO lease (it holds no write grant at all) | mediated |\n| Retirement settlement (\xA713.1 barrier executor) | the retirement barrier's op-bounded executor: a DISTINCT per-operation principal (`local.epexe_<opId-hash>`, CONNZ principal-tagged) minted per (op \xD7 endpoint) over this operation's EFFECTIVE INVENTORY bound to the durable intent (`opId`, target lifecycle; the pools are the target's accepted `oblig.<uid>.>` routes, DISCOVERY-ONLY (no caller-supplied hint)), its settlement code running on ITS OWN connection, live only for that operation and revoked + cluster-verified-evicted by the barrier at the same fence as the cleaner, BEFORE any frontier records; never the cleaner profile, never the barrier's standing connection, never a standing grant | the settlement seam is EFFECTIVE-INVENTORY-CLOSED: for every item the cleaner hands it, the executor re-derives the authority coordinates from the item's durable acceptance decision (a FENCING leader-served read; cleaner-supplied coordinates never authorize) and refuses a ref whose endpoint or pool is outside its EFFECTIVE-INVENTORY spec (the discovered pools), a decision that is not an accepted pool admission, an `expired` request before the item's OWN `workExpiry`, and a `retired` request for an accepted target that is not the intent's lifecycle (the confused-deputy closure: a cleaner chooses refs but can never borrow this authority beyond that effective inventory or the retirement lifecycle); it settles by CASing the item's `lease.<endpoint>.<pool>.<acceptance>.spec` record to a settled state, where the ONLY settlements it may INITIATE are `expired` (bound to the item's own horizon) and `retired` (re-bound to ITS operation's retiring target through the acceptance) and an ALREADY-settled lease DOMINATES (a crashed owner's `committed` lease is derived and its terminal published verbatim, never overwritten, never contradicted), then publishes/observes the exact lease-derived `wrk` terminal create-only (first terminal wins, \xA713.8 cancellation ordering) for the cleaner to validate; its authority is lease-record CAS plus `epf.<endpoint>.wrk.<pool>.>` publish on its effective-inventory pools plus the leader-served fencing reads its own code path performs (`STREAM.MSG.GET` on the facts stream and on the records store, plus the records store's bind-probe `STREAM.INFO` and `$JS.API.INFO`; NO work-stream read: the settlement path always settles or expires through the lease key before any EPW live-entry probe, so that read is unreachable and ungranted) and its connection-scoped reply inbox, and NOTHING else (no consumer authority anywhere, no work-enqueue publish, no auth-store access), and it carries the write residual the bounded cleaner does NOT: KV subject permissions cannot distinguish CAS from overwrite or DEL/PURGE markers, and the `wrk` publish is payload-blind, so a compromised executor can forge a lease settlement or work terminal within its WHOLE EFFECTIVE INVENTORY (every discovered pool; the per-item checks above bind honest execution, not a compromised bearer), explicit per D32, op-bounded and effective-inventory-confined, never standing, never beyond that inventory | mediated |\n| Drain commit applier (\xA713.8 accepted-self recovery) | a per-op, per-repair principal (`local.epapl_<opId-hash>`, CONNZ principal-tagged) the retirement drain mints ONLY after the commit key passes the CLOSED self-commit class: the key's kind must resolve in the canonical frozen kind registry to a NON-authority definition whose targeted `spec`/`status` half is registered to the \xA713.8 commit-path writer, at exact arity (which structurally excludes every authority HEAD, including the 3-token lifecycle head) with every qualifier token validated; a key outside the class refuses BEFORE any credential exists (the confused-deputy closure: a forged accepted-self row cannot turn `oblig.`/`govern.`/`policy.`/`uid.`/`frontier.`/a lifecycle head/an unregistered kind into a granted coordinate) | exactly ONE `$KV.cotal_records_<space>.<commitKey>` publish row plus its connection-scoped reply inbox; NO reads, NO wildcards. It executes the mediator-validated command verbatim: the resolved, canonically digest-verified intent bytes at the pinned base revision, written by guarded CAS; a CAS loss reports the another-writer conflict and the drain's re-enumeration re-classifies (landed / superseded), never a blind retry. NAMED residual: KV subject permissions cannot distinguish CAS from overwrite or DEL/PURGE, so within its one granted key a compromised applier can overwrite or delete for the credential's short life \u2014 the confinement is the exact key, the closed class, and the op-bounded lifetime, never write semantics. RETIREMENT-FENCE residual (\xA713.1/\xA713.13): no credential-ledger row backs this bearer, so the retirement fence guarantees KILL-LIVE (cluster-verified eviction of any live connection before the frontier), never deny-new \u2014 the connection is minted non-reconnecting so a KICK is durable in one round, and a fresh connect with a still-unexpired held bearer+seed after that point-in-time scan is the accepted residual, dominated by data-account signing-seed compromise (signing-key rotation is the only true deny-new) | mediated |\n| Drain route reconciler (\xA713.8 accepted-pool repair) | a per-op, per-repair principal (`local.eprec_<opId-hash>`, CONNZ principal-tagged) the retirement drain mints only to execute a MEDIATOR-DERIVED closed repair command: the mediator reads the item's durable acceptance decision itself (a leader-served fencing read), binds it to the obligation row (fingerprint/sourceSeq/route/horizon), and derives the exact EPW item subject plus the canonical acceptance item bytes (\xA713.6); the executor re-validates the exact six-token item shape for its own space and holds NO derivation authority (row-supplied coordinates or bytes never reach a grant) | exactly ONE `cotal.<space>.epw.<endpoint>.<pool>.<cOwner>.<cActor>.<cUid>.<id>` create-only publish row plus its connection-scoped reply inbox; a lost create is benign (a concurrent enqueue won; the drain re-reads establishment either way, so a no-op executor still fails closed); the payload-blind enqueue residual is confined to the one item subject for the credential's short life. RETIREMENT-FENCE residual (\xA713.1/\xA713.13): no credential-ledger row backs this bearer, so the retirement fence guarantees KILL-LIVE (cluster-verified eviction of any live connection before the frontier), never deny-new \u2014 the connection is minted non-reconnecting so a KICK is durable in one round, and a fresh connect with a still-unexpired held bearer+seed after that point-in-time scan is the accepted residual, dominated by data-account signing-seed compromise (signing-key rotation is the only true deny-new) | mediated |\n| Drain effects canceller (\xA713.8 option-(i) retirement cancel) | a per-op, per-repair principal (`local.epcan_<opId-hash>`, CONNZ principal-tagged) the retirement drain mints only to execute a MEDIATOR-DERIVED effects-cancel repair: the mediator reads and row-binds the acceptance decision itself and derives the exact completion subject (the `eff` marker or the goal `result` coordinate; the executor re-validates that exact shape for its own space); the cancelled terminal is built by the CORE validated builders, which refuse a foreign or absent target \u2014 a retirement cancels only ITS OWN target's accepted work \u2014 and never fabricate success (the effects union's `cancelled` member, or the goal union's first-class `cancelled` state with the digest-bound retirement attribution) | exactly ONE completion-subject create-publish row plus its connection-scoped reply inbox; CREATE-ONLY, so first-terminal-wins is structural (a racing real completion that landed first wins and the cancel loses its create harmlessly; the drain re-reads the winner either way, so a no-op executor still fails closed); the payload-blind single-subject create residual is confined to the one marker for the credential's short life. RETIREMENT-FENCE residual (\xA713.1/\xA713.13): no credential-ledger row backs this bearer, so the retirement fence guarantees KILL-LIVE (cluster-verified eviction of any live connection before the frontier), never deny-new \u2014 the connection is minted non-reconnecting so a KICK is durable in one round, and a fresh connect with a still-unexpired held bearer+seed after that point-in-time scan is the accepted residual, dominated by data-account signing-seed compromise (signing-key rotation is the only true deny-new) | mediated |\n| Auth control rail (the `auth-admin` listener, \xA713.2 reserved) | the auth service's dedicated LISTENER credential: serve + bounded replies on the `ctl.auth-admin` subtree, standing with the plane. The surface is GENERIC \u2014 \"retire a lifecycle (owner, actor, lifecycleUid)\" \u2014 never caller-specific; caller attribution is SUBJECT-derived (`ctl.auth-admin.<owner>.<actor>`, broker-ACL-enforced) and the reply target must live under the sender's own `<request>.reply.>` subtree (an unbound target is dropped before any processing). Serve-time authz is the RAIL-TIME space-manager-lease holder check: ONE leader-served `STREAM.MSG.GET` read of the manager bucket's single `lease` key, fresh per request, requiring `lease.holder == principalKey(subjectOwner, subjectActor)`; a DEL/PURGE marker or TTL-expunged row reads ABSENT and refuses fail-closed. The four-outcome idempotence table answers in operator vocabulary (already-retired = success; the same stable opId resumes; a foreign operation refuses naming it; a stale incarnation refuses naming the current one), and every refusal is a COMPLETE no-op stated as such | subscribe `ctl.auth-admin.*.*` + publish `ctl.auth-admin.*.*.reply.>` (replies ONLY: the handler only ever responds under `<request>.reply.>`, so a bare request subject is unpublishable by the listener credential, closing the self-forge where a compromised listener publishes a request as the current lease holder and passes its own subject-derived lease check) + `$JS.API.INFO` + the ONE lease read row + its connection-scoped inbox; NO store writes, NO consumer authority, NO scanner/plane reach \u2014 every executing right stays with the plane's own registry and retirement deps (the drain rides the plane's ONE sealed records scanner) | mediated |\n| Retirement requester (per-despawn, \xA713.2) | an EPHEMERAL one-shot credential the space manager mints per despawn (`retirement-requester` profile, five-minute window): request + reply ONLY, for exactly ITS OWN control subject. The manager derives a STABLE opId from the retiring lifecycleUid, so a despawn retry, a same-name-spawn nudge, and the auth service's boot resume all drive the SAME operation. The requester holds no executing right \u2014 a leaked credential can only ask the rail to retire a lifecycle, and the rail's fresh lease check + idempotence table bound what that ask can do | publish exactly `ctl.auth-admin.<owner>.<actor>` (its minting manager's own principal) + subscribe that subject's `reply.>` subtree and its connection-scoped inbox; nothing else | mediated |\n| Governance head (registration linearization) | the provisioner-registration principal | the **unsplit** governance head `$KV.cotal_records_<space>.govern.<endpoint>` (\xA713.7): it reads the head FRESH under the frozen registration gate (a FENCING read, read service above: leader-served `$JS.API.STREAM.MSG.GET.KV_cotal_records_<space>` last-by-subject on the head key, never the follower-served `DIRECT.GET` the records bucket would allow) and is the head's ONLY writer (slot-take CAS in phase 1, promote CAS after the spec publish); the SAME principal holds the write on `$KV.cotal_records_<space>.policy.<endpoint>.>` (each immutable policy version is published exactly once, before the stage CAS that names it). The immutability of a policy version is a TRUSTED-WRITER INVARIANT, not a broker-enforced subtraction: KV create/update/delete all publish to the one `$KV.\u2026policy.<endpoint>.<digest>` subject, and NATS subject permissions cannot distinguish the create-CAS header or the `KV-Operation` header, so a subject grant cannot forbid an overwrite or DEL. The invariant is upheld by the writer's create-only CAS plus every reader's SELF-CERTIFICATION (\xA713.7: the value must digest to the key), so a changed-byte overwrite is REFUSED on read; the residual, confined to this prefix, is that a buggy or compromised provisioner could still DEL or same-byte-overwrite an enforced version and (history 1) destroy its availability, at which point admission pauses fail-closed rather than admitting under a lost policy. No agent, endpoint, observer, admin, or host profile holds any grant. The head is NEVER-DELETED (the `lifecycle`-head discipline): no grant permits DEL/PURGE on `govern.>`; a reader treats only TRUE ABSENCE as a virgin head, and a deletion marker refuses loudly as corruption (\xA713.12 retention floor), never as absence | mediated |\n\nTerminal pool cleanup settlement is lease-fenced across the two profiles above: the executor\nCASes the item's lease (or observes the winning settled lease), publishes/observes the exact\nlease-derived `wrk` terminal, and only then does the cleaner, after re-reading and\ncodec-validating that terminal, ACK the delivery. A `wrk` create that bypasses the lease CAS is\nnon-conformant: it can contradict a racing commit.\n\nAn `eff` completion fact `epf.<endpoint>.eff.<cO>.<cA>.<cUid>.<id>` is a CLOSED two-member\nunion carrying a REQUIRED `outcome` discriminant on EVERY member (the goal union's `state`\nbar, applied to effects: a member is never structurally assignable to the other, and every\nreader is forced to read the outcome). The RAN member is\n`{ v: 1, id, fingerprint, caller, sourceSeq, ts, outcome: \"ran\" }`; the RETIREMENT-CANCELLED\nmember is `outcome: \"cancelled\"` plus exactly `cancelled: { opId, target }` \u2014 the same\nidentity spine, plus the binding to the retiring target's lifecycle and the retirement\noperation that cancelled it. A fact missing the discriminant, or claiming one outcome while\ncarrying the other's fields, refuses. A reader that sees `cancelled` KNOWS the effect did not run; the member is never\na forged success. Both members' caller triple and `id` are bound by the subject, and their\n`fingerprint` and `sourceSeq` MUST equal the accepted decision's. The cancelled member may be\nwritten ONLY for an acceptance whose own `target` names the retiring lifecycle (a retirement\nnever cancels a foreign target's work), publishes CREATE-ONLY on the SAME subject the real\nmarker would use \u2014 so first-terminal-wins is structural: a racing real completion that lands\nfirst wins and the cancel loses its create harmlessly, and vice versa \u2014 and is produced by\nthe drain's per-op canceller profile (\xA713.9). An ACTION needs no new member: the `goal\u2026.result`\nunion already carries the first-class `cancelled` outcome state, and a retirement-cancelled\ngoal terminalizes through it with the same acceptance-fingerprint binding and the retirement\nattribution in its digest-bound payload (`data.cancelledBy = { opId, target }`). An\neffects-route drain compares the PARSED fact against the acceptance and treats EITHER bound\nmember as established; an action's drain instead requires the parsed `goal\u2026.result` fact whose\n`fingerprint` matches the acceptance. Subject presence alone never proves completion: a bare,\nmalformed, or mismatched fact refuses the drain loud (\xA713.8).\n\nRaw `STREAM.MSG.GET` and `CONSUMER.MSG.NEXT` authority carries a caller-selected reply subject.\nFor every trusted profile holding those APIs, D32 includes confused-deputy response injection:\ncompromise can direct fetched API/message bytes onto a foreign subject even though its\nconnection-scoped inbox prevents subscribing there. This is injection, not foreign read access,\nand requires a future fixed-destination mediation boundary to remove.\n\nDeletes beyond these rows: only the lifecycle-keyed deprovisioner (exact names, \xA713.1) and\nstream retention.\n\nA **mediated** row means the raw storage grant is held only by a narrowly scoped writer\nprincipal (per endpoint, never a universal writer), with authenticated caller binding,\nidempotent request semantics, and bounded failure/backpressure; CAS headers, fingerprint\nrules, schema validity, and digest-correct bytes are *enforced* there. A **direct** row means\nthe broker guarantees writer/key containment only, and the row **explicitly downgrades**\nCAS/schema/header/byte correctness to a conforming-client guarantee; readers of direct-row\nstate fail loud on invalid content. No profile (agent, observer, admin, host) holds generic\n`$JS.API.>`/`$KV.>`/`$O.>` authority over control-surface state, for the contract store that\nmeans the REAL subjects and APIs: **write** on `cotal.<space>.epc.>` belongs\nto the contract publisher alone (create-only per digest subject); **read** is the\nsubject-scoped last-by-subject Direct Get of the reader row above, never a body-selected\nform and never a consumer, because there is nothing to replay: one message per digest\nsubject IS the store, with verify-on-read as the tamper\nboundary; and the **stream-management surface** of `EPC_<space>`\n(`$JS.API.STREAM.{UPDATE,DELETE,PURGE,MSG.DELETE}.\u2026`) is held by NO profile, publisher\nincluded, stream lifecycle belongs to space setup under operator provisioning authority\nonly, which is what \"immutable once published\" rests on (a `$OBJ.>` deny matches no NATS\nsubject and audits nothing).\nThe matrix is re-audited mechanically (decoded-credential fixture + live positive/negative\nprobes, with predicates over the real `$O.`/`$JS.API` subject forms) at every phase that\nadds a resource or changes ownership.\n\n**Writer table (core kinds, mediation decided, D7: authoritative CAS/schema record writes\nare mediated by separately scoped spec/status writer principals; an endpoint holds no raw\noverwrite grant on its own record keys).** `svc`, spec: the provisioner/registration path,\n**mediated** (CAS + schema enforced at registration); status: the owning instance's commit\npath, **mediated** with **epoch currency enforced at the writer**: the writing epoch is\nread from the broker-authenticated `epr` ingress subject (\xA713.2, the instance's serve\ncredential pins the epoch token there, so a stale process CANNOT claim the successor's\nepoch: the value is attested by the grant, never by payload), and the writer validates it\nagainst a FRESH read of the authoritative lifecycle mapping's `processEpoch`,\nrejecting a non-current epoch (`expired`), monotonicity against the stored status epoch\nalone is NOT sufficient, because between the takeover CAS (mapping N\u2192N+1) and the completed\nrevoke/evict barrier the superseded N would still equal the stored status epoch and pass a\nbelow-stored check, and additionally rejects a below-stored epoch (`conflict`). The record\nkey is restart-stable and\ncannot carry the epoch (\xA713.1), so this epoch-pinned-ingress-plus-fresh-equality mediation\nis the record's only stale-writer fence.\n`signer`, spec+status: the space operator's registry tooling as the scoped writer\nprincipal, **mediated**. `handle`; keys are **issuer-namespaced**,\n`handle.<issuerKeyId>.<id>`, so two issuers can never collide or cross-revoke; spec: the\nissuer through the record-writer seam, create-only; status/revocation: issuer or space\noperator, **mediated and monotonic** (revoked never un-revokes; the signature stays the\ncontent authority; mediation enforces key grammar, CAS, and schema). `contracts` index, the instance, **direct** (explicitly advisory and\nnon-authoritative; `describe` is authoritative; readers fail loud on invalid state).\n`goal`/`cp` projections, status: the owning instance's commit path, **mediated**. Lifecycle\nmapping records (\xA713.1), the minting manager's commit path, **mediated**, CAS-only. The\n`govern` head (\xA713.7), the provisioner-registration principal, **mediated**, CAS-only (the\nmatrix row above).\nCanonical acceptance, work-pool enqueue, lease state, and contract-artifact publication,\n**mediated** per the matrix above.\n\n**Trait seam.** Core owns the fail-closed pre-effect verification interfaces (guard call,\npriced-proof verification, governed-attachment verification); policy engines, token formats,\nand payment rails remain extensions behind those seams.\n\n### 13.10 Receipts and signing trust anchors\n\n**Receipts.** A receipt binds a request to its outcome, signed and non-repudiable, for\nmetering, disputes, and pipeline causality; payment semantics stay opaque to core.\n\n`Receipt` = `{ v: 1, requestId, sourceSeq (the accepted submission's sequence, the\nexecution identity its subject carries, \xA713.2), space, endpoint, command, instance: { id, instanceId, epoch },\ncaller: { id, lifecycleUid }, schemaDigests: { input, output }, argsDigest, outcome: { ok,\ncode? }, resultDigest?, ts, signer: { keyId }, sig }`, canonical JSON, Ed25519-signed\n(`space` per the unconditional artifact rule below).\nLifecycle and epoch are recorded as **evidence**, never redemption authority. A command\ncarrying `ai.cotal.priced` MUST verify an independently verifiable payment proof in the\n`auth` slot before effect (never a bare \"settled\" assertion) and emit a receipt fact\n(`epf\u2026.receipt.<cOwner>.<cActor>.<cUid>.<id>.<sourceSeq>`, the caller- and\nexecution-scoped subject of \xA713.2; receipts are create-only per subject). A priced command\nis therefore journal-class: its receipt derives its identity from the accepted submission's\ndecision fact and its outcome from the committed terminal, never from emitter-supplied\nparameters, so a command with no acceptance fact has no receipt to emit; a conforming\nimplementation refuses to serve `ai.cotal.priced` on an ephemeral command (an\nadmission-time refusal at serve construction, never a first-request surprise). Receipt\nretention: default 90 d, \u2265 the idempotency horizon (outcome-stated by the \xA713.12 retention\nfloor).\nVerification: signature against the anchor registry + digest recomputation; forged or\nrequest-mismatched receipts fail loud. Receipts MAY be emitted for unpriced commands.\n\n**Trust anchors.** One per-space registry covers every signed artifact of this section,\nauthorization slots, capability handles, checkpoint resumes, trait definitions and\nattachments, session grants, receipts. Anchors are `signer.<keyId>` records: spec =\n`{ keyId, publicKey (Ed25519), owner (the principal or reverse-DNS domain the key belongs\nto), roles \u2286 [handles, traits, receipts, resume, sessions, authz-slots, obligations,\npayments], scope: per-role structured ceilings, for a `handles`-role key the **full grant\ndimensions**, in the handle-grant shape itself: the endpoints/domains, and per entry the\nmaximal commands, authorization modes, target patterns, instance ids, and read subtrees the\nkey may issue for (a handles- or receipts-role key without a dimension ceiling has that\ndimension closed, not open); for other roles the endpoints/domains it may attest for,\nvalidFrom, validTo }`, status = revocation. `issuer-authority` is defined by exactly this\nrecord: a verifier resolves the artifact's keyId FRESH at verification and enforces the role\nAND its scope under the \xA713.6 containment order (`handle.grants \u2286 anchor.scope`), a\nhandles-role key scoped to `com.acme.>` cannot issue for `manager`, a receipts-role key\nscoped to one endpoint cannot attest as another, and a handles-role key whose scope names no\n`handle`-mode targets cannot issue actor-pinned grants. Verification (fail closed): resolve the key,\nreject unknown keys, out-of-window use, role mismatch, or revocation (immediate for new\nverifications; effected work is not retroactively unwound). Rotation registers a successor\nand closes the predecessor's window; overlap is permitted for handoff. Third-party trait\nauthorities register under their reverse-DNS domain claim. Trust roots never merge across\nspaces.\n\n**Signature encoding (normative, D28).** For every signed artifact: the signature input is\nthe UTF-8 bytes of the RFC 8785 canonical JSON of the artifact **with its `sig` field\nabsent**; the signature is Ed25519 (nkeys); `sig` carries it base64url-encoded (unpadded).\nVerification recomputes the canonical form, resolves `signer.keyId`/`issuer.keyId` in the\nanchor registry, and fails closed on any mismatch.\n\n**Replay and claims matrix (normative, per artifact type).** Every row below additionally\nand unconditionally requires `space`, the signing `keyId` (`issuer`/`signer` per shape), and\n`sig` (the \xA713.10 encoding): an artifact missing any of the three is invalid before its\nreplay rule is ever consulted, and each artifact type is a discriminated schema, a verifier\ndispatches on the type, never duck-types the claims.\n\n| Artifact | Required claims | Replay rule |\n| --- | --- | --- |\n| Capability handle | id, space, issuer, holder (principal+UID), structured grants, iat, exp (nbf, parentDigest, epoch as applicable) | reusable within TTL, holder-bound; revocable if sturdy |\n| Checkpoint resume | checkpoint token, goal id, holder (principal+UID), iat, exp, nonce | **one-use** (journaled by create-only CAS); duplicate = `conflict` |\n| Session grant | sessionId, subjects, holder (principal+UID+processEpoch), serving instance+epoch, window, iat, exp, nonce | **one-use** redemption (holder epoch fresh-checked), then live; dies with either side's epoch |\n| Guard obligation | goal/request id, attenuations, iat, exp | bound to its goal/request; reusable within it |\n| Payment proof | per the priced contract's declared policy | default one-use per request id |\n| Trait attachment | endpoint, command, contractDigest, traitUrn, value, signer, ts | revision-bound evidence; replaced only by an authorized contract revision |\n| Receipt | per \xA713.10 shape (ts, signer; no exp/nonce) | evidence, never authority; replay-irrelevant |\n\nEvery verifier rejects out-of-window use (where `exp` applies), wrong-holder presentation,\nand unknown/revoked keys.\n\n### 13.11 The hard cut\n\nThis section is an intentional hard cut on the pre-1.0 line per \xA711. The version marker is\nthe grammar itself: the `ep`/`epe`/`epf`/`epj`/`ept`/`epw`/`eps` subject kinds and the\nversioned envelope are disjoint from every v0.3 control subject and shape, and the old rails\nare removed, subjects, envelopes,\nhandlers, credential grants, minting paths. No compatibility adapter, dual serving, or\ntranslation window exists. A credential minted before the cut can publish only into dead v0\nsubjects: nothing subscribes them, no post-cut handler is reachable from them, no trusted\nreply can be elicited (a pre-cut grant matches no endpoint-surface subject by construction,\nverified adversarially with captured pre-cut credentials from every old profile). The one\nstructural exception is the pre-cut `admin` profile, whose space-wide `P.>` subscribe\npredates and therefore MATCHES the new rails: **admin credentials MUST be re-minted at the\ncutover** to the post-cut admin shape (Appendix B: messaging-plane subjects only, no\n`ep*`/`eps`/`epc` subscribe), and the pre-cut admin credential is revoked with the cut;\nthe hard-cut guarantee is not honest without it. The wire\n`protocolVersion` (\xA76, \xA711) targets `0.4` at the completion of this revision's migration, per\nthe \xA711 convention that the advertised version is the migration's normative target, and a\nv0.4-conformant participant MUST advertise it (the optional-field era ends at the marker\nboundary); `1.0` is a separate, later stability declaration (\xA711).\n\n### 13.12 NATS + JetStream binding\n\n**Broker floor.** The control surface REQUIRES NATS server \u2265 2.12 (message schedules, atomic\ncreate-CAS, counters) AND a `max_control_line` large enough for the deployment's\nmaximum-capability CONNECT line. The two floors are checked at the tier that can see them:\n\n- **Clients** check the server version from the pre-auth INFO and fail loud below 2.12 or\n when schedules are unavailable (including the offline-assets downgrade mode). The\n control-line limit is NOT discoverable pre-auth; an oversized CONNECT is silently dropped\n and looks like a network fault, so a client's obligation is bounded reconnect attempts\n plus the named diagnostic on a repeated pre-auth drop (\"CONNECT may exceed the broker's\n max_control_line; have the operator verify it\"), never an infinite retry loop.\n- **Operator tooling** (doctor/setup) asserts the cause before any credential is minted:\n read `max_control_line` over the system account (`$SYS.REQ.SERVER.PING.VARZ`) from\n **every server of the cluster the credential may connect to**; the ping is fanned out,\n the response set is checked complete against the expected server count, and a partial\n response set is a FAILED assertion, never a pass, and require, on each server,\n `max_control_line \u2265 (largest encoded CONNECT line of the \xA713.9 fixture set) + margin`.\n The fixtures are **byte-reproducible** (concrete maximum-length identities, the full\n grant set at the policy ceiling, the maximum-capability agent credential and the\n maximum-command serve credential, the encoded credentials, the resulting CONNECT\n lengths), so the floor is a measured quantity; the reference deployment's configured value\n is 65536; a derived number, not an assertion. The 16 KiB policy gate remains a distinct\n mint-time cap on credential authority, refused loudly at minting. The same assertion pass\n checks `max_payload \u2265` the largest serialized **bounded decision fact** fixture (the\n maximum `RejectionFact`/`QuarantineFact` under the token and detail bounds, \xA713.4) AND\n `max_payload \u2265` the 256 KiB contract-artifact document bound plus envelope margin\n (\xA713.7; a contract artifact is one message on its digest subject), so\n \"the rejection fact always fits by construction\" and \"an artifact is a single message\"\n are measured floors, not assumptions.\n\nNo sweeper fallback exists. Only 2.12 schedule semantics are assumed (same-subject\nreplacement; NOT the 2.14 stop-plus-publish path).\n\nPer-space resources, created at space setup (`STREAM.CREATE` remains denied to agents):\n\n| Resource | Captures / holds | Retention notes |\n| --- | --- | --- |\n| `EPJ_<space>` stream | `cotal.<space>.epj.>` (submissions, untrusted) | Limits; **native dedupe not relied upon**; submitters never set `Nats-Msg-Id` (\xA713.4; stream-wide header dedupe is a cross-caller suppression vector on a shared untrusted stream). A zero duplicate window is NOT server-accepted (`0` normalizes to the 120 s default; the minimum is 100 ms), so the config sets the server minimum and the guarantee is the header rule: a hostile header suppresses only another non-conformant header-bearing write; retention \u2265 recovery/redelivery lag |\n| `EPF_<space>` stream | `cotal.<space>.epf.>` (canonical facts) | Limits; acceptance via create-only CAS (`Nats-Expected-Last-Subject-Sequence: 0`); `allow_direct=true` (NON-fencing subject-confined reads only: every \xA713.9 matrix fact read is FENCING and leader-served `STREAM.MSG.GET`, \xA713.9 read service); retention \u2265 horizons, outcome-stated by the retention floor below |\n| `EPE_<space>` stream | `cotal.<space>.epe.>` (events, progress) | Limits; space policy |\n| `EPT_REQ_<space>` stream | `cotal.<space>.ept.*.*.*.*.schedule` (instance schedule REQUESTS, \xA713.2) | Limits; message schedules **DISABLED**; client-set scheduling headers are inert bytes here; retention \u2265 writer recovery lag |\n| `EPR_<space>` stream | `cotal.<space>.epr.>` (record-write ingress, \xA713.2) | Limits; epoch-pinned publish grants (\xA713.9); consumed only by the record writer; retention \u2265 writer recovery lag |\n| `EPT_<space>` stream | `cotal.<space>.ept.*.*.*.*.armed` + `\u2026.fire` (authoritative schedules + fires, \xA713.2) | `AllowMsgSchedules`; only the timer writer publishes `.armed` (\xA713.9); each schedule targets its sibling `.fire` subject (ADR-51 forbids target = publish subject); retention \u2265 max deadline + margin |\n| `EPW_<space>` stream | `cotal.<space>.epw.>` (work pools; one item per subject, \xA713.2) | WorkQueue; provisioner-pre-created non-overlapping exact-filter per-pool consumers (\xA713.9) with **`max_deliver=-1` pinned** (a finite delivery ceiling strands exhausted items outside `num_pending`/`num_ack_pending` and falsifies the \xA713.6 admission occupancy; the occupancy reader re-checks the pin at every read because MaxDeliver is editable post-create); **`allow_direct=false`**: EPW has NO non-fencing subject-confined reader (pool workers drain the WorkQueue via `CONSUMER.MSG.NEXT`, never a subject read), and its ONLY subject read is the reconciliation probe, which is FENCING and MUST be leader-served `STREAM.MSG.GET` (\xA713.9 read service; an acked item leaves the WorkQueue, an in-flight one remains readable, which is exactly the \xA713.6 predicate, and a stale follower miss would re-arm settled work). Disabling Direct Get on EPW makes that leader-served requirement STRUCTURAL: no reader (including virtual-endpoint activation reconciliation, \xA713.6) can take the follower path even by mistake. This differs from EPF, which keeps `allow_direct=true` because it DOES have non-fencing subject readers (the \xA713.9 last-by-subject fact reads); EPF's fencing CAS-winner read opts into the leader by caller choice |\n| (sessions: core-only, no stream) | `cotal.<space>.eps.>` | never captured; bounded in-memory window |\n| `cotal_records_<space>` KV | records: the \xA713.7 core-kind key grammars (`svc`, `signer`, `handle`, `contracts`, `goal`, `cp`, `lease`, `lifecycle`, `govern`, `uid`, `policy`, `oblig`) | per-key CAS; `.spec`/`.status`-split keys EXCEPT the unsplit atomic keys `lifecycle.<owner>.<actor>`, `govern.<endpoint>`, `uid.<lifecycleUid>`, `policy.<endpoint>.<digest-hex>`, and `oblig.>` (\xA713.1/\xA713.7/\xA713.8/\xA713.9); `allow_direct=true`, but the heads and every fencing read are leader-served `STREAM.MSG.GET` (\xA713.9 read service). **No age retention on authority keys:** `lifecycle` heads, `govern`, `uid` reservations, `policy` versions, and `oblig` rows are NEVER-DELETED (no grant permits DEL/PURGE; an age-evicted reservation would reopen UID reuse, an evicted obligation would orphan accepted work); a deletion marker on any of them refuses loudly as corruption, never as absence. **Shape is proved at bind, not assumed:** the stream MUST be primary (never a mirror/sourced copy) and MUST carry no bucket-wide silent-eviction limit (no `max_age`, no finite `max_msgs`/`max_bytes`: under `DiscardOld` a finite global limit evicts a prior authority key's latest row the moment an unrelated key is written); every trusted consumer of this store (the minting authority, the mapping reader, the mediator) verifies exactly this via `STREAM.INFO` when it binds and refuses to serve otherwise |\n| `cotal_auth_<space>` KV | the credential ledger (`cred.<lifecycleUid>.<credentialId>` + issuance gates `gate.<lifecycleUid>` + the disjoint endpoint families `epgate.<endpoint>.<instanceId>` / `epcred.<endpoint>.<instanceId>.<credentialId>` + the staging family `stage.>` + source gates `srcgate.<issuerKeyId>.<id>` + lineage index `bysrc.\u2026`, \xA713.1) + session ledger (`session.<sessionId>`, \xA713.6) | trusted auth path ONLY; no agent, endpoint, observer, admin, or host profile holds any grant (\xA713.9 matrix); **`allow_direct=false`** (every fence is a leader-served revision-pinned CAS write; Direct Get's follower/mirror reads would defeat read-your-writes, \xA713.1); CAS + monotonic states. **No bucket-wide age retention:** `gate.`, `epgate.`, `srcgate.`, and `session.` authority keys persist until their lifecycle/handle/session is explicitly terminal (an age-evicted `open` gate would silently reopen minting, or drop a `frozen`/`retired` fence); only `cred.`/`epcred.`/`bysrc.` rows carry a per-key TTL bounded by the credential TTL (NATS per-key message TTL, \u2265 2.12), never a bucket MaxAge; `stage.` rows follow their operation's retention, never a ledger row's. **Shape is proved at bind** (the records-store rule above, plus `allow_direct=false`): primary, un-mirrored, no bucket `max_age`, no finite `max_msgs`/`max_bytes`; the trusted auth path verifies this via `STREAM.INFO` when it binds and refuses to serve otherwise |\n| `EPC_<space>` stream | `cotal.<space>.epc.>` (content-addressed contract artifacts, one per digest subject, \xA713.7) | Limits, no age eviction (artifacts are permanent); create-only mediated publication (`Nats-Expected-Last-Subject-Sequence: 0`); `allow_direct=true` (the subject-scoped last-by-subject read IS the fetch path; non-fencing, verify-on-read); permanence is BROKER-ENFORCED: `deny_delete=true, deny_purge=true` (the broker rejects the message-delete and purge APIs even from a stream-API-holding principal). Permanence is the COMBINATION of these flags, the retention floor's no-early-removal rule (below: the flags alone stop delete/purge but not age eviction or a whole-stream teardown), verify-on-read pinning WHAT a subject carries, and the stream-management surface held by no profile (\xA713.9); no single flag makes deletion structurally impossible |\n\n**Retention floor (one-use-identity facts).** A stream or bucket whose messages carry\none-use identity, that is decision facts realizing the \xA713.4 idempotency horizon, goal\nterminal facts and tombstones (\xA713.6), receipt facts (\xA713.10), and the never-deleted\nauthority heads (`lifecycle`, `govern`, the auth-bucket gates), MUST retain every protected\nmessage until its governing horizon, stated by OUTCOME: NO removal cause may drop a\nprotected fact early. That forbids not only age eviction below the horizon but every\nconforming alternative that erases it while `MaxAge` still passes: a finite\n`MaxMsgs`/`MaxBytes`/`MaxMsgsPerSubject` with `DiscardOld`, a per-message TTL,\nrollup/compaction, or a retention-policy change; for these families finite count/byte\nlimits MUST fail loud or `DiscardNew` rather than evict protected history, and message TTL\nand rollup MUST be disabled on protected subjects (a per-key TTL is permitted only on\nnon-protected keys, e.g. the auth bucket's `cred.`/`bysrc.` index rows above, never on a\nprotected fact, head, or gate). NO principal, including operator, setup, and system tooling,\nnot only \xA713.9 profiles, may `MSG.DELETE`/`PURGE`, `STREAM.DELETE`, or issue a\n`STREAM.UPDATE` that weakens any of these limits; the never-deleted heads and gates carry\nan UNBOUNDED horizon. A KV writer MUST NOT publish a DEL/PURGE marker for a never-deleted\nkey, and a reader that encounters one treats it as corruption, never as absence. (Root can\nalways destroy a broker; such an act is explicitly non-conformant, not outside this\nclause.) `CONSUMER.DELETE` is distinct and permitted: it removes a reader cursor and can\nnever mutate stored facts. Concretely: `EPF_<space>` retention \u2265 max(idempotency horizon,\nresult retention, receipt retention), because the acceptance fact is the durable\nreconstruction source for receipts, while the raw submission stream is age-evicted by\ndesign.\n\nClaim pools are pull consumers on `EPW` with `AckExplicit`, held **only by the pool's owning\nendpoint** (\xA713.5): `ack_wait` is the broker's redelivery-to-owner timer and nothing more;\nthe authoritative lease token and deadline live in the owner's lease record, never in the\nitem value (stored bytes are work identity and input only), and the owner acks only after\nthe committed terminal state. Filtered replay of events/facts uses pinned single-filter\nconsumer creates (the CHAT-history containment mechanism, \xA78/\xA79). Timer scheduling is\n**mediated** (\xA713.2, \xA713.9): instances publish only `.schedule` REQUESTS into the\nschedules-disabled `EPT_REQ` stream, where a client-set `Nats-Schedule-Target` (or any\nscheduling header) is inert bytes and the timer writer rejects a request carrying one, this\ncloses the ADR-51 confused deputy, in which a direct publisher confined only to \"some\nsubject the schedules stream captures\" could target ANOTHER instance's `.schedule` (installing\nor replacing its schedule state, since schedule headers are copied to the target verbatim) or\nits `.fire`. The timer writer alone publishes the authoritative schedule on `.armed`, with\n`Nats-Schedule-Target` = the sibling `\u2026.fire` subject derived from the authenticated request\nsubject's own tokens; and **fire handling is the trusted seam** behind it, a `.fire`\nconsumer acts only on a fired message matching a current authoritative\nschedule it owns (`timerId` + generation + deadline, \xA713.2) AND whose broker-authored\nscheduler-origin header (`Nats-Scheduler`, the schedule's subject, set by the server on\nfire) equals its own exact sibling `.armed` subject, discarding anything else as\nforged. Replacement is the writer's same-subject publish on `.armed` (server rollup); fired\nmessages appear on `.fire` carrying `(timerId, generation)`.\n\n### 13.13 Plane ownership (the sealed-scanner claim)\n\nAt most ONE authority plane per space may hold the sealed scanners (\xA713.9's seventh-round\nseal). The scanners' serialization is process-local, so two same-space auth processes would\ninterleave the literal enumeration consumers' critical sections and return PARTIAL\nenumerations: a drain declares quiescence over undrained obligations and the retirement\nfrontiers close over live work. The exclusion is broker-visible, not host-local:\n\n- **The claim row.** One exact, never-deleted auth-KV key (`plane`, subject\n `$KV.cotal_auth_<space>.plane`) holds `{ v, generation, claimId, state: held | released,\n ledger, records, openedAt }`, where `ledger`/`records` are the two ownership-bearing sealed\n scanner connections' broker identities `(serverId, cid, userNkey)`. The barrier profile is\n the row's SOLE writer, at exact arity (never `plane.>`); reads are leader-served. The\n barrier's own identity is deliberately NOT in the row: barrier liveness is irrelevant to the\n literal consumers and could only falsely block a reclaim.\n- **Open order.** Ensure stores; open BOTH candidate scanner connections NON-RECONNECTING (the\n tuples must be stable and disappearance must be final) and keep them INERT (no scan\n capability exists or escapes); take the claim by broker-atomic create (virgin key) or\n revision-CAS (a `released` row, or a `held` row proven dead as below). Only the WINNER\n constructs the branded scanners; a loser closes both candidates and refuses with\n operator-legible copy. The brief dual connected-credential window before the CAS is inside\n the trusted signing-seed residual; there is no dual SCAN authority because the capability\n does not exist before the win.\n- **Plane credentials.** The two plane-owned scanner connections authenticate with\n NON-EXPIRING user JWTs, for exactly these two connections and no other profile: an expiring\n credential would have the broker hard-disconnect at expiry, and a renewal cannot be\n presented without the reconnect the non-reconnecting shape forbids \u2014 an expiry would fence\n the plane on a timer. The credentials never leave process memory, and the account signing\n seed co-resident in the same memory is strictly stronger authority, so the marginal\n exposure is the existing trusted-process residual class; revocation remains service-stop +\n seed rotation. Every other authority credential keeps the short-expiry + in-process-renewal\n boundary.\n- **Reclaim is liveness-only.** A `held` row is reclaimed only when BOTH claimed tuples are\n conclusively ABSENT under a COMPLETE connection sweep, adjudicated by the delivery daemon's\n read-only oracle over the privileged delivery-admin rail (the auth process holds no `$SYS`;\n the D5 rail split). The closed oracle verb takes exactly the two claimed tuples and returns\n two bound verdicts (`live | gone | unknown`) plus sweep completeness, echoing the queried\n identities; any live, unknown, incomplete, malformed, or foreign-echo answer REFUSES the\n takeover (at most one plane: dual-refuse is safe, dual-proceed is not). There is NO TTL, NO\n heartbeat, and NO \"did the last sealed scan finish\" bit: a mid-scan crash drops the\n non-reconnecting connections, a complete sweep proves them gone, and the successor's\n fail-closed pre-clean (\xA713.9) makes its full re-scan safe. A paused-but-live process still\n holds its TCP connections and therefore still holds the plane (no pause hazard).\n- **The single-server proof.** Connection absence alone cannot distinguish a RESTARTED\n claimed server (`server_id` is per-broker-run; genuinely gone, and requiring its reply\n forever would turn every whole-stack crash into a permanent reclaim wedge) from a\n PARTITIONED one (live, unreachable; treating its absence as death authorizes a split-brain\n steal). A `gone` verdict is therefore valid ONLY under the single-nats-server-process\n boundary, proven per observation from the responding server's OWN topology declaration in\n the `$SYS` reply envelope \u2014 never inferred from which servers happened to reply: every\n reply must declare NO cluster membership and exactly one distinct server may have replied.\n Any cluster self-report, multi-server observation, or reply without the declaration reads\n `unknown` and refuses. Only a SUCCESSFUL, well-formed page counts toward the sweep: a reply\n carrying an API error, a malformed or empty server envelope, a non-string cluster\n declaration, an envelope/data server-id mismatch, or a structurally incomplete data page\n poisons the whole observation (every verdict `unknown`). Each sweep's reply inbox carries a\n per-call collision-resistant nonce, so concurrent sweeps can never satisfy or falsely\n complete each other's rounds; and the auth plane closed-parses the oracle's result (exact\n keys at every level) before reasoning over it. NAMED residuals: a leafnode- or\n gateway-extended account is outside the cluster self-report, so such topologies are out of\n contract for the space's account; a backup restored onto a fresh broker can present a\n still-running foreign predecessor's `serverId` as dead. A clustered/multi-server deployment\n requires an authoritative server incarnation/roster authority in place of this proof.\n- **Holding invariant.** The winner re-validates the claim (state `held`, its `claimId`, its\n `generation`, AND both pinned scanner tuples \u2014 a row rewrite preserving the identifiers but\n swapping a tuple is a lost claim, never \"still ours\") BEFORE every sealed scan (refuse to\n enumerate) and AFTER it (discard the enumeration), inside the serialized critical section.\n An owned scanner disconnect is a FENCING event, and the fence is FATAL to the WHOLE\n authority plane: scan exposure is invalidated immediately, the sibling closes, every\n authority operation (connect authorization, credential mint) refuses from that moment, and\n the service goes DOWN loud rather than serving from a half-dead plane a successor may be\n reclaiming; a still-live sibling correctly blocks a successor until it is closed or proven\n absent.\n- **Clean close.** Scan-capable clients close FIRST, then the row CASes `held \u2192 released`\n (never released while either scanner can still act), then the barrier. A crash leaves\n `held`; the successor reclaims through the oracle. A `released` row is claimed without an\n oracle round.\n- **Operator faces.** The three refusal states carry DISTINCT copy: a live peer (\"stop the\n other auth process\", with the space and connection identities), an inconclusive observation\n (fail-safe wait/retry wording that never says \"stop the other process\"; when the oracle rail\n is down it names the delivery daemon and the restart order), and a mid-life scanner death\n (a deliberate fail-closed stop naming the restart path). An unparseable claim row refuses\n loudly and is never overwritten automatically.\n- **Host belt.** Launchers additionally claim an exclusive per-space pidfile, published\n ATOMICALLY and PRE-POPULATED: the claimant writes its pid to a unique temp inode, then\n publishes it as the slot with an atomic no-overwrite `link(2)` \u2014 no create-then-write window\n exists for a sibling to misread, and an empty slot is impossible to publish. A live holder\n is yielded to; a provably dead holder's slot \u2014 and an empty (pre-protocol crash shape) one \u2014\n is reclaimed exactly once; unattributable content is never stolen. A cheap belt only, never\n the exclusion.\n\n### 13.14 Conformance (control surface)\n\nA conformant endpoint (v0.4) MUST:\n\n1. Serve only under a credential whose serve grants match its registered name, stable\n instance id, and registered command set (publish-side grants pinned to the current\n epoch); register its service record before serving; advance the epoch by CAS on takeover\n and stop serving when superseded; a takeover is complete only after the \xA713.1 barrier\n (revoke + cluster-verified eviction of the superseded credential).\n2. Answer `describe` authoritatively, intersected only against the trusted authorization view\n (or declared-public), failing closed when that view is unavailable.\n3. Publish contract artifacts content-addressed and immutable; validate args/replies at\n runtime within the schema profile and budgets.\n4. Reply only on the reply rail derived from the authenticated request subject; ignore\n payload/transport reply targets; let attribution ride the reply subject.\n5. Enforce the envelope invariants (version/op/class/target/sender, catalog codes, monotonic\n attenuation); treat the subject, never the body, as the authorization boundary; resolve\n targets by `(alias, lifecycleUid)` against current mappings immediately before effect.\n6. Route effects by delivery class; journaled effects only from canonical accepted facts\n through the mediated writer; fingerprint-bind ids first-wins; hold the declared horizons,\n retentions, and floors.\n7. Validate every Cotal-owned commit through the mediated path (fencing token + unexpired\n lease + lifecycle + epoch as applicable); lose CAS loudly.\n8. Implement advertised composites per \xA713.6: the single action vocabulary, authorization\n linearized at acceptance, one-use resumes, generation- and scheduler-origin-validated\n timers (a fire counts only against its own sibling `.armed`, \xA713.12) with durable\n reconciliation, fail-closed governed traits, bounded sessions.\n9. Fail loud below the broker version floor (from the pre-auth INFO), with bounded\n reconnects and the named pre-auth-drop diagnostic (\xA713.12); the `max_control_line` floor\n is asserted by operator tooling (\xA713.12), never by the client, which cannot inspect it.\n10. Connect successfully while presenting the normative maximum-capability credential\n fixture for its profile (\xA713.9), the only test that exercises the control-line bound.\n\nA conformant caller (v0.4) MUST: hold a lifecycle-pinned credential and never present another\nlifecycle's artifacts; choose ids/goalIds/nonces within the token grammar and the 1024-byte\nsubject bound and reuse ids only per the idempotency rules; declare `class` and\n`replyExpected` and honor `contract-mismatch`/`conflict`; freeze scatter expectations from the\nregistry and classify partial results; verify digests of fetched artifacts and signed\nartifacts against the anchor registry, failing closed.\n\n---\n\n## Appendix A: Reference implementation map\n\n| Spec section | Source |\n| --- | --- |\n| \xA72 Identity | `packages/core/src/identity.ts` |\n| \xA73 Subjects | `packages/core/src/subjects.ts` |\n| \xA75 Envelopes, \xA76 Presence, \xA77 Channels | `packages/core/src/types.ts` |\n| \xA78 Streams | `packages/core/src/streams.ts`, `packages/core/src/endpoint.ts` |\n| \xA79 Security | `packages/core/src/provision.ts` |\n| \xA710 Join link | `packages/core/src/link.ts` |\n| \xA713 Endpoint control surface | `packages/core/src/` (endpoint rails, envelope, contracts; lands with the control-surface campaign) |\n\n## Appendix B: Profile ACLs\n\nThis appendix is normative for the NATS binding. *(The operator-facing summary of these\ngrants is [docs/identity-and-auth.md](docs/identity-and-auth.md).)* Names below use these\nplaceholders:\n\n- `P = cotal.<space>`\n- `CHAT = CHAT_<space>`, `DM = DM_<space>`, `TASK = TASK_<space>`\n- `DLV = <Plane-3 per-member delivery stream>`; `INBOX = <mixed pre-auth fan-out stream>` (the durable-backstop handoff, \xA78): fan-out writes `INBOX` (`dinbox.<owner>.<actor>.<uid>`; lifecycle-bound from v0.4, so an inactive-gap or predecessor entry can never migrate to a same-name successor), the trusted reader re-authorizes and transfers to `DLV` (`dlv.<owner>.<actor>.<uid>`, same binding), and the agent binds its own `DLV` DELIVER consumer (filter pinned to its own triple). An agent gets **no** grant on `INBOX` (the mixed pre-auth store).\n- `KV = KV_cotal_presence_<space>`\n- `CHKV = KV_cotal_channels_<space>`; `DLVKV = <delivery lease/readiness KV>`\n- `<owner>.<actor> = the authenticated principal` (\xA72): `<owner>` and `<actor>` are its two tokens; the dot-form is the wire/KV form, the dash-form `<owner>-<actor>` is the durable-name form\n- `connId = the authenticated connection id` (the connection nkey in static mode; the client-chosen nonce in user mode); distinct from the principal, and keys ONLY the reply inbox\n- `role = authenticated agent role`\n- `chatHistD = chathist_<owner>-<actor>-<uid>`, `dmD = dm_<owner>-<actor>-<uid>`, `dlvD = dlv_<owner>-<actor>-<uid>`, `svcD = svc_<role>` (per-instance durables are lifecycle-scoped from v0.4: keyed on the dash-form + lifecycle UID, \xA78/\xA713.1; `svcD` stays role-scoped)\n- `inbox = _INBOX_<connId>.>`\n\nGrouped placeholders such as `<CHAT|DM|TASK>` mean one concrete subject per listed token.\n\n### Agent\n\n`sub.allow`:\n\n- `inbox`\n- `P.ep.reply.*.*.*.<owner>.<actor>.<uid>.*` (exact arity; the agent's own endpoint reply rail: every endpoint's replies to THIS caller triple + nonce, \xA713.2; replies never ride the per-connection `inbox`)\n- `P.epe.\u2026`; the exact fully-qualified event subtrees of every minted read capability\n (\xA713.9 event-read row), incl. the caller's own per-goal subtree\n `P.epe.*.*.*.goal.<owner>.<actor>.<uid>.>`; the live tail of watch, granted per\n capability, none by default\n- `P.chat.*.*.<ch>` for every `allowSubscribe` channel, the **live read boundary**: native core-sub join/leave is a `sub.allow`-bounded subscribe to this subject (wildcard sender owner+actor), so an agent whose ACL permits a channel joins it alone with no manager. Wildcards preserved (e.g. `P.chat.*.*.team.>` for `allowSubscribe: team.>`); a `team.>` grant matches strictly deeper channels, not the bare `team`; a `>` grant is read-all chat in the space on credential compromise\n\n`pub.allow`:\n\n- `P.chat.<owner>.<actor>.<ch>` for every `allowPublish` channel (post ACL; none by default)\n- `P.inst.*.*.<owner>.<actor>` (DM any recipient, forge-locked to me as sender)\n- `P.svc.*.<owner>.<actor>` (anycast any role, as me)\n- endpoint request forms per minted capability (\xA713.9): every agent gets the baseline set\n (`describe` on all endpoints; the delivery endpoint's durable join/leave/list commands;\n self-targeted lifecycle commands with authz-mode `self`); the `spawn` capability adds the\n manager endpoint's lifecycle commands with authz-mode `owner`; `child`/`ledger` forms and\n wider target patterns only per explicitly minted capability. The caller triple\n `<owner>.<actor>.<uid>` is pinned in every granted form\n- control-surface durable reads (contract artifacts, decisions, goal results, receipts,\n event catch-up, record reads): **NO raw JetStream read grant of any kind**, no\n `DIRECT.GET`, no consumer `CREATE`, no bind-only `MSG.NEXT`/`ACK`, on `EPC`/`EPF`/`EPE`/the\n records KV. Per \xA713.9 \"Mediated reads\", every JetStream read delivers stored bytes to a\n caller-chosen destination the broker does not confine (push `deliver_subject`, pull\n `MSG.NEXT` reply, `DIRECT.GET` reply are the same vector), so an untrusted caller holds none\n of them. The caller reads through the trusted read mediator via a read command (an endpoint\n request form, above) and receives its own caller-scoped facts over its reply rail\n `P.ep.reply.*.*.*.<owner>.<actor>.<uid>.*` (already in `sub.allow`); the mediator owns the\n reader consumers and re-authorizes each read. Live event progress is the caller's own core\n subscription to granted `P.epe.\u2026` subtrees within `allowSubscribe` (bytes land only on its\n own subscription, never a caller-chosen subject)\n- `$JS.API.INFO`\n- `$JS.API.STREAM.INFO.<CHAT|KV|CHKV|DLVKV>`: CHAT plus the world-readable presence/registry/lease KVs only; **not** DM/TASK (agents bind those by name and never inspect them, so INFO there would only leak inbox/task metadata)\n- `$JS.API.CONSUMER.CREATE.<CHAT>.<chatHistD>.<P.chat.*.*.<ch>>` for every `allowSubscribe` channel (history reads; the single filter the server pins to the body, the agent's only CHAT consumer create. The live tail is the core `sub.allow` subscription above, not a JetStream consumer)\n- `$JS.API.CONSUMER.INFO.<CHAT>.<chatHistD>`\n- `$JS.API.CONSUMER.MSG.NEXT.<CHAT>.<chatHistD>`\n- `$JS.API.CONSUMER.DELETE.<CHAT>.<chatHistD>`\n- `$JS.API.CONSUMER.INFO.<DM>.<dmD>`\n- `$JS.API.CONSUMER.MSG.NEXT.<DM>.<dmD>`\n- `$JS.ACK.<DM>.<dmD>.>` (DM inbox: BIND-ONLY its own pre-created `dmD`, never create)\n- `$JS.API.CONSUMER.INFO.<DLV>.<dlvD>`\n- `$JS.API.CONSUMER.MSG.NEXT.<DLV>.<dlvD>`\n- `$JS.ACK.<DLV>.<dlvD>.>`, the **durable backstop**: BIND-ONLY its own pre-created per-member DELIVER consumer `dlvD` (the trusted reader's re-authorized handoff, \xA78). The agent holds NO grant on the mixed pre-auth `INBOX` fan-out stream.\n- `$JS.API.CONSUMER.CREATE.<KV>.>`\n- `$JS.API.CONSUMER.INFO.<KV>.>`\n- `$JS.FC.>`\n- `$KV.cotal_presence_<space>.<owner>.<actor>`\n- `$JS.API.STREAM.MSG.GET.<CHKV>`\n- `$JS.API.CONSUMER.CREATE.<CHKV>.>`\n- `$JS.API.CONSUMER.INFO.<CHKV>.>`\n- `$JS.API.STREAM.MSG.GET.<DLVKV>` (delivery lease/readiness; read-only, non-gating)\n- if `role` is set: `$JS.API.CONSUMER.INFO.<TASK>.<svcD>`,\n `$JS.API.CONSUMER.MSG.NEXT.<TASK>.<svcD>`, `$JS.ACK.<TASK>.<svcD>.>`\n\n`pub.deny` (the agent binds these consumers, never creates them; its only consumer-create grant is the pinned per-channel `chatHistD` history create):\n\n- `$JS.API.CONSUMER.CREATE.<DM>`\n- `$JS.API.CONSUMER.CREATE.<DM>.>`\n- `$JS.API.CONSUMER.DURABLE.CREATE.<DM>.>`\n- `$JS.API.CONSUMER.CREATE.<TASK>`\n- `$JS.API.CONSUMER.CREATE.<TASK>.>`\n- `$JS.API.CONSUMER.DURABLE.CREATE.<TASK>.>`\n- `$JS.API.CONSUMER.CREATE.<DLV>`\n- `$JS.API.CONSUMER.CREATE.<DLV>.>`\n- `$JS.API.CONSUMER.DURABLE.CREATE.<DLV>.>`\n\nA bare/multi-filter consumer create on `CHAT` is **not** explicitly denied (that would also deny the\npinned `chatHistD` create the agent needs), so it is default-denied (the agent holds no such allow),\nleaving the single-filter history consumer above as the agent's only CHAT consumer.\n\n### Observer\n\n`sub.allow`:\n\n- `P.chat.>`\n- `inbox`\n\nApplication publish is denied. `pub.allow` contains only read/control verbs needed to read\nCHAT history, presence, and channel registry:\n\n- `$JS.API.INFO`\n- `$JS.API.STREAM.INFO.<CHAT|KV|CHKV>`\n- `$JS.API.CONSUMER.CREATE.<CHAT>`\n- `$JS.API.CONSUMER.CREATE.<CHAT>.>`\n- `$JS.API.CONSUMER.INFO.<CHAT>.>`\n- `$JS.API.CONSUMER.MSG.NEXT.<CHAT>.>`\n- `$JS.API.CONSUMER.DELETE.<CHAT>.>`\n- `$JS.ACK.<CHAT>.>`\n- `$JS.API.CONSUMER.CREATE.<KV>.>`\n- `$JS.API.CONSUMER.INFO.<KV>.>`\n- `$JS.API.STREAM.MSG.GET.<CHKV>`\n- `$JS.API.CONSUMER.CREATE.<CHKV>.>`\n- `$JS.API.CONSUMER.INFO.<CHKV>.>`\n- `$JS.API.CONSUMER.DELETE.<CHKV>.>`\n- `$JS.FC.>`\n\n### Admin\n\nAdmin has observer grants, with `sub.allow = [P.chat.>, P.inst.>, P.svc.>, inbox]`, the\ngod-view is the **messaging plane only**, enumerated: it deliberately excludes `P.ep.>`,\n`P.epe.>`, `P.epf.>`, `P.epj.>`, `P.ept.>`, `P.epr.>`, `P.epw.>`, `P.eps.>`, and `P.epc.>`\n(a space-wide `P.>` would plain-subscribe every `ep.one` request rail, collecting reply\nnonces the queue-qualified-only rule exists to protect, and every core-only session\nframe; \xA713.2, \xA713.11). Plus DM history read grants:\n\n- `$JS.API.STREAM.INFO.<DM>`\n- `$JS.API.CONSUMER.CREATE.<DM>`\n- `$JS.API.CONSUMER.CREATE.<DM>.>`\n- `$JS.API.CONSUMER.INFO.<DM>.>`\n- `$JS.API.CONSUMER.MSG.NEXT.<DM>.>`\n- `$JS.API.CONSUMER.DELETE.<DM>.>`\n- `$JS.ACK.<DM>.>`\n\nAdmin still has no application publish grants.\n\n### Scoped host profiles (formerly `manager`)\n\nThere is **no allow-all credential**. The privileged host duties are split into scoped,\nsingle-function profiles, each granting only the verbs its function needs and none other:\n\n- `provisioner`: pre-creates the per-instance lifecycle-scoped durables (`dm_\u2026-<uid>`,\n `svc_\u2026`, the per-member `dlv_\u2026-<uid>` handoff) AND the trusted control-surface consumers of\n the \xA713.9 matrix; `poolD`, `effD`, and the read mediator's reader durables\n (`decD`/`goalD`/`eveD-n`/`recD-n`, owned by the mediator, never by callers, \xA713.9\n \"Mediated reads\"), all PULL with exact full-tail filters; and mints scoped credentials;\n ephemeral onboarding authority.\n- `deprovisioner`: target-pinned teardown of ONE retired lifecycle's footprint, minted per\n teardown with the target's `(principal, lifecycleUid)` in every exact-name grant; it can\n delete only lifecycle-keyed names, so it structurally cannot reach a same-name successor\n (\xA713.1).\n- `supervisor`: the always-on agent-lifecycle daemon (the manager process's own connection). It\n is the manager endpoint's serve credential (\xA713.9) and the ONLY holder of the capabilities for\n the delivery endpoint's admin commands (below).\n- `delivery`: the server-side Plane-3 infra: fan-out, trusted-reader re-authorization, and the\n membership/ACL records the durable backstop authorizes against (\xA77). It is the `delivery`\n endpoint's serve credential (\xA713.9); its admin commands, `reloadCreds`, the explicit adoption\n step of standing credential renewal (the daemon re-reads its re-signed creds file, pins the\n identity, swaps its connection, and reconnects the membership feed's rw connection, replying\n with the adopted JWT windows); and `evictPrincipal`, force-drop of a denied principal's live\n connections (system-account CONNZ scan \u2192 per-server KICK \u2192 re-scan verify, fail-closed on\n partial scans and on owners outside the principal namespace); carry a capability requirement\n minted to the `supervisor` profile **and to the trusted auth path** (\xA79/\xA710), which is the\n executor of the \xA713.1 takeover / terminal-retirement / handle-revocation barriers and calls\n `evictPrincipal` on each revoked credential's `holderPrincipal` (\xA713.1) as their eviction\n step; agents are broker-denied. `evictPrincipal` is\n wired into those barriers, not\n a standalone admin convenience. The former\n `delivery-admin` control tier is deleted with the v0 rail (\xA713.11).\n- `membership-rw`: the derived channel-membership graph feed reader/writer.\n- `operator`, `purger`, `teardown`, `channel-writer`, `control-caller-*`, `deployer`, `probe`: the\n human-CLI and maintenance surfaces, each scoped to its verbs.\n\nStanding host credentials are **bounded and renewed**: one-shot profiles carry minutes-scale\nexpiry; `supervisor`/`delivery`/`membership-rw` carry a 24h expiry with the manager as the named\nrenewal owner (self-remint for its own credential; same-nkey re-sign + explicit `reloadCreds`\nadoption for the seed-less daemons); the two system-account credentials (`membership-observer`,\n`connection-evictor`) carry a 30d expiry and are renewable ONLY by a system-account rotation +\nbroker restart; no persisted system-account minting secret exists, by design. On per-user-auth\nspaces, static `agent`/`observer`/`admin` minting is retired entirely (the flip): agent identities\nexist only as owner+actor principals under a logged-in user, and the elevated profiles of this\nappendix are reached per-connection via the exchange-authored view claim instead (\xA710). The flip is\ndeny-new: a static\ncredential signed before it (or minted out-of-band with the account signing key) remains\nbroker-valid until signing-key rotation, which is the revocation lever for static material; the\nguarantee therefore applies to spaces that never issued static user-facing credentials.\n\nThe live channel subscribe depends on none of these; it is broker-enforced via `sub.allow`, so\nself-serve live join works with no host present; only the durable backstop and its membership writes\nrequire a privileged host. None of these profiles is ever issued to ordinary agents. On the v0.4\nendpoint surface, every host profile's grant rows are **generated from the \xA713.9 ownership matrix**\n(matrix \u2192 grants, never the reverse): a profile with no matrix row holds no `ep*`, `$O.`, or\ncontrol-surface `$JS.API` authority, and `provision.ts` (`permissionsFor`) is the generated artifact\nthis appendix summarizes, not an independent authority. This appendix spells out the `agent`,\n`observer`, and `admin` profiles that make up the wire-facing security claim.\n\n## Appendix C: Normative references\n\n| Reference | Used for |\n| --- | --- |\n| RFC 2119, RFC 8174 | requirement keywords |\n| RFC 8259 | UTF-8 JSON envelopes (\xA75) |\n| RFC 4648 | base32 instance-id encoding (\xA72) |\n| RFC 8032 | Ed25519 keypairs behind nkeys (\xA72) |\n| [NATS client protocol](https://docs.nats.io/reference/reference-protocols/nats-protocol) + [JetStream](https://docs.nats.io/nats-concepts/jetstream) | the v0 transport binding (\xA78) |\n| [NATS decentralized JWT auth](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/jwt) + nkeys | identity and authorization (\xA72, \xA79) |\n\n## Appendix D: Change log\n\nNormative revisions of this document, newest first. Dated snapshots per \xA711; the wire\n`protocolVersion` is the compatibility signal, not these dates.\n\n| Date | Revision |\n| --- | --- |\n| 2026-07-19 | **v0.4 amendment continuation: retirement cleaner inventory is discovery-only.** The terminal retirement barrier no longer accepts a caller-supplied `(endpoint, pools)` hint: the per-op cleaner and settlement-executor pool set is now DISCOVERY-ONLY, exactly the retiring lifecycle's accepted `oblig.<uid>.>` pool routes discovered from the just-drained obligation set. This SUPERSEDES the round-11 optional-hint clause (the 2026-07-15 row): the hint was a TRUSTED ADDITIVE AUTHORITY input that would mint a bounded per-op credential for a pool with no backing obligation, and the despawn rail never exercised it (always an empty hint), so it was grant-widening surface with no production caller. Every grant now scopes to exactly the pools the target holds accepted work on, and the \xA713.9 residuals cover only those discovered pools. The intent's `endpoints` field is removed from the closed operation-intent schema; a pre-change durable intent that still carries it fails the closed-schema check on resume (the v0.4 hard-cut window, where a clean broker holds none). |\n| 2026-07-16 | **v0.4 amendment continuation: connect-arm deny-new (production activation R1).** Every bearer carries its incarnation's root credential id (`act.credentialId`); the exchange mints the root credential RELEASE-LAST (active `cred.` row durable, gate finalize, lifecycle-head current-root CAS, bearer bytes last) and the connect authority requires the LIVE row (leader-served from the shape-proved primary auth store, re-proved on every rebind) plus root head equality, so revoking the row denies the next connect and a superseded or crash-orphaned root issuance never authenticates. The root credential is **incarnation-wide** (ratified): one row per incarnation, re-stamped (the same id) every exchange for its 90d life, never a fresh id per exchange, so one revoke denies every bearer of the incarnation, and a crash after the head CAS re-exports the same id by design (nothing unobserved to revoke; the only pre-release crash window is a durable unstamped row, denied by head equality). The authority store shape proof binds the stream to the actual KV bucket (exactly the one `$KV.<bucket>.>` subject + durable file storage, in addition to the primary/un-mirrored/non-evicting/`allow_direct` flags) at every bind and at boot ensure. Claimless bearers, revoked/expired/absent rows, and an unreadable authority store deny outright (no file-only fallback; a failed reader-credential renewal downs the reader immediately and denies). The head's current-root stamp moves only ABSENT to value: root rotation without the full family-revoke barrier is refused structurally. Named R1 residuals: a same-alias re-grant while the predecessor incarnation is live refuses the exchange (production issuance runs no takeover barrier yet), and the auth service's reader/mint-writer are seed-signed infra credentials (revoked by service stop or signing-seed rotation) pending the ledgered infra-mint family. |\n| 2026-07-16 | **v0.4 amendment continuation: retirement settlement authority split.** A seventh round (an independent cold read on the landed barrier plus the panel's authority ruling) split terminal pool cleanup across two profiles: the bounded cleaner keeps ONLY bind-scoped fetch, leader-served EPF terminal-observe reads, and ACK (its former own-pool `wrk` terminal-forge residual is REMOVED with the grant; its remaining residuals are terminal-free ACK suppression and the space-wide read exposure), while the op-bounded retirement settlement executor (a new \xA713.9 row) owns the intent-closed lease-record CAS and the lease-derived `wrk` terminal publish, carrying the relocated, intent-confined forge residual. Settlement is lease-fenced: an already-settled lease (a crashed owner's `committed`) dominates and is never overwritten. Effects-route completion is a new CLOSED `eff` fact (subject-bound caller and id; `fingerprint` and `sourceSeq` bound to the accepted decision), an action's completion requires the parsed `goal\u2026.result` fingerprint match, and subject presence never proves quiescence. The mediator's obligation-row residual is stated honestly (an operation/header-blind KV publish: valid-terminal overwrite or DEL/PURGE markers, refused loud by readers; the records stream denies stream-API message-delete/purge), and the caller-selected-reply confused-deputy injection residual is named for every raw `MSG.GET`/`MSG.NEXT` profile. |\n| 2026-07-15 | **v0.4 amendment (folds into the in-flight \xA713 revision below): lifecycle and admission fences.** Three-state lifecycle head (`active | retiring | retired`; currency only at `active`; `mappingRevision` = the head key's store revision), space-global never-deleted UID reservation (`uid.<lifecycleUid>`), per-kind issuance-gate operation intents and their allowed-transition sets, the locked terminal barrier order (obligation drain to quiescence before the exact-pool cleaner, both before frontiers), the \xA713.8 authority-head reservation/drain protocol (create-fence + proof-gated admission + per-class decision coordinates + writer\u2260target reclamation), the endpoint-wide admission-policy coordinate (the governance head + `policyRevision`) with drain-gated policy enforcement, the `ep` sentinel for untargeted admissions, and bind-time store shape proofs (\xA713.12). Refined per the re-verify round: the govern head's NORMATIVE policy selector `{ enforcedPolicyKey, enforcedPolicyRevision, pendingPolicy\u2026 }` with a stage/drain/promote mutation order (so the enforced policy is machine-selectable during the drain window), the `self`-class obligation's complete commit intent `{ commitKey, commitBaseRevision, commitValue, commitDigest }` (the pinned BYTES, not just a digest) with deterministic `accepted \u2192 terminal` recovery and full-intent create-join (an accepted-but-uncommitted row never blocks quiescence), the retirement barrier's cleaner-credential revoke + verified-eviction BEFORE any frontier records, the LIMITS-retention bind-time proof (a non-Limits authority store deletes rows on consumer ack), and the runtime gate parse rejecting impossible `retired`-under-takeover/registration state. A second re-verify round added: the head's `lastTakeoverOpId` (the epoch advance stamps the completing op, so a losing concurrent takeover never claims the winner's completion), the immutable revision-addressed admission-policy key (a mutable per-instance slot loses the old revision under history 1 during the drain), the `epgate.principal` and the rule that a ledger row's `holderPrincipal` is ALWAYS a CONNZ-attributable principal (the endpoint NAME forms the `epcred.` key in a separate field, never the eviction target), and the lifecycle barrier's session-pair teardown (a takeover revoking a `session.`-derived credential terminalizes the session and revokes the paired serving row). A third round (a convergent panel + independent cold read) added: the normative immutable `policy` record kind `policy.<endpoint>.<digest-hex>` (self-certifying content-addressed key; the govern selector names exactly this kind, replacing the per-deployment \"versioned key\" allowance), the CLOSED `commitValue` union (`{ enc: \"b64u\", bytes }` exact base64url value bytes, or `{ enc: \"ref\", key }` naming an immutable records key; `commitDigest` = `sha256:<hex>` over the raw value bytes), proof-issuance PAUSE for policy-admitted decisions while a `pendingPolicy\u2026` is staged (which makes the policy drain converge and the after-final-enumeration no-admit rule hold for policy movement), the serving-principal JOIN into the lifecycle barrier's verified-eviction set (a session-pair teardown returns the paired serving row's holder principal and the barrier evicts it before the epoch CAS), and the torn-coordinate takeover guard (the intent capture re-proves head coherence, and the freeze CAS is preceded by a head-currency read, so a stale intent never freezes the winner's reopened gate). A fourth round (a convergent re-verify + independent cold read) added: the drain-window admission pause is now a NORMATIVE step of the \xA713.8 admission algorithm (the mediator's create-fence AND post-create recheck leader-read the govern head and refuse a policy-admitted decision while a `pendingPolicyKey` is staged, which also bounds the never-deleted `oblig` set during a long drain), the \xA713.9 matrix records the mediator's govern-head and policy-version read authority, the `policy` kind's immutability is stated honestly as a trusted-writer create-only-CAS invariant backed by read-time self-certification rather than a broker-level update/delete subtraction (KV operations share one subject), and the takeover barrier's crash-boundary recovery COMPLETES containment (revoke + reconcile + verified-evict every family holder) BEFORE it aborts a stale/torn freeze, so a crash after a partial revoke never leaves a revoked credential's connection live. A fifth round (panel + independent cold read on the B2 mediator) refined: `commitDigest` is the RFC-8785 canonical content digest of the committed value, `sha256:<hex>` (not a raw-bytes digest, so it is insensitive to a non-canonical storage stringify), and `commitValue`'s `b64u`/`ref` forms both resolve that same value; the policy publication is content-addressed by the same canonical digest (property-order-insensitive). The session expiry sweep now enumerates a marker-preserving stream read rather than the bucket's `keys()` (which filters DEL/PURGE), so a tombstoned session key is reported as corruption, not silently skipped. The terminal barrier's frontier record is pinned as the `frontier.<lifecycleUid>` kind (\xA713.7: create-only, never deleted, one key per retired lifecycle, recorded once under its own operation's `opId` before the gate/head terminals), and the exact-pool cleaner's `retired` disposition is a first-class `wrk` terminal fact carrying its operation and retiring-target binding. A sixth round (the D14 confinement review) pinned the two mediated-profile grant shapes: the admission mediator's enumeration consumer carries a deterministic (endpoint, connection)-bound name with name-literal CREATE/INFO/MSG.NEXT/DELETE rows (closing the name-wildcard cross-consumer reach; the own-name delete is what keeps the fixed name reusable across filters), both profiles' reply inboxes are connection-scoped (`_INBOX_<connId>.>`, never the account-wide default), and both payload-blind write residuals are named with equal explicitness: the mediator's own-endpoint acceptance-forge and the cleaner's own-pool `wrk` terminal-forge (work suppression or mis-settlement), each confined to its subject-expressible scope. A seventh round (the control-surface sealed-scanner seal) moved the dynamic-enumeration `CONSUMER.CREATE` off every standing/runtime credential (the takeover/retirement/handle-revocation barrier and the session sweep on `cotal_auth_<space>`, and the admission mediator plus the retirement obligation-drain on `cotal_records_<space>`) into dedicated SEALED scanners the trusted process opens for itself and NEVER hands out, because a consumer-create request BODY is not subject-ACL confinable (an extended name+filter grant still admits a `durable_name` + push `deliver_subject` exporter of every current/future row that survives connection close and revocation, nats-server#8274, reproduced live); each scanner is pinned to one literal consumer name under a forced pull/`LastPerSubject`/ephemeral/memory config, bind-verified before use and unconditionally deleted after, its CREATE filter confined to its subtree, space-bonded so a hand-assembled or foreign-space scanner never enumerates, and fence-free by construction (a `LastPerSubject` read carries no upper cutoff, so a same-subject overwrite during the scan is SEEN, not dropped). Its re-verify round hardened the seal from asserted to enforced: the scanner capability handle is immutable once branded (a swapped scan op throws rather than surviving the injection assert; that mutation vector was reachable only from inside the trusted process, the signing-seed residual class, never externally), every scan over a space's literal consumer name serializes process-wide (a second scanner instance can never interleave with a live scan and return a partial enumeration; cross-process duplication remains excluded by the one-authority-plane-per-space composition), every delivered subject is revalidated against the exact requested filter (an out-of-filter delivery from a foreign re-resolution of the literal name is refused loud; a foreign SAME-OR-NARROWER filter remains covered by the one-plane composition, not by this check), the two scanner profiles are explicit \xA713.9 matrix rows whose grant builders the mechanical matrix audit pins as the SOLE dynamic-enumeration `CONSUMER.CREATE` holders on the two authority streams (the provisioner's pre-created full-tail reader durables remain the one other records-stream consumer authority, and the audit pins that complete surface too), and the admission-mediator coordinate stays package-internal until a composition owns the one-records-scanner-per-space injection. An eighth round (the control-surface piece-2/4 wiring) landed: the record-reader provisioning seam is an ALLOWLIST over one canonical authority-def collection (a reader durable's kind must be a registered caller-readable record kind, so every authority-control kind and every unregistered kind refuse, and a dual-token kind whose atomic head is authority admits only a filter strictly deeper than the head, never one that can match or is shallower than the head key); that classification is runtime-frozen and the seam consults a private module-load snapshot, so a post-import mutation cannot remove the guard (the same integrity discipline is applied to every exported security-relevant collection: the baseline grant vocabularies, the credential-lifetime matrix, the session terminal states, the schema profile, and the broker floor are all frozen, and the minting-path consumers read private snapshots). The retirement barrier's cleaner authority is SPLIT into two per-operation credentials: a zero-write cleaner (its residual is terminal-free ACK suppression) and a settlement executor that alone holds the lease-record CAS and the lease-derived `wrk` terminal publish on the intent's exact pools plus the leader-served EPF and records fencing reads its own code path performs (NO EPW read: the settlement path settles or expires through the lease key before any EPW live-entry probe, so that read is unreachable and ungranted); the two are distinct CONNZ principals fenced independently before any frontier records, and the barrier runs settlement on the executor's own connection rather than its standing one. The retirement barrier is the `frontier.<lifecycleUid>` writer (the exact-arity `frontier.*` grant row), and the auth service's boot crash-resume finishes an owed retirement through the assembled deps (a per-endpoint short-lived drain client over the reviewed admission-mediator profile sharing the plane's sealed records scanner, and the per-op cleaner/executor split), fail-closed and loud like the takeover resume. Its re-verify round closed three composition gaps: the barrier now grants `STREAM.INFO` for exactly the CLOSED retirement-frontier stream set (the per-space lifecycle-data streams EPF/EPW/EPE/records, one source feeding both the intent validation and the grant, so a frontier read is never denied on a real broker nor a caller-selected arbitrary stream), the settlement executor drops the unreachable EPW live-entry read (the settlement path settles or expires through the lease key before any EPW probe, so that grant was dead), and the assembled drain completes every settleable obligation but fails CLOSED with an operator-legible frozen-not-lost message on accepted work that needs a confined commit-applier/route-reconciler authority (a scoped boundary whose full mechanics are a separate reviewed slice, never a broad records-write grant bolted onto the drain). A ninth round (the cross-process plane-ownership seal, \xA713.13) closed the last composition assumption the sealed scanners leaned on: at most one authority plane per space now holds them by a broker-visible claim, one exact never-deleted auth-KV `plane` row binding the two non-reconnecting scanner connections' broker identities, taken by create/revision-CAS with the candidates INERT until the win (no scan capability exists before it); a stale `held` row is reclaimed on LIVENESS ALONE (both claimed tuples conclusively absent under a COMPLETE connection sweep, adjudicated by the delivery daemon's closed read-only oracle over the delivery-admin rail; the auth process holds no `$SYS`), with no TTL, no heartbeat, and no sealed-scan-progress bit (a mid-scan crash reclaims; a paused-but-live plane keeps its connections and its ownership); the winner re-validates the claim before AND after every sealed scan (refuse or discard), an owned scanner disconnect fences the plane (invalidate exposure, close the sibling, never a transparent reconnect into a successor's consumer), clean close releases only after the scan clients are down, the three operator refusal faces carry distinct copy (live peer / inconclusive-fail-safe / mid-life fenced stop), and the launcher adds an exclusive-create pidfile belt. Its re-verify round hardened the reclaim and the fence: a `gone` verdict is valid only under the single-nats-server-process boundary, proven per observation from the responding server's own topology declaration in the `$SYS` reply envelope (any cluster self-report, multi-server observation, or missing declaration reads `unknown`; leafnode/gateway-extended accounts and backup-restore-onto-a-fresh-broker are named residuals; multi-server needs an incarnation/roster authority) \u2014 never inferred from which servers replied, which could neither be enforced by reply-counting (a partition shows one responder) nor flipped to require-the-claimed-server's-reply (a restarted server can never reply, the permanent-wedge horn); claim re-validation covers the two pinned scanner tuples (a tuple-only row rewrite is a lost claim); a scanner-death fence is FATAL to the whole authority plane (every authority operation refuses and the service exits loud, never a healthy-looking half-dead plane); the plane credentials' non-expiring boundary is normative (exactly the two non-reconnecting plane connections; every other authority credential keeps short-expiry + renewal); the claim row, connection tuple, oracle-query, and oracle-result schemas are closed exactly (unknown fields refuse, at every level); only successful well-formed CONNZ pages count toward a reclaim sweep (an API error, malformed envelope, non-string cluster declaration, id mismatch, or incomplete page poisons the observation); every sweep's reply inbox carries a per-call nonce (concurrent sweeps cannot cross-complete); the fenced plane's refusals are audience-split (a retryable unavailability to connecting agents, the state-3 restart copy to the operator's log and exit line); and the pidfile belt publishes atomically pre-populated (temp inode + no-overwrite `link(2)`; an empty slot is unpublishable and a pre-protocol one reclaims exactly once). A tenth round (the confined drain repairers) closed the retirement drain's accepted-work boundary functionally: the fail-closed applyCommit/reconcile interim is replaced by two per-op, per-repair principals \u2014 the COMMIT APPLIER (`local.epapl_<opId-hash>`, one exact records-KV publish row, minted only for a key inside the CLOSED self-commit class derived from the canonical frozen kind registry + the commit-path writer metadata, so a forged accepted-self row can never name an authority coordinate into a grant) and the POOL-ROUTE RECONCILER (`local.eprec_<opId-hash>`, one exact EPW item create-publish row, executing only a MEDIATOR-DERIVED closed repair command: the mediator reads and row-binds the durable acceptance decision itself and derives the exact subject + the \xA713.6 canonical acceptance item bytes, now a normative derivation so first enqueues and crash repairs are byte-identical) \u2014 each minted per repair, executed, closed, with the CAS-header and payload-blind residuals named per profile; an accepted self-commit now re-applies (or classifies landed/superseded) and an accepted pool route re-materializes, so a retirement with covered accepted work COMPLETES on resume, and an accepted EFFECTS route with no completion marker terminalizes through the RETIREMENT-CANCEL terminal (\xA713.8 option (i)): the effects completion fact becomes a closed two-member union (ran, or `cancelled: { opId, target }` \u2014 the same identity spine, never a forged success, written only for the retiring target's own acceptances), an action's goal union already carries the first-class `cancelled` state (the retirement attribution rides its digest-bound payload), the cancel publishes CREATE-ONLY on the SAME completion subject so first-terminal-wins is structural in both directions, and a third per-op principal (`local.epcan_<opId-hash>`, one exact completion-subject create row) executes the mediator-derived repair \u2014 so a retirement with in-flight accepted effects work now COMPLETES on resume with a reader-legible cancelled terminal instead of freezing. An eleventh round (the despawn\u2192retirement trigger, the P1 closure) reserved the `auth-admin` control service (SPEC 13.2): the AUTH plane serves the GENERIC \"retire a lifecycle\" operation on the `ctl` grammar's subject-attributed rail (the delivery-admin discipline: broker-ACL caller attribution, bound replies, an unbound reply target dropped before processing), authorized at SERVE TIME by the fresh space-manager-lease holder check (one leader-served read of the manager bucket's single lease key; holder == the subject-attributed requester principal; DEL/PURGE markers and TTL-expunged rows read absent and refuse fail-closed \u2014 never mint-time trust, closing the post-lease-loss window), answering the four-outcome idempotence table in operator vocabulary with every refusal a stated COMPLETE no-op; the space manager triggers it per despawn through an ephemeral request-and-reply-only `retirement-requester` credential with a STABLE per-lifecycle opId (retries, same-name-spawn nudges, and boot resumes converge on one operation), holds the despawned name RESERVED-pending-retirement until the terminal (a same-name spawn refuses legibly and re-drives the request; the in-memory reservation's restart residual is named \u2014 the durable truth is the lifecycle head itself), and the retirement executes through the plane's own reviewed deps over its ONE sealed records scanner. The barrier's terminal cleaner/executor pool set is the operation's EFFECTIVE INVENTORY: the target's accepted `oblig.<uid>.>` pool routes discovered from the just-drained obligation set UNIONED with the intent's OPTIONAL trusted hint (the despawn rail passes none), superseding the round-8 \"intent's exact pools\" enumeration so an empty-hint despawn still settles every accepted pool item before the frontier; the durable-intent hint is a TRUSTED ADDITIVE AUTHORITY input (a hinted pool with no accepted obligation still receives a bounded per-op credential), and the compromised cleaner/executor residuals scope to that whole effective inventory, including any hint-only pool. |\n| 2026-07-10 | **v0.4 binding revision: endpoint control surface (\xA713).** One standardized typed surface for every endpoint (manager, delivery, wrapped third-party servers): class/instance/scatter rails with per-command broker enforcement and an authorization-mode gradient, lifecycle identity (recyclable alias + never-reused lifecycle UID + fenced process epoch, \xA713.1, \xA72/\xA76/\xA78 extensions), versioned envelope with structured errors and signed slots, three delivery contracts (ephemeral, split-key records, untrusted submissions \u2192 mediated canonical facts), verbs call/cast/watch/claim/scatter (claim owner-mediated: workers hold no pool grant), composites (action, checkpoint, guard, capability handle with redemption-pinned `handle`-mode targets, session, virtual endpoints), content-addressed cluster contracts + governed traits + describe, the ownership matrix (incl. exact reader/consumer/ack rows and pinned consumer-name grammars), takeover/retirement revoke-and-evict barriers over the full ledgered credential family (credential ledger, \xA713.1), mediated timer arming (request/armed/fire split with a scheduler-origin fire check), poison quarantine facts, an epoch-pinned record-write ingress plane (`epr`), a single-message digest-subject contract store (`epc`), pre-created pull-only reader consumers (no dynamic reader creates: a create's delivery target is body-set and unconfined), an alias CAS head for lifecycle activation, and receipts and trust anchors. **Hard cut:** deletes the v0 `ctl` rail, `ControlRequest`/`ControlReply`, the `self`/`manager`/`admin`/`delivery-admin` tiers, and the reserved `control.<instance>` subject. `protocolVersion` targets `0.4` at migration completion; `1.0` stays reserved as a later stability declaration. |\n| 2026-07-07 | Documentation revision, no wire change: layered authority statement (schema authoritative for shapes, prose for semantics), document-snapshot policy and this change log (\xA711), reciprocal links to the informative docs. |\n| 2026-07-03 | **v0.3 binding revision: owner+actor identity.** The wire identity becomes the two-token principal `(owner, actor)`: subjects carry the sender as `<owner>.<actor>`, and grants, durables, presence, and `from.id` re-key onto the pair (\xA72, \xA73, \xA76, \xA78, \xA79). The connection nkey remains only the transport credential (the per-connection reply inbox). Adds the per-user-auth authorization grammar and the owner-token format (\xA72, \xA79). Supersedes the single-id grammar. |\n| 2026-06-21 | **v0.3 binding revision: channel live delivery.** Channel live delivery moves from the mediated per-instance live-tail durable to native `sub.allow`-bounded core subscriptions, with an explicit per-channel `live`/`durable` delivery class and the per-member durable backstop (\xA74, \xA77, \xA78); membership moves to a privileged-written registry (\xA77). Supersedes the v0.2 single-durable live-tail. |\n| earlier | v0.2 and before predate change control: the v0.2 contract (single mediated live-tail durable binding) is superseded by v0.3 and kept only in history. |\n"
383
+ "body": "# Cotal Wire Specification\n\n> **Status:** Draft, v0.4 (pre-1.0). This document is the normative wire contract. Libraries\n> (including the reference TypeScript implementation) are thin clients over it; where a\n> client disagrees with this document, this document wins.\n>\n> **Layered authority.** Message *shapes* are defined by the machine-readable schema,\n> [`spec/cotal.schema.json`](spec/cotal.schema.json) (\xA75); this document's prose defines\n> *semantics*: routing, delivery guarantees, presence, authorization, and conformance. For\n> the reference implementation's operator surfaces (the CLI, the `cotal_*` tools), see the\n> [Reference docs](docs/README.md#reference); those describe the TypeScript implementation,\n> not this contract.\n>\n> **Editors:** Cotal maintainers. **Last updated:** 2026-07-19. Changes are tracked in\n> [Appendix D](#appendix-d-change-log); versioning rules are \xA711.\n>\n> **v0.3 binding revision: owner+actor identity.** An instance's wire identity moves from a single\n> id (the connection nkey, used as the sender token everywhere) to a two-token **principal**\n> `(owner, actor)` (\xA72): the human/account owner and the agent actor become distinct routing tokens,\n> so every subject carries the sender as `<owner>.<actor>` (\xA73), and grants, durables, presence, and\n> `from.id` re-key onto the principal (\xA76, \xA78, \xA79). The connection nkey survives only as the transport\n> credential, keying the per-connection reply inbox `_INBOX_<connId>` (\xA72, \xA710); the wire identity and\n> the connection credential are now distinct. Cross-owner **and** same-owner cross-actor forge/read\n> isolation is a normative confinement property (\xA79). `parseSubject` splits the tokens; a well-formed\n> split is necessary but not sufficient: a reader additionally rejects a non-principal owner token\n> (e.g. an old-shape alias carrying a raw nkey) at the surfacing boundary (\xA73, \xA79). The owner-token\n> *format* (`u_` + 26 base32-lower) is normative; its *derivation* from an owner's identity (login \u2192\n> auth callout, or another identity adapter) is a pluggable edge, not fixed by this contract. This\n> supersedes the v0.2/early-v0.3 single-id grammar. As with the live-delivery revision, the advertised\n> wire `protocolVersion` (\xA76, \xA711) is the migration's normative target, not a claim that every surface\n> has cut over.\n>\n> **v0.4 binding revision: endpoint control surface.** Structured command traffic moves from the v0\n> `ctl` control rail to one standardized, typed, discoverable endpoint surface (\xA713): class +\n> instance + scatter rails with per-command broker enforcement, a versioned envelope, three\n> delivery contracts (ephemeral / record / journal), normative composites (action, checkpoint,\n> guard, capability handle, session), content-addressed contracts with governed traits, and\n> lifecycle identity (\xA713.1) extending \xA72/\xA76/\xA78. This is an intentional **hard cut** (\xA711,\n> \xA713.11): the v0 control grammar, envelope, and authority tiers are deleted, not dual-served.\n> The advertised `protocolVersion` targets `0.4` at the completion of this revision's migration;\n> `1.0` remains reserved as a later stability declaration, not part of this revision.\n>\n> **v0.3 binding revision: channel live delivery.** Channel *live* delivery moves from a single\n> mediated JetStream live-tail durable (`chat_<id>`) to native core-NATS subscriptions bounded by\n> `sub.allow`, with durability provided by an explicit per-channel `live`/`durable` delivery class\n> (\xA74, \xA77, \xA78). Join/leave becomes a direct subscribe/unsubscribe with no privileged mediation,\n> and channel membership moves off consumer topology to a privileged-written registry (\xA77). This\n> supersedes the v0.2 single-durable live-tail. The reference implementation migrates additively\n> (the legacy durable and the new core-sub path coexist behind `id` dedup until the legacy path is\n> removed), but that migration path is not itself normative. The advertised wire `protocolVersion`\n> (\xA76, \xA711) stays `0.2` until the core-sub behaviour ships; this revision is the normative target the\n> migration converges to, and the additive `deliveryClass` field is backward-compatible meanwhile.\n\nThe key words MUST, MUST NOT, REQUIRED, SHALL, SHOULD, SHOULD NOT, MAY, and OPTIONAL in\nthis document are to be interpreted as described in [RFC 2119](https://www.rfc-editor.org/rfc/rfc2119)\nand [RFC 8174](https://www.rfc-editor.org/rfc/rfc8174).\n\nSections 3 to 7 define the transport-agnostic Cotal contract. Sections 8 to 10 define\nthe NATS + JetStream binding (v0). A conformant deployment implements one binding; the\nNATS binding is the only one defined today. External specifications this document relies on\nare listed in Appendix C.\n\n---\n\n## 1. Scope and terminology\n\nCotal is a wire interface for software, especially AI agents, to coordinate in real time\nas lateral peers in a shared pub/sub space, not as nodes in an orchestrator tree.\n\n- **Space**: an isolated coordination context. One space is one tenant boundary; messages\n in one space are not visible in another. NATS binding: one space = one account.\n- **Instance**: a connected participant, identified by a stable **instance id**. Also called\n an endpoint.\n- **Agent node**: an instance whose `kind` is `agent`, versus a plain `endpoint` such as an\n observer, logger, or dashboard.\n- **Peer**: any other instance in the same space.\n- **Channel**: a named multicast topic within a space, dotted and hierarchical.\n- **Service**: an anycast role reached by name (`svc`, \xA74).\n- **Endpoint (control surface)**: a daemon that registers a service identity, publishes\n typed contracts, and serves commands on the endpoint rails (\xA713).\n- **Broker**: the message router for a space. v0 assumes a single trusted broker.\n- **Delivery message**: a multicast, unicast, or anycast `CotalMessage`.\n- **Endpoint request**: a typed request/reply command addressed to an endpoint class or\n instance on the `ep` rails (\xA713). The v0 `ctl` control rail is deleted (\xA713.11).\n\n---\n\n## 2. Identity\n\nAn instance's wire identity is a **principal** = a pair of routing tokens `(owner, actor)`:\n\n- **`owner`**: the account that owns the instance: the human (or organization) an agent acts on\n behalf of. In an authenticated deployment it is a derived **owner token** (`u_` followed by 26\n base32-lower characters), a namespaced, nkey-disjoint token deterministically derived from the\n owner's stable identity (e.g. an IdP subject) by the deployment's identity adapter; the wire\n contract fixes the token *format*, not the derivation mechanism, which is a pluggable edge. In open\n dev mode the owner is the literal `local`.\n- **`actor`**: the instance's own handle within that owner (its agent id). Distinct actors under one\n owner are distinct principals and are confined from one another (\xA79), so one human's two agents\n cannot forge or read as each other.\n\nEach token is sanitized to `[A-Za-z0-9_]` (see \xA73) with `-` additionally reserved as the form\nseparator, so a principal has two unambiguous serializations: the **dot-form** `<owner>.<actor>` and\nthe **dash-form** `<owner>-<actor>`. The same principal MUST appear identically as: the\n`AgentCard.id` (\xA76, dot-form), the sender tokens in subjects (\xA73), the message `from.id` (\xA75,\ndot-form), the presence key (\xA76, dot-form), and the per-instance durable names (\xA78, dash-form).\n\n**The principal is distinct from the connection credential.** In the authenticated NATS binding the\nconnecting user is still an Ed25519 nkey (base32, 56 chars, prefix `U`, e.g. `UAQG...`), stable for\nthe lifetime of the connection, but it is **not** the wire identity. The nkey authenticates the\ntransport and scopes only the per-connection reply inbox `_INBOX_<connId>.>` (\xA710); the principal\nthat keys every subject, grant, and durable is carried by the minted grant, not by the nkey. This\nseparation is what lets a login (\xA79) mint a fresh connection whose nkey the client never sees while\nthe principal stays stable across reconnects.\n\n- A client that authenticates with a static credential MUST adopt the principal that credential's\n grant names; if a principal is also set explicitly (via the card) it MUST match, else the client\n MUST fail before publish.\n- A client that authenticates through the auth callout (user mode, \xA79) cannot know its connection\n nkey before connecting, so it chooses its own reply-inbox nonce (`connId`) and derives its\n principal from its bearer; the broker's minted grant, not the client's self-read, is the\n boundary.\n- Open dev mode MAY use `local` as the owner and an opaque stable actor, but open mode is outside\n the security claims in \xA79 and is not a conformant authenticated deployment.\n\nFuture binding, not v0: portable `did:key` identity plus signed envelopes so authenticity\nsurvives an untrusted relay. See the threat model in [docs/security.md](docs/security.md).\n\n---\n\n## 3. Subject layout\n\nEvery wire subject is rooted at `cotal.<space>`. `<space>` and every routing token are\nsanitized: any character outside `[A-Za-z0-9_-]` maps to `_`. Sanitization is lossy; tokens\nMUST NOT be decoded back into display names.\n\nThe **sender** of every delivery is a principal (\xA72), carried as **two adjacent tokens**\n`<owner>.<actor>`. Routed kinds (`inst`) also carry the recipient principal as two tokens.\n\n| Purpose | Subject | Sender tokens | Delivery |\n| --- | --- | --- | --- |\n| Multicast | `cotal.<space>.chat.<owner>.<actor>.<channel...>` | 3\u20134 | \xA74 multicast |\n| Unicast | `cotal.<space>.inst.<recipOwner>.<recipActor>.<sndOwner>.<sndActor>` | 5\u20136 | \xA74 unicast |\n| Anycast | `cotal.<space>.svc.<role>.<owner>.<actor>` | 4\u20135 | \xA74 anycast |\n| Endpoint rails | `cotal.<space>.ep.<one\\|all\\|inst\\|reply>.\u2026`, `cotal.<space>.ep<c\\|e\\|f\\|j\\|r\\|t\\|w\\|s>.\u2026` | see \xA713.2 | \xA713 control surface |\n| Trace | `cotal.<space>.trace.<instance>` | n/a | reserved |\n\nToken indexing is zero-based on `subject.split(\".\")`: `cotal` = 0, `<space>` = 1,\n`<kind>` = 2. The sender principal is recovered as the dot-form `<owner>.<actor>` (= the message\n`from.id`, \xA75), so a guard comparing `from.id` to the subject sender uses one value.\n\n**Two-token sender, and its asymmetry.** A reader MUST locate the sender by kind:\n\n- `chat`: sender owner at token 3, actor at token 4; the channel is everything after, tokens 5+,\n so it may be hierarchical (`team.backend`).\n- `svc`: route target at token 3; sender owner at token 4, actor at token 5.\n- `ep`: per-mode arities with the caller as the trailing identity tokens; \xA713.2 defines them.\n- `inst`: recipient owner+actor at tokens 3\u20134; sender owner+actor at tokens 5\u20136.\n\nThe two-token sender is what lets a native publish grant **forge-lock** the sender suffix (e.g.\n`inst.*.*.<myOwner>.<myActor>` permits a DM to anyone but only *as me*), so the broker enforces\nsender authenticity and a receiver need not re-verify a payload claim. A subject that does not match\none of these shapes (wrong prefix or wrong per-kind arity) MUST be treated as having no sender and\nMUST NOT be read as a delivery. `parseSubject` **splits only**: it recovers the tokens but does not\nvalidate that `<owner>` is a well-formed owner token; trust comes from the broker's forge-locked\ngrant, and a reader that surfaces content additionally rejects a non-principal owner token at the\nsurfacing boundary (\xA79). Reference implementation: `parseSubject` in\n`packages/core/src/subjects.ts`.\n\n**Channel tokens.** A channel is dotted; each segment is sanitized. The literal wildcards\n`*` and `>` are preserved only as whole segments for subscription and allow-list patterns;\n`>` is valid only as the final segment. A publish target MUST be concrete, with no `*` or\n`>`; a subscription MAY be wildcard.\n\n**Reserved prefixes.** Application messages MUST NOT use subjects beginning with `$JS.`,\n`$KV.`, `$SYS.`, `$O.`, or `_INBOX.`. (`$O.` is the Object Store data/meta subject prefix\nper ADR-20, `$O.<bucket>.C.>` / `$O.<bucket>.M.>`; `OBJ_<bucket>` is a stream NAME, not a\nsubject prefix.)\n\n---\n\n## 4. Delivery modes\n\n| Mode | Routing field | Semantics |\n| --- | --- | --- |\n| multicast | `channel` | delivered to every subscriber of the channel |\n| unicast | `to` | delivered to the named instance's inbox |\n| anycast | `toService` | delivered to one consumer of the named role |\n\nExactly one of `channel`, `to`, or `toService` MUST be set on a `CotalMessage` (\xA75).\n\n**Authenticated delivery kind.** A receiver MUST derive \"how was this addressed to me\"\nfrom the delivering subject kind (`chat` -> `channel`, `inst` -> `dm`, `svc` ->\n`anycast`), not from payload routing fields, which are advisory. (\"Delivery kind\", the\naddressing axis, is distinct from a channel's `live`/`durable` **delivery class**, \xA77.) A peer can put your id in\npayload `to`, but cannot publish on your private unicast subject. Reference:\n`MessageMeta.kind`.\n\n**Delivery guarantee: `live` and `durable` classes.** Channel delivery has two classes, fixed\nper channel and wire-observable (\xA77); the guarantee is defined here, its NATS realization is the\nbinding in \xA78. A receiver MUST derive its effective class from channel config (\xA77), not from\nper-message metadata (`MessageMeta` need not carry it); it MUST NOT assume one class.\n\n- **`live`** is native broker-subscription delivery and is **at-most-once**: a message reaches\n only the instances subscribed to the channel at publish time. An instance that is disconnected,\n busy, or not yet joined does not receive that message live and has no claim to the live copy\n later. There is no per-subscriber redelivery of the live copy.\n- **`durable`** is `live` plus a per-subscriber durable backstop and is **at-least-once for\n current members within retention**: the message is also retained for each member and delivered on\n that member's next connection or turn, remaining pending until acked. A crash or `ack_wait` expiry\n redelivers the durable copy. At-least-once is bounded by the channel's retention / `replayWindow`\n (\xA77): a message evicted by retention before ack may be lost; the guarantee is not unbounded.\n\nUnicast (`to`) and anycast (`toService`) are at-least-once via their own DM/TASK consumers (\xA78);\nthey have no channel membership and are not subject to the per-channel delivery-class mechanism. An\n`@mention` (\xA75) on a `live` channel additionally writes a durable copy to each mentioned target\n**authorized to read that channel** (its `allowSubscribe` covers the channel), so an authorized but\noffline target still receives it; an `@mention` MUST NOT deliver channel content to a target outside\nits read ACL. Durable mention routing resolves each lowercased name to a unique current instance id\nfrom presence at publish time; an ambiguous (multiple live matches) or unresolvable name yields no\ndurable copy, and authorization is checked against the resolved id's current `allowSubscribe`. A\ntarget authorized for a channel is **mention-reachable** there whether or not it is currently joined; this is intentional (an `@mention` can pull an authorized peer in) and is distinct\nfrom membership; a client SHOULD distinguish \"joined\" (actively subscribed) from \"readable /\nmention-reachable\" (in `allowSubscribe`) so an unjoined channel is not treated as \"cannot reach me\nhere.\"\n\nA message delivered both live and durable is **one logical delivery**: receivers MUST deduplicate\nby `id` across classes (\xA78); the durable copy owns ack/commit; and a previously seen `id` MUST NOT\nbe treated as authorization for a later durable copy (for example one that arrives after a leave).\nReceivers MUST tolerate the `live` gap and rely on the `durable` backstop for catch-up on\n`durable` channels. Malformed JSON, spoofed sender payloads, and unparseable delivery subjects are\npermanent anomalies and MUST be terminated, not retried.\n\n**Ordering.** Cotal does not define global ordering across modes, channels, or consumers.\nImplementations MUST NOT depend on cross-subject ordering. Per-consumer delivery is ordered\nby the backing stream except where redelivery or explicit backfill interleaves older\nmessages.\n\n---\n\n## 5. Envelopes\n\nDelivery messages are UTF-8 JSON objects with this shape (`CotalMessage`):\n\n| Field | Type | Req | Notes |\n| --- | --- | --- | --- |\n| `id` | string | MUST | unique message id; NATS binding also uses it as `Nats-Msg-Id` |\n| `ts` | number | MUST | epoch ms |\n| `space` | string | MUST | space name |\n| `from` | `EndpointRef` | MUST | `{ id, name, role? }` |\n| `channel` | string | one-of | multicast target |\n| `to` | string | one-of | unicast target instance id |\n| `toService` | string | one-of | anycast target role |\n| `mentions` | string[] | MAY | lowercased peer names; wakes the mentioned peer. On a `live` channel it also routes a durable copy to each mentioned target authorized to read that channel (\xA74); it never delivers content outside the target's read ACL and is not a routing substitute for `channel`/`to` |\n| `parts` | `Part[]` | MUST | content |\n| `replyTo` | string | MAY | id of the message replied to |\n| `contextId` | string | MAY | thread/conversation correlation id |\n\n`Part` is one of the two core shapes, or an extension object whose `kind` is namespaced\nas described in \xA711:\n\n- `{ \"kind\": \"text\", \"text\": string }`\n- `{ \"kind\": \"data\", \"data\": <any JSON value> }`\n- `{ \"kind\": \"<reverse-DNS extension kind>\", ... }`\n\n`EndpointRef` is `{ \"id\": string, \"name\": string, \"role\"?: string }`.\n\nOn receive, a client MUST verify `from.id` equals the subject sender (\xA73). On mismatch, a\nmissing `from`, or an unparseable delivery subject, the message MUST be rejected and never\nredelivered.\n\nEndpoint requests and replies (the control surface) use the versioned typed envelope of\n\xA713.3 (`EndpointRequest`/`EndpointReply`); they are not Cotal delivery messages. The v0\n`ControlRequest`/`ControlReply` shapes are deleted (\xA713.11).\n\nReceivers MUST ignore unknown object fields. Unknown conformant extension `Part.kind` values\nMUST be ignored unless the receiver explicitly supports that extension. Bare unrecognized\ncore-kind values are not conformant. Messages MUST fit the broker's configured maximum payload.\nv0 has no artifact transfer part; large payload transport is reserved for a future Object Store\nextension.\n\n**Schema.** The JSON Schema (draft-07) at\n[`spec/cotal.schema.json`](spec/cotal.schema.json) is **authoritative for message shapes**:\na conformant delivery message MUST validate against it, and where this document's field\ntables and the schema diverge on a shape, the schema wins. Delivery *semantics* (routing,\nguarantees, rejection) are defined by this document's prose. The schema is generated from\nthe reference source, [`packages/core/src/types.ts`](packages/core/src/types.ts)\n(`pnpm gen:schema`), and committed; the published copy lives at\n`https://docs.cotal.ai/cotal.schema.json`.\n\n**Rejection reasons.** The three permanent anomalies in \xA74 are terminated, never redelivered.\nThese reason tokens are advisory (for logs and error surfaces); the action is uniform:\n\n| Reason | Trigger |\n| --- | --- |\n| `malformed-subject` | the delivery subject does not parse (\xA73) |\n| `sender-mismatch` | `from` is missing, or `from.id` does not equal the subject sender (\xA75) |\n| `malformed-json` | the payload is not valid UTF-8 JSON |\n\n---\n\n## 6. Presence and discovery\n\nPresence is a per-space directory keyed by instance id. NATS binding: JetStream KV bucket\n`cotal_presence_<space>` (\xA78).\n\n`Presence`:\n\n| Field | Type | Req | Notes |\n| --- | --- | --- | --- |\n| `card` | `AgentCard` | MUST | identity record |\n| `status` | `PresenceStatus` | MUST | `idle`, `waiting`, `working`, or `offline` |\n| `activity` | string | MAY | freeform current activity |\n| `attention` | `AttentionMode` | MAY | global attention mode: `open` \\| `dnd` \\| `focus`. Advisory observability; `open`/absent \u21D2 receives everything. Reset: `open` published on `SessionStart`, removed on the offline sweep |\n| `lifecycleUid` | string | MUST in auth mode from v0.4 | the current managed-lifecycle UID (\xA713.1); distinguishes a live instance from a same-name successor. Advisory for display; authority checks use the trusted lifecycle mapping, not presence |\n| `channelModes` | `Record<string, ChannelMode>` | MAY | per-channel attention overrides (`ChannelMode` = `quiet` \\| `muted`), keyed by concrete channel name. Advisory, **not** access control (the broker still authorises and delivers); a receive-side preference, reset on restart |\n| `ts` | number | MUST | epoch ms of last heartbeat |\n\n`AgentCard`:\n\n| Field | Type | Req | Notes |\n| --- | --- | --- | --- |\n| `id` | string | MUST | instance id (\xA72) |\n| `name` | string | MUST | display name |\n| `kind` | `agent` or `endpoint` | MUST | participation class |\n| `role` | string | MAY | service role |\n| `description` | string | MAY | one-line summary |\n| `tags` | string[] | MAY | capability tags |\n| `skills` | `AgentSkill[]` | MAY | `{ id, name, description? }` |\n| `meta` | object | MAY | free-form display metadata; reserved keys include `connector` (host harness name) and `model` (pinned model), both advisory only |\n| `protocolVersion` | string | MUST from v0.4 | wire version spoken (\xA711); `\"0.4\"` for this revision. Advertisement is the marker at the v0.4 reachability boundary (\xA713.11): a participant that omits it is pre-0.4 (omission means the pre-0.4 line, where the field was optional) and MUST NOT be addressed on the `ep` rails. A change signal, not negotiation |\n\nAn instance MUST refresh its own presence entry on the heartbeat interval, default 2000 ms.\nThe liveness window defaults to 6000 ms. A peer whose `ts` is older than the liveness window\nis considered `offline`.\n\nLive clients MUST NOT heartbeat as `offline`. A graceful disconnect MAY publish one final\n`offline` presence record. Observers MUST also derive `offline` from stale timestamps and\nfrom KV delete/purge events. Offline peers MAY remain in local rosters for observability.\nAn instance MUST write only its own presence key, and the key MUST equal `card.id`.\n\n---\n\n## 7. Channels\n\nA channel is addressable as soon as it is published to. Channel config is optional and lives\nin the per-space registry bucket `cotal_channels_<space>`, keyed by the concrete channel\ntoken.\n\n`ChannelConfig`:\n\n| Field | Type | Notes |\n| --- | --- | --- |\n| `replay` | boolean | history replay-on-join; overrides the space default |\n| `replayWindow` | string | backfill horizon matching `^\\d+(s\\|m\\|h\\|d)$`, e.g. `\"24h\"` |\n| `deliveryClass` | `live` \\| `durable` | per-channel delivery class (\xA74); overrides the space default |\n| `description` | string | one-line purpose; max 200 chars |\n| `instructions` | string | advisory usage text; max 2000 chars |\n\nSpace-wide defaults (`ChannelDefaults`: `replay?`, `replayWindow?`, `deliveryClass?`) live under\nthe reserved key `=defaults`. Effective replay is `channel.replay ?? defaults.replay ?? true`.\nEffective delivery class is `channel.deliveryClass ?? defaults.deliveryClass ?? \"durable\"`.\n`defaults.deliveryClass` MUST be written at space creation from the deployment profile\n(local/self-hosted \u21D2 `durable`, persistence on by default; public/web-scale \u21D2 `live`, durability\nopt-in per channel), so the effective default is always discoverable on the wire, never inferred\nfrom out-of-band context. The same effective config MUST be the single source of truth for live\njoin, durable fan-out, history read, and membership surfacing; an implementation MUST NOT resolve\nthe class differently in different paths.\n\nJoin subscribes the instance to the channel; leave unsubscribes it. A join target MUST be within\nthe instance's read ACL (`allowSubscribe`, \xA79); a join outside it MUST be refused by the broker on\nsubscribe. A client MUST NOT publish to wildcard channels, but a wildcard read ACL (`team.>`)\nauthorizes subscribing to any one concrete channel under it **without enumerating channels in\nadvance**. In the NATS binding, join is a native `sub.allow`-bounded core subscription to the\nchannel subject and leave is the corresponding unsubscribe; **no privileged mediation is\nrequired**: the broker enforces every subscribe against `sub.allow`, so an instance whose ACL\npermits a channel joins and leaves it on its own, with no manager present. Open mode behaves the\nsame (the client subscribes directly). Leaving the last channel is permitted: under the core-sub\nbinding an empty subscription set subscribes to nothing (the v0.2 \"empty filter subscribes to all\"\nhazard and its last-channel-leave refusal were artifacts of the multi-filter durable and no longer\napply). On a `durable` channel, join additionally establishes durable membership, a separate\n**privileged** step: the instance requests durable membership from the server-side delivery daemon (a\ndurable-join command on the `delivery` endpoint, \xA713, carrying the channel and its captured join\ncursor) and the daemon writes the membership record. This is decoupled from the live subscribe, so a self-serve live join never depends\non it: a `durable` channel still delivers live with no privileged writer present, and only its\ndurable backstop requires one. A locally created subscription that the\nbroker later refuses (the permission violation is asynchronous in the NATS binding) is NOT a\nsuccessful join: an instance MUST treat a join as effective only once the broker has accepted the\nsubscribe, and MUST drop the channel from its joined set on a late refusal (\xA712). Leave removes the\nmembership (see membership below).\n\nReplay / catch-up on join:\n\n1. Record the channel join watermark (the CHAT frontier) before the subscription is active, so\n live tail and backfill do not double-deliver.\n2. Subscribe to the channel subject (`sub.allow`-bounded; \xA78). The live copy now flows.\n3. If effective replay is on, read retained messages for that channel up to the watermark,\n through a single-channel history read bounded by the current read ACL (`allowSubscribe`, \xA78),\n optionally limited by `replayWindow`. History is ACL-bounded, not membership-gated: an ACL-holder\n may read a channel's retained content whether or not it is a current member (it could self-join\n and read regardless), so the confidentiality boundary here is the ACL, consistent with the live\n read.\n4. Surface backfilled messages with `MessageMeta.historical = true`.\n5. Deduplicate by `id` across the live tail, the backfill, and (on `durable` channels) the durable\n backstop, so a message surfaces once.\n\n`replay=false` is noise control, not confidentiality. CHAT history is readable only within an\ninstance's read ACL (`allowSubscribe`, \xA79); confidential content MUST use DM or anycast.\n\nChannel membership governs **durable-delivery inclusion** (who receives fan-out copies into their\nper-subscriber backstop) and is broker-known, not self-reported. It is NOT a confidentiality\nboundary tighter than the read ACL: `allowSubscribe` bounds what content an instance may read (live\nand history, \xA79), and an ACL-holder can self-join, so membership adds delivery semantics, not read\nconfinement. In the NATS binding, membership is a privileged-written record in the space registry\nplane under a key the agent's profile cannot write (NOT the agent's presence key), carrying per-member\njoin/leave cursors so a publish concurrent with a join or leave orders deterministically; it is NOT\nderived from consumer topology, and an agent MUST NOT self-assert its own membership. It is written by\nthe server-side delivery daemon in response to a durable-join command on the `delivery` endpoint\n(\xA78, \xA713, Appendix B), distinct from and not required by the self-serve live subscribe. The implementation MUST re-authorize every\n**durable-backstop** read of `(instance, channel, message)` against the instance's current read ACL\nand membership before surfacing content, so a channel dropped from the ACL or **left** is no longer\nsurfaced from the backstop: **leave is a hard read boundary for the durable backstop** (it does not\nrevoke the ACL: an instance may still re-subscribe live, or read ACL-bounded history, within\n`allowSubscribe`). Membership remains observability data for liveness/roster purposes and MUST NOT be\nused as a send authorization gate.\n\nOn a `durable` channel, membership carries the member's **join cursor** (the CHAT frontier captured\nat join, the same watermark used to deconflict the live tail and the backfill) and, on leave, a\n**leave cursor/tombstone**. The durable backstop is at-least-once (within retention)\nfor messages whose stream sequence is **> the member's join cursor and \u2264 its leave cursor**, where each\ncursor is the CHAT frontier (the last sequence) captured at that transition; messages published before a\njoin or after a leave are not redelivered as durable and are reachable only via an ACL-bounded history\nread (within `allowSubscribe`). A rejoin takes a new join cursor, so messages published during the gap are not durably\nredelivered. A `durable` join is atomic across its two effects: the instance is durable-joined only\nonce BOTH the broker-confirmed live subscribe AND the membership write have succeeded, and on a late\nsubscribe refusal the membership record MUST be removed. If the live subscribe succeeds but durable\nmembership cannot be established (for example no privileged writer is present), the instance is\n**`joined live` with the durable backstop unestablished**: it MUST NOT be reported as `joined durable`,\nthe live subscription remains active, and the durable shortfall MUST be surfaced as an exceptional\ndelivery state (e.g. `durable backstop unavailable`), never silently.\n\n---\n\n## 8. NATS + JetStream binding\n\nBacking streams are created once at space setup. `STREAM.CREATE` is denied to agents in auth\nmode.\n\n| Stream | Captures | Retention | Required config |\n| --- | --- | --- | --- |\n| `CHAT_<space>` | `cotal.<space>.chat.>` | Limits | file storage, `max_msgs_per_subject=1000`, `discard=Old`, `allow_direct=true` |\n| `DM_<space>` | `cotal.<space>.inst.>` | Limits | file storage, no Direct Get |\n| `TASK_<space>` | `cotal.<space>.svc.>` | WorkQueue | file storage, no Direct Get |\n\nChannel **live** delivery is a native core-NATS subscription to `cotal.<space>.chat.*.*.<channel>`\n(wildcard sender owner+actor) bounded by `sub.allow` (\xA79), not a durable consumer; join/leave is the\nsubscribe/unsubscribe and needs no privileged mediation. The legacy v0.2 `chat_<owner>-<actor>`\nlive-tail durable is removed from this binding (it MAY coexist transiently during migration behind\n`id` dedup, but is not part of the contract).\n\nDurable consumers. Per-instance durables are keyed on the principal's **dash-form** `<owner>-<actor>`\n(a `.` is illegal in a durable name; see \xA72), so a durable name-scopes to exactly one principal:\n\n| Durable | Stream | Filter | Policy |\n| --- | --- | --- | --- |\n| `chathist_<owner>-<actor>-<uid>` | CHAT | one `cotal.<space>.chat.*.*.<channel>` per read | transient single-filter consumer for history reads (join-backfill / focus-recall); created per read scoped to one channel in `allowSubscribe`, then deleted; `AckNone`. History is ACL-bounded by the pinned filter, not membership-gated (\xA77, \xA79) |\n| `dm_<owner>-<actor>-<uid>` | DM | `cotal.<space>.inst.<owner>.<actor>.>` | provisioner-created in auth mode at lifecycle activation; bind only; `DeliverPolicy.ByStartSequence` with `OptStartSeq = activationFrontier + 1`, where the **activation frontier** is the DM-stream's last sequence captured at activation (`0` on an empty stream, so the start is `1`): `ByStartSequence` is inclusive and the lifecycle interval is half-open, so the consumer starts strictly AFTER the frontier, never `All`, which would replay a recycled alias's history and the inactive-gap backlog; `AckExplicit`; `ack_wait=60000ms` |\n| `svc_<role>` | TASK | `cotal.<space>.svc.<role>.>` | provisioner-created in auth mode; bind only; `AckExplicit`; `ack_wait=60000ms`. **Intentionally role-shared, not lifecycle-scoped**: anycast work belongs to the role, and successive holders draining one pool is the contract |\n\nFrom v0.4, each lifecycle's durable state lives in the **half-open interval**\n`(activationFrontier, retirementFrontier]` per stream: consumers start strictly after the\nactivation frontier (`OptStartSeq = frontier + 1`, table above; the frontier is captured\nAFTER any inactive alias gap), and terminal retirement records the\nretirement frontier before the alias is freed, so a successor lifecycle never receives the\npredecessor's pending backlog nor messages published while no lifecycle was active (\xA713.1).\n\nPer-instance durable names use the principal's dash-form `<owner>-<actor>` (both tokens\nfail-loud-validated, not lossily sanitized), so a durable name-scopes to exactly one principal (\xA72).\nThe authenticated wire identity is the principal, not the connection nkey. From v0.4, in auth mode,\nper-instance durable state is additionally **lifecycle-scoped** (\xA713.1): durable consumer names,\npending delivery cursors, membership rows, and ACL/ledger rows key on\n`(principal, lifecycleUid)` (dash-form `<owner>-<actor>-<lifecycleUid>`), terminal retirement\nrecords per-stream sequence cutoffs before an alias is reused, and a same-name successor\ninherits none of its predecessor's pending state: its consumers start after its OWN\nactivation frontier (which is \u2265 the predecessor's retirement cutoff), the cutoffs bound the\npredecessor's interval, they are never the successor's start.\n\n**Durable backstop (\xA74).** The per-subscriber durable copy is a delivery contract, not a pinned\nlayout: each member has a private durable store, written on publish for a `durable` channel's current\nmembers and, for an `@mention` on a `live` channel, for each mentioned target authorized to read that\nchannel (its `allowSubscribe` covers it), so an authorized but offline target still receives it. The\nagent holds **no content-bearing read** on this mixed store. A **trusted reader** (the server-side\ndelivery daemon) pulls each pending entry, re-authorizes `(instance, channel, message)` against the\nmember's **current read ACL** and, for `durable`-channel fan-out entries, its **membership interval**\n(the message's CHAT sequence is `> joinCursor` and `\u2264 leaveCursor`; \xA77), not a current-member boolean,\nso a pre-leave entry stays deliverable and a post-`leaveCursor` one does not,\nand delivers each authorized copy to the member over an **at-least-once** handoff (its own\n`dlv_<owner>-<actor>-<uid>` DELIVER consumer, carrying the same ack semantics, not a fire-and-forget publish). The trusted reader MUST NOT ack or\ndelete the backstop entry until the member has confirmed the copy was surfaced or handled (or it has\nbeen transferred to an equivalent per-member at-least-once mechanism with the same ack semantics); on a\ndownstream nak, timeout, or crash before that confirmation, the entry remains pending and redelivers, so\na crash between the `dlv` handoff and the member surfacing the message cannot lose it, and `durable`\nstays at-least-once end-to-end, not maybe-once. Content\nfor a channel dropped from the ACL, or (for a durable channel) left, is never surfaced (at-least-once for\nthe member within retention; **leave is a hard read boundary for the backstop**); a `live`-channel\n`@mention` copy is delivered and `id`-deduped the same way. The read MUST run in this trusted component\nthe agent cannot bypass, because a self-bound consumer has no server-side per-message ACL/membership\nfilter. The store's stream/subject layout, the fan-out writer, the trusted reader, and the membership\nregistry are reference-implementation, not normative; a conformant deployment MAY realize the backstop\ndifferently as long as the \xA74 guarantee and the \xA79 checks hold.\n\nPublishers MUST publish channel, unicast, and anycast delivery messages through JetStream and set\nthe JetStream message id to `CotalMessage.id` (`Nats-Msg-Id` on the wire). A JetStream publish is\nan ordinary subject publish that the stream also captures, so the same message reaches core\nsubscribers live (\xA74 `live`) and is retained for history and the durable backstop in one publish;\nthe publish path is unchanged from v0.2; only the live *read* moves to a core subscription.\nAck/nak/term semantics apply to JetStream-consumed copies (history, DM, anycast, and the durable\nbackstop): receivers MUST ack only after a message has actually been surfaced or handled, MAY nak\ntransient failures, and MUST term permanently invalid messages. The at-most-once `live` copy is not\nacked.\n\nHistory on join uses the pinned single-filter `chathist_<owner>-<actor>-<uid>` consumer create above, bounded to\n`allowSubscribe`; agents are not granted unfiltered Direct Get. DM and TASK MUST NOT enable Direct Get\nbecause it would bypass the consumer-create deny that is part of the confidentiality boundary.\n\nKV buckets are also streams and are pre-created:\n\n| Bucket | Holds | TTL |\n| --- | --- | --- |\n| `cotal_presence_<space>` | presence (\xA76) | 6000 ms |\n| `cotal_channels_<space>` | channel registry (\xA77) | none |\n| `cotal_membership_<space>` | derived channel-membership feed (below) | none |\n\n**Derived channel-membership feed (observability).** `cotal_membership_<space>` is a per-agent\n(key = `card.id`) derived view of who is subscribed to each channel: the **union** of an agent's\n`live` core-subscriptions (read by a privileged daemon from the broker's connection view) and its\n`durable` memberships (the members registry), each value `{ live: string[], durable: string[],\nobservedAt }` with `live` keeping subscription patterns (wildcards) the consumer expands at read time.\nIt exists so an observer can show silent readers and `live`-channel membership without a broker-admin\ncredential in the dashboard tier; it is written by a scoped privileged daemon and read by the\nadmin/observer profile only. It is **DISPLAY-ONLY and broker-derived**: it MUST NOT be an input to any\ndelivery, ACL, or authorization decision (authority for those stays the broker's `sub.allow` and the\nmembers registry), and it is not part of the normative wire contract a client must implement.\n\n---\n\n## 9. NATS + JetStream security and authorization\n\n**On by default.** A space is provisioned with decentralized JWT auth. Open unauthenticated\ndev mode is available but out of scope for the security claims here. *(Informative\noperator-facing views of this section: [docs/identity-and-auth.md](docs/identity-and-auth.md),\n[docs/channels-and-permissions.md](docs/channels-and-permissions.md); the threat model is\n[docs/security.md](docs/security.md).)*\n\n- **Account = space, user = agent.** A space is one NATS account. The **broker's** operator signs\n the account; an account signing key mints per-agent user JWTs. A broker (one nats-server trust\n root: one operator, one system account) MAY host several spaces \u2014 one account per space, every\n account signed by that one operator. Broker trust is therefore per-broker, never per-space: a\n space owns only its own account and references the broker's operator, and rotating or replacing\n broker trust is intrinsically broker-wide - it affects every tenant on the broker at once and\n cannot be scoped to a single space.\n- **Profiles are default-deny allow-lists.** Subject, stream, durable, and KV names are built\n from the same builders as \xA73 and \xA78. Exact profile shapes are in Appendix B.\n- **An agent's channel scope is three concepts**, each a list of channel names or wildcard\n subtrees (`team.>`): `subscribe`, the active read set, the channels it subscribes to at boot\n (now native core subscriptions; mutable at runtime by direct subscribe/unsubscribe with no\n mediation); it MUST be a subset of `allowSubscribe`. `allowSubscribe`, the read **ACL**, the\n channels it MAY read (default = `subscribe`), minted as native `sub.allow` subscribe grants over\n `cotal.<space>.chat.*.*.<channel>` (wildcards preserved, so an open ACL needs no enumeration) and\n as the matching per-channel history-consumer create grants. `allowPublish`, the post **ACL**,\n the channels it may publish to; **default-deny** (a chat publish grant is minted only for a\n declared channel).\n\nEvery grant below is keyed on the agent's **principal** `<owner>.<actor>` (\xA72), except the reply\ninbox, which is keyed on the **connection** `<connId>`: the connection nkey (static mode) or the\nclient-chosen nonce (user mode, \xA79). This is the one place the wire identity and the connection\ncredential diverge (\xA72): the principal keys subjects/durables/presence; the connId keys the inbox.\n\n| Profile | Application publish | Read surface | Notes |\n| --- | --- | --- | --- |\n| `agent` | own `chat.<owner>.<actor>.<ch>` for each `allowPublish` channel (post ACL, default-deny), `inst.*.*.<owner>.<actor>`, `svc.*.<owner>.<actor>`; endpoint request forms per minted capability (`ep.one`/`ep.all`/`ep.inst` with the capability's authz-mode/target pattern, caller triple `<owner>.<actor>.<uid>` pinned; `describe` by default; `epj` submissions for journaled capabilities; \xA713.9); own presence key | own `_INBOX_<connId>.>` + own endpoint reply rail (`ep.reply.*.*.*.<owner>.<actor>.<uid>.*`, exact arity); channel live tail via native `sub.allow` subscriptions to `chat.*.*.<channel>` per `allowSubscribe` (wildcards preserved); CHAT history via single-filter `chathist_<owner>-<actor>-<uid>` creates, one per `allowSubscribe` channel (ACL-bounded); own lifecycle-scoped `dm_\u2026`/`svc_\u2026` bind-only; durable backstop via own bind-only lifecycle-scoped `dlv_\u2026` DELIVER consumer, **no** grant on the mixed pre-auth fan-out stream; granted record-key/event-topic read subtrees per capability | read bounded by `allowSubscribe`; durable copies re-authorized (current ACL + membership + lifecycle) by the trusted reader before the `dlv` handoff; no Direct Get; DM/TASK/DLV create denied |\n| `observer` | none | chat, CHAT history, presence, channel registry | DMs invisible |\n| `admin` | none | whole space live tap plus DM history | plaintext god-view, opt-in |\n| scoped host profiles | least-privilege per function | least-privilege per function | The former allow-all `manager` is **deleted**; its host duties split into scoped, single-function creds (`supervisor`, `provisioner`, `delivery`, `membership-rw`, `operator`, `purger`, `teardown`, `channel-writer`, \u2026). No allow-all credential exists. Appendix B summarizes them; the concrete grant lists are **generated from the \xA713.9 ownership matrix** into `provision.ts` (the matrix is the single oracle; `provision.ts` is its artifact, Appendix B its summary). |\n\nDM and TASK confidentiality, and the CHAT read boundary, close the leak paths:\n\n1. Replies and pull responses ride a per-connection inbox prefix, `_INBOX_<connId>.>`, which\n `sub.allow` permits alongside the agent's channel read grants (next item) and nothing else. In user\n mode the client picks `<connId>` (a nonce) and the callout scopes the inbox to it, so a\n wildcard-inbox subscribe that would sniff peers' DM deliveries is refused. Re-authorized durable\n copies do NOT ride the inbox; they ride the agent's own lifecycle-scoped `dlv_<owner>-<actor>-<uid>` DELIVER consumer\n (item 5, \xA78).\n2. **Channel live reads are bounded by `sub.allow`.** `allowSubscribe` is minted as native subscribe\n grants over `cotal.<space>.chat.*.*.<channel>` (wildcards preserved); the broker refuses, per\n subscribe, any channel subject outside the ACL. There is no per-channel consumer name to confine,\n so an open ACL (`team.>`, `>`) grants selective single-channel join with no enumeration and no\n read-breakout. A `>` grant is read-all chat in the space by design (credential compromise reads\n all chat), so it suits trusted/local deployments, not least privilege.\n3. A consumer create on the bare/multi-filter subject is not ACL-constrainable, so the provisioner\n pre-creates `dm_<owner>-<actor>-<uid>`, `svc_<role>`, and the per-member `dlv_<owner>-<actor>-<uid>` handoff\n durables. Agents bind their own `dm_\u2026-<uid>`/`svc_<role>`/`dlv_\u2026-<uid>` only (never\n create); the mixed pre-auth fan-out store is read by a trusted reader, not the agent (\xA78, item 5).\n Those bare/multi-filter create forms are not granted to agents (default-deny), with explicit\n create-denies on `DM_<space>`, `TASK_<space>`, and the `DLV` stream; on `CHAT_<space>` the only\n consumer-create an agent holds is the pinned single-filter history create (next item), so a broad\n CHAT create-deny is intentionally absent: it would also deny that pinned create.\n4. CHAT history reads are bounded to `allowSubscribe`: a consumer create on the extended subject\n `$JS.API.CONSUMER.CREATE.<stream>.<name>.<filter>` carries a single filter the server pins to the\n request body, so an agent is granted exactly one such create-subject per `allowSubscribe` channel\n and can read history of no other channel. The unfiltered Direct Get grant is not given to agents.\n5. **The durable backstop is read by a trusted reader, not the agent.** The agent holds no\n content-bearing read on the mixed pre-auth fan-out store; a trusted reader (the server-side delivery\n daemon) MUST re-authorize `(instance, channel, message)` against the member's current read ACL and,\n for `durable`-channel fan-out entries, its current membership, before handing the authorized\n copy off to the member's own lifecycle-scoped `dlv_<owner>-<actor>-<uid>` DELIVER consumer:\n broker ownership of an inbox (\"this is agent A's\") is not authorization, since the store can hold\n messages for channels A has since dropped from its ACL or left, and a self-bound consumer cannot\n filter per-message on membership. Fan-out-on-write is routing, not an authorization check; for a\n durable channel a `leave` is a hard read boundary on the backstop. History/backfill reads are instead\n self-served and bounded by the current read ACL (the pinned single-filter create above), consistent\n with the live read. An `@mention` durable copy is written only to a target authorized to read the\n channel, so `mentions` cannot carry content outside a target's read ACL.\n6. **\"Current read ACL\" is the effective broker-accepted credential.** An ACL narrowing takes effect\n when the credential/permissions are updated and enforced by the broker (re-mint / reconnect /\n revocation), not as an instantaneous global value; until then an existing broad credential remains\n broad. Both the broker `sub.allow` checks and the trusted-reader re-checks are evaluated against that\n effective credential.\n\nThis binding provides containment and authenticity under a single trusted broker: an agent\ncan emit only as itself and only to its declared `allowPublish` channels, and read only its own\nDMs and chat *content* within `allowSubscribe` (and, for `durable` content, its current\nmembership), enforced by the server. It does not provide\nnon-repudiation, does not survive an untrusted relay, and DMs are plaintext to the broker and\nto `admin`. The read bound is on **content**, not metadata: agents hold `STREAM.INFO` on CHAT\n(for the join watermark, the recall drop-marker, and channel-list counts), so a `subjects_filter`\nquery leaks chat subject *metadata* (channel names, sender ids, and per-subject counts) for\nchannels outside `allowSubscribe` (channel names are already public via the registry). Hiding\nthat metadata is deferred strict-containment work. See [docs/security.md](docs/security.md).\n\n**Consumer-delivery confused deputy on the read grants.** A JetStream consumer delivers stored\nbytes to a **caller-chosen destination the broker does NOT confine to the requester's\n`pub.allow`**: a push consumer's `deliver_subject`, and a pull `MSG.NEXT`/`DIRECT.GET`\nrequest's reply subject, are set in the request body and the server's internal client publishes\nthere regardless of the requester's publish permissions. The v0.3 read grants above,\nCHAT-history `CONSUMER.CREATE`, the bind-only DM/DLV/TASK `MSG.NEXT`, and the KV watch creates\n(Appendix B); therefore let an agent redirect content it may legitimately READ onto a subject\nit may NOT publish to: e.g. replay a stored CHAT message whose `from.id` is another sender onto\n`inst.<victim>.<thatSender>`, where the recipient derives the DM sender from the subject and\nsurfaces it as a genuine DM from a principal who never sent it. The \xA713.9 \"Mediated reads\" rule\napplies here: **no untrusted agent holds a raw consumer `CREATE`/`MSG.NEXT` or `DIRECT.GET` on\n`CHAT`/`DM`/`TASK`/`DLV` or the KV buckets**; those reads are served by the trusted\nreader/mediator (\xA78) onto the agent's own confined rail. Which of these read paths require\nmediation and which are provably safe depends on whether a redelivered message retains its\noriginal captured subject and how the receiver's subject-derived kind check (\xA712) then\nclassifies it; the reference implementation determines this by test and pins the exact grants.\nOn the v0.3 rails without this mediation, read containment holds only against a *conforming*\nclient; the broker does not enforce it.\nSee [docs/security.md](docs/security.md).\n\n---\n\n## 10. Connection and onboarding\n\nJoin link grammar:\n\n```text\ncotal://[token@]host[:port]/space[?channel=a,b] plaintext\ncotals://[token@]host[:port]/space[?channel=a,b] TLS required\ncotal://user:pass@host/space user/password auth\n```\n\n- Default port is `4222`.\n- `channel` and `channels` query parameters are equivalent comma-separated channel lists.\n- Credentials in `userinfo` are parsed out and passed to the NATS client as connect options;\n they are not left inside the server URL.\n- Bare `userinfo` with no `:` is a token. `user:pass` is username/password.\n- `cotals://` means `nats://host:port` plus TLS-required connect options.\n- Credentials (`creds`) are mutually exclusive with token and username/password auth.\n- A client MUST set `inboxPrefix` to `_INBOX_<connId>` before any request, pull consumer, or KV\n watch operation, where `<connId>` is the connection identifier (the connection nkey in static\n mode; the client-chosen nonce in user mode, \xA72/\xA79), NOT the owner+actor principal, which the\n client may not know pre-connect.\n\nAuthenticated onboarding has two bindings. **Out-of-band credential minting** provisions a per-agent\ncredential ahead of connect (the static path). **Auth-callout onboarding** validates a user bearer at\nconnect time and mints the scoped data-account JWT then (user mode, \xA72/\xA710): the client presents a\ndeny-all sentinel credential plus its bearer, the callout derives the owner+actor principal and grants,\nand re-binds the connection into the data account. The owner-token *derivation* (how a bearer maps to\nan owner token) is a pluggable identity adapter (any OIDC/IdP via a thin bridge), not fixed by this\ncontract; the callout *mechanism* and the resulting grants are. From v0.4 every minted connection also carries its **lifecycle UID** (\xA713.1): the manager\nmints it for managed agents at provision, and the callout/exchange attaches it as a claim at\nconnect for user-mode connections, so the caller-UID token in every endpoint-rail grant is\nauthority-assigned, never client-chosen. Every bearer additionally carries its incarnation's\n**root credential id** (`act.credentialId`, \xA713.1). The exchange ensures the ACTIVE\n`cred.<lifecycleUid>.<credentialId>` ledger row exists BEFORE the bearer bytes are released\n(the row durable first, the issuance-gate finalize CAS, the lifecycle head's current-root CAS\nlast), and the connect authority proves the presented id against the LIVE row, leader-served\nfrom the shape-proved primary auth store: the row MUST be `active`, unexpired, and bound to the\nconnecting principal and lifecycle, and a root-issued credential MUST additionally equal the\nlifecycle head's current root credential. A claimless bearer, a revoked, expired, or absent row,\nand an unreadable authority store all DENY the connect. The root credential is\n**incarnation-wide**: ONE `cred.<lifecycleUid>.<credentialId>` row per incarnation, re-stamped\n(the same id) on every exchange for the incarnation's lifetime, never a fresh id per exchange.\nRevoking that one row is the per-credential revocation lever and denies EVERY bearer of the\nincarnation at the next connect (deny-new; evicting an already-live connection is the lifecycle\nbarriers' job, \xA713.1). Because the id is incarnation-stable, a crash after the head's current-root\nCAS re-exports the SAME id on the next exchange (that id IS the incarnation's live root, so there\nis nothing unobserved to revoke); the only pre-release crash window is a durable active-but-\nunstamped row, which the head-equality check denies. Rotating an incarnation's root credential is\nexclusively a lifecycle barrier's job, never a bare re-mint. A bearer MAY carry a server-authored\n**view** claim, minted only by the deployment's signed-in human exchange (never accepted from the\nclient or from a managed agent-secret exchange) and re-authorized against the live grant ledger at\nevery connect: the callout then mints the connection as the named elevated profile (Appendix B:\n`admin`, or a scoped host profile such as `purger`, `channel-writer`, `deployer`) instead of `agent`.\n\n---\n\n## 11. Versioning and extensibility\n\n- Wire contract version is v0.2 as advertised today. `AgentCard.protocolVersion` (\xA76) carries\n this string. The two v0.3 binding revisions (channel live delivery and owner+actor identity,\n see the header) and the **v0.4 endpoint control surface** (\xA713) are the normative targets the\n reference implementation is converging to. The control surface is an intentional **hard\n cut on the pre-1.0 line** (\xA713.11): the v0.3 control grammar and envelope are removed from\n this contract, not dual-served, a breaking revision, permitted pre-1.0, shipping under an\n explicit new version marker per this section's rule; the marker is the disjoint endpoint\n subject grammar and versioned envelope. The advertised `protocolVersion` bumps to `0.4` when\n the control-surface migration completes (one campaign, one merge); a version string is not a\n per-surface cutover claim. **`1.0` is deliberately deferred**: it is a stability declaration\n to outside implementers, made separately once the contract has settled (further pre-1.0\n arcs (presence/addressing, multi-space, federation) may still break the wire). **The wire `protocolVersion`\n is the compatibility signal**; dated document snapshots (below) are navigation artifacts, not\n negotiation; an implementation MUST NOT treat a document date as an interop key.\n- v0 has no in-band capability negotiation. Deployments MUST agree on the binding and\n version out of band. A participant advertises the version it speaks via\n `AgentCard.protocolVersion` (\xA76) as a one-way change signal, optional before the v0.4\n marker, MUST from v0.4 (\xA76, \xA713.11); v0 defines no behavior on a mismatch beyond rejecting\n messages it cannot parse.\n- New message families, subjects, and routing kinds are added in the core contract,\n generalized for all deployments, not in one example.\n- Receivers MUST ignore unknown object fields and MUST NOT treat an unknown field as an\n error.\n- A future v1 MUST either keep v0 subjects backward-compatible or use an explicit new\n version marker in subjects, credentials, or deployment config.\n\n**Document snapshots.** Published revisions of this document are dated snapshots\n(`YYYY-MM-DD`, the **Last updated** date above): the current revision is canonical, and a\nsuperseded one stays retrievable from the repository history (the git history and tagged\nreleases of `SPEC.md`), so a client built against it can still be audited. The snapshot\ndate advances on any normative change; the wire `protocolVersion` moves only per the\nchange process below.\n\n**Change process.** This document is the change-control point: a change lands here first,\ngeneralized into `core`, and the reference implementation follows. Additive changes (a new\noptional field, a new namespaced `Part.kind`, a new subject) are backward-compatible and ship as\na minor bump, since receivers ignore what they do not recognize. Changing the meaning of an\nexisting field or subject, or removing or renaming one, is breaking. **Pre-1.0**, a breaking\nchange ships as a minor bump of the v0.x line under an explicit new version marker in\nsubjects, credentials, or deployment config (the v0.4 endpoint grammar is such a marker);\n**post-1.0**, it ships as a major bump. `1.0` itself is a stability declaration, made\ndeliberately and separately from any wire change.\n\n**Extension namespacing.** Core `Part.kind` values, `meta` keys, and `tags` are bare and reserved\nto this spec (`text`, `data`, and future core additions). A non-core extension MUST namespace its\ncustom `Part.kind` values and `meta` keys reverse-DNS, under a domain its author controls, e.g.\n`{ \"kind\": \"com.acme.snapshot\" }` or `meta[\"com.acme.region\"]`; Cotal's own non-core extensions\nuse `ai.cotal.*`. This keeps third-party names from colliding with each other or with future core\nnames, with no central registry.\n\nReserved future work: signed envelopes, `did:key` identity, artifact/object-store parts,\nauth-callout bootstrap tokens, manager profile scoping, and federated/untrusted relay\nbindings. (Revocation/TTL for minted credentials is no longer future work on the control\nsurface: v0.4 defines it normatively via the credential ledger and the lifecycle barriers,\n\xA713.1.)\n\n---\n\n## 12. Conformance\n\n*(An informative build-order walkthrough of this checklist is\n[docs/build-a-client.md](docs/build-a-client.md).)*\n\nA conformant authenticated NATS client MUST:\n\n1. Use one stable principal `<owner>.<actor>` as its wire identity everywhere: subject sender\n tokens (\xA73), `from.id` (\xA75), presence key (\xA76), durable names (dash-form, \xA78); and treat the\n connection credential (nkey) as distinct, keying only its reply inbox (\xA72).\n2. Publish only on subjects whose sender tokens are its own principal `<owner>.<actor>` (\xA73).\n3. Publish delivery messages as UTF-8 JSON through JetStream with `msgID = id` (\xA78).\n4. Set exactly one routing field on each delivery message (\xA75).\n5. Reject any received delivery message whose `from.id` does not match the subject sender, and whose\n subject `<owner>` is not a well-formed principal owner token: a subject that split-parses but\n carries a non-owner in the owner slot (e.g. a raw nkey, an old-shape alias) MUST NOT be surfaced\n as a delivery (\xA73, \xA75).\n6. Derive delivery kind (channel/dm/anycast) from the subject, not payload routing fields (\xA74).\n7. Ack only surfaced/handled messages and terminate permanent anomalies (\xA74, \xA78).\n8. Write only its own presence key on the heartbeat interval (\xA76).\n9. Set the per-instance inbox prefix before transport operations (\xA710).\n10. Treat unknown fields as ignorable (\xA711).\n11. Resolve a channel's effective delivery class (`live`/`durable`) from channel config, not from a\n deployment assumption, and use one resolution across live join, durable fan-out, history read,\n and membership surfacing (\xA74, \xA77).\n12. On a `durable` channel, tolerate the at-most-once `live` gap and catch up via the durable\n backstop; deduplicate by `id` across the live, backfill, and durable copies (\xA74, \xA78).\n13. Join and leave a channel's **live** subscription by subscribing/unsubscribing under `sub.allow`\n with no privileged mediation; treat a live join as effective only once the broker accepts the\n subscribe, and drop it on a late permission refusal. On a `durable` channel, additionally establish\n durable membership via the privileged provisioner; if it cannot be established, report `joined live`\n with the durable backstop unestablished, never `joined durable` (\xA77, \xA79).\n14. Bound history/backfill reads by the current read ACL, and re-authorize every durable-backstop read\n against the current read ACL (and, for `durable`-channel entries, membership) before surfacing\n content, treating a leave as a hard read boundary on the backstop (\xA77, \xA79).\n\nTest vectors use these sample principals (`<owner>.<actor>`); `<ownerA>` = `u_aaaaaaaaaaaaaaaaaaaaaaaaaa`,\n`<ownerB>` = `u_bbbbbbbbbbbbbbbbbbbbbbbbbb` (owner tokens are `u_` + 26 base32-lower, \xA72):\n\n- Alice: `<ownerA>.alice`\n- Bob: `<ownerB>.bob`\n- Reviewer role: `reviewer`\n\nSubject parsing. `parseSubject` **splits only** (\xA73): it recovers tokens by prefix and per-kind arity\nbut does NOT validate the owner token: a well-formed *split* is necessary, not sufficient, for a\nsubject to be surfaced as a delivery. The last row shows an old-shape alias that split-parses yet MUST\nbe dropped at the surfacing boundary (\xA79):\n\n| Subject | Result |\n| --- | --- |\n| `cotal.main.chat.<ownerA>.alice.team.backend` | `kind=chat`, `sender=<ownerA>.alice`, `rest=team.backend` |\n| `cotal.main.inst.<ownerB>.bob.<ownerA>.alice` | `kind=inst`, `sender=<ownerA>.alice`, `rest=<ownerB>.bob` (recipient) |\n| `cotal.main.svc.reviewer.<ownerA>.alice` | `kind=svc`, `sender=<ownerA>.alice`, `rest=reviewer` |\n| `cotal.main.ctl.manager.<ownerA>.alice` | no sender; v0 control subject, retired (\xA713.11): nothing serves it and it MUST NOT be handled |\n| `cotal.main.chat.<ownerA>.alice` | no sender; malformed (owner+actor but no channel token) |\n| `cotal.main.chat.UAQGWOEVJKMIO4WXSYOTLARXYOZTCXFK67JASEH6AFFFYK6FOPSKQCAD.team.backend` | split-parses (`kind=chat`, `owner=UAQ...QCAD`, `actor=team`, `rest=backend`) but MUST be dropped: `UAQ...QCAD` is not a principal owner token (\xA73, \xA79) |\n\nSample multicast message:\n\n```json\n{\n \"id\": \"018f1d0a-0000-7000-9000-000000000001\",\n \"ts\": 1710000000000,\n \"space\": \"main\",\n \"from\": {\n \"id\": \"u_aaaaaaaaaaaaaaaaaaaaaaaaaa.alice\",\n \"name\": \"alice\",\n \"role\": \"planner\"\n },\n \"channel\": \"team.backend\",\n \"mentions\": [\"bob\"],\n \"parts\": [{ \"kind\": \"text\", \"text\": \"Can you review this?\" }],\n \"contextId\": \"ctx-1\"\n}\n```\n\nSample unicast message changes only the routing field:\n\n```json\n{\n \"id\": \"018f1d0a-0000-7000-9000-000000000002\",\n \"ts\": 1710000001000,\n \"space\": \"main\",\n \"from\": {\n \"id\": \"u_aaaaaaaaaaaaaaaaaaaaaaaaaa.alice\",\n \"name\": \"alice\"\n },\n \"to\": \"u_bbbbbbbbbbbbbbbbbbbbbbbbbb.bob\",\n \"parts\": [{ \"kind\": \"text\", \"text\": \"Direct note.\" }]\n}\n```\n\nInterop scenario:\n\n1. Provision a space and credentials for Alice and Bob.\n2. Alice and Bob connect with inbox prefixes `_INBOX_<connId>` (per-connection, \xA72).\n3. Both write presence and join `team.backend`.\n4. Alice multicasts on `team.backend`; Bob receives with `kind=channel`.\n5. Alice unicasts to Bob; Bob receives with `kind=dm`.\n6. Alice anycasts to `reviewer`; exactly one reviewer receives with `kind=anycast`.\n7. A late joiner joins `team.backend`; replayed messages arrive with `historical=true` and\n live-tail duplicates at or below the join watermark are ack-dropped.\n\n---\n\n## 13. Endpoint control surface (v0.4)\n\nEverything on the mesh that serves structured commands (the manager daemon, the delivery\ndaemon, a wrapped MCP server, a third-party service) is an **endpoint**: a daemon that\nregisters a service identity, publishes its contracts, and answers `describe`. There is no\nspecial-cased service in this contract: `manager` and `delivery` are endpoint names like any\nother, and no subject or envelope in this section knows them. This section supersedes and\n**deletes** the v0 control rail (`ctl.<service>.<owner>.<actor>`, `ControlRequest`/\n`ControlReply`, the `self`/`manager`/`admin`/`delivery`/`delivery-admin` service tiers, and the\nreserved `control.<instance>` subject). The cut is hard (\xA713.11): no v0 control subject,\nenvelope, handler, or grant survives, and a pre-cut control credential cannot reach a post-cut handler.\n\nLayering: identity and transport are \xA72/\xA73, extended by the lifecycle identity below; \xA713.1\nidentity; \xA713.2 grammar; \xA713.3 envelope; \xA713.4 delivery contracts; \xA713.5 verbs; \xA713.6\ncomposites; \xA713.7 contracts and discovery; \xA713.8 distributed guarantees; \xA713.9 authority\nboundary; \xA713.10 receipts and signing anchors; \xA713.11 the hard cut; \xA713.12 the NATS binding;\n\xA713.13 plane ownership; \xA713.14 conformance.\n\n### 13.1 Lifecycle identity\n\nThe principal `owner.actor` (\xA72) is a **recyclable routing alias**: despawning an agent frees\nits actor name, and a later spawn may legitimately reuse it. An alias is therefore never\nsufficient *authority* identity on this surface. Two further identity components exist:\n\n- **Lifecycle UID** (`lifecycleUid`, one token `[a-z0-9]{26,32}`, \u2265128 bits of CSPRNG\n entropy in a fixed canonical encoding): an unguessable, never-reused\n identifier of one managed lifecycle under a principal. The UID is entropy, never order:\n no allocator counter exists, and what is durable and monotonic is only the never-used\n set. Before anything else, the minting authority (the manager for managed agents; the\n provisioner for endpoint daemons and operator credentials) **reserves the candidate UID\n space-globally**: a create-only write of the reservation key `uid.<lifecycleUid>`\n (\xA713.7), never deleted for the life of the space. A create conflict burns the candidate\n and draws a fresh one (the alias head alone cannot reject the same UID under a different\n alias, and the `gate.`/`cred.` families key by UID alone, so uniqueness must be\n space-wide); a DEL/PURGE marker on a reservation is corruption, never reusable absence.\n Only then does it mint **before the entity is reachable**, persisting a CAS-fenced\n mapping\n `{ owner, actor, lifecycleUid, managerInstance, processEpoch,\n state: active | retiring | retired, currentCredentialId?, lastTakeoverOpId?, op? }` (closed\n schema; the\n embedded `owner`/`actor` MUST equal the key's alias tokens, so a key-mismatched row\n never authorizes; `currentCredentialId` is absent until the credential ledger releases\n a root under the reopened gate; `lastTakeoverOpId` is the opId of the takeover operation\n that LAST advanced `processEpoch` (the epoch advance and this stamp are ONE head CAS, so a\n completion is bound to exactly one operation: a resuming barrier confirms the completed head\n carries ITS opId, and a LOSING concurrent takeover that captured the same pre-takeover\n coordinates finds a foreign opId and refuses, never claiming the winner's completion; absent\n until the first takeover); `op` is required at `retiring` and forbidden elsewhere)\n under the alias's **CAS head key** (\xA713.7:\n the **unsplit** `lifecycle.<owner>.<actor>` head key HOLDS this mapping as one atomic\n record, the single authoritative current mapping and the only source of `mappingRevision`,\n \xA713.9; the UID-suffixed `lifecycle.<owner>.<actor>.<lifecycleUid>` key is optional\n append-only audit, never the authority). `mappingRevision` IS the head key's store\n revision, learned from the publish ack or from the leader-served read that returned the\n mapping (one read returns `{ mapping, revision }`); the value carries NO revision field,\n and a body-supplied revision is never a CAS coordinate. Head states: `active` is the\n ONLY current state. `retiring` is the containment phase of the terminal barrier (below),\n bound to the retirement operation's `op.opId`; it is non-current and NOT replaceable.\n `retired` is terminal and asserts the barrier COMPLETED (the cleanup proof), which is\n what makes replacing a retired predecessor safe. **Every currency seam fails closed on\n both non-`active` states**: target resolution, the process-epoch reads gating\n record/status writes, admission/start, and supervision derive current authority only\n from `state: \"active\"`; `retiring` and `retired` alike yield no current mapping and no\n current epoch. Activation is the head CAS (create-only for a virgin alias;\n revision-pinned from a `retired` predecessor), so two concurrent mints for one alias\n serialize there and exactly one activates; the loser terminalizes its own orphan gate\n and burns its reserved UID, never deleting either (`currentCredentialId` is a public key\n identifier/fingerprint plus authority epoch, never secret material). A supervised restart\n of the same entity **preserves**\n the UID (revoking/rotating the connection credential and advancing the process epoch); a\n terminal despawn, explicit stop, or supervision escalation retires the UID through the\n terminal barrier *before* the alias is freed. A retired UID is never reactivated\n (`retired \u2192 active` for the SAME UID is forbidden; only the ALIAS is replaceable, by a\n freshly reserved UID); recycling cannot move to the reservation, which is never freed.\n- **Process epoch** (`incarnation`, an unsigned integer): the fenced ownership epoch of the\n process currently animating an identity, advanced by CAS on every takeover or restart. At\n most one live epoch owns an identity; a superseded process MUST stop serving and its commits\n are rejected (\xA713.8). **The epoch fences egress only**: reply, event, timer, session, and\n record-write-ingress publish grants pin it (\xA713.9), but request subjects deliberately omit it; a caller cannot\n know the serving epoch, so **no subject-level fence for ingress exists or can exist**. An\n un-revoked superseded serve credential remains a member of the class queue group and can\n consume (and externally effect, and never validly answer) one call in N. Takeover therefore\n carries a **normative barrier, in order**: freeze issuance for\n the lifecycle in the credential ledger (below) \u2192 revoke EVERY active credential-ledger\n row under the lifecycle prefix, every root (the superseded `currentCredentialId` and any\n earlier unexpired root: each root mint, initial or rotation, writes its own ledger row)\n and every ledgered descendant (handle-redemption-minted and per-session credentials,\n \xA713.6), via the deployment's auth\n authority, verifying the updated revocation state is enforced on EVERY server of the\n cluster before proceeding (fail-closed on partial acknowledgment: an unrevoked-anywhere\n credential can reconnect there) \u2192 evict the live connections of every revoked\n credential's `holderPrincipal` (from its ledger row, above)\n cluster-wide and verify the re-scan found none, the barrier executor (the trusted auth\n path) holds the delivery endpoint's `evictPrincipal` capability for exactly this step\n (Appendix B: granted to the barrier executor, not only `supervisor`); `evictPrincipal`:\n system-account CONNZ scan \u2192 per-server KICK \u2192 re-scan verify, fail-closed on partial\n scans; Appendix B) \u2192 **only THEN advance the process epoch by CAS (N\u2192N+1), reopen the gate\n at the new generation, and activate the successor's serve subscription**. The epoch CAS is\n LAST, not first: a superseded process is revoked and evicted before the successor's epoch\n exists, so it cannot publish a reply or event in a window between the CAS and the eviction;\n the egress epoch is honest attribution precisely because no live predecessor egress survives\n the barrier. (A reply the predecessor emitted for an in-flight call before eviction reaches\n a caller only within that caller's own deadline and from a not-yet-evicted process; the\n barrier's job is that no such process remains once the successor answers.) Where\n revocation or verified eviction is unavailable (e.g. static credential material\n pre-rotation, Appendix B), takeover MUST fail loud rather than proceed.\n\n**Credential ledger (normative).** Ingress has no epoch fence, so revocation is only as\ncomplete as the set of credentials it covers, and the lifecycle's `currentCredentialId` is\nnot that set. Every credential the trusted auth path mints **derived from** a lifecycle (the\nshort-lived credential of a handle redemption, the two per-session credentials of a session\nredemption, \xA713.6) is recorded at mint time in a durable, auth-owned **credential ledger**\nrow `{ credentialId, holderPrincipal (the `<owner>.<actor>` whose connections the barrier evicts; the credential id is NOT the principal, and eviction is by principal), lifecycleUid (the holder's), sourceChain: [root |\nhandle.<issuerKeyId>.<id>\u2026 | session.<sessionId>], the FULL verified lineage: for a\nhandle redemption, EVERY handle in the presented `parentDigest` chain (\xA713.6), never only\nthe leaf, state: active | revoked (monotonic), exp }`, keyed\n`cred.<lifecycleUid>.<credentialId>` so both barriers enumerate a lifecycle's full descendant\nfamily by key prefix. Each mint additionally writes one reverse-index key\n`bysrc.<issuerKeyId>.<id>.<lifecycleUid>.<credentialId>` per chain member, so **revoking a\nsturdy handle revokes every credential minted under it or under any of its descendant\nhandles**; a credential redeemed through a child handle carries the parent in its\n`sourceChain`/`bysrc` keys, so parent revocation reaches it without walking handle records.\n**Source gates.** The same fence applies per issuing handle, because a handle's revocation\nstate lives in the records bucket while credential indexes live here, and two buckets share\nno order: each sturdy handle has an auth-bucket gate `srcgate.<issuerKeyId>.<id>`\n(`{ state: open | frozen }`, CAS). Handle revocation CASes the source gate to `frozen`\n**before** it enumerates `bysrc.`, and a redemption, after writing its `cred.`/`bysrc.`\nrows, revision-pinned-CASes the source gate of EVERY handle in the presented chain (plus the\nlifecycle gate below), releasing only if all are still `open` at their observed revisions. An\nin-flight redemption under a handle being revoked therefore either finishes before the freeze\n(its rows are in the enumeration) or loses a CAS and never releases. **Handle revocation\ncarries the SAME cluster-wide eviction as a lifecycle barrier** (\xA713.9 `evictPrincipal`):\nafter freezing the source gate and enumerating `bysrc.`, revocation revokes every descendant\ncredential AND verifies revocation enforced on every server, then evicts and re-scans the live\nconnections of every revoked credential's principal, fail-closed, an already-connected\ndescendant credential is never silently left with live grants. The handle status write is\nacked only after that eviction is verified complete.\n\nAn unledgered mint MUST NOT occur (the ledger write precedes credential\nrelease, fail-closed), and the rule carries a mechanical audit invariant in the style of the\n\xA713.9 matrix grep test: every credential the auth authority has ever released MUST resolve\nto a `cred.<lifecycleUid>.<credentialId>` row; an issuance path that cannot show its ledger\nrow is non-conformant, auditable by diffing issued-credential ids against the ledger.\n\n**Issuance gate (normative).** \"Freeze issuance\" is a durable transition, not an assertion:\neach managed-agent lifecycle has a gate key `gate.<lifecycleUid>` in the same auth KV,\n`{ state: open | frozen | retired, generation, op? }` (CAS). A `frozen` gate MUST carry a\ndurable **operation intent** `op = { opId, kind: activation | takeover | registration |\nretirement, successor? }`: after a crash the intent alone\ndecides WHICH operation a frozen gate belongs to and what may advance it, a retry or\nreconciler resumes the SAME `opId`, and a writer that is not that operation's executor\nMUST NOT advance, reopen, or terminalize the gate. A `retired` gate RETAINS the\nterminalizing operation's intent as audit, and an idempotent terminal retry succeeds only\nfor that SAME operation. **Successor coordinates are per-kind and derivable, never loose\nprose**: an `activation` or `retirement` intent carries NO `successor` (an activation's\nsuccessor IS the head mapping the same operation writes; a retirement has none); a\n`takeover` or `registration` operation's successor artifacts are durably keyed by its own\n`opId` (the `stage.<opId>.` staging family and the operation's audit rows), so\n`{ opId, kind }` alone resumes deterministically. The gate MAY carry a `successor` summary\ntoken for those two kinds, but the staged rows are authoritative and a resumer MUST NOT\nact on a summary that the staged rows do not corroborate. **Allowed transitions are also\nper-kind**: a gate is BORN `frozen` only under an `activation` intent (and only for a UID\nwhose `uid.` reservation already exists); `open \u2192 frozen` belongs to `takeover`,\n`registration`, and `retirement`; `frozen \u2192 open` (reopen) belongs to `activation`,\n`takeover`, and a `registration` abort, NEVER `retirement` (a retirement freeze never\nreopens); `frozen \u2192 retired` belongs to `activation` (a head-CAS loser terminalizing its\nown orphan gate) and `retirement`, NEVER `takeover` or `registration` (those abort by\nreopening). An implementation MUST refuse a transition whose gate op kind is outside these\nsets, before any CAS is attempted. The `opId` is an identifier, never a\nbearer capability: a resumer re-authenticates as the operation's executor, and possession\nof the id alone grants nothing. `retired` is terminal, a retired\nlifecycle never mints again. `frozen` is **not** terminal, because a supervised restart\npreserves the UID (\xA713.1) and must mint the successor process's root credential: the\ntakeover barrier freezes at generation `G`, completes revoke + verified eviction of the\nfamily, and only then CASes the gate to `open` at generation `G+1`; the reopen is the\nbarrier's own final step, so no credential of generation `G` is ever live when generation\n`G+1` mints. A gate reopen by anyone but the completing barrier is non-conformant.\n**Endpoint instances use a disjoint gate family, distinguished by explicit prefix and\nnever by token arity**: the endpoint issuance gate is `epgate.<endpoint>.<instanceId>`,\n`{ state: open | frozen | retired, generation, processEpoch, registrationRevision,\nnameAuthorityRevision, principal, op? }` (the endpoint fence coordinates of \xA713.5/\xA713.7, plus\n`principal`: the serving instance's own CONNZ-attributable connection principal, recorded at\nregistration), and\nendpoint-derived credentials ledger under `epcred.<endpoint>.<instanceId>.<credentialId>`\nwith the same row schema, mint protocol, gate discipline, and never-delete rules as\n`cred.`/`gate.`. **`holderPrincipal` is ALWAYS a CONNZ-attributable `<owner>.<actor>` in\nBOTH families** (the barrier KICKs it; an endpoint NAME is not attributable and never sits\nthere): in `cred.` it is the caller principal; in `epcred.` it is the serving instance's own\nconnection principal, copied from the endpoint gate's `principal`, while the endpoint NAME that\nforms the `epcred.` KEY is a SEPARATE row field, so the key identity and the eviction target\nstay disjoint (an `epcred` row that put the endpoint name in `holderPrincipal` could never be\nKICKed). The `cred.`/`epcred.` families hold ONLY conformant ledger rows:\nimplementation staging, half-minted state, and tombstone fences live in a distinct\n`stage.` family, never under a ledger prefix a barrier enumerates.\n\n**A read is never a fence; only a CAS write is.** JetStream `DIRECT.GET` may be served by a\nfollower or mirror and gives NO read-your-writes guarantee (a mint that *reads* the gate can\nobserve a stale `open` after a barrier froze it on the leader), so the auth bucket sets\n`allow_direct=false` (\xA713.12) and every fence here is a leader-served, revision-pinned CAS\nwrite. The mint protocol is **observe gate \u2192 write rows \u2192 CAS the gate \u2192 release**: the auth\npath reads the gate (recording `state`, `generation`, and KV `revision`), writes the\n`cred.`/`bysrc.` rows, then performs a **revision-pinned CAS update of `gate.<lifecycleUid>`\nitself at the observed revision**; a leader write that fails if the gate changed at all,\nand releases the credential only on CAS success with the gate still `open` at the same\ngeneration. On CAS failure, `frozen`/`retired`, or any generation advance it aborts and marks\nits own row revoked, never releasing. A barrier CASes the gate to `frozen` FIRST and only then\nenumerates the family. The race is closed by **serialization on one key**, not by timing or\nread freshness: freeze and mint-finalize are both CAS writes to the SAME gate key, so one\nloses; a mint that wins wrote its rows before its winning CAS, so the barrier's later\nenumeration sees them; a mint that loses never released. The ledger is written only by the\ntrusted auth path (\xA713.9 matrix; NATS binding: the auth KV, \xA713.12).\n\n**Every lifecycle operation is a cross-bucket saga, never an implied transaction.** The\nrecords head and the auth gate/ledger live in different buckets with no shared order, so\neach operation persists its durable intent (the gate `op`, above) before touching the\nsecond bucket, every crash boundary resumes the SAME operation from that intent, and the\nsafe orders are normative. **Initial activation, in order**: reserve the UID (create-only\n`uid.<lifecycleUid>`, above) \u2192 create the issuance gate `frozen` carrying the activation\n`op` (unmintable from birth; no credential is ever released under a frozen gate, per the\nunledgered-mint rule) \u2192 CAS the alias head to the new mapping (`active`) \u2192 reopen the gate\nat its first mintable generation as the operation's LAST step. A head-CAS loser\nterminalizes its own orphan gate and burns its reserved UID (never deleting either); a\ncrash after the head CAS leaves the lifecycle active-but-unreachable, and recovery resumes\nthe same activation `opId`, never minting a second UID for one activation. **Takeover**\nkeeps the barrier order above (freeze \u2192 revoke + verified-evict \u2192 epoch head CAS LAST \u2192\nreopen). **Terminal retirement** keeps the barrier order below. No other head transition\nexists: the head advances only inside these operations, and no epoch-advance or retire\nseam is exposed outside the operation that completes its barrier.\n\nBinding rule (normative): **durable** authority and state; sturdy handles, accepted goals,\ncheckpoint tokens and resumes, durable consumers and delivery state, ledger rows, bind\n`(principal, lifecycleUid)` and survive supervised restart. **Live** authority, session\ngrants, reply attribution, serve/commit ownership, additionally binds the process epoch and\ndies on restart. The alias alone authorizes nothing: a delayed or redelivered request, handle,\nor teardown that names a recycled alias fails against the replacement because the lifecycle\nUID differs. Endpoint daemons carry the same triple, with the **stable logical instance id**\n(`instanceId`, `[a-z0-9]{26,32}`, \u2265128 bits of CSPRNG entropy, persisted for the endpoint\nlifetime) as their routable identity component. `instanceId` is **minted by the provisioner,\nnever reused, and unique within `(space, endpoint)`**, the allocator records it in the\ninstance's service record by create-only CAS and rejects collisions durably. Reply\nattribution, scatter deduplication, queue ownership, and the event/timer planes all key on\nit, so its uniqueness and entropy are load-bearing, not cosmetic. `instanceId` is to an\nendpoint what `lifecycleUid` is to a managed agent, and both follow the same\nrestart-preserve / terminal-retire / epoch-fence rules.\n\n**Cross-plane scoping.** Chat/DM/presence *subjects* keep the \xA73 grammar (the alias), but\ntheir backing state is lifecycle-scoped: presence carries the current `lifecycleUid` (\xA76);\nper-instance durable consumers, pending delivery cursors, durable memberships, history\ncutoffs, and ACL/ledger rows key on `(principal, lifecycleUid)` (\xA78, \xA79). The DM subjects\n(`inst.>`) DELIBERATELY stay alias-keyed; a second implementer MUST NOT uid-scope them; the\nsuccessor cut for DMs is the ACTIVATION FRONTIER (the DM stream sequence captured at the\nlifecycle's provisioning, delivery starting at frontier+1, \xA78), and that frontier capture is\na leader-served read (the \xA713.9 read-service class), never a follower get. Explicit same-name\nrecreation inherits **no** predecessor authority or content: terminal retirement records\nper-stream sequence cutoffs before the alias is freed, messages published while no lifecycle\nis active do not flow to a later replacement, and retirement across streams is ordered and\nreconciled (never assumed atomic). **Destructive cleanup is broker-enforced where the resource is broker-addressable**: durable\nconsumer names, ACL rows, KV record keys, and membership rows are lifecycle-keyed, the UID\nis part of the resource NAME, and the teardown credential (the deprovisioner) is minted\ntarget-pinned to `(principal, lifecycleUid)` by exact name, so a credential minted for\nlifecycle A cannot even NAME lifecycle B's resources; the broker denies the stale delete\noutright. Only resources the broker cannot see (the manager's local credential/token/health\nfiles) fall back to a handler-side **delete-if-current** check carrying the retiring UID +\nexpected ownership revision. In both regimes the alias stays reserved until retirement and\ncleanup have durably completed, so a stale detached teardown can never destroy a same-name\nsuccessor. **Terminal retirement is additionally a credential barrier, in order**: CAS the issuance\ngate `open \u2192 frozen` carrying the durable retirement `op` FIRST (the bar: a staged mint\nloses the gate CAS, exactly the mint-protocol race above; the gate revision moves, so a\nmint that observed `open` cannot finalize) \u2192 CAS the head `active \u2192 retiring` bound to the\nsame `op.opId` (from this point every currency seam yields no current mapping and no\ncurrent epoch, and the alias is NOT replaceable) \u2192 revoke every\nactive credential-ledger row under the lifecycle prefix (all roots and all descendants,\ncredential ledger above), verifying revocation enforcement on every server as in the\ntakeover barrier \u2192 cluster-verified eviction of every revoked credential's live connections\n(`evictPrincipal`, as in the takeover barrier above) \u2192 **drain the target's acceptance\nobligations to quiescence** (\xA713.8: enumerate `oblig.<targetUid>.>`, settle every\nunresolved row through its decision coordinate, and re-enumerate until an enumeration\nfinds none unsettled; every writer that observed the pre-`retiring` mapping is settled\nHERE, before the cleaner below runs and before any frontier closes) \u2192 **fence the drain's\nper-op repair principals** (the commit applier, pool-route reconciler, and effects canceller\nminted inside the drain, `local.{epapl|eprec|epcan}_<opId-hash>`): cluster-verify eviction of\nany live connection under each BEFORE the cleaner and BEFORE any frontier \u2014 the applier\nespecially, whose records-KV last-value write is returned to a normal reader regardless of the\nper-stream frontier cutoff. These are self-minted data-account bearers with NO credential-ledger\nrow, so there is no connect-time deny-new: the guarantee here is **kill-live** (verified eviction\nof currently-connected principals), NOT reconnect prevention; a fresh connect within the\nbearer's TTL is the accepted residual NAMED per drain-repair profile in the \xA713.9 matrix (each\n\"RETIREMENT-FENCE residual\" row), of the same kill-live-not-deny-new class \xA713.13 fences for the\nplane connections (repair connections MUST be minted non-reconnecting so a verified eviction is\ndurable) \u2192 the trusted terminal **pool\ncleaner** settles the lifecycle's expired and orphaned pool work under a DISTINCT,\nseparately minted, exact-pool scoped profile whose pool set is this operation's **effective\ninventory**: the target's accepted `oblig.<lifecycleUid>.>` pool routes enumerated from the\nSAME drained, now-`retiring` obligation set (so no new row can appear and the enumeration is\ndeterministic across resumes). The inventory is DISCOVERY-ONLY: the barrier takes no\ncaller-supplied pool hint, so every inventory entry is an obligation-discovered pool this target\nholds accepted work on, and no pool ever enters the cleaner/executor grant without a backing\nobligation. Confinement is the EXACT per-pool effective-inventory grant plus the\nexecutor's per-item decision/horizon/retire-target checks (which bind HONEST execution, not a\ncompromised bearer): (\xA713.9\nmatrix row: bind-only on the pool's\npre-created durable, terminal-only ACK after the item's durable terminal fact, no consumer\ncreate/update/delete, no raw stream DELETE; it never holds, reuses, or impersonates the\nrevoked owner's authority, which this barrier just killed) \u2192 **retire the cleaner\ncredential itself, verified, BEFORE any frontier closes**: once the cleaner has settled the\npool and proven it quiescent (every pre-existing owner ACK drained through `AckWait`, and a\nfresh consumer read shows zero `num_pending` and zero `ack_pending`; a fire-and-forget ACK\nis confirmed with `AckSync` or re-proven, never assumed), the barrier REVOKES the cleaner's\nown bounded-lived credential and cluster-verifies eviction of its principal (`evictPrincipal`,\nexactly as for the owner above), so no in-flight cleaner can ACK a redelivery or write a\nterminal after the alias is reused; the cleaner's authority MUST be dead before the frontier\nrecords \u2192 record the\nper-stream retirement frontiers (the create-only, never-deleted `frontier.<lifecycleUid>`\nrecord, \xA713.7: one key per retired lifecycle, recorded once under this operation's `opId`) \u2192\nCAS the gate `frozen \u2192 retired` (terminal; unlike\ntakeover, retirement never reopens it) \u2192 CAS the head `retiring \u2192 retired` \u2192 only then\nfree the alias, and a successor activates only with a freshly reserved UID. `retired` on\nthe head therefore ASSERTS completed cleanup: replacing a retired predecessor needs no\nfurther proof, because nothing reaches `retired` without the barrier. Every boundary of\nthis sequence is crash-resumable through the durable `op` intent, and only the same\noperation resumes it. Chat/DM/presence subjects stay\nalias-keyed, so without the revoke-and-verified-evict step a still-connected stale process\ncould keep speaking as the recycled alias. Where the deployment cannot revoke the credential\nor cannot verify eviction, alias reuse is **forbidden**: a same-name respawn fails loud.\nSupervised restart of the same UID retains all of it.\nIntentional role-mailbox continuity across lifecycles is only available as an explicit,\nseparately authorized transfer operation, never an accidental consequence of string reuse.\n\n### 13.2 Grammar\n\n**Endpoint names.** An endpoint name is one or more DNS-shaped labels, each matching\n`[a-z0-9]([a-z0-9-]*[a-z0-9])?` (no leading/trailing dash, no bare dashes; `_` MUST NOT\nappear in a label). Single-label names (`manager`, `delivery`) are reserved for\nendpoints shipped by this contract's reference implementation and require the space operator's\nprovisioning authority to serve; a third-party endpoint name MUST be reverse-DNS (two or more\nlabels under a domain its author controls, e.g. `com.acme.deploy`) and is mintable only under\nthe owner that registered that domain claim. In a wire subject the name is one token with `.`\nreplaced by `_` (`com_acme_deploy`); because `_` cannot appear in a label the mapping is\nbijective. Name authority is the credential, never the registry (\xA713.9). Endpoint-name\ntokens may contain `-` inside labels; they are never used to derive principal dash-form\nnames; control-surface consumer names are the \xA713.9 pinned grammars, each carrying a\nstated collision-freedom argument, and none is ever parsed back into its components, so\nthe \xA72 dash-form separator stays unambiguous.\n\n**Command tokens.** A command name is one token `[a-z0-9-]{1,32}`. The command is a validated\nsubject token so the broker enforces per-command authority (\xA713.9). `describe` and `cancel`\nare reserved command names (\xA713.7, \xA713.6).\n\n**Request subjects.** Three **addressing modes** under one kind `ep`, the mode token says\nwhere a request routes, never which verb it is (the verb rides the envelope, \xA713.3/\xA713.5):\n`one` (queue-group anycast: exactly one class member), `all` (scatter: every instance),\n`inst` (one instance by its stable triple). The `one` rail's queue group is canonically\nnamed by the endpoint-name token, and serve subscriptions to it are **queue-qualified\nonly** (\xA713.9): no credential can plain-subscribe the class rail, which is what keeps\nper-request nonces visible only to the queue-selected instance. Every request carries the caller as **three**\nforge-locked tokens `<owner>.<actor>.<uid>` (principal + lifecycle UID, \xA713.1) followed by a\ncaller-chosen unguessable **nonce** token (`[A-Za-z0-9_-]{22,64}`, \u2265128 bits of CSPRNG\nentropy; one outstanding call per nonce; reuse before the prior call resolves is a caller\nerror and the reply rail MUST treat the earlier subscription as dead); always, on calls and\ncasts alike, so one grant row covers both verbs and no shape is distinguished by counting. A\ncommand whose contract declares it **targeted** carries an **authorization-mode token** and,\nper mode, zero to three pinned target tokens between the command and the caller:\n\n| Form | Subject | Tokens |\n| --- | --- | --- |\n| Class, untargeted | `cotal.<space>.ep.one.<endpoint>.<command>.<owner>.<actor>.<uid>.<nonce>` | 10 |\n| Class, `self` | `cotal.<space>.ep.one.<endpoint>.<command>.self.<owner>.<actor>.<uid>.<nonce>` | 11 |\n| Class, `owner`/`any` | `cotal.<space>.ep.one.<endpoint>.<command>.<authz>.<tOwner>.<owner>.<actor>.<uid>.<nonce>` | 12 |\n| Class, `child`/`ledger` | `cotal.<space>.ep.one.<endpoint>.<command>.<authz>.<tOwner>.<owner>.<actor>.<uid>.<nonce>` | 12 |\n| Class, `handle` | `cotal.<space>.ep.one.<endpoint>.<command>.handle.<tOwner>.<tActor>.<tUid>.<owner>.<actor>.<uid>.<nonce>` | 14 |\n| Scatter | as class forms with mode token `all` | 10-14 |\n| Instance | `cotal.<space>.ep.inst.<endpoint>.<instanceId>.<command>[.<authz>[.<target tokens per mode>]].<owner>.<actor>.<uid>.<nonce>` | 11-15 |\n| Reply | `cotal.<space>.ep.reply.<endpoint>.<instanceId>.<epoch>.<owner>.<actor>.<uid>.<nonce>` | 11 |\n\n**Single-owner endpoint names (normative).** An endpoint name binds to exactly ONE owner\n(\xA713.9: operator-provisioned core names, domain-owner-bound reverse-DNS names), so the name\ntoken alone determines the serving owner and instance-addressed subjects carry **no owner\ntokens**: `(endpoint, instanceId)` is the complete routable instance address. Two parties\nwanting the \"same\" name use their own reverse-DNS names; an owner-qualified shared-name form,\nif ever wanted, would be a later additive subject form, not a change to these. This trades an\nalready-forbidden expressiveness for structurally smaller subjects and credentials.\n\nThe target's **lifecycle UID is body-carried, not a subject token** (`target.lifecycleUid`,\n\xA713.3): a grant could only ever wildcard it (targets are dynamic; the UID is unknowable at\nmint time), so a token there would add zero broker enforcement while costing every targeted\ngrant row a token, the trusted validator, not the broker, compares the expected UID against\nthe current mapping (\xA713.1). The one exception is `handle` mode: at handle redemption the\ntarget's UID IS known and current, so the redemption-minted form pins the full target triple\nas subject tokens (below); pin what is knowable at mint time; body-carry only what is not.\nEvery form stays within the NATS 16-token recommendation.\n\n**Explicit discrimination (never arity counting).** The forms are distinguished by the token\nafter `<command>`: it is either one of the six reserved authorization-mode tokens (`self`,\n`owner`, `any`, `child`, `ledger`, `handle`) or the caller's owner token, and the two sets\nare disjoint by construction, because an owner token is `local` or `u_`+base32 (\xA72), never a\nbare mode word. The target-block arity then follows the mode (`self`: none;\n`owner`/`any`/`child`/`ledger`: one `<tOwner>` token; `handle`: three,\n`<tOwner>.<tActor>.<tUid>`); a closed set at a fixed position, exactly the property that\nmakes per-mode arity safe. A parser dispatches on that set; a subject matching no defined shape\nhas no sender and MUST NOT be handled.\n\n**Token bounds (normative).** On the endpoint rails every identity token is bounded:\n`owner` \u2264 64, `actor` \u2264 64, `command` \u2264 32, `endpoint` \u2264 64, nonce and ids \u2264 64 characters;\n`lifecycleUid` and `instanceId` are bounded by their single defining grammar\n`[a-z0-9]{26,32}` (\xA713.1); deliberately not restated here, so the bound cannot drift from\nthe definition. A total request or reply subject MUST NOT\nexceed 1024 bytes; implementations validate fail-loud at build time. (Transport headroom:\nthe reference deployment raises `max_control_line` to 64 KiB; the PUB line is never the\nbinding constraint; minted-credential size is, \xA713.9.)\n\n**The authorization-mode token** (`<authz>`) makes the authority gradient explicit and\nbroker-enforced where it is statically expressible, and honestly validator-primary where it is\nnot. Six modes:\n\n- `self`, the target IS the caller: the form carries **no target tokens and no body\n `target`** (a supplied one is `target-mismatch`, never ignored); the endpoint derives the\n target from the broker-authenticated caller triple in the same subject. Fully\n broker-confined, including the lifecycle UID, because the caller's own `<uid>` token is\n the target's UID, forge-locked by the mint: a stale lifecycle's credential cannot even\n publish the successor's subject.\n- `owner`, owner-domain: the target block is `<authz>.<tOwner>` (ONE target token); grants\n pin `<tOwner>` to the caller's own owner (standing mints; a handle redemption instead pins\n the issuer-signed target owner, \xA713.6). The target actor and expected lifecycle UID are\n body-carried (`target`) and validator-checked against the current mapping, the broker\n cannot express \"any actor under my owner, currently mapped to this UID\". An `owner`-mode\n grant is NEVER minted with a wildcard target owner. Broker-confined on the owner; validator\n on the rest.\n- `any`, unrestricted target owner (`<authz>.<tOwner>` with `*`): a distinct mode mintable\n only for operator/admin capabilities, so no widening of an `owner` grant can ever reach\n it. Validator-checked target as for `owner`.\n- `handle`, **redemption-minted only** (\xA713.6): the target block is\n `handle.<tOwner>.<tActor>.<tUid>` (THREE target tokens), each a literal pinned at\n redemption from the issuer-signed grant against the then-current mapping. Never a standing\n capability, never wildcarded. Broker-confined on the full target triple; the validator\n re-checks only currency; a subject `<tUid>` that no longer matches the current mapping is\n `expired`.\n- `child`, static-mesh own-child (`spawner == caller`): a **distinct trusted-validator form**.\n The grant means \"may ask this validator\", not \"already authorized\"; the handler MUST\n fresh-check the immutable spawner relation against durable state and fail closed. Its\n `<tOwner>` ceiling is the caller's own owner, as for `owner` mode (a static-mesh child\n shares its spawner's owner).\n- `ledger`, fresh-ledger escalation: a distinct trusted-validator form; the handler MUST\n fresh-read the authorization ledger and fail closed on lookup failure, timeout, or absence.\n Its grants pin literal `<tOwner>` values named at mint; a wildcard target owner in `ledger`\n mode is mintable only for operator/admin profiles.\n\n`any`, `child`, `ledger`, and `handle` are never wildcard-reachable from a `self`/`owner`\ngrant (distinct token \u21D2 distinct subject \u21D2 distinct grant row). A handler MUST resolve the target (the\nrevision-pinned `(alias, lifecycleUid)` mapping, \xA713.1) immediately before effect and reject\nany request whose body target disagrees with the subject target tokens (`target-mismatch`) or\nwhose expected target lifecycle UID does not match the current mapping (`expired`). The\nsubject, never the body, is the authorization boundary; handler policy only narrows.\n\n**Replies.** Every reply rides the dedicated reply rail above, **deterministically derived\nfrom the authenticated request subject**: the responder copies the caller triple and nonce\nfrom the request subject and prefixes its own endpoint/instance/epoch tokens (the owner is\ndetermined by the endpoint name; no owner tokens appear). A responder\nMUST ignore any transport- or payload-supplied reply target (the confused-deputy boundary).\nThe grants are exact-arity, no `>` tail admits subjects outside the grammar: the caller's\nread grant is its own rail (`ep.reply.*.*.*.<owner>.<actor>.<uid>.*`), so it reads only\nreplies addressed to it; the responder's publish grant pins its own instance triple and\nepoch (`ep.reply.<endpoint>.<iId>.<epoch>.*.*.*.*`), so the answering instance and\nepoch are read off the broker-authenticated reply subject, never trusted from the payload.\nTwo properties, enforced differently, stated precisely: **attribution** (who answered) is\nbroker-enforced by the responder's pinned prefix; **addressing** (whom a responder may\nanswer) is capability-by-secret, the responder's grant spans all caller suffixes, and what\nconfines it to the requester is possession of the unguessable per-request nonce, which only\nthe request's recipients hold. A stale process (superseded epoch) publishes attributably\nstale replies that callers reject; scatter gathers additionally reject replies from\ninstances outside the frozen expected set (\xA713.5). The **caller's** process epoch is\ndeliberately NOT encoded in the rails: reply consumption binds to the requesting process\nbecause a caller MUST subscribe the exact concrete nonce subject before publishing a call\nand MUST NOT persist nonces; a restarted successor never holds the predecessor's nonce\nsubscriptions, so in-flight calls die with the process (they are ephemeral by definition)\nand a late reply is unreadable rather than misdelivered.\n\n**Event and journal subjects.** Endpoint-published planes, captured by per-space streams\n(\xA713.12); the publishing instance's identity is forge-locked into the subject:\n\n| Plane | Subject |\n| --- | --- |\n| Events | `cotal.<space>.epe.<endpoint>.<instanceId>.<epoch>.<topic...>` |\n| Canonical facts | `cotal.<space>.epf.<endpoint>.<topic...>` |\n| Submissions | `cotal.<space>.epj.<endpoint>.<command>[.<authz>[.<target tokens per mode>]].<owner>.<actor>.<uid>` |\n| Timers | `cotal.<space>.ept.<endpoint>.<instanceId>.<epoch>.<timerId>.<schedule\\|armed\\|fire>` |\n| Record writes | `cotal.<space>.epr.<endpoint>.<instanceId>.<epoch>.<kind>.<qualifier...>` (mediated record-writer ingress; the instance's epoch-pinned rail for `svc`/`goal`/`cp` status writes; consumed ONLY by the record writer, which reads the writing epoch from the broker-authenticated subject, never from payload, \xA713.9) |\n| Contract artifacts | `cotal.<space>.epc.<digest-hex>` (one immutable artifact per subject; `<digest-hex>` is the artifact's SHA-256 hex, 64 chars; the `sha256:` prefix is not a subject token; \xA713.7) |\n| Work pools | `cotal.<space>.epw.<endpoint>.<pool>.<cOwner>.<cActor>.<cUid>.<id>` (one item per subject; the trailing four tokens are the item's **acceptance identity**; the accepted submission's caller triple + request id, \xA713.6) |\n| Sessions | `cotal.<space>.eps.<endpoint>.<sessionId>.<epoch>.<in\\|out>` |\n\nEvents carry the publishing instance's **epoch as a subject token**, pinned by the serve\ngrant, so a superseded process cannot emit progress indistinguishable from the current\nincarnation's; readers match the current (or goal-accepted) epoch and treat stale-epoch\nevents as attributably stale. A **targeted** journal command carries the same authz/target\nblock in its submission subject as its request forms, so the broker confines targeted\njournal work exactly as it confines calls; the canonicalizer additionally requires exact\nbody/subject agreement before acceptance. Timers use three forms: `.schedule` is the\ninstance-published **schedule request**, captured by a stream with message schedules\nDISABLED, so any client-set scheduling header is inert bytes, and the mediated timer writer\nrejects a request carrying one; `.armed` holds the **authoritative schedule message**,\npublished only by the mediated timer writer (\xA713.9), which derives the ADR-51\n`Nats-Schedule-Target`, the sibling `.fire` subject, from the broker-authenticated\nREQUEST subject's own tokens, never from any payload or header (a schedule's target MUST\ndiffer from its publish subject per ADR-51; replacement is the writer's same-subject\npublish on `.armed`); `.fire` is where fires appear. An instance's serve grant covers\n**only `.schedule`** (epoch-pinned); no client credential holds `.armed` or `.fire`\npublish; fired messages are written by the broker's scheduler alone, and the handler\nvalidates the carried `(timerId, generation)` against current status AND\n`now \u2265 the authoritative deadline` AND that the broker-authored scheduler-origin header\nnames its own exact sibling `.armed` subject (\xA713.12) before acting.\n\nReserved event topics: `ev.<cluster>.<event>` (cluster events), `goal.<cOwner>.<cActor>.\n<cUid>.<goalId>.<t>` (per-goal action progress; the caller identity in the subject gives\nmint-time read containment), `cp.<token>.<t>` (checkpoint transitions). Reserved fact topics:\n`dec.<cOwner>.<cActor>.<cUid>.<id>` (canonical decisions (accepted/rejected) caller-scoped, \xA713.4), `quar.<sourceSeq>` (poison quarantine, \xA713.4; its own family,\ndisjoint from the caller-id `dec` namespace by construction), `goal.<cOwner>.<cActor>.<cUid>.<goalId>.result` (terminal\nresults), `wrk.<pool>.<cOwner>.<cActor>.<cUid>.<id>` (per-work-item terminal results,\nkeyed by the item's acceptance identity, \xA713.5/\xA713.6), `eff.<cOwner>.<cActor>.<cUid>.<id>`\n(per-request effect-complete facts for non-action effects commands, \xA713.9), `cp.<token>` (one-use checkpoint\nresume, journaled by create-only CAS, \xA713.6),\n`receipt.<cOwner>.<cActor>.<cUid>.<id>.<sourceSeq>`\n(caller-scoped; request ids are caller-chosen, so an endpoint-wide `receipt.<id>` would\nlet two callers collide and read each other's receipts, and **execution-scoped**: the\naccepted submission's `sourceSeq` is unique per execution, so a request id lawfully reused\nafter its decision retention expires (\xA713.4) mints a NEW receipt subject instead of\nappending to the old one, where a last-by-subject read would have hidden the earlier\nreceipt for the rest of its 90-day retention). Submissions are publishable directly by capability holders\nand are **explicitly untrusted** (\xA713.4); canonical fact subjects are publishable only by\ntheir mediated writer (\xA713.9). `<id>`, `<goalId>`, `<timerId>`, `<token>`, `<sessionId>` are\nsingle tokens `[A-Za-z0-9_-]{1,64}`.\n\nThe v0 subjects `cotal.<space>.ctl.>` and `cotal.<space>.control.>` are retired: nothing\nserves them and no post-cut credential carries a grant on them. `trace.<instance>` remains reserved,\nunchanged. `<pool>` is a single token `[a-z0-9-]{1,32}` (command-token grammar).\n\n### 13.3 Envelope\n\nRequests, replies, submissions, events, facts, and progress payloads are UTF-8 JSON. The\nenvelope is versioned and typed; `ControlRequest`/`ControlReply` are deleted.\n\n`EndpointRequest`:\n\n| Field | Type | Req | Notes |\n| --- | --- | --- | --- |\n| `v` | `1` | MUST | envelope schema version (independent of the wire `protocolVersion`; the envelope starts at its own v1 inside the v0.4 revision); other values rejected (`unsupported-version`) |\n| `id` | string | MUST | caller-chosen request id, `[A-Za-z0-9_-]{1,64}`; the idempotency key at the declared scope (\xA713.8), realized on journaled planes by the caller-scoped decision CAS (\xA713.4), never by a transport header |\n| `op` | object | MUST | `{ endpoint, command, inputDigest, outputDigest }`; MUST agree with the subject (`op-mismatch`). The digests bind the invocation to the described contract and are **both REQUIRED on every command except `describe`** (the discovery bootstrap), unconditional, because every command declares both schemas: a side with no payload declares the canonical void schema (\xA713.7), whose digest exists like any other. A serving member rejects a missing digest (`contract-mismatch`) before any effect, and one that cannot honor a pinned digest replies `contract-mismatch`, never coerces |\n| `class` | `ephemeral` \\| `journal` | MUST | the submission's declared delivery contract; MUST equal the command's contract class (`class-mismatch`); immutable per submission. (`record` is a state contract, never a request class; the action composite is a command marker, not a class; an action command's submissions are `journal`) |\n| `replyExpected` | boolean | MUST | the verb: `true` = call (a reply is expected on the reply rail; `deadlineMs` required; the caller subscribes its exact nonce before publishing), `false` = cast (fire-and-forget; a responder MUST NOT reply). The subject shape is identical for both; the verb never changes the grammar |\n| `goalId` | string | action commands | MUST for a command whose contract declares the action composite: the client-generated goal id (\xA713.6); absent otherwise. `id` remains the per-request idempotency key |\n| `target` | object | per mode | `{ owner, actor, lifecycleUid, mappingRevision? }`. **Absent for `self`** (and for untargeted ops): a supplied one is `target-mismatch`, never ignored. **Required for `owner`/`any`/`child`/`ledger`/`handle`**: `owner` MUST equal the subject `<tOwner>` token (`target-mismatch`); `actor` and `lifecycleUid` are validator-compared against the current mapping (`expired` on mismatch), and in `handle` mode MUST additionally equal the subject `<tActor>`/`<tUid>` tokens (`target-mismatch`); `mappingRevision`, when present, additionally pins the exact mapping revision the caller observed |\n| `args` | object | MAY | validated against the input schema before any effect (`bad-request`) |\n| `from` | `EndpointRef` | MUST | as \xA75; `from.id` MUST equal the subject sender principal, and the sender UID token MUST match the caller's minted lifecycle UID (broker-enforced by the grant) |\n| `deadlineMs` | number | MUST for call/scatter and journal submissions | caller deadline budget; bounded, never unbounded. On a journal-class submission it is the **decision deadline**: the bound within which the caller expects its durable decision fact (\xA713.4) |\n| `correlation` | object | MAY | `{ traceparent?, tracestate?, baggage? }` per W3C Trace Context; propagated to downstream calls, events, facts, receipts |\n| `auth` | string | MAY | opaque signed authorization-context slot (capability handle, obligations, payment proof). Opaque to the transport, never to identity: its **`authDigest`** (\xA713.4 fingerprint) is `sha256:<hex>` over the UTF-8 bytes of this string **exactly as carried**; the slot is already a canonical signed artifact, so it is digested as bytes, never re-canonicalized, and is absent from the fingerprint iff `auth` is absent |\n\n`EndpointReply`:\n\n| Field | Type | Req | Notes |\n| --- | --- | --- | --- |\n| `v` | `1` | MUST | |\n| `id` | string | MUST | echoes the request `id` |\n| `ok` | boolean | MUST | |\n| `data` | any JSON | MAY | present iff `ok`; validated against the output schema |\n| `error` | object | iff `!ok` | `{ code, message, details?[] }`; codes below; `details[]` entries carry reverse-DNS `kind` |\n| `receipt` | string | MAY | opaque signed receipt slot (\xA713.10) |\n\nThe answering instance, its epoch, and the addressee are read from the **reply subject**\n(\xA713.2), not from payload fields; a payload claim of either is advisory display data only.\n\nEvery other plane is typed too: a journaled **submission** is an `EndpointRequest` (same\nenvelope, published to `epj`); an **event** (incl. per-goal progress) is\n`{ v: 1, topic, ts, data, correlation? }`; an **acceptance fact** is the `AcceptanceFact` of\n\xA713.4; a **terminal result fact** carries the goal's terminal state (one of the five\nterminal values of \xA713.6), outcome digest, and\nresult payload (or its digest-pinned reference). All are runtime-validated at their\nconsuming boundary.\n\n**Monotonic attenuation (invariant).** Envelope content, the `auth` slot, a handle,\nobligations; may only narrow what the presenting credential already permits, never widen it.\nA handler that honors envelope content as authority beyond the broker grant is non-conformant.\nAuthority *conferral* exists only as trusted redemption (\xA713.6 capability handle).\n\n**Error catalog.** `code` is one token: `bad-request`, `unsupported-version`, `op-mismatch`,\n`class-mismatch`, `target-mismatch`, `sender-mismatch`, `unauthenticated`,\n`permission-denied`, `not-found`, `already-exists`, `conflict` (CAS/fencing loss,\nfingerprint conflict, duplicate resume), `contract-mismatch`, `contract-invalid` (schema\noutside the profile / over budget at registration), `failed-precondition`,\n`deadline-exceeded`, `cancelled`, `expired` (lease, handle, lifecycle UID, epoch, token),\n`unavailable` (no responder), `unimplemented`, `resource-exhausted`, `internal`. Extensions\nadd codes only under reverse-DNS. A `code` (catalog or extension) is one token of at\nmost **64 bytes**, so every fact shape that embeds one (`RejectionFact`, `QuarantineFact`)\nstays bounded by construction and the \xA713.12 fact fixture is a true worst case.\n\n### 13.4 Delivery contracts\n\nThree delivery contracts, chosen per command class, declared in the contract, immutable per\nsubmission. Decision rule: crash means \"just re-ask\" \u2192 **ephemeral**; long-lived state\nsomething converges on \u2192 **record**; must survive restart, be audited, metered, or\ncompensated \u2192 **journal**. Wrong-class submission fails loud.\n\n**Ephemeral**, request/reply on the `ep` rails; no broker persistence; at-most-once effect\nunless the command is idempotent by `id`. No-responder is a loud `unavailable`.\n\n**Record**, a `{kind, schema, spec, status, meta}` resource in the per-space records bucket,\nstored as **two keys with independent revisions**: `<key>.spec` and `<key>.status`. The split\nis the broker-enforced writer boundary: the spec-writer and status-writer roles hold publish\ngrants on their own key only (per-kind writer table, \xA713.9). Writes use per-key CAS; a lost\nrace is a loud `conflict`. The merged logical read returns both\nrevisions and carries `status.observedSpecRevision`; a reader treats\n`observedSpecRevision < spec.revision` as a stale-but-valid level-triggered projection, not\nan error, and `observedSpecRevision > spec.revision` (a lagging spec read, possible across\nreplica freshness points) as its own signal to re-read the spec key, bounded retries until\ncaught up or the caller's deadline, never trusting the mismatched pair. Watch delivers\ncurrent values then deltas per key; a watcher that falls behind MUST re-read both keys and\nresume, never patch forward across a gap. Records are\nbounded (\xA713.8).\n\n**Journal**, an explicitly **untrusted at-least-once submission log** feeding **canonical\naccepted-fact subjects** with a mediated writer; effects consume only canonical facts, never\nraw submissions.\n\n1. A journaled submission is published to the submission plane (`epj`) as a **plain append**:\n submitters MUST NOT set `Nats-Msg-Id`, and native dedupe is **not relied upon**, the\n server does not accept a zero duplicate window (\xA713.12), so the reference config sets the\n server minimum and the guarantee rests on the header rule, not the window: a conformant\n submission carries no dedupe header and cannot be suppressed by one. Native broker dedupe\n keys on a caller-set header value compared\n **stream-wide**, so on a shared submissions stream any writer could pre-seed a predicted\n header value from its own allowed subject and silently suppress another caller's first\n submission for a full dedupe window, a cross-caller denial that no \"advisory\" framing\n makes safe; with the MUST NOT in force, a hostile header-bearing publish can suppress only\n another non-conformant header-bearing write. Transport retries therefore simply append\n again; the caller-scoped decision\n CAS below resolves every copy to one decision. Submission subjects and fact subjects are\n disjoint by construction (\xA713.2), so a submission credential cannot write a fact.\n2. The **semantic fingerprint** covers every effect-defining dimension, the fingerprint\n object is `{endpoint, command,\n class, authz?, target?: {owner, actor, lifecycleUid, mappingRevision?}, inputDigest,\n outputDigest, args, authDigest?, caller: {id, lifecycleUid}, goalId?, id}`, and the\n fingerprint VALUE is that object's `sha256:<hex>` content digest per \xA713.7 (strict\n RFC 8785 over I-JSON, the SAME canonicalization every contract artifact uses; one\n canonicalizer, never a second): absent optional fields are OMITTED from the object, never\n written `null`, so two implementations digest identical bytes, which also makes the\n fingerprint **computable for EVERY parseable submission**, however incomplete: a\n parseable envelope missing `class` or digests fingerprints the subset it carries and is\n rejected with that fingerprint. **\"Parseable\" here means canonicalizable I-JSON**, not\n merely syntactically valid JSON: bytes that parse but cannot be canonicalized, duplicate\n object names, a lone surrogate, a non-finite or out-of-I-JSON-range number; have no\n interoperable RFC 8785 form and therefore no fingerprint, so they take the quarantine\n path exactly as unparseable bytes and an invalid `id` do (\xA713.4 item 3: raw-byte digest,\n no fingerprint). Every submission thus has exactly one terminal path. Same id +\n same fingerprint is the same request (idempotent, first-wins); same id + different\n fingerprint (including the same args retargeted at a different lifecycle) is a loud\n `conflict`, never accepted or effected.\n3. The **canonicalizer**, the narrowly scoped mediated writer for this endpoint's facts\n (\xA713.9); consumes the submission plane through a **normative durable `AckExplicit`\n consumer** and acks a submission ONLY after a durable decision fact exists, and, for a\n pool-admitted acceptance, ONLY after the \xA713.6 EPW enqueue create has additionally\n succeeded (or lost its CAS to an already-present entry): a crash anywhere between\n acceptance and enqueue therefore redelivers the submission, and the reconciliation\n predicate resolves the redelivered copy; recovery never has to DISCOVER orphaned\n acceptances, because an acceptance without its enqueue is by construction an unacked\n submission that comes back. A crash before\n the fact redelivers the submission; a crash after it observes the CAS winner on\n redelivery. It validates each submission (schema, body/subject agreement incl. the target\n block, authorization per \xA713.6, and (for work-pool commands) pool admission/capacity\n BEFORE acceptance) and then decides each request exactly once by publishing a\n **decision fact** to the caller-scoped subject\n `epf.<endpoint>.dec.<cOwner>.<cActor>.<cUid>.<id>` with create-only CAS (expected last\n sequence on the subject = 0), so distinct callers can never squat each other's ids. **For\n an action command the canonicalizer additionally binds the goal before accepting**: it\n create-only-CASes a **goal-bind fact** `epf.<endpoint>.goal.<cOwner>.<cActor>.<cUid>.<goalId>.bind`\n carrying the accepted fingerprint, and rejects (`conflict`) any later submission whose\n `goalId` matches but whose fingerprint differs, so two distinct `id`s naming one `goalId`\n cannot both be accepted-and-effected (the decision CAS keys on `id`, which alone would let\n both through; the goal-bind CAS keys on `goalId`, which stops the second BEFORE acceptance\n and effect, not at the terminal-result stage where the effect has already happened).\n The decision is `accepted` or `rejected` (with the catalog error); **rejection is as\n durable, caller-readable, and idempotent as acceptance**, so a permanently invalid\n submission is distinguishable from a lost one. First decision wins atomically; a later\n attempt fails its CAS and reads the existing fact. There is no append-then-memo pair to\n crash between. The canonicalizer is a **singleton per endpoint** (one active principal,\n epoch-fenced like any serve identity, recovered through the \xA713.1 takeover barrier):\n admission checks (pool capacity for work-pool commands) are thereby serialized with the\n decisions they gate, so two canonicalizers cannot both admit the last slot; capacity is\n consumed by the acceptance itself, never checked apart from it. A submission that cannot\n yield a decision key; bytes that are not canonicalizable I-JSON (unparseable, duplicate\n object names, lone surrogate, out-of-range number), or no `id` within the token\n grammar; is\n **quarantined, never redelivered forever**: the canonicalizer publishes a\n **`QuarantineFact`** to the disjoint quarantine family\n `epf.<endpoint>.quar.<sourceSeq>` (\xA713.2); keyed by the source sequence, which exists\n for every stored copy by construction, in a family that shares no namespace with\n caller-chosen `dec` ids, so no legal request id can collide with a quarantine key, with\n create-only CAS, and terminally acks\n (`AckTerm`) the submission ONLY after that fact durably exists (or its CAS loss shows it\n already does), so a poison message cannot pin `MaxAckPending` and the\n fact-before-terminal-ack rule holds on the poison path exactly as on the decision path.\n `QuarantineFact` = `{ v: 1, decision: \"quarantined\", sourceSeq, submissionDigest (the\n `sha256:<hex>` digest of the raw stored bytes, \xA713.7), error: { code (catalog token),\n detail? (\u2264 256 bytes) }, caller?: { id, lifecycleUid } (from the broker-authenticated\n submission subject, when it parses), ts }`, every field bounded or fixed-size, so the\n fact fits by construction; it never carries the poison bytes themselves.\n4. Journal submissions set `replyExpected: false`; the caller **observes its decision** by\n watching/reading its own decision subtree (`epf.<endpoint>.dec.<its triple>.>`, a\n caller-scoped read grant minted with every journal capability). An action command's\n accept/reject is exactly its decision fact, expected within the submission deadline.\n5. The **acceptance fact is self-sufficient for effect and replay** (`AcceptanceFact`, the\n `accepted` decision): `{ v: 1, id, decision: \"accepted\", fingerprint, request: <the\n canonical EndpointRequest, args INLINE, bounded by the broker's max_payload; a submission\n too large is refused loudly with resource-exhausted, never spilled into storage>, caller:\n {id, lifecycleUid}, target?: {owner, actor, lifecycleUid, mappingRevision},\n contractDigests: {input, output}, authzDecision: {revision, epoch},\n route: \"effects\" | `pool.<pool>` (the acceptance's SINGLE execution route, decided by\n the canonicalizer at admission: a pool-routed acceptance is executed by the pool's\n worker path (\xA713.5) and the effects consumers MUST ack it without effect; an\n effects-routed acceptance is executed by exactly one instance off the shared effects\n durable (\xA713.9). No acceptance is ever executed twice, because the fact names its route),\n readinessDeadlineMs?: <the acceptance-relative readiness bound, present iff the command\n declares bounded readiness, \xA713.6; persisted HERE because it is goal state, not the\n request's decision deadline>,\n workExpiry?: <absolute expiry of a pool-routed item, present iff `route` is a pool, \xA713.8;\n survives reconciliation re-enqueue unchanged>, sourceSeq, ts }`. A `target`-bearing\n acceptance (work bound to a lifecycle) publishes ONLY after its target-indexed\n obligation row exists AND only under an unexpired admission proof the mediator issued\n for that row (\xA713.8: proof issuance is the post-create currency recheck, so a row whose\n target or policy moved between create and recheck never admits; the fact's durable\n address is caller-scoped, so the obligation row, keyed target-first, is the ONLY\n target-enumerable record a retirement barrier can drain;\n `target.mappingRevision` is provenance, never a fence). The\n canonicalizer preflights the **serialized decision fact**, not merely the inline args,\n against `max_payload`: a submission whose acceptance fact would not fit is rejected\n `resource-exhausted`, and the rejection fact always fits by construction: every field\n is bounded or fixed-size (the operator floor assertion covers the maximum serialized\n rejection/quarantine fact, \xA713.12):\n `RejectionFact` = `{ v: 1, id, decision: \"rejected\", fingerprint, error: { code (catalog\n token), detail? (\u2264 256 bytes) }, caller: {id, lifecycleUid}, authzDecision?: {revision,\n epoch}, sourceSeq,\n ts }`; the fingerprint and the catalog error, never the args (a parseable submission\n always yields the fingerprint; the unparseable/no-id case is the QuarantineFact above,\n which requires neither `id` nor `fingerprint`). Digest-pinned\n references inside a fact may name **only already-published public contract artifacts**,\n never per-request payloads: the contract store is public, immutable, and permanent,\n the opposite lifecycle of private, horizon-bounded request content (a large-payload\n facility, if ever needed, is its own future primitive with its own store, retention, and\n \xA713.9 rows). Effects and replay read the fact, never the raw submission (a TOCTOU re-read\n of the untrusted log is non-conformant).\n6. Decision facts/tombstones are retained at least the declared **idempotency horizon**\n (default 24h, space-configurable) AND longer than the maximum submission-log retention\n plus recovery/redelivery lag; otherwise a rebuilt canonicalizer could re-accept an old\n submission still sitting in the log as new work. The horizon is **realized by decision\n retention, not by a clock**: the create-only CAS returns the recorded decision for exactly\n as long as the fact exists, and a reused id becomes new work only once retention has\n evicted the old fact and freed its subject; there is no separate time rule for the CAS\n to disagree with. The \xA713.12 retention floor states the horizon by OUTCOME: no removal\n cause may drop a decision fact or tombstone before it. The canonical subjects are the authority (D12) for anything\n auditable, metered, compensated, effected, or replayed. Ordering is per-subject;\n consumers never assume cross-subject order.\n\n**Events are not facts.** Cluster events and per-goal progress (`epe`) are direct,\nepoch-fenced, instance-published notifications on a durable, ordered, replayable stream;\nthat is the sense in which they ride the journal contract. They do NOT pass through the\ncanonicalizer, carry no acceptance semantics, and MUST NOT drive effects that require\ncanonical acceptance; anything auditable/metered/compensated goes through submissions and\nfacts.\n\n### 13.5 Verbs\n\n- **call**, bounded request/reply (`replyExpected: true`, `deadlineMs` mandatory). On the\n `one` rail it is queue-group anycast; on `inst` it addresses one stable instance. No\n responder \u2192 `unavailable`.\n- **cast**, the same subjects and grants (`replyExpected: false`): fire-and-forget,\n at-most-once, the responder MUST NOT reply and the caller never reads the rail (the nonce\n is present but unused). A cast to a journaled command is `class-mismatch`; journaled work\n goes through submissions.\n- **watch**; observe a record (KV watch; fell-behind \u21D2 re-read, \xA713.4) or an event topic\n (live subscription within the read grant plus filtered replay from the event stream).\n Per-key and per-goal subjects carry read containment; a watch grant names the exact subtree.\n- **claim**, competitive at-most-one-winner acquisition from a durable work pool (`epw`),\n **owner-mediated**: the pool's owning endpoint holds the pool's single `AckExplicit` pull\n consumer (\xA713.12); workers hold **no** JetStream grant on the pool and acquire, renew, and\n settle work exclusively through the owning endpoint's reserved **`lease`** and **`commit`**\n commands on the ordinary `ep` rails. This is the only shape that satisfies both claim\n invariants at once: the delivery's ack token never leaves the party allowed to use it, and\n the attempt binding is **owner-recorded at assignment** rather than asserted by the worker\n (a worker-carried \"sequence + attempt\" proves nothing about delivery; an owner assignment\n does). The stored pool message is **work identity and input only, never the authoritative\n lease**: broker redelivery re-delivers the same stored bytes, so a token in the payload\n cannot fence, and the consumer's `ack_wait` is the broker's redelivery-to-owner timer only,\n never the lease. `lease` (call): the owner fetches the next stored item and records the\n lease `{item, sourceSeq, attempt: the delivery count, worker: the broker-authenticated\n caller (principal + lifecycle UID, plus epoch for endpoint workers), fencingToken,\n leaseDeadline}` in its `lease` record (key grammar \xA713.7, writer table \xA713.9) by\n **first-wins idempotent CAS per (item, attempt)**, a duplicate or\n delayed `lease` call for a still-current attempt returns the SAME lease; an attempt is\n superseded once redelivery advances the delivery count; `fencingToken` is CAS-incremented\n per attempt and `leaseDeadline` comes from the owner's own clock. Expiry revokes the claim\n at that deadline even before reassignment. Every Cotal-owned commit from claimed work is\n submitted through the reserved **`commit` command** carrying the exact lease tuple; the\n handler validates token currency AND unexpired lease against its own clock AND that the\n caller is the lease's bound worker, then performs an **atomic, idempotent per-item CAS to\n a cached terminal result**, the per-item terminal fact\n `epf.<endpoint>.wrk.<pool>.<acceptance identity>` (\xA713.2), create-only CAS per item,\n under its mediated writer credential (\xA713.9): a committed item\n can never be leased again, a duplicate commit returns the cached terminal outcome, and a\n raced commit loses loudly. Only after observing the committed terminal state does the\n owner ack the WorkQueue message; it holds the delivery natively, so the deletion\n capability is never transferred, and no worker-side ack can destroy an item whose commit\n was rejected. A lost owner ack merely redelivers the item to the owner, which observes the\n committed terminal state and acks again: **settled work is never re-enqueued as new** (the\n durable bridge is the acceptance fact plus the per-item terminal CAS; an accepted item\n with no terminal result and no live pool entry is the only re-enqueueable state, \xA713.6). A\n stale token, expired lease, or superseded worker is `expired`/`conflict`; workers hold no\n bypass write.\n- **scatter**, a request on the `all` rail. The caller freezes a **request-scoped expected\n set**, the live instances of the class from the service registry, each as\n `(instanceId, registrationRevision, epoch)`, where `registrationRevision` is the store\n revision of the instance's `svc\u2026.spec` record key (\xA713.7: it advances only on mediated\n registration writes, and the record read/watch grant that freezes it is a \xA713.9 matrix\n row), at send time. Gather accepts at most one\n terminal reply per expected `instanceId`, attributed from the reply subject **including its\n epoch** (\xA713.2): a second reply from the same `(instanceId, epoch)` is classified\n `duplicate` and **reported, never silently dropped** (first reply wins); a reply from a\n frozen `instanceId` at a different epoch, or an observed registration-revision advance;\n is classified `churn` (the instance restarted mid-scatter and may never have seen the\n request) and does not count toward completion; replies from outside the frozen set are\n classified `unexpected` and never count toward completion. Completion is\n all-expected-replied or deadline, in which case the result is explicitly partial with\n `missing` / `churn` / `unexpected` / `duplicate` / `late` classifications (a churned slot\n reports as `churn`, not `missing`). An empty or unreadable registry is\n `failed-precondition`, not an empty success. Deadline mandatory.\n\n### 13.6 Composites\n\nPatterns over the verbs and contracts; zero new transport.\n\n**Action**, a long-running command. `action` is a command **marker**, never a class: an\naction command's submissions are `class: journal` (\xA713.3).\n\n1. The caller submits with a client-generated `goalId` and the request fingerprint (\xA713.4).\n Accept/reject is the durable decision fact (\xA713.4), expected within the submission's\n decision deadline; there is no reply-rail answer to recover.\n **Authorization linearizes at acceptance**: the acceptance fact persists the caller and\n target lifecycle tuples, command + contract digests, and the authorization decision\n revision/epoch it was made under. A scope narrowing before acceptance rejects the goal;\n after acceptance it blocks *new* goals but an accepted goal continues, unless the\n command's contract declares **continuous reauthorization**, in which case each declared\n checkpoint re-validates and deterministically transitions to `cancelling`/`failed`\n (`permission-denied`) on narrowing. Handle expiry/revocation mid-goal follows the same\n declared policy.\n2. States: `accepted \u2192 running \u21C4 waiting \u2192 succeeded | failed | cancelled | expired |\n uncertain`, with\n `cancelling` between a cancel and its terminal state. This is the **single status\n vocabulary** for every long-running surface. All five of `succeeded`, `failed`,\n `cancelled`, `expired`, and `uncertain` (item 6) are **terminal**, and first-terminal-fact-wins\n applies uniformly: `uncertain` is not an absence of an outcome, it is the outcome\n \"this action's success signal did not arrive within its readiness deadline\".\n3. Progress rides per-goal events (`epe\u2026goal.<caller triple>.<goalId>.progress`), read-scoped\n to the caller at mint time. The goal's current state is a status-only record projection;\n the journal owns the facts.\n4. Cancel is the reserved `cancel` command: `graceful` (compensations, default) or\n `terminate`. Cancel of an unknown/terminal goal is `failed-precondition` with the cached\n outcome attached. Cancel races completion at the mediated commit point: first terminal\n fact wins; the loser observes it.\n5. The terminal result is a journal fact and is cached. The full payload is retained at least\n the declared result retention (default 24h); a **terminal tombstone**\n `{goalId, fingerprint, state, outcomeDigest}` at least the idempotency horizon (\u2265 result\n retention; outcome-stated by the \xA713.12 retention floor). Same goalId + fingerprint returns the cached outcome (after payload eviction:\n the tombstone summary, `data.evicted: true`); same goalId + different fingerprint is\n `conflict`; beyond the horizon a reused goalId is explicitly new work.\n6. **Bounded readiness (`uncertain`).** An action whose success signal may lawfully not\n arrive within its readiness bound declares a **readiness deadline**, a distinct,\n acceptance-relative bound persisted in the acceptance fact/goal state, NOT the\n submission's `deadlineMs` (which bounds only the decision, \xA713.3). Spawn readiness is\n the reference case: its readiness deadline is **30 s**, the migrated presence-or-exit\n backstop, D29; every legacy spawn-timeout consumer converges on this single bound. When\n the deadline passes without the signal, the owner records the goal's terminal **result\n fact** (`goal\u2026.result`, \xA713.2) with the outcome\n `uncertain`, and the goal IS terminal: `uncertain` is a terminal outcome like\n `succeeded`/`failed`, immutable, first-terminal-fact-wins as for any goal (there is no\n call and no reply rail here: an action is a journal submission, and the result fact IS\n the caller-visible outcome, item 5). The underlying ENTITY's later convergence\n (ready/exited) is observable on that entity's own status record (`svc\u2026.status`, the\n lifecycle mapping); a caller that needs the eventual answer watches the entity, never\n the goal; the goal is not rewritten and its status does not linger non-terminal.\n7. Goals bind the target's `(principal, lifecycleUid)` (\xA713.1): a goal accepted against a\n lifecycle is not redeemable, cancellable, or effectful against a same-name successor. A\n restarted instance (same `instanceId`/UID, advanced epoch) recovers its goals from journal\n + records; a superseded epoch cannot commit transitions.\n\n**Awaitable checkpoint**; one durable pause primitive (approvals, guard holds, payment\nauthorization). A waiting action mints a checkpoint: a durable token persisted with the goal,\na `waiting` status carrying the checkpoint id and its **deadline generation**, and a durable\ntimer (\xA713.12). Deadlines are mandatory. Heartbeat/extension CAS-advances the generation in\nstatus, then replaces the timer (a new `.schedule` request; the mediated timer writer's\nsame-subject `.armed` publish is the server rollup, \xA713.2/\xA713.12, the 2.14 atomic\nstop-plus-publish is NOT assumed at the 2.12 floor). A firing timer carries\n`(timerId, generation)`; the endpoint validates the generation against current status before\nacting, stale fires **no-op**. Because status and timer are two resources with no atomic\nbridge, a **durable reconciler** on the owning endpoint repairs the pair after crash or\nleadership change WITHOUT any status\u2194schedule read the no-read timer plane cannot serve: the\nreconciler **re-emits a `.schedule` request at the current generation for every `waiting`\nstatus it owns**, and a same-`(timerId, generation)` arm is **idempotent at the timer writer**\n(it re-derives the same `.armed` message; a duplicate is a no-op replacement), so\nover-emission is harmless and a missing schedule is repaired without the reconciler ever\nhaving to observe whether one exists. Stale-generation fires still no-op at the handler. Cancellation of a timer is cleanup, never the correctness boundary.\nTimer retention MUST exceed the maximum deadline plus a recovery margin. Resume: a `resume`\ncommand presenting the checkpoint token; resume authorization is **one-use** (journaled by\ncreate-only CAS on the checkpoint token; duplicate resume is `conflict`) and holder-bound\n(\xA713.10). Expiry fails the checkpoint closed.\n\n**Guard checkpoint**, the pre-effect authorization hook. A command carrying the governed\n`ai.cotal.guarded` trait MUST NOT effect until the guard endpoint named by the trait value\nanswered **allow** (class call). Answers: `allow | deny | hold` plus optional signed\nobligations (attenuations the endpoint MUST apply; monotonic). `hold` converts the action to\n`waiting` on a checkpoint owned by the guard decision. Timeout or unreachable guard is\n**deny** (fail closed). Ordering is guard-then-effect. Side-effecting guards own their own\nreconciliation.\n\n**Capability handle**, the one passable reference type: a signed JSON grant, RFC 8785\ncanonical, Ed25519-signed by a key in the trust-anchor registry (\xA713.10):\n\n`{ v: 1, id, space, issuer: { keyId }, holder: { id, lifecycleUid }, grants: [{ endpoint,\ninstanceId?, commands: [{ name, authz?, targetOwner?, targetActor?, targetLifecycleUid? }],\nreads?: [<record-key or event-topic subtree>] }], iat, nbf?, exp, parentDigest?, sturdy,\nepoch?, sig }`\n\nA grant entry carries **every subject-level dimension** a capability has (\xA713.9): a targeted\ncommand names its authorization mode and target components; read scopes name exact\nrecord-key / event-topic subtrees. The per-command target tuple is a **closed set of three\nlegal shapes**, no target components; `targetOwner` alone; or the full triple\n`{targetOwner, targetActor, targetLifecycleUid}`, and **every other combination is\nschema-invalid** (`contract-invalid`): in particular `targetActor` without\n`targetLifecycleUid` (a handle that pins a recyclable alias component MUST pin the lifecycle\nit means) and `targetLifecycleUid` without `targetActor` (a lifecycle restriction with no\ncompile target would otherwise be silently DROPPED into an owner-wide grant, a partial\ntuple never weakens into a broader one). The normative compiler maps a grant entry to\nexactly the subjects the equivalent minted capability would receive (never wider) it MUST\nconsume every present signed component (a component the compile target cannot express is\nschema-invalid, never ignored), and every legal entry HAS a compile target:\n\n- a **no-target** entry compiles to the untargeted or `self` form per the command's\n contract; an `authz` field on it is schema-invalid.\n- an **owner-domain** entry (`targetOwner` alone) compiles to the mode its `authz` field\n names, `owner` (the default), `child`, or `ledger`, and NOTHING else: each pins the\n signed `targetOwner` in that mode's own subject form (\xA713.2), **never collapsing `child`\n or `ledger` to `owner`** (the modes are distinct validator-primary rails and rewriting\n one into another widens authority), and **`authz: \"any\"` is schema-invalid in a handle\n grant entry** (`contract-invalid`): the `any` rail is operator-ceiling authority, minted\n only as a standing capability under an operator-scoped anchor (\xA713.10), never conferred\n or attenuated through a handle; a compiler therefore has no `any` case, and no\n implementation choice exists between rejecting, literalizing, or widening it.\n- an **actor-pinned** entry (the full triple) compiles to the `handle`-mode form pinning the\n full signed triple `<targetOwner>.<targetActor>.<targetLifecycleUid>` (\xA713.2); an `authz`\n field on it is schema-invalid (the triple IS the mode).\n- an **instance** entry compiles to\n the exact `ep.inst` rails; complete, because `(endpoint, instanceId)` is the whole instance\n address and instance ids are never reused (\xA713.1).\n\nA capability that cannot be represented in this shape MUST\nNOT be carried by a handle.\n\n- **Two uses, both fail-closed.** *Attenuation:* presented in the `auth` slot, a handle only\n narrows; the handler enforces `effective = presenter-cred \u2229 handle.grants \u2229\n issuer-authority`, and additionally requires any signed target triple to match the\n request's target and the current mapping (`expired` on mismatch); it never confers broker\n reach. *Conferral:* a handle grants reach only by **redemption through the trusted auth\n path** (the exchange/callout of \xA79/\xA710), which verifies the signed target triple against\n the current mapping **at redemption time** (`expired` on mismatch) and mints a short-lived\n credential whose grants are the intersection of issuer authority, handle grants, and the\n redeeming holder's current lifecycle + credential; actor-pinned grants compile to\n `handle`-mode subjects carrying the verified triple (\xA713.2), so a target lifecycle that\n rotates after mint is caught by the endpoint's currency check; no handler-side widening\n exists. The minted credential is **ledgered before release** in the credential ledger\n (\xA713.1), keyed under the redeeming holder's lifecycle with the FULL presented handle\n chain as its `sourceChain` (plus the per-ancestor `bysrc.` index keys), so\n takeover/retirement barriers revoke it with the family and revoking ANY handle in its\n lineage (parent or leaf) cascades to it. Chain verification itself checks the\n revocation status of EVERY sturdy link in the chain, not only the presented leaf,\n failing closed on any revoked ancestor.\n- **Holder-bound:** `holder` names the one `(principal, lifecycleUid)` that may present or\n redeem it; bearer transfer exists only as an explicit issuer-signed re-issue. `space` binds\n it to one space. A recycled alias cannot present its predecessor's handles (UID mismatch).\n- **Attenuation chain:** `parentDigest` references the parent handle; a child MUST be \u2286 its\n parent under the **normative containment order**, per grant entry: endpoint within the\n parent's endpoint/domain pattern; `instanceId` equal or newly pinned (never widened to\n absent); commands a name-subset with per-command mode never higher in `self < owner < any`\n (`child`/`ledger`/`handle` are grantable only where the parent names the same mode); target\n components equal or newly pinned; read subtrees subject-prefix-contained, and per\n envelope: same `space`, validity window within the parent's, `sturdy` only if the parent is\n sturdy. The issuer of a child is the parent's holder, anchor-registered with a `handles`\n role whose scope covers the child (\xA713.10); the same containment order defines issuer-scope\n coverage. Presentation carries the full chain inline (`parentDigest`-linked artifacts\n presented together, no ambient fetch); verification walks every link to a registered\n anchor, failing closed on widening, unknown/revoked keys, or expiry.\n- **Sturdy vs live:** live handles (`sturdy: false`) bind the current process `epoch`, are\n never persisted, `exp \u2264 24h`, and die on restart. Sturdy handles bind the lifecycle UID\n (surviving supervised restart), persist as issuer-namespaced `handle.<issuerKeyId>.<id>`\n records (spec create-only; status = revocation state, monotonic; \xA713.9 writer table), and\n verifiers MUST check revocation (fail closed if unreadable). Max sturdy TTL is\n space-configured (default 30d).\n- Handles are reusable within TTL unless a composite declares one-use (checkpoint resume);\n the replay matrix of \xA713.10 governs every signed artifact.\n\n**Session (bidirectional stream)**, the generic composite for interactive byte/frame\nstreams (terminal attach is its first consumer; nothing terminal-specific is normative). It\nis exactly D26's cast-ingress + watch-egress composed over dedicated per-session subjects,\nno new verb and no new transport: the `in` subject is a cast-only rail (caller publishes,\nendpoint subscribes) and the `out` subject is a watch rail (endpoint publishes, caller\nsubscribes). A session is established by an ordinary command whose answer is a **session\ngrant**: a one-use,\nholder-bound handle (live: bound to the caller's lifecycle AND current process epoch,\nlive authority dies on restart, \xA713.1, so redemption fresh-checks the holder epoch and an\nunredeemed grant does not survive the caller's restart, plus the serving instance epoch) naming a fresh\nunguessable `sessionId` and the epoch-pinned session subjects\n`eps.<endpoint>.<sessionId>.<epoch>.in` (caller \u2192 endpoint) and `\u2026.out` (endpoint \u2192 caller).\nSession subjects are **core-only**, never stream-captured; the bounded flow window lives in\nmemory and a dropped frame is the composite's problem, not retention's. Redemption mints\nexact asymmetric per-session credentials: the caller publishes `in` and subscribes `out`;\nthe serving instance the reverse; no third party holds either, and no standing wildcard EPS\ngrant exists. Frames are opaque; flow control is bounded (window declared in the grant;\noverflow is `resource-exhausted`, never unbounded buffering). Close is explicit, and\nrevocation has a **durable** named authority that survives the\nserving endpoint: the trusted auth path (the exchange/callout of \xA79/\xA710) persists a **session\nledger row** at redemption, key `session.<sessionId>` in the auth store (\xA713.12), value\n`{sessionId, endpoint, serving instance + epoch, holder (principal + lifecycleUid), both\nminted credential ids, per-credential revocation marks, state, exp}` (the endpoint is in the\nrow because an `instanceId` is unique only within its endpoint, so every serving-party\noperation authenticates against the full serving identity the row pins), create-only CAS per\n`sessionId` (this CAS IS the one-use\nredemption), state monotonic\n(`active \u2192 closed | expired | superseded | retired`, all terminal), and each per-session\ncredential is simultaneously a credential-ledger row under its holder's lifecycle (\xA713.1),\nwhich is the index the \xA713.1 barriers enumerate, and a barrier that revokes a\nsession-sourced credential MUST resolve its `session.<sessionId>` row, transition it\nterminal, and revoke BOTH per-session credentials, so either side's takeover or retirement\ntears down the whole pair, not its own half. Redemption's writes are ordered by a **finalize CAS**, so no half-issued session is ever\nusable: the create-CAS writes the session row in state `issuing` (this create IS the\none-use), then both per-session credential rows are written gate-checked (\xA713.1), then the\nredemption **CAS-finalizes the session row `issuing \u2192 active`**, fresh-checking BOTH the\nholder and serving process epochs and both lifecycle gates at that CAS, and releases the two\ncredentials only on finalize success. A credential is authority ONLY once its session row is\n`active`; an `issuing` row confers nothing. Close/expiry/either barrier CAS the row to a\nterminal state (`closed`/`expired`/`superseded`/`retired`) and revoke both credential ids by\nname (the ids are known from the row, whether or not both credentials were released) so a\ncrash mid-issue leaves an `issuing` row that the expiry sweep collects (revoking both ids and\ntombstoning), never a live half-pair, and a redemption racing a close loses its finalize CAS\nand releases nothing. A revocation mark is set only by a revoke that SUCCEEDED; a terminal\nrow with an unmarked credential is retried by every later sweep pass, exactly the unconfirmed\nids, until both marks confirm, so a transient revocation failure can never quietly leave half\na pair alive. The auth path revokes BOTH per-session\ncredentials with eviction (bounded\npropagation) on any of: an **authenticated close input** on the trusted auth path itself,\na defined operation of the SAME exchange/callout surface that redemption already uses\n(\xA79/\xA710, off-broker, so no broker grant row applies): the caller authenticates as one of\nthe session's two parties (its lifecycle or per-session credential) or as the operator and\nnames the `sessionId`; the auth path verifies party membership against the ledger row\nbefore transitioning it. The in-band close frame\nis an advisory peer signal, never the revocation authority, because EPS subjects are\ncore-only and captured by nothing; expiry per the handle rules (`exp` is enforced by the\nauth path's own timer, not by the endpoint), or the serving\nepoch's supersession / lifecycle retirement via the \xA713.1 barriers (either side's lifecycle:\nholder and serving rows both index the family). Neither side can keep a\nhalf-closed session alive, and a crashed serving endpoint cannot orphan one, the ledger, not\nthe endpoint, remembers what to revoke. Ledger rows are retained at least the maximum\nsession `exp` plus a recovery margin. The session dies with the serving instance's epoch\n(the epoch is in the subject, so a restarted instance cannot resume it; a durable session is\na new establishment). Routing is authenticated broker routing end to end; there is no loopback URL\nor out-of-band transport in the contract, and cross-machine reachability is exactly broker\nreachability.\n\n**Virtual endpoints.** An endpoint MAY be virtual: registered (`spec.activation = on-demand`)\nwith no live instance. A virtual endpoint's commands MUST be journal-class: the buffered\ningress path is the ordinary submission plane (`epj` is durable and needs no live\nsubscriber), and the canonicalizer, which for a virtual endpoint runs wherever its\nactivator/owning authority runs, checks pool admission BEFORE deciding (an over-capacity\nsubmission is rejected `resource-exhausted` as its durable decision fact, never accepted and\nstranded), then accepts and enqueues the work into the endpoint's `epw` pool. Admission\noccupancy is the pool consumer's `num_pending + num_ack_pending`, read fresh from the exact\nper-pool consumer INFO after reconciling the canonicalizer's own outstanding acceptances\nagainst the predicate below (a repaired item is inside the count new work competes under);\nthe read fails closed (an unreadable consumer is `unavailable`, never an empty pool), and the\nsum is honest only while the pool consumer's delivery ceiling is unlimited\n(`max_deliver = -1`) AND its filter is exactly the pool's own subtree; BOTH are editable after\ncreation, so both are pinned at creation AND re-proved at every read (a message that exhausts\na finite ceiling stays stored but leaves both counters; a narrowed or foreign filter reads\nempty while stored work remains). The admission capacity comes from the endpoint's REGISTERED\nactivation policy (declared as the registration's `spec.activation` block, a closed schema\nwhose `capacity` is required; the registration path publishes each version as an immutable\n`policy` record, \xA713.7, and the govern head's selector below names the enforced one), READ\nleader-served at each decision (the read is FENCING by use, so a\nfollower Direct Get is never used; a scoped canonicalizer executes it only through the\nconfined policy reader of \xA713.8, whose request subject binds the authenticated endpoint)\nand its enforced revision RE-PROVEN after the decision's\nlater reads and carried into the acceptance commit, never a free-standing argument; the\ncarried revision is provenance, and the FENCE against the policy or lifecycle moving while\nthe acceptance is in flight is the \xA713.8 obligation row, not the carried value. The\n**endpoint-wide policy coordinate** is not a new head: it is the governance head\n`govern.<endpoint>` (\xA713.7, the endpoint's registration linearization point). To make the\nenforced policy MACHINE-SELECTABLE by any second implementer (not inferable from prose), the\ngovern head value carries a normative **policy selector**: `{ enforcedPolicyKey (the exact\nrecords key of the immutable `policy` record currently governing, \xA713.7), enforcedPolicyRevision\n(that record's STORE revision), pendingPolicyKey?, pendingPolicyRevision? }`. A canonicalizer reads\ngovern leader-served, follows `enforcedPolicyKey`, and re-proves it is still at\n`enforcedPolicyRevision`, with no per-instance guesswork; `policyRevision` throughout this\nsection IS `enforcedPolicyRevision`. **`enforcedPolicyKey` MUST name an IMMUTABLE,\nREVISION-ADDRESSED policy record, not a mutable per-instance slot** (a bare\n`svc.<endpoint>.<instanceId>.spec` overwritten on every re-registration is disqualified: the\nrecords bucket keeps history 1, so once a mutation overwrites it the OLD `enforcedPolicyRevision`\ncan no longer be read, and the drain window's claim that \"the old policy keeps governing\" would\nbe unbacked). The normative immutable form is the **`policy` record kind** (\xA713.7):\n`policy.<endpoint>.<digest-hex>`, one unsplit, create-only, NEVER-DELETED key per policy\nversion, where `<digest-hex>` is the SHA-256 hex of the record's canonical value bytes: the\nkey is self-certifying (a reader re-digests the value and refuses a mismatch), so a\ndifferent-byte overwrite is caught on read, and BOTH the enforced and the pending revisions\nstay readable throughout the drain. Immutability is upheld by the sole writer's create-only\nCAS plus that read-time self-certification, not a broker-level subtraction (\xA713.9). A\ndeployment that cannot provide an immutable policy key MUST pause admission during the\nmutation rather than claim the old value remains readable.\nA policy mutation is a re-registration under the frozen registration gate that lands in TWO\nfenced govern-head CAS steps (\xA713.9): (1) **stage** records the new registration as\n`pendingPolicy{Key,Revision}` (a NEW immutable policy key) while `enforcedPolicy...` still\npoints at the OLD immutable record, so\nthe old policy keeps governing and stays readable; (2) **promote**, only after the mutation has **drained the\nendpoint's unresolved obligations to quiescence** (\xA713.8: enumerate `oblig.*.<endpoint>.>`,\nsettle every unresolved row pinning an older `enforcedPolicyRevision` through its decision\ncoordinate, re-enumerate until none remain), moves `pendingPolicy...` into `enforcedPolicy...`\nand clears the pending slot. Admission always pins the CURRENT `enforcedPolicyRevision`,\nand **while a `pendingPolicy\u2026` is staged, proof issuance for policy-admitted decisions\nREFUSES** (`failed-precondition`: the endpoint is inside its drain window; target-bound-only\nadmissions are unaffected). The pause is what makes the drain CONVERGE under load and makes\n\xA713.8's rule (a row created after the drain's final enumeration can never admit) hold for\npolicy movement exactly as it holds for retirement; rows admitted BEFORE the stage keep their\npinned old revision readable through the immutable key, so no admission is ever judged\nagainst a policy it did not pin. The stage/drain/promote order is a durable, resumable\ngovern-head sequence, never an implied transaction. The **restart-status commit is the same two-coordinate\nclass**: before its status CAS the supervisor obtains a `self`-class obligation (\xA713.8)\nthrough the same mediator, pinning the `enforcedPolicyRevision` its thresholds were read\nunder AND the complete commit intent `{ commitKey, commitBaseRevision, commitValue, commitDigest }`\nof the\nstatus record it will write; the status CAS is authorized only while that obligation is\n`accepted`, so a policy or lifecycle movement settles the obligation and the delayed commit\nloses a CAS, and a crash after `accepted` is finished deterministically from the pinned\nintent (\xA713.8 recovery), never a\ncarried-revision comparison. The\nrestart-intensity thresholds are read leader-served from the SAME registered policy, so neither\na caller nor a follower-stale read can loosen the window to suppress an escalation. A command\nname is declared ONCE across the whole closure; a cross-cluster duplicate is an ambiguous\nsurface and registration refuses it, and a command declared non-journal-class in ANY cluster is\nnon-journal for the on-demand registration check. The supervisor-owned status fields (the\nrestart history and the retirement mark) and the `escalated` state can be ORIGINATED only\nunder the supervisor's DISTINCT WRITE AUTHORITY (a package-private branded capability held by\nthe restart-note and the escalation reconciler, never an ambiently-mintable factory or the mere\npresence of a revision pin): an instance-side status write, whether it creates the first status\nor updates a later one, has them stripped and cannot originate `escalated`. The restart history\nand retirement mark are validated at every read boundary (a unique-epoch history, an integer\nmark present only on an escalated row), and a DEL/PURGE status marker fails closed on the\nretirement path (a deletion is never clean absence). Every status write operates on a validated DETACHED snapshot\ntaken before its first read, so a caller mutating a shared status object mid-write cannot split\nthe authenticated coordinate from the stored bytes. The activator's reply authority is its\nown CONNECTION-SCOPED inbox (`_INBOX_<connId>.>`), never the account-wide default, and its\noccupancy read re-proves the pool consumer's ack policy and pull mode alongside its editable\ndelivery ceiling and filter (a delete/recreate must not substitute a semantically different\nconsumer). A supervision clock behind the newest recorded restart is refused before the\nduplicate-note short-circuit, so a rolled-back clock never returns a stale count. The virtual endpoint's canonicalizer durable serializes admission\n(`max_ack_pending = 1`): one submission is in the count-decide-enqueue path at a time, so two\nsubmissions cannot both observe the same free slot; because MaxAckPending is also editable\nafter creation, every admission re-proves the live pin and refuses on drift rather than\ndeciding under a serialization it no longer has; pool-worker execution concurrency is an\nindependent knob, already inside the count via `num_ack_pending`. A virtual endpoint's\nregistration REFUSES if any declared command is not journal-class (an ephemeral surface\ncannot exist with no live instance). Acceptance and\nenqueue span two streams with no atomic bridge, so the enqueue is **idempotent, keyed by the\nacceptance identity, and reconciled against a decidable predicate**: the pool subject carries\nthe acceptance identity and the enqueue is a create (expected-last-sequence-for-subject 0),\nso a duplicate enqueue loses its CAS harmlessly; because the pool owner acks only after the\ncommitted terminal state (\xA713.5), an acceptance fact **with** a terminal result is settled\nand never re-enqueued, and an acceptance fact with **no** terminal result and **no** live\npool entry (a FENCING absence: the probe is the leader-served `STREAM.MSG.GET` last-by-subject\nread of the \xA713.9 work-pool reconciliation row, never a follower-servable Direct Get, because a stale\nfollower miss would re-arm settled work) is unambiguously never-enqueued-or-lost, the\nonly re-enqueueable state. A crash after the acceptance CAS but before the enqueue is\nrepaired by exactly that predicate; an enqueue without an acceptance fact cannot occur\nbecause only the canonicalizer holds the pool-write grant and it enqueues only from its own\naccepted decisions. The stored item bytes are the CANONICAL derivation of the acceptance \u2014\nthe RFC-8785 canonical JSON of exactly `{ v: 1, id, fingerprint, sourceSeq, workExpiry,\ncaller, request }` (work identity + input only; never a lease, token, or decision metadata) \u2014\nso any two conforming writers (a first enqueue and a crash repair) produce BYTE-IDENTICAL\nitems, and the create's same-subject-same-bytes idempotency holds across them; a differing\nbody under the same acceptance identity is a mixup and refuses loud. An ephemeral\ncall to a virtual endpoint with no live instance is an honest `unavailable`; nothing\nsilently buffers it. An **activator** (holder of its activation capability) watches the pool\nand starts an instance; single-writer per identity is fenced by instance-record CAS +\nepoch. The exact consumer INFO the activator watches is a request/reply snapshot with no\nbroker wakeup, so watching is bounded polling with backoff to a finite maximum interval, and\nan INFO failure is loud, never a silent skipped poll; the activator's broker authority is\nexactly that INFO read plus its mediated, target-bound start seam (no pool consume/ack, no\nstream read, no consumer create/update/delete). Passivation drains, updates status, exits;\ndurable reminders ride the timer plane.\nSupervision is restart-intensity escalation: more than `maxRestarts` (default 3) within\n`restartWindow` (default 60s) escalates; the instance stops restarting, status records\n`escalated`, the lifecycle retires terminally (\xA713.1), and the failure is loud. The restart\nhistory is DURABLE on the instance's own status record, SUPERVISOR-OWNED (the status writer\ncarries it forward through every ordinary instance-side write, so a successor's `ready`\nconvergence can neither reset nor forge it), and each note is a revision-pinned CAS: a\nsupervisor restart cannot amnesty the count and two concurrent notes cannot merge-lose a\nrestart. Each history entry is bound to the DYING PROCESS EPOCH (a real restart advances the\nepoch), so a replayed or duplicated notification of one restart is an idempotent no-op, never\na double count; and a supervision clock behind the newest recorded restart REFUSES rather\nthan silently truncating history. `escalated` is IRREVERSIBLE at the status writer (no later\nwrite, any epoch, replaces it), refuses further notes, and is excluded from every liveness\nderivation (a frozen scatter expected set never contains an escalated instance). The\nescalation commits before the lifecycle retirement runs; the retire seam MUST be idempotent,\na retirement failure leaves the escalation standing, and a reconciler retries retirement on\nalready-escalated rows until it completes, recording completion durably (nothing\nun-escalates).\n\n### 13.7 Contracts and discovery\n\n**Clusters.** An endpoint's surface is a set of composable **capability clusters**, each\n`{ urn, revision, attributes[], commands[], events[] }`:\n\n- `urn`, reverse-DNS cluster type URN (`ai.cotal.lifecycle`, `com.acme.deploy`).\n- `attributes`, readable/watchable state; each declares a name, value schema, and record\n derivation (which record key carries it). Attribute reads/subscribes ride the record\n contract, never ephemeral replies.\n- `commands`, each declares name, input/output schemas, `class`, `targeted` (and if so which\n authz modes it admits), its **capability requirement** (the named capability minting maps to\n subjects, \xA713.9), and optional traits.\n- `events`, name + payload schema; events ride the journal contract on the event plane\n (`epe\u2026.ev.<cluster>.<event>`), read-contained by event-topic grants.\n\nAn **endpoint type** is a conformance set of cluster URNs. `manager` and `delivery` are\nordinary conformance sets defined by the reference implementation; core knows only\n\"endpoint\".\n\n**Schemas.** Contract schemas are JSON Schema **2020-12**, validated by a real 2020-12\nvalidator (the reference implementation pins `ajv`), under this normative resource profile: a\nschema is a **closed resource bundle**, either fully self-contained (local `$defs`/`#/\u2026`\nrefs) or referencing other contract-store artifacts **by digest** only. `$id`/`$anchor`/\n`$dynamicRef` resolve deterministically within the bundle; ambient HTTP/file/URI resolution\nMUST NOT occur. Contract identity is the **closure digest** (above): the digest of the\nmanifest naming the complete resolved closure, not of the root document alone. Registration-time bounds (loud `contract-invalid`, distinct from\ninvocation-time `bad-request`): document \u2264 256 KiB, closure \u2264 1 MiB, nesting \u2264 32, ref chain\n\u2264 32, bounded pattern complexity, compile/validation time budgets, and a bounded compiled-schema cache (reference: 256-entry LRU) (\xA713.8). Runtime\nvalidation at the serving boundary is mandatory: args before any effect, replies against the\noutput schema. Authoring tooling is free (the reference implementation authors in Zod); the\nwire artifact and validation semantics are the JSON Schema documents themselves.\n**Every command declares BOTH an input and an output schema**: a side with no payload\ndeclares the **canonical void schema**, the artifact `{\"type\":\"null\"}`, whose RFC 8785\ndigest is therefore one fixed value, so both `op` digests exist for every command (\xA713.3)\nand no shape in this section is conditional on a missing side. Validation against the void\nschema means the side's payload is absent or `null`.\n\n**Content addressing.** A contract artifact (cluster document, schema bundle member, trait\ndefinition or attachment) is identified by the SHA-256 digest of its RFC 8785 canonical JSON\n(strict RFC 8785 over I-JSON; the reference implementation pins `json-canonicalize`'s strict\npath and gates on the RFC's published test vectors, including number-serialization and\nsurrogate edges). **Two digests, never conflated.** An **artifact digest** identifies ONE\ndocument's bytes and is the value that keys its subject and every by-digest reference. A\n**closure digest** identifies a whole resolved bundle, a cluster document or a schema\nclosure, and is the artifact digest of that bundle's **manifest**: the artifact\n`{ v: 1, root: <artifact digest>, members: [<artifact digest>, \u2026] }`, `members` being every\nartifact transitively reachable through by-digest references from `root`, sorted\nlexicographically and deduplicated. The manifest is itself an ordinary artifact on its own\ndigest subject, so a closure digest is an artifact digest, nothing dispatches on which kind\na digest is. Contract identity (\xA713.7 `contractDigest`, `clusterDigests[]`, and the\n`op.inputDigest`/`outputDigest` a caller pins) is always a CLOSURE digest; a `$ref`-by-digest\ninside a schema is always an ARTIFACT digest.\n\n**Every `*Digest` field in this section is one scalar shape**, `sha256:<hex>`, lowercase\nhex, and each names exactly one input, so no field's digest is implementation-defined:\n`inputDigest`/`outputDigest`, `contractDigest`, `clusterDigests[]` = the CLOSURE digest of\nthe named bundle (above); a schema's by-digest `$ref` = an ARTIFACT digest;\n`argsDigest`/`outcomeDigest`/`resultDigest` = over the strict RFC 8785 canonical JSON of\nthat value (absent iff the value is absent); `authDigest` = over the raw UTF-8 bytes of the\n`auth` slot as carried (\xA713.3); `submissionDigest` = over the raw stored submission bytes\n(\xA713.4). Integer fields on the wire (`sourceSeq`, `revision`, `epoch`, `ts`,\n`deadlineMs`, `readinessDeadlineMs`) are non-negative integers \u2264 2^53 \u2212 1, the I-JSON\ninteroperable range, so at most 16 decimal digits, which is what makes the \xA713.12\nmaximum-fact fixture a computable worst case rather than an estimate.\n\nArtifacts live in the per-space **contract stream**: one artifact per\ndigest-keyed subject `cotal.<space>.epc.<digest-hex>` (\xA713.2), published as a single\nmessage; possible because a document is bounded at 256 KiB (below) and the operator floor\nasserts `max_payload` covers it (\xA713.12); a closure is fetched artifact-by-artifact through\nits digest references, never as one blob. Reads are the subject-scoped last-by-subject\nDirect Get on the exact digest subject, no consumer, no replay machinery, and nothing\nbody-selected (\xA713.9). Readers MUST verify fetched bytes against the digest and fail loud\non mismatch. Publication is mediated and create-only (\xA713.9): artifacts are immutable once\npublished. A single-message digest subject is readable subject-confined; a chunked object\nstore is not, because chunk replay needs a consumer whose delivery target is body-selected\n(\xA713.9).\n\n**Record kinds and key grammar.** Every record kind is registered: core kinds are defined\nby this section (writer table, \xA713.9), and each kind's registry entry pins its **key\ngrammar** (the qualifier tokens between the kind token and the `.spec`/`.status` suffix),\nits writer roles, and its mediation class; grants and merged watches are derived from that\ngrammar, so two implementations always agree on which key carries what. The core kinds'\nkey grammars, pinned here (each key then splits `.spec`/`.status` per \xA713.4, EXCEPT the\nunsplit atomic keys the table marks: the `lifecycle` head, `govern`, `uid`, and `oblig`):\n\n| Kind | Key grammar |\n| --- | --- |\n| `svc` | `svc.<endpoint>.<instanceId>` |\n| `signer` | `signer.<keyId>` |\n| `handle` | `handle.<issuerKeyId>.<id>` |\n| `contracts` | `contracts.<endpoint>` |\n| `goal` | `goal.<endpoint>.<cOwner>.<cActor>.<cUid>.<goalId>` |\n| `cp` | `cp.<endpoint>.<token>` |\n| `lease` | `lease.<endpoint>.<pool>.<cOwner>.<cActor>.<cUid>.<id>` (the item's acceptance identity, \xA713.2) |\n| `lifecycle` | `lifecycle.<owner>.<actor>.<lifecycleUid>` (the \xA713.1 mapping detail) |\n| `lifecycle` head | `lifecycle.<owner>.<actor>`; the alias's **authoritative current mapping**, and the ONLY key `mappingRevision` (\xA713.3) counts: a **single unsplit key** (NOT `.spec`/`.status`-split; the mapping is one atomic record, and a handler's \"fresh current mapping\" read is one leader-consistent read of this key returning `{ mapping, revision }`, the revision being the STORE revision, never a value field), CAS-updated, NEVER-DELETED (the head discipline: no grant permits DEL/PURGE, true absence alone is virgin, a deletion marker refuses loudly as corruption). States `active | retiring | retired` (\xA713.1): the mapping is current ONLY at `active`; `retiring` is the op-bound containment phase, non-current and not replaceable; `retired` asserts the completed \xA713.1 barrier. Activation CASes it from none (create-only) or from a `retired` predecessor to a freshly reserved UID's mapping; two concurrent mints for one alias cannot both win the CAS; the terminal barrier CASes `active \u2192 retiring` at its bar and `retiring \u2192 retired` as its final head step. The per-UID `lifecycle.<owner>.<actor>.<lifecycleUid>` detail below is optional append-only audit, never the authority |\n| `uid` | `uid.<lifecycleUid>`; the \xA713.1 **space-global UID reservation**: a **single unsplit key**, create-only, NEVER-DELETED, value = `{ owner, actor, mintedBy }` (the reserving authority and intended alias, audit only; the KEY is the reservation). A key exists for every UID ever reserved, including burned candidates; a DEL/PURGE marker is corruption |\n| `policy` | `policy.<endpoint>.<digest-hex>`; the \xA713.6 **immutable admission-policy version**: a **single unsplit key** per policy version, create-only, NEVER-DELETED. `<digest-hex>` is the SHA-256 hex (64 chars) of the record's canonical value bytes, so the key is SELF-CERTIFYING: a reader re-digests the value it read and refuses a mismatch. Immutability is a TRUSTED-WRITER invariant (create-only CAS by the sole writer) BACKED by that read-time self-certification, not a broker subtraction (KV create/update/delete share the one subject, \xA713.9): a different-byte overwrite is refused on read, and the residual (a DEL or same-byte overwrite by a buggy/compromised writer destroying availability under history 1) fails admission closed rather than admitting a lost policy. `enforcedPolicyKey`/`pendingPolicyKey` on the govern head (\xA713.6) name keys of exactly this kind, which is what keeps BOTH the enforced and the pending policy readable through a mutation's whole drain window. Writer: the provisioner registration path ONLY (\xA713.9); a DEL/PURGE marker is corruption |\n| `oblig` | `oblig.<targetUid>.<endpoint>.<cOwner>.<cActor>.<cUid>.<id>`; the \xA713.8 **target-indexed acceptance obligation**: a **single unsplit key** whose grammar IS the deterministic acceptance identity (target lifecycle UID first, so a retirement barrier enumerates `oblig.<targetUid>.>`), create-only winner, monotonic value states, NEVER-DELETED. An admission under policy with NO target lifecycle keys the row with the fixed sentinel target token `ep` (which the \xA713.1 UID token grammar can never produce, so no collision exists): `oblig.ep.<endpoint>.<cOwner>.<cActor>.<cUid>.<id>`: excluded from retirement drains (it binds no lifecycle) and included, like every targeted row, in the endpoint's policy drain via the endpoint-position filter `oblig.*.<endpoint>.>` (\xA713.6/\xA713.8) |\n| `frontier` | `frontier.<lifecycleUid>`; the \xA713.1 **per-stream retirement frontiers**: a **single unsplit key** per retired lifecycle, create-only, NEVER-DELETED, value = `{ lifecycleUid, opId, streams }` where `streams` maps each lifecycle-bounded stream to its last sequence at retirement. Written by the terminal barrier AFTER the obligation drain, the drain's repair-principal fence, the pool cleaner, and the cleaner-credential revoke+evict, and BEFORE the gate/head terminals (\xA713.1 order), so a `retired` head implies its frontier exists. The cutoffs bound the predecessor's half-open interval `(activationFrontier, retirementFrontier]` (\xA78); they are never a successor's start (a successor captures its OWN activation frontier). Writer: the minting authority's retirement barrier ONLY; it records once, under its own operation (a foreign-op record refuses the barrier closed); a DEL/PURGE marker is corruption |\n| `govern` | `govern.<endpoint>`; the endpoint's **governance head**: a **single unsplit key** (NOT `.spec`/`.status`-split), value = the endpoint's MONOTONIC binding map, command to governed URN set, the NORMATIVE **admission-policy selector** `{ enforcedPolicyKey, enforcedPolicyRevision, pendingPolicyKey?, pendingPolicyRevision? }` (\xA713.6: `enforcedPolicyKey` is the exact records key of the immutable `policy` record currently governing admission and `enforcedPolicyRevision` its store revision, so any implementer selects the endpoint-wide enforced policy WITHOUT per-instance guesswork; a mutation stages `pendingPolicy\u2026` and promotes it into `enforcedPolicy\u2026` only after the endpoint's obligation drain, so the selector alone decides which revision governs during the drain window), plus whatever internal serialization state the provisioner's registration CAS needs (that state is non-normative: a second implementer may linearize registration with a different slot shape and conform, provided every registration contends on this head under its frozen gate through spec publication, the policy selector fields carry the meaning above, and the external guarantees hold). Enforcing the governed-attachment no-strip/no-downgrade mandate (Traits, below) is a HISTORY-bearing, ENDPOINT-WIDE property: a fresh instance, a remove-then-re-add, or a concurrent registration must not launder a governed binding away, so this head is also the endpoint's **registration linearization point**. Writer: the provisioner registration path ONLY (\xA713.9); NEVER-DELETED, per the `lifecycle`-head discipline |\n\nThird-party kinds\nregister under reverse-DNS kind names.\n\n**Descriptor and describe.** Each instance registers a **service record** (kind `svc`, key\n`svc.<endpoint>.<instanceId>`; the owner is determined by the name and recorded in the\nvalue): spec = `{ endpoint, owner, endpointType?,\nclusterDigests[], protocol: { v: 1 }, activation? }`, status = `{ epoch, state,\nobservedSpecRevision, \u2026 }` (writer table \xA713.9). The spec key's **store revision is the\ninstance's `registrationRevision`**, the value scatter freezes (\xA713.5): it advances only\nwhen the mediated registration path writes the spec key, so an advance during a scatter is\nexactly a re-registration. `describe` is a reserved untargeted\nephemeral command every endpoint MUST serve, returning the descriptor with clusters inline or\nby digest. **Authorization-scoped answers use a trusted authorization source only**: the\nanswer is intersected against a fresh view of the caller's authority obtained from the\ndeployment's authorization ledger/callout (\xA79/\xA710), keyed by the broker-authenticated caller\nidentity, never against payload- or slot-asserted scope, which is ignored. If the trusted\nview is unavailable or stale beyond its declared freshness bound, describe fails closed\n(`unavailable`) rather than answering from a weaker source; deployments MAY declare an\nendpoint's descriptor public, in which case no view is consulted and the answer says so.\nDescriptor visibility is never inferred from reachability of `describe` alone. A KV browse\nindex (record kind `contracts`) is an advisory convenience copy; `describe` is authoritative.\n\n**Invocation binding.** The digests are not caller courtesy but a two-sided requirement\n(\xA713.3): a caller MUST pin `op.inputDigest`/`op.outputDigest` on every command except\n`describe` (the discovery bootstrap), and a serving member MUST reject their absence\n(`contract-mismatch`) before any effect; an unpinned invocation cannot silently bypass the\ndescribe\u2192invoke binding, and MUST honor pinned digests or reject `contract-mismatch`. Rolling updates keep classes contract-homogeneous: an incompatible\ngeneration registers a distinct routable identity (new endpoint name or explicit version\nlabel) until homogeneous.\n\n**Traits.** A trait attaches governed metadata to a cluster, command, attribute, or event.\nA **trait definition** `{ urn, valueSchema (digest), selector, breakingChanges, authority }`\nis content-addressed and signed: `ai.cotal.*` definitions by the space-operator authority;\nthird-party definitions by their defining owner's registered key. **Attachment authority is\ndistinct from definition authority**: every *required/governed* attachment (this revision governs\nexactly `ai.cotal.guarded` and `ai.cotal.priced`) is separately signed by the definition's\nnamed authority over `{ endpoint, command, contractDigest (the cluster document's complete\nclosure digest), traitUrn, value }`, so a self-published descriptor cannot strip, forge, or downgrade a governed\nannotation; removal or downgrade is an authorized contract revision. Enforcement is\nfail-closed at the pre-effect seam: missing, unverifiable, or stale governed attachments\nrefuse before effect. Non-governed traits are unsigned vocabulary.\n\n**Compatibility.** Cluster evolution is BACKWARD by default: within a revision line, changes\nMUST be additive and added fields MUST carry defaults; removal, rename, or semantic change\nmints a new cluster URN version. A push-time JSON-native compatibility differ + review gate\nenforce this in the reference workflow (repository tooling under `scripts/`, not shipped\nclient code). The discovery protocol itself is versioned additively under `protocol.v`.\n\n### 13.8 Distributed guarantees\n\n- **Idempotency scope.** Ephemeral idempotent commands by `id` (handler-local, within result\n retention); journaled submissions and actions by `id`/`goalId` + fingerprint within the\n declared horizon. Exactly-once is bounded honestly: delivery is at-least-once; Cotal\n guarantees idempotent submission/fact recording and fenced commits of Cotal-owned state; an\n external side effect is exactly-once only when the external API honors the propagated\n idempotency key or fencing token, else the contract documents at-least-once effects.\n- **Fencing and mediated commits.** Every Cotal-owned authoritative transition flows through\n its mediated writer (\xA713.9) carrying `(fencingToken | lifecycleUid | epoch)` as applicable;\n the writer validates token currency, unexpired lease against its own clock, lifecycle\n currency, and epoch currency. Value-carried tokens + CAS stop conforming-but-stale writers;\n scoped credentials + mediation stop everything else. The threat boundary of any\n direct-owner write is explicitly downgraded (\xA713.9).\n- **CAS conflict.** Any lost CAS is a loud `conflict`; the loser re-reads and re-decides.\n- **Authority-head reservation/drain.** An authority head (the \xA713.1 lifecycle head; the\n \xA713.6 registered admission policy) and a durable acceptance/start fact live in different\n streams; no cross-stream CAS exists, and a revision carried inside a fact is provenance,\n never a fence. Any durable acceptance or start that creates work bound to a lifecycle,\n or admits work under a policy read, therefore contends with the head's movement on ONE\n durable serialization coordinate: the **target-indexed obligation row** (kind `oblig`,\n \xA713.7). In order: (1) BEFORE the EPF decision publish, the writer obtains the obligation\n through the **admission mediator**. The mediator owns the `oblig.` prefix (the\n canonicalizer holds no raw write on it), derives the coordinate from the\n broker-authenticated request subject (never from a body field), and IMMEDIATELY before\n the create performs the FENCING currency reads it will pin: for a target-bound\n admission a leader-served read of the target's lifecycle head, REFUSING unless the state\n is `active` (a `retiring` or `retired` target admits nothing); for a policy-admitted\n decision a leader-served read of the governance head (\xA713.6) that FIRST refuses if a\n `pendingPolicyKey` is present (the endpoint is inside its drain window; the drain-window\n admission pause is a normative step of THIS algorithm, not only a \xA713.6 property, so any\n conforming mediator refuses without needing to infer it) and only then follows\n `enforcedPolicyKey`, self-certifies it (\xA713.7), and pins its `enforcedPolicyRevision` as\n `policyRevision`. Refusing at the create-fence (not only at the post-create recheck) is\n also what bounds the row set: a request that could not create its row leaves no\n never-deleted `oblig` debt behind, so a long or crashed drain cannot accumulate an\n unbounded set of rejected rows. An admission with no target lifecycle keys the\n row under the fixed sentinel target token `ep` (\xA713.7). It then creates the row\n create-only at the deterministic acceptance-identity\n key `oblig.<targetUid>.<endpoint>.<cOwner>.<cActor>.<cUid>.<id>`. The KEY never contains\n `sourceSeq`, delivery attempt, mapping revision, or writer op id (a redelivery of the\n same logical acceptance MUST land on the SAME key); where a digest stands in for the\n tuple it is a versioned, collision-resistant digest of exactly that tuple, never\n delimiter-ambiguous concatenation. The VALUE pins the first winner under a CLOSED\n per-class schema: every row carries `{ state: provisional | accepted | rejected |\n terminal, decision: epf | self, opId }` plus the currency pins taken above\n (`mappingRevision` iff target-bound, `policyRevision` iff policy-admitted; at least one\n present); an `epf`-class row (a canonical acceptance) adds `{ fingerprint, sourceSeq,\n route }`; a `self`-class row (a guarded record commit, e.g. the restart-status CAS,\n \xA713.6) adds the COMPLETE commit intent `{ commitKey, commitBaseRevision, commitValue,\n commitDigest }`: the exact record key its accepted state authorizes, the store revision of\n that record the commit CASes FROM, the value it commits, and that value's digest.\n `commitValue` is a CLOSED discriminated union, so two implementations resolve and replay the\n SAME value: `{ enc: \"b64u\", bytes }` carries a JSON encoding of the committed value,\n base64url-encoded (RFC 4648 \xA75, no padding), or `{ enc: \"ref\", key }` names an\n IMMUTABLE, create-only records key (the \xA713.7 `policy` kind or another never-overwritten\n key) whose stored value IS the commit value; a mutable or absent `ref` target\n refuses at recovery, fail-closed. Never only a digest (a digest cannot reconstruct the\n value a crash recovery must re-write). `commitDigest` is the RFC-8785 CANONICAL content\n digest of the committed value, `sha256:<hex>` (the same `*Digest` scalar shape \xA713.7 uses\n everywhere; over the CANONICAL value, never a non-canonical storage stringify, so the\n landed/not-landed comparison is insensitive to how the store serializes the record). A\n crashed writer's commit is thus deterministically finishable from the row alone (below). The\n `decision` class is fixed by the TRUSTED operation kind, never caller-selectable. A\n create loser leader-reads the winner: the FULL pinned identity must match to join (an\n `epf`-class row on coordinate + fingerprint + route; a `self`-class row on the ENTIRE commit\n intent `commitKey` + `commitBaseRevision` + `commitDigest`, so two different desired values\n or base revisions never join under one `commitKey`); any\n mismatch is `conflict`, never a second obligation. (2) **Proof issuance is a post-create\n currency recheck, and admission is proof-gated**: after winning or joining the create,\n the mediator leader-reads the SAME coordinates AGAIN, and only if the target head is\n still `active` at the pinned `mappingRevision` AND (for a policy-admitted decision) the\n governance head STILL stages no `pendingPolicyKey` and the enforced policy is still at\n the pinned `policyRevision` does it return the opaque admission proof; otherwise it\n IMMEDIATELY settles its own provisional through the row's decision coordinate (below) and\n refuses. The recheck reads the SAME govern head the create-fence read, so a\n `pendingPolicy` staged in the window between the create and the recheck also fails\n proof issuance, not merely a moved `enforcedPolicyRevision`.\n No target-bound or policy-admitted EPF acceptance may publish, and no `self`-class\n guarded commit may run, without an unexpired proof issued under this rule. This is the\n structural half of the head fence: an obligation created in the window between a fresh\n `active` read and a head or policy movement exists durably, but its proof can never\n issue, so it can never admit; it is inert cleanup debt any later drain settles. (3) The\n EPF decision CAS runs as\n specified (\xA713.4), publishing with the WINNER's pinned acceptance identity and\n `sourceSeq`, whichever delivery is processing; a `self`-class writer instead advances\n its own row `provisional \u2192 accepted` (revision-pinned) and performs its guarded commit\n only while the row is `accepted`. (4) On acceptance the SAME key advances\n `provisional \u2192 accepted` and is retained until the accepted route is\n terminal and cleaned: the only enumerable record of accepted work is never\n erased at the moment it wins. States are monotonic (`provisional \u2192 accepted \u2192\n terminal`, or `provisional \u2192 rejected`), the row is NEVER-DELETED, and a DEL/PURGE\n marker is corruption. The stored `opId` is not a bearer capability: a resuming writer\n re-authenticates as the same endpoint-scoped principal through the mediator and joins\n by acceptance identity + fingerprint; any opaque reservation token the mediator issues\n is target/endpoint/connection-bound, bounded-lived, and checked against the CURRENT\n obligation state; the durable obligation is the authority, never possession of its\n identifier. **The decision coordinate is per-class** and is where every unresolved row\n settles: an `epf`-class row settles through the EPF decision subject's create-only CAS\n (read the winner; if absent, create-only publish the terminal rejection so a delayed\n acceptance CAS loses; the mediator holds that rejection-publish authority and executes\n it for its own recheck refusals and on behalf of the drains, \xA713.9); a `self`-class row\n settles on ITSELF: while still `provisional`, the drain CASes `provisional \u2192 rejected`\n (the writer's `provisional \u2192 accepted` CAS and the drain's rejection contend on the ONE\n row, exactly one wins, and a delayed guarded commit finds its authority gone). An\n `accepted` `self`-class row is NOT stuck and does NOT block quiescence: because the row\n pins the complete commit intent `{ commitKey, commitBaseRevision, commitValue, commitDigest }`,\n either\n the writer's own resume OR a drain reconciler drives it `accepted \u2192 terminal`\n deterministically. Read the record at `commitKey`: if its value canonically digests to\n `commitDigest` the commit landed, CAS the row `accepted \u2192 terminal`; if it is still at\n `commitBaseRevision` the commit did not run, re-apply it by CASing the resolved\n `commitValue` (decode `b64u`, or leader-read the immutable `ref` key's value, verifying its\n canonical digest against `commitDigest` BEFORE writing) at\n `commitBaseRevision` then CAS the row terminal; if the\n record has moved PAST\n `commitBaseRevision` to a foreign value the intended commit can never land (the guarded\n CAS would lose), so CAS the row straight to `terminal` as superseded. Quiescence therefore\n means NO `provisional` and NO un-driven `accepted` `self`-class rows remain: an accepted\n commit is always completable from the row alone, never an unrecoverable orphan. **Reclamation is never\n clock-only**, and because the EPF writer need not be the retiring lifecycle (a\n cross-endpoint canonicalizer publishes decisions bound to a foreign target, and revoking\n the TARGET's credential family disarms nothing that writer holds), target-side\n revocation alone is NEVER the reclamation condition. An unresolved `provisional` is\n reclaimed only by: settling it through its decision coordinate; or revoking +\n verified-evicting the WRITER's own commit authority; or the target head being\n non-current AND the drain below having completed to quiescence under the create fence +\n proof gate. A timeout alone never frees a slot\n while the writer retains publish authority. **Drain to quiescence**: after the head\n CASes to `retiring` (\xA713.1), and equally when a policy mutation must enforce a new\n revision (\xA713.6, enumerating `oblig.*.<endpoint>.>`), the drain enumerates the prefix\n (`oblig.<targetUid>.>` for retirement), settles every\n unresolved row through its decision coordinate, completes accept-side reconciliation\n (enqueue/goal/terminal, \xA713.6) for accepted rows, then RE-ENUMERATES, and records its\n cleaner and frontier completion (or treats the new policy as enforced) only when an\n enumeration finds no unsettled row. A provisional whose pinned `mappingRevision` or\n `policyRevision` is no longer the live coordinate is settled as REJECTION, never treated\n as still open for acceptance. A row created after the final enumeration cannot admit\n (its proof can never issue, step 2) and is settled by any later enumeration;\n an acceptance published after the recorded cleanup frontier from a\n stale `active` read is non-conformant even if later effect resolution would reject it.\n Whether the obligation is released once the route is settled under ordinary policy\n movement (`release-after-accept`) or survives as cleanup debt the terminal barrier must\n observe (`promote-to-lifecycle-obligation`) is fixed by the TRUSTED operation kind,\n never caller-selectable. The admission-policy specialization additionally binds\n identity at the read: the confined policy reader's request subject pins the\n authenticated canonicalizer endpoint AND the requested policy endpoint, requires their\n equality, derives the reply rail from that authenticated subject, and returns\n `{ policy, revision }` with an opaque proof binding `{ space, endpoint, policy\n revision, obligation/op id }`; endpoint A can never obtain, or replay, endpoint B's\n admission proof.\n- **Retry/backoff.** Only idempotent-at-scope operations are retried: exponential backoff,\n base 250 ms, factor 2, cap 15 s, full jitter, bounded by the caller deadline.\n- **Deadlines.** Mandatory on call, scatter, claims, checkpoints, timers, sessions. Reference\n default call deadline 15 s; defaults are overridable, never removable.\n- **Cancellation ordering.** First terminal fact at the mediated commit point wins.\n- **Watch recovery.** Fell-behind \u21D2 snapshot re-read then resume; bounded relist; no silent\n gap-skipping.\n- **Ordering/partitioning.** Per-subject only; the subject is the partition key.\n- **Retention floors.** Submissions \u2265 recovery/redelivery lag (\xA713.12; native dedupe is not\n relied upon, \xA713.4); facts/tombstones \u2265 idempotency horizon;\n results \u2265 result retention; receipts \u2265 receipt retention; timers \u2265 max deadline + recovery\n margin. **Pool coupling:** every accepted pool item carries an **absolute work expiry**\n (`workExpiry`, set at acceptance in the AcceptanceFact, NOT a per-message age a\n reconciliation re-publish would reset; a re-enqueue re-publishes with the SAME `workExpiry`,\n and the item is dead once it passes, leased or not). The EPW stream's max age is \u2265 the\n maximum `workExpiry` + recovery margin, and a pool item's decision and `wrk` terminal facts\n are retained \u2265 that same bound, so a live (or crash-recovering) item can never outlive the\n facts that identify it as accepted or settled: a decision that expired under a still-live\n item would let a reused id collide with the old enqueue, and an expired `wrk` under a\n lost owner ack would make settled work unrecognizable on redelivery. A reused `id` becomes\n new work only after the old item's `workExpiry` AND its facts' retention have both passed.\n An endpoint MUST refuse to start against a store below its declared floors.\n- **Backpressure and budgets.** Bounded consumer pending (default 1024), bounded\n virtual-endpoint pools and session windows, flow control on watches; overload is\n `resource-exhausted`. Schema compile/validate budgets (reference: 100 ms / 10 ms) and\n bounded regex; over budget is `contract-invalid`/`bad-request`.\n- **Timers.** Broker message schedules at the 2.12 floor; same-subject replacement only (at\n the mediated `.armed` subject, \xA713.12); generation- and scheduler-origin-validated firing\n (stale or foreign-origin \u21D2 no-op); durable reconciliation repairs\n status\u2194schedule divergence; replication and offline-assets downgrade fail loud at the\n broker floor gate.\n\n### 13.9 Authority boundary\n\nThe credential is the coarse boundary; every subject in \xA713.2 is default-deny. Every\n**statically expressible** authorization dimension is broker-enforced through the subject\ngrammar: caller identity + lifecycle, endpoint,\ncommand, the target components each mode pins statically (\xA713.2: the full triple for `self`,\nthe caller's own, and for `handle`, redemption-pinned; the owner for\n`owner`/`any`/`child`/`ledger`), serve identity, reply\n**attribution**, and plane writer ownership.\nReply **addressing** is the one deliberate exception: it is capability-by-secret (the\nper-request nonce, \xA713.2), not a broker grant, and it is sound precisely because serve\ncredentials cannot plain-subscribe the class rail (queue-qualified grants, \xA713.2), so nonces\nare visible only to the instance the queue selected (plus every instance on a scatter, which\nis scatter's definition). Target enforcement is stated per mode, never as a blanket claim:\n`self` is broker-confined end to end including the lifecycle UID; `handle` is broker-confined\non the full redemption-pinned target triple, with the validator re-checking only mapping\ncurrency; `owner`/`any` are broker-confined on the target owner and validator-primary on the\nactor and UID currency; `child`/`ledger` are validator-primary within their distinct broker\nrails. The **named dynamic relations** (static-mesh\nown-child, fresh-ledger escalation, target-mapping currency, authorization epochs after\nacceptance) are trusted-validator-primary by design, fail-closed, and operate only within\nthe broker ceiling. Handlers only narrow. **The process epoch fences only the five planes\nwhose subjects carry it** (reply, `epe`, `ept`, `eps`, `epr`). Request-ingress subjects and durable record\nkeys cannot carry it; the caller cannot know it, and a restart-stable key must not change,\nso those two classes are fenced by the mechanism each admits: records by mediation (writer\ntable below), ingress by credential revocation with verified eviction (\xA713.1), never by\nsubject.\n\n**Caller grants.** Minting maps each named capability to exact endpoint+command subjects:\npublish on the request forms (class + instance) with the authz-mode/target pattern the\ncapability specifies, subscribe on the caller's own reply rail, publish on matching `epj`\nsubmission subjects for journaled commands, and the exact record-key / event-topic subtrees\nfor attribute/event read capabilities (per-goal containment rides the caller triple in the\ntopic). The caller's lifecycle UID token is pinned in every granted subject, so a credential\nis dead against its principal's next lifecycle by construction. Wildcards are bounded: `*` in\nthe command position only when the capability covers every command of the endpoint; `*` in\nthe endpoint position never, outside operator/admin profiles; `child`/`ledger` mode subjects\nare never covered by an `owner`-mode wildcard. `describe` is granted by default for all\nendpoints; a space MAY narrow it. Because the subject shape is verb-invariant (\xA713.2), one\npublish row covers call and cast of a command. Minted credentials MUST stay within the\ndeployment's JWT size envelope, and the envelope is validated against a **normative\nmaximum-capability fixture**, not an adjective: the reference fixture is an agent holding\nevery baseline grant plus capabilities on 3 endpoints x 12 commands each, each targeted\ncommand in both `self` and `owner` modes, plus journaled submissions and per-goal read\nscopes for all of them. Minting MUST fail loud before emitting a credential that exceeds the\npolicy gate (reference: 16 KiB); the transport bound is the CONNECT control line\n(`max_control_line`, \xA713.12) and the policy gate MUST be the tighter of the two. The fixture\nset additionally includes a **maximum-command serve credential** (a 12-command endpoint's\nper-command rows, below); the \xA713.12 operator assertion uses the largest encoded CONNECT\nline in the set.\n\n**Serve grants.** Serving is granted authority, dual to calling. On the **subscribe side**\nan instance's credential binds its registered service name, stable instance id, and\n**registered command set**, one queue-qualified subscribe row per registered command\n(matrix below), never a bare `>` tail spanning commands the instance did not register. The\nper-command enumeration is affordable precisely where the caller-side equivalent is not:\nserve credentials are one per instance, a handful per space, with no capability-count\nscaling pressure. The subscribe side deliberately does NOT bind the epoch; a caller cannot\nname the serving epoch, so no request subject carries it and **ingress cannot be\nepoch-fenced by subject**; the fence for a superseded subscriber is the \xA713.1 takeover\nbarrier (revoke + cluster-verified eviction), not a grant shape. On the **publish side** the\ncredential binds the epoch everywhere it is real: the epoch-pinned reply prefix, the\nepoch-pinned `epe` event plane, its `ept` timer schedule requests, and its `epr`\nrecord-write ingress. Session subjects are\ndeliberately absent from the standing serve grant: both sides of a session hold only\nredemption-minted per-session credentials (\xA713.6); no standing EPS grant exists on either\nside. The credential also carries the record keys the writer table assigns it and, where\nthe endpoint owns a work pool, the pool's consumer + ack grants (\xA713.5; matrix below).\nNothing else. Every \"binds X\" in this paragraph has a matrix row below that actually binds\nX. Serve\ncredentials are re-minted on takeover (new epoch, \xA713.1 barrier); a superseded credential's\nreplies and commits are rejectable by epoch. Core names require operator provisioning\nauthority; reverse-DNS names bind to their registered owner. The registry is discovery; the\nserve grant is the authority: a foreign credential cannot subscribe a class rail, answer as\nan instance, or enter a frozen scatter set.\n\n**The ownership matrix (normative).** Every profile \xD7 resource \xD7 transition is classified\n**mediated** or **direct**, in an independently reviewed matrix from which grants are\ngenerated (never the reverse). Each row names the writer PROFILE, the exact subject/API\nnamespace (including the queue qualifier where one applies; the grant grammar has a queue\ndimension, \xA713.2), the operation, and the enforcement class; **read, consume, ack, and\ndelete authority are rows in the same table**, never prose that \"follows\" it. Every\ncredential and every audit probe is generated from these rows.\n\n**Consumer-name grammar (normative).** Every consumer a row names has a pinned name grammar\n(dash-form, \xA72; `<e>` is the endpoint-name token, `<uid>` the holder's lifecycleUid or\ninstanceId): `canonD = canon_<e>` (the canonicalizer durable), `poolD = pool_<e>_<pool>`\n(the pool durable, **pre-created by the provisioner** with exact filter\n`cotal.<space>.epw.<e>.<pool>.>`, the \xA78 item-3 pattern: the bare create form is\nbody-filter-selectable and is granted to NO ONE on control-surface streams), `timerD =\ntimerw_<space>` (the timer writer durable), `recwD-k = recw_<space>-<kind>` (one record\nwriter durable PER RECORD KIND, \xA713.9), `effD = eff_<e>` (the endpoint's ONE shared\neffects durable; below), `goalD = goal_<uid>-<e>` (the caller's own goal-result durable).\nEvery composite name is **collision-free by construction**, and\neach derivation states why: `pool_<e>_<pool>` parses uniquely from its LAST `_` because a\npool token contains no `_` (`[a-z0-9-]`) while `<e>` may (a dash separator would be\nambiguous, both tokens admit `-`); `dec_<uid>-<e>` parses from its FIRST `-` because\n`<uid>` is `[a-z0-9]` and contains none, and `goal_<uid>-<e>` likewise; `eve_<uid>-<e>-<gid>-<n>`\ncarries TWO `-`-adjacent soft components (`<e>` and `<gid>`), so `<gid>` is constrained\nSEPARATOR-FREE (`[a-z0-9]`, no `-` or `_`): then `<uid>` (leading, `-`-free), `<n>` (trailing\ndigits) and `<gid>` (separator-free) are each a single token off their edges, leaving `<e>` as\nthe only `-`-bearing component with an unambiguous extent (`eve_<uid>-a-b-c-0` can ONLY be\nendpoint `a-b`/gid `c`, never endpoint `a`/gid `b-c`). `rec_<uid>-<gid>-<n>` has one soft\ncomponent `<gid>` bounded by `-`-free `<uid>` and digit `<n>`. Without the separator-free `<gid>`\nthe two grants above would collide on one durable name. A derivation that cannot state its\ncollision-freedom argument is non-conformant. Reader consumers use **mint-time-enumerated LITERAL names**, and every one\nis **pre-created by the provisioner at capability mint as a PULL durable with its exact\nfilter; the holder receives BIND-ONLY grants** (INFO/MSG.NEXT/ACK, never CREATE or\nDELETE): `decD = dec_<uid>-<e>` (one per journal capability), `goalD = goal_<uid>-<e>`\n(one per action capability),\n`eveD = eve_<uid>-<e>-<gid>-<n>` and `recD = rec_<uid>-<gid>-<n>` (one per granted subtree;\n`<gid>` is the **grant id**, a short stable SEPARATOR-FREE (`[a-z0-9]`) id the provisioner\nassigns per minted capability grant, so two independent capability mints for one lifecycle UID\nnever collide AND the `<e>`/`<gid>` boundary stays unambiguous, and `<n>` is\nthe subtree's zero-based index within THAT grant, sorted lexicographically at mint; the\ndeprovision key is `<uid>-<gid>`, so revoking one capability deletes exactly its own reader\ndurables and cannot reach a sibling capability's). Two reasons, both\nload-bearing. A NATS wildcard replaces a\nWHOLE dot-separated token and never matches inside one, so an embedded `*` in a name token\n(e.g. `dec_<uid>-*`) is a literal character, not a glob; every name token in a grant is\nfully literal.\n\n**Mediated reads (normative).** No untrusted capability holder is granted **any** raw\nJetStream read of a control-surface stream, not a consumer create, not a bind-only pull,\nnot a `DIRECT.GET`. Every JetStream read is request/reply where the server delivers stored\nbytes to a **caller-chosen destination the broker does not confine to the caller's\n`pub.allow`**: a push consumer's `deliver_subject`, a pull `MSG.NEXT` request's reply\nsubject, and a `DIRECT.GET` request's reply subject are all set in the request body, and the\nserver's internal client publishes there regardless of the requester's publish permissions.\nA holder with only `MSG.NEXT` or\n`DIRECT.GET` on its own filtered reader can therefore route stored bytes onto a victim's DM,\nreply, or record subject, a confused deputy no filter tail, literal name, or pull-vs-push\nchoice prevents, because the destination is the vulnerable field, not the filter. Untrusted\ncallers instead read exactly as the \xA78 durable backstop already does, through a **trusted\nread path**, never a self-bound consumer: a caller receives its decisions, goal results,\nevent catch-up, and record reads over its OWN confined rails, a live core subscription to a\nsubject inside its `sub.allow` (bytes land only on the caller's own subscription), or a\nmediator that owns the reader consumer, re-authorizes each read against the caller's current\ngrants, and returns bytes over the caller's own attribution-pinned reply rail\n(`ep.reply.\u2026<caller triple>.<nonce>`: the mediator holds the publish grant, the caller the\nread grant, and the nonce confines addressing, \xA713.2). The mediator IS a trusted\nsingle-purpose principal (the delivery/read daemon, \xA78/Appendix B) that delivers only to the\nre-authorized caller and never proxies to an arbitrary subject; raw\nconsumer/`DIRECT.GET`/`STREAM.MSG.GET`\nauthority stays with trusted single-purpose infra principals (canonicalizer, commit\nprincipal, record writer, timer writer, the read mediator, the auth path) that deliver to\nthemselves. This contract fixes the boundary; untrusted callers never hold raw reads; reads\nare mediated onto confined caller rails, and leaves the read-command wire shape (batching,\ncursors, flow control) to the reference implementation.\n**Subject convention:**\napplication subjects in rows are written relative and are prefixed `cotal.<space>.` on the\nwire; **JetStream API tails (extended-create filter tails and `DIRECT.GET` subject\ntails) are always spelled in FULL** (`cotal.<space>.\u2026`/`$KV.\u2026`/`$O.\u2026`), because the API\nsubject embeds the stored subject verbatim and a relative tail matches nothing (the\nstreams capture `cotal.<space>.ep*.>`, \xA713.12).\nThe grep tests the matrix MUST pass: the only `CONSUMER.CREATE` grants below belong to\ntrusted provisioning/infra profiles and each carries a full literal filter tail; every\nconsumer-name token in a grant is a LITERAL (no embedded `*`); every filter or Direct-Get\ntail is fully qualified; **no UNTRUSTED profile (agent/observer/admin) holds any\n`CONSUMER.CREATE`/`MSG.NEXT`/`DIRECT.GET`/`STREAM.MSG.GET` on a control-surface resource** (an\naudit MUST run this over Appendix B too, not only this matrix; the profile tables are\ngenerated from these rows, so a generated grant that contradicts the matrix fails the build);\nand the ONLY `STREAM.MSG.GET` (body-selected) grants that exist at all are the leader-served\nreads of named TRUSTED single-purpose profiles, each granted to no other profile - every one\na FENCING read (read service, below) except where its row names it a CAS-PINNING read, a\nleader-served currency read whose FENCE is the pinned CAS write it feeds (\xA713.1: a read is\nnever a fence): the auth path on `KV_cotal_auth_<space>`, the lifecycle mapping-reader and\nthe provisioner-registration principal on the `cotal_records_<space>` heads, the endpoint's\ncanonicalizer on `EPF_<space>`/`EPW_<space>`, the endpoint's commit principal on its own\n`EPF_<space>` fact families AND on `KV_cotal_records_<space>` (its goal/checkpoint FENCING\nspec-and-currency reads: the terminal-commit's spec read and the epoch/deadline reads the\nread-service clause names), each record kind's spec/status writer principal on\n`KV_cotal_records_<space>` (its fresh lifecycle-mapping `processEpoch` currency read, the\nwriter-table stale-writer fence; per \xA713.1 a mapping yields a current epoch ONLY at\n`state: \"active\"`, and `retiring`/`retired` alike refuse the write), and the space's timer writer on\n`KV_cotal_records_<space>` (its fresh generation/deadline check before arming, a FENCING\nread) and on `EPT_<space>` (`$JS.API.STREAM.MSG.GET.EPT_<space>`, the armed-subject's own\nlast-by-subject sequence read: CAS-PINNING, the leader-served input to the arm's\n`Nats-Expected-Last-Subject-Sequence` publish, whose broker CAS - not the read - is the\nfence, the same \xA713.1 complementarity class as the FIRE handler's status CAS). The timer\nFIRE handler holds no records `STREAM.MSG.GET`: its settlement is a revision-pinned status\nCAS, so a stale read loses the CAS loudly (\xA713.1 complementarity), never mis-fires (the\nmatrix rows below). The body-selected form is not\nsubject-confinable by the broker, so each of these grants trades broker confinement for\nprofile trust; the trade is acceptable exactly because every holder IS a trusted\nsingle-purpose principal for whom read-your-writes is a correctness requirement, not a\nhazard (on the `allow_direct=false` buckets a leader-consistent get is precisely a\n`STREAM.MSG.GET`). Every OTHER subject-scoped read is NON-fencing and uses the\nlast-by-subject `DIRECT.GET.<stream>.<subject>` form, which the broker confines by subject\ntokens. (The pre-v0.4 messaging-surface CHKV/DLVKV reads in Appendix B are the v0.3 binding,\noutside this matrix; their confused-deputy exposure is the \xA79 in-scope-for-v0.4 remediation.)\n\n**Read service (fencing reads are leader-served).** A read is FENCING when its result, a\nvalue, a revision, OR an authoritative ABSENCE, gates a subsequent CAS or authorizes an\neffect; fencing is defined by USE, never by subject family. A CAS loser reading the winner,\na terminal-commit's spec read, and the work-pool re-enqueue predicate (accepted, with the\nauthoritative absence of BOTH a committed terminal and a live `EPW` entry, \xA713.6) are all\nfencing: a stale follower read that misses a committed terminal while the `EPW` entry is\nlegitimately absent re-arms settled work. A fencing read MUST be leader-served, meaning one\nof `STREAM.MSG.GET`, a get against a bucket with `allow_direct=false`, or delivery\nserialized by the authoritative primary stream/consumer (an authoritative `MSG.NEXT`, e.g.\nthe accepted-fact effects row and the auth path's snapshot enumeration below), and it MUST\nbe served against the AUTHORITATIVE stream or bucket for its key, never a mirror, a sourced\nstream, or a cross-space replica (\"leader-served\" means that authoritative primary; a\nmirror's own leader can lag its source). `allow_direct=true` and Direct Get exist for\nNON-fencing, subject-confined reads only; a client MUST NOT let a fencing read silently\nride Direct Get because the bucket allows it. This does not weaken \xA713.1's rule that a read\nis never a fence: the fence itself stays a CAS or create-only write; leader service is what\nkeeps the read's result from silently falsifying the CAS or effect it feeds.\n\n| Transition | Writer profile | Exact namespace (per space/endpoint) | Class |\n| --- | --- | --- | --- |\n| Request publish | capability holder (agent, per capability) | per \xA713.2 form: `ep.{one,all}.<endpoint>.<command>[.<mode>[.<target tokens per mode>]].<cO>.<cA>.<cUid>.*` and `ep.inst.<endpoint>.<instanceId>.<command>[.<mode>[.<target tokens per mode>]].<cO>.<cA>.<cUid>.*`, mode/target tokens literal per the minted capability (`handle`: the full redemption-pinned triple) | direct, untrusted input, broker-confined |\n| Reply subscribe (caller) | capability holder | `ep.reply.*.*.*.<cO>.<cA>.<cUid>.*` (exact arity) | direct read; own rail only |\n| Serve subscribe | the endpoint's serve credential | per registered command: `\"ep.one.<endpoint>.<command>.> <endpoint>\"` (queue-qualified ONLY), `ep.all.<endpoint>.<command>.>` plain, `ep.inst.<endpoint>.<instanceId>.<command>.>` exact (never a cross-command `>` | direct) name/instance/command-pinned; epoch deliberately absent (\xA713.1 barrier is the fence) |\n| Reply publish | the endpoint's serve credential | `ep.reply.<endpoint>.<instanceId>.<epoch>.*.*.*.*` | direct; attribution-pinned; addressing by nonce |\n| Journal submission append | capability holder | `epj.<endpoint>.<command>[.<mode>[.<target tokens per mode>]].<cO>.<cA>.<cUid>` | direct, explicitly untrusted input |\n| Canonicalizer consume | the endpoint's canonicalizer principal (singleton, \xA713.4) | its durable on `EPJ_<space>`: `$JS.API.CONSUMER.CREATE.EPJ_<space>.<canonD>.cotal.<space>.epj.<endpoint>.>` (full-tail single filter), `$JS.API.CONSUMER.INFO.EPJ_<space>.<canonD>`, `$JS.API.CONSUMER.MSG.NEXT.EPJ_<space>.<canonD>`, plus `$JS.ACK.EPJ_<space>.<canonD>.>` (ack/term after durable decision only, and, for pool-admitted acceptances, after the enqueue, \xA713.4) | mediated |\n| Canonical decisions + quarantine + goal-bind | the endpoint's canonicalizer principal | publish `epf.<endpoint>.dec.>`, `epf.<endpoint>.quar.>`, and `epf.<endpoint>.goal.*.*.*.*.bind` (the per-goal first-wins bind, \xA713.4, create-only CAS per subject; the `.bind` leaf is disjoint from the commit principal's `goal\u2026.result`/status writes, so no writer overlap) | mediated |\n| Canonicalizer CAS-winner + terminal read | the endpoint's canonicalizer principal | leader-served `$JS.API.STREAM.MSG.GET.EPF_<space>` (body-selected `last_by_subj`; these reads are FENCING, read service above, so the follower-served `$JS.API.DIRECT.GET.EPF_<space>.\u2026` form is NOT granted; the body-selected form is the broker-confinement-for-profile-trust trade above) over exactly its families: `epf.<endpoint>.dec.>` + `epf.<endpoint>.quar.>` (observes the winning fact on redelivery, \xA713.4) + `epf.<endpoint>.wrk.>` (READ-ONLY: the reconciliation predicate's terminal probe, \xA713.6; `wrk` writes stay with the commit principal, row below) + `epf.<endpoint>.goal.*.*.*.*.bind` (the goal-bind CAS winner: on a lost `.bind` create the canonicalizer reads the existing bind to decide same-fingerprint retry vs. `conflict`, \xA713.4) | mediated |\n| Caller durable reads (decisions, goal results, receipts, event catch-up, record reads/watches) | the **read mediator** owns the reader consumers; the **caller** holds only its own reply rail | **Mediated (normative above).** The caller holds NO consumer/`DIRECT.GET` grant on EPF/EPE/EPC/records. It issues a read command and receives its own caller-scoped facts (`dec`/`goal\u2026result`/`receipt` under its triple, \xA713.2), event catch-up, and record snapshots over its attribution-pinned reply rail `ep.reply.\u2026<cO>.<cA>.<cUid>.<nonce>`; the mediator re-authorizes each read against the caller's current grants before delivering. Live progress is the caller's own core subscription to granted `epe` subtrees within `sub.allow` (bytes land only on its own sub). Reader consumers (`decD`/`goalD`/`eveD`/`recD`) are owned and bound by the mediator, never the caller | mediated read; confined to the caller's own rails |\n| Accepted-fact consume (effects) | every instance's serve credential, on the endpoint's ONE shared durable | **bind-only** on the provisioner-pre-created pull durable `effD = eff_<e>` (exact filter `cotal.<space>.epf.<endpoint>.dec.>`, `AckExplicit`): `$JS.API.CONSUMER.INFO.EPF_<space>.<effD>`, `$JS.API.CONSUMER.MSG.NEXT.EPF_<space>.<effD>`, `$JS.ACK.EPF_<space>.<effD>.>`; instances **pull-compete on the shared durable** so each accepted decision is delivered to exactly one live instance (at-least-once): a per-instance consumer over the class-wide decision subtree would be broadcast, and every instance would duplicate the external effect. Effects consume canonical facts, never raw submissions (\xA713.4); a rejected/quarantined decision is ack-skipped, and so is any acceptance whose `route` is a pool (\xA713.4, the pool's worker path executes it; effects MUST NOT). **Ack barrier:** an effecting instance MUST ack a `dec` message ONLY after its effect is durably recorded, for an action command the terminal `goal\u2026.result` fact; for a **non-action `route:\"effects\"` journal command** a generic per-request **effect fact** `epf.<endpoint>.eff.<cO>.<cA>.<cUid>.<id>` (create-only CAS, written by the effecting instance's commit path before ack; every `route:\"effects\"` acceptance has exactly this durable effect-complete marker), never before; an ack-before-effect would let a crash drop journal work the at-least-once contract promised. A crash before the ack redelivers the decision to another competing instance, which observes the existing terminal fact (idempotent) or effects it | direct read, endpoint-scoped, work-shared |\n| Result/receipt/terminal/resume facts | the endpoint's commit principal | enumerated fact families, no subtraction and **never `dec.>`/`quar.>`** (canonicalizer-only): publish `epf.<endpoint>.goal.*.*.*.*.result` (the goal terminal result; the `.bind` leaf under `goal.>` is the canonicalizer's, row above), `epf.<endpoint>.eff.>` (per-request effect-complete fact for non-action `route:\"effects\"` commands, create-only CAS, \xA713.9 ack barrier), `epf.<endpoint>.receipt.>` (caller-scoped subjects, \xA713.2), `epf.<endpoint>.wrk.>` (per-item terminal, create-only CAS), `epf.<endpoint>.cp.>` (one-use resume CAS); read-back is FENCING (read service above: it gates create-only CAS emission and idempotent re-commit decisions), leader-served `$JS.API.STREAM.MSG.GET.EPF_<space>` (body-selected `last_by_subj` over exactly these five families; the follower-served per-family `DIRECT.GET` form is NOT granted) | mediated |\n| Live event progress (caller) | capability holder (per read capability) | a caller-owned **core subscription** to the granted `epe` subtrees (fully-qualified `cotal.<space>.epe.\u2026` in `sub.allow`, Appendix B), incl. per-goal `epe.<endpoint>.*.*.goal.<cO>.<cA>.<cUid>.>`; safe because a core sub delivers only to the caller's own subscription, never a caller-chosen subject; durable catch-up/replay is the mediated read above, not a self-bound consumer | direct read; own subscription only |\n| Claim / action / checkpoint commits | the owning endpoint's commit path | its own record keys (`goal`/`cp`/`lease` grammars, \xA713.7, per the writer table) + the enumerated commit fact families of the Result row above, never `dec.>`/`quar.>`; its goal/checkpoint FENCING reads (the terminal-commit's spec read, epoch/deadline currency) are leader-served `$JS.API.STREAM.MSG.GET.KV_cotal_records_<space>` (read service above; the records bucket's Direct Get is NON-fencing only) | mediated (validates fencing, lease clock, lifecycle, epoch) |\n| Contract-artifact publication | the contract publisher principal | publish `epc.<digest-hex>` (`epc.*`), create-only per subject (`Nats-Expected-Last-Subject-Sequence: 0`; a digest subject is written at most once); read-back via the reader row below | mediated, immutable once published |\n| Contract-artifact read | trusted infra directly (`DIRECT.GET.EPC_<space>.cotal.<space>.epc.>`); untrusted callers via the read mediator | contract artifacts are content-addressed and public (verify-on-read is the tamper boundary, \xA713.7), so exposure is not the risk; the confused-deputy INJECTION is, so an untrusted caller's artifact fetch is mediated onto its own reply rail exactly like any other read; trusted infra fetches directly | mediated for callers / direct for infra |\n| Record write ingress (`epr`) | the owning instance | publish `epr.<endpoint>.<instanceId>.<epoch>.<kind>.<qualifier...>`; the instance's ONLY path to `svc`/`goal`/`cp` status writes; the epoch token is pinned by the serve credential, so the record writer reads the writing epoch from the broker-authenticated subject, never from payload | direct; epoch-pinned ingress to the mediated writer |\n| Record writer consume + `spec`/`status` writes | the kind's separately scoped spec/status writer principal (writer table); **one principal and one consumer PER KIND**, never a single writer draining every kind | consume: `$JS.API.CONSUMER.CREATE.EPR_<space>.<recwD-k>.cotal.<space>.epr.*.*.*.<kind>.>` (full-tail single filter on the `<kind>` token of \xA713.2's `epr` grammar; `recwD-k = recw_<space>-<kind>`) + `$JS.API.CONSUMER.INFO.EPR_<space>.<recwD-k>` + `$JS.API.CONSUMER.MSG.NEXT.EPR_<space>.<recwD-k>` + `$JS.ACK.EPR_<space>.<recwD-k>.>`; write: `$KV.cotal_records_<space>.<that kind's \xA713.7 key grammar>.{spec,status}`; its writer-table stale-writer fence (the FRESH lifecycle-mapping `processEpoch` currency read; current ONLY at `state: \"active\"`, \xA713.1, so a `retiring` or `retired` mapping refuses the write) is leader-served `$JS.API.STREAM.MSG.GET.KV_cotal_records_<space>` (a FENCING read, read service above); the kind token in the ingress subject is what keeps the writer separation the writer table declares | mediated per kind below, no row left open |\n| Reader/pool/effects consumer provisioning (one-shot, at capability mint / endpoint setup) | the provisioner | exact full-tail extended creates for every pre-created durable this matrix names: `$JS.API.CONSUMER.CREATE.EPW_<space>.<poolD>.cotal.<space>.epw.<e>.<pool>.>`, `$JS.API.CONSUMER.CREATE.EPF_<space>.<effD>.cotal.<space>.epf.<e>.dec.>`, `$JS.API.CONSUMER.CREATE.EPF_<space>.<decD>.cotal.<space>.epf.<e>.dec.<cO>.<cA>.<cUid>.>`, `$JS.API.CONSUMER.CREATE.EPF_<space>.<goalD>.cotal.<space>.epf.<e>.goal.<cO>.<cA>.<cUid>.>` (per action capability), `$JS.API.CONSUMER.CREATE.EPE_<space>.<eveD-n>.<granted full-tail subtree>`, `$JS.API.CONSUMER.CREATE.KV_cotal_records_<space>.<recD-n>.$KV.cotal_records_<space>.<granted subtree>` (the reader-config seam is an ALLOWLIST: the `<granted subtree>` kind token MUST be a registered caller-readable record kind, so it REFUSES every authority-control kind (`oblig` above all, plus `govern`/`policy`/`uid`/`frontier`) and every unregistered kind, and for a dual-token kind whose atomic head is authority (`lifecycle`, head `lifecycle.<owner>.<actor>`) it admits only a filter strictly deeper than the head, never one that can match the head key itself; so no reader durable is ever pre-created over the `oblig.` subtree the sealed records scanner owns nor over an authority head, nats-server#8274), every create PULL, every filter a full literal tail; plus matching `CONSUMER.DELETE` for deprovisioning (lifecycle-keyed names, \xA713.1) | mediated, trusted provisioning only |\n| Events | the owning instance | `epe.<endpoint>.<instanceId>.<epoch>.>` | direct; subject-confined, epoch-pinned |\n| Timer schedule request | the owning instance | publish `ept.<endpoint>.<instanceId>.<epoch>.*.schedule` (never `.armed`/`.fire`); a request carrying any scheduling header is rejected by the timer writer (\xA713.2) | direct; epoch-pinned; captured by the schedules-DISABLED request stream |\n| Timer request consume + arm | the space's timer writer principal (singleton infra, like the delivery daemon) | consume: `$JS.API.CONSUMER.CREATE.EPT_REQ_<space>.<timerD>.cotal.<space>.ept.*.*.*.*.schedule` (full-tail single filter) + `$JS.API.CONSUMER.INFO.EPT_REQ_<space>.<timerD>` + `$JS.API.CONSUMER.MSG.NEXT.EPT_REQ_<space>.<timerD>` + `$JS.ACK.EPT_REQ_<space>.<timerD>.>`; arm: publish `ept.*.*.*.*.armed`, deriving `Nats-Schedule-Target` = the sibling `.fire` from the authenticated request subject tokens ONLY, stripping/rejecting every client scheduling header, and **fresh-checking the authoritative timer generation/deadline before arming** (a FENCING read: leader-served `$JS.API.STREAM.MSG.GET.KV_cotal_records_<space>` on the checkpoint record, read service above); the arm also reads the armed-subject's own last sequence via `$JS.API.STREAM.MSG.GET.EPT_<space>` and publishes with `Nats-Expected-Last-Subject-Sequence` pinned to it - that read is CAS-PINNING, not fencing: the broker CAS is the fence and a delayed writer's stale read loses it loudly (\xA713.1 complementarity, the FIRE handler's class); a redelivered or delayed stale-generation request is discarded, never armed, so it cannot overwrite the current schedule and silently lose the live deadline (\xA713.2, \xA713.6, \xA713.12) | mediated |\n| Timer fire consume | the owning instance | its own `ept.<endpoint>.<instanceId>.<epoch>.*.fire` (fired messages validated against its authoritative schedule state AND the broker-authored scheduler-origin header = its exact sibling `.armed`, \xA713.12); no client credential holds `.armed` or `.fire` publish | direct read |\n| Session `.in` publish | the session's caller (per-session credential) | `eps.<endpoint>.<sessionId>.<epoch>.in` exact | direct |\n| Session `.in` subscribe | the serving instance (per-session credential) | `eps.<endpoint>.<sessionId>.<epoch>.in` exact | direct read |\n| Session `.out` publish | the serving instance (per-session credential) | `eps.<endpoint>.<sessionId>.<epoch>.out` exact | direct |\n| Session `.out` subscribe | the session's caller (per-session credential) | `eps.<endpoint>.<sessionId>.<epoch>.out` exact | direct read |\n| Session ledger (one-use redemption, credential ids, revocation state, authenticated close) | the trusted auth path (\xA79/\xA710) | `$KV.cotal_auth_<space>.session.<sessionId>`, create-only CAS per `sessionId`, monotonic state (\xA713.6) | mediated |\n| Credential ledger (issuance gate, descendant enumeration, lineage index, revocation) | the trusted auth path (\xA79/\xA710) | writes: `$KV.cotal_auth_<space>.cred.<lifecycleUid>.<credentialId>` + `\u2026.gate.<lifecycleUid>` (the issuance gate, revision-pinned CAS is the mint fence, \xA713.1) + `\u2026.epgate.<endpoint>.<instanceId>` + `\u2026.epcred.<endpoint>.<instanceId>.<credentialId>` (the disjoint endpoint gate/credential families, \xA713.1: same protocol, explicit prefixes, never arity) + `\u2026.stage.>` (implementation staging/tombstone fences; NEVER under `cred.`/`epcred.`, \xA713.1) + `\u2026.srcgate.<issuerKeyId>.<id>` (per-handle source gate, \xA713.1) + `\u2026.bysrc.<issuerKeyId>.<id>.<lifecycleUid>.<credentialId>` (the per-ancestor lineage index) + `\u2026.session.<sessionId>` (create-CAS `issuing`, finalize-CAS `active`, \xA713.6) + `\u2026.plane` (the ONE plane-ownership claim row, \xA713.13: create/revision-CAS by the barrier profile only, exact arity, never `plane.>`); reads: **leader-served `$JS.API.STREAM.MSG.GET.KV_cotal_auth_<space>`** (with `allow_direct=false` a KV get is exactly this body-selected `last_by_subj` call against the stream LEADER; read-your-writes, not a follower-served `DIRECT.GET`; the body-selection is safe here because this profile IS the trusted auth path, and it is granted to no other profile) for gate/session/row state, which is why the mint and session fences are revision-pinned CAS *writes* rather than reads (a read is never a fence, \xA713.1); and **fence-free prefix enumeration through the SEALED auth-ledger scanner, never a runtime consumer create**: no standing or runtime-reachable auth credential (the takeover/retirement/handle-revocation barrier, the session sweep, any replayable executor) holds `$JS.API.CONSUMER.CREATE` on `cotal_auth_<space>`, because a consumer-create request BODY is not subject-ACL confinable: an extended `CONSUMER.CREATE.<stream>.<name>.<filter>` grant still admits a body with `durable_name` (equal to the subject name token) and a push `deliver_subject`, a DURABLE exporter of every current and future row that SURVIVES the credential's connection close and revocation; a subject ACL cannot constrain that body, so the only safe runtime grant is none. The dynamic-enumeration `CONSUMER.CREATE` lives in exactly ONE profile, a SEALED scanner the trusted auth process opens for itself and NEVER hands out: its credential, connection, and identity seed reach no caller, child, log, or persistence (a process-memory compromise reaches it, the SAME residual class as the account signing seed the process already holds; never broker confinement, never a network-reachable JWT). The scanner is pinned to ONE literal consumer name under a FORCED config: pull (no `deliver_subject`), ephemeral (no `durable_name`), `AckPolicy.None`, `DeliverPolicy.LastPerSubject`, memory storage, bounded inactivity; re-read and bind-verified before use and unconditionally deleted after, with every scan over the stream serialized on that one name, and the injected scanner bonded to its exact space so a hand-assembled or foreign-space scanner never enumerates. The scan is FENCE-FREE by construction: under the history=1 store a same-subject `active\u2192revoked` overwrite EVICTS the pre-scan revision, so a sequence/`STREAM.INFO` cutoff would DROP that subject and leave its holder un-revoked; a LastPerSubject read carries no upper cutoff and, draining to a freshly re-observed zero pending (never a stale local count), returns each subject's CURRENT last, so a concurrent overwrite is SEEN, never dropped. It enumerates exactly `cred.<lifecycleUid>.>`, `bysrc.<issuerKeyId>.<id>.>`, `stage.>` (operation-intent discovery), or `session.>`. The barrier's family enumeration and the expiry sweep are executable reads, not prose. No profile OTHER than the sealed scanner and this trusted write path holds ANY grant on `cotal_auth_<space>` | mediated |\n| Auth-ledger enumeration (the SEALED scanner profile, the credential-ledger row's enumeration seam) | the trusted auth process's DEDICATED self-minted scanner principal; opened for the process itself, NEVER handed out (full rationale in the credential-ledger row above) | exactly `$JS.API.INFO` + `$JS.API.STREAM.INFO.KV_cotal_auth_<space>` + `$JS.API.CONSUMER.CREATE.KV_cotal_auth_<space>.cotal-ledger-scan.$KV.cotal_auth_<space>.>` + `$JS.API.CONSUMER.INFO.KV_cotal_auth_<space>.cotal-ledger-scan` + `$JS.API.CONSUMER.MSG.NEXT.KV_cotal_auth_<space>.cotal-ledger-scan` + `$JS.API.CONSUMER.DELETE.KV_cotal_auth_<space>.cotal-ledger-scan` + its connection-scoped `_INBOX_<connId>.>` subscribe, and NOTHING else (no records-stream grant, no KV write, no `DIRECT.GET`, no `$JS.ACK`: an `AckPolicy.None` scan acks nothing); `cotal-ledger-scan` is the ONE pinned literal consumer name every auth-stream scan serializes on, and this profile plus the records scanner below are the ONLY DYNAMIC-ENUMERATION `CONSUMER.CREATE` holders on the two authority streams (the provisioning row's pre-created full-tail reader durables, CREATE+DELETE by the provisioner and INFO/MSG.NEXT/ACK bind by the read mediator, are the one other records-stream consumer authority, and the reader-config seam REFUSES an authority-control record kind so no reader durable can target the `oblig.` subtree the records scanner owns), re-audited mechanically per this section's closing clause | mediated |\n| Obligation enumeration (the SEALED records scanner profile, the acceptance-obligation row's enumeration seam, ONE instance per space) | the trusted process's DEDICATED self-minted records-scanner principal; opened for the process itself, NEVER handed out (full rationale in the acceptance-obligation row below; every scan over the literal name serializes process-wide per space, so a second instance can never interleave with a live scan and hand back a partial result, and the scanner handle is immutable once branded) | exactly `$JS.API.INFO` + `$JS.API.STREAM.INFO.KV_cotal_records_<space>` + `$JS.API.CONSUMER.CREATE.KV_cotal_records_<space>.cotal-records-scan.$KV.cotal_records_<space>.oblig.>` (the CREATE filter is confined to the `oblig.` subtree) + `$JS.API.CONSUMER.INFO.KV_cotal_records_<space>.cotal-records-scan` + `$JS.API.CONSUMER.MSG.NEXT.KV_cotal_records_<space>.cotal-records-scan` + `$JS.API.CONSUMER.DELETE.KV_cotal_records_<space>.cotal-records-scan` + its connection-scoped `_INBOX_<connId>.>` subscribe, and NOTHING else; `cotal-records-scan` is the ONE pinned literal consumer name, disjoint from the auth scanner's (one scanner instance, lock, and literal name PER STREAM) | mediated |\n| Work-pool enqueue | the endpoint's canonicalizer (from accepted decisions only) | `epw.<endpoint>.>` publish, create-per-subject (`Nats-Expected-Last-Subject-Sequence: 0`; the acceptance identity is the subject, \xA713.2) | mediated |\n| Work-pool reconciliation probe | the endpoint's canonicalizer | leader-served `$JS.API.STREAM.MSG.GET.EPW_<space>` (body-selected `last_by_subj` on the exact item subject; the probe is FENCING, read service above: a follower-served `DIRECT.GET` that misses the live entry re-arms settled work, so that form is NOT granted) + the CAS-winner read row above (`dec` + `wrk` last-by-subject), together they decide the \xA713.6 predicate: accepted, **`now < workExpiry`** (an expired item is never re-enqueued; it is terminally settled `expired` with its `wrk` fact and acked without effect), no terminal, no live entry \u21D2 re-enqueue for the item's REMAINING TTL; a worker likewise MUST check `now < workExpiry` before lease/effect and refuse expired work | mediated |\n| Virtual-endpoint activation watch | the endpoint's activator principal (holder of its activation capability, \xA713.6) | exactly `$JS.API.CONSUMER.INFO.EPW_<space>.<poolD>` (the per-pool occupancy snapshot; request/reply, so watching is bounded polling) PLUS its own connection-scoped reply inbox `_INBOX_<connId>.>` (never the account-wide default); the instance START is a mediated, target-bound seam resolved by the supervisor's own authority, never a broker grant; NOTHING else: no `CONSUMER.MSG.NEXT`/`$JS.ACK` (watching is never draining), no `STREAM.MSG.GET.EPW_<space>` (no reconciliation authority), no consumer create/update/delete, no `epw.>` publish | mediated |\n| Work-pool consume + ack | the pool's owning endpoint ONLY (workers hold NO pool grant, \xA713.5) | **bind-only** on the provisioner-pre-created exact-filter `poolD` (grammar above): `$JS.API.CONSUMER.INFO.EPW_<space>.<poolD>`, `$JS.API.CONSUMER.MSG.NEXT.EPW_<space>.<poolD>`, `$JS.ACK.EPW_<space>.<poolD>.>` (ack only after committed terminal state); NO consumer create, NO stream-wide read | mediated |\n| Lease issue / fencing advance | the pool's owning endpoint (`lease` command) | its `lease` record keys (\xA713.7 grammar), via the record-writer seam | mediated |\n| Lifecycle mapping / teardown | minting manager's commit path; lifecycle-pinned deprovisioner | the **unsplit** alias CAS head `$KV.cotal_records_<space>.lifecycle.<owner>.<actor>` (one atomic key, NOT `.spec`/`.status`-split; the authoritative current mapping and the only `mappingRevision` source, activation/retirement serialize here by CAS, \xA713.7; NEVER-DELETED, three states `active | retiring | retired`, transitions only inside the \xA713.1 operations) + the create-only space-global UID reservation `$KV.cotal_records_<space>.uid.<lifecycleUid>` (\xA713.1: won BEFORE any gate or head write; NEVER-DELETED); leader-consistent current-mapping read `$JS.API.DIRECT.GET` is NOT used for authority reads of this key (the records bucket may follower-serve; a fresh mapping read is a leader-served `$JS.API.STREAM.MSG.GET.KV_cotal_records_<space>` last-by-subject get on the head key; leader-served for read-your-writes, granted to the trusted mapping-reader/mediator profile, not a follower-served `DIRECT.GET`; that reader profile ALSO holds exactly `$JS.API.STREAM.INFO.KV_cotal_records_<space>` so it can shape-prove at bind time that the stream it leader-reads is the primary, un-mirrored, non-evicting records store (\xA713.12); a reader that cannot prove its store's shape MUST refuse to serve authority reads); optional append-only per-UID audit `$KV.cotal_records_<space>.lifecycle.<owner>.<actor>.<lifecycleUid>`; teardown: exact lifecycle-keyed names only | mediated / broker-pinned delete |\n| Acceptance obligation (reservation/drain, \xA713.8) | the admission mediator (per endpoint; the canonicalizer holds NO raw `oblig.` grant) | create-only winner + monotonic revision-pinned CAS on `$KV.cotal_records_<space>.oblig.<targetUid>.<endpoint>.<cO>.<cA>.<cUid>.<id>` (\xA713.7; the key derives from the broker-authenticated request subject plus the create-fence currency reads of \xA713.8, never from a body field; proof issuance only after the post-create recheck); its winner/settle reads are FENCING, leader-served `$JS.API.STREAM.MSG.GET` on the obligation key and on the EPF decision subject; its currency reads are FENCING, leader-served `$JS.API.STREAM.MSG.GET` on the target's `lifecycle` head AND on the endpoint's `govern` head (\xA713.6: the govern head read is what surfaces both a staged `pendingPolicyKey` (which pauses policy-admitted proof issuance) and the enforced policy selector the mediator follows to the immutable `policy.<endpoint>.<digest-hex>` version; the mediator reads govern and policy for its OWN endpoint only, the confined-reader identity bind) PLUS the immutable `policy.<endpoint>.>` version it names; PLUS create-only publish on the endpoint's EPF decision subjects for the TERMINAL REJECTION settle only (\xA713.8: its own recheck refusals and the retirement/policy drains, which settle through it); the broker cannot distinguish a rejection payload from an acceptance, and rejection-only is NOT subject-expressible (both decisions MUST share the create-only decision subject for first-wins settlement), so this grant's residual is explicit per D32: a compromised mediator can forge a decision for ITS endpoint INCLUDING AN ACCEPTANCE, an escalation to injecting executed work, never merely reject/stall (the same class of trust already placed in that endpoint's canonicalizer), and never beyond its endpoint (the decision-publish row is endpoint-literal); obligation enumeration (the \xA713.1 retirement barrier's `oblig.<targetUid>.>` discovery + quiescence recheck, and the mediator's own `oblig.*.<endpoint>.>` policy-movement drain, \xA713.6) runs through a SEALED records scanner, the same seal as the auth-ledger scanner above: this profile holds NO `$JS.API.CONSUMER.CREATE` (nor INFO/MSG.NEXT/DELETE) on `cotal_records_<space>`, because a consumer-create request BODY is not subject-ACL confinable: an extended `CONSUMER.CREATE.<records>.<name>.<oblig filter>` grant still admits a body with `durable_name` and a push `deliver_subject`, a DURABLE exporter of the whole `oblig.` subtree that SURVIVES the credential's connection close and revocation (nats-server#8274; reproduced live against the prior grant). The fence-free `LastPerSubject` enumeration `CONSUMER.CREATE` lives in exactly ONE profile: a sealed records scanner the trusted process opens for itself and NEVER hands out (its credential, connection, and seed reach no caller; the same process-memory residual class as the auth-ledger scanner), pinned to ONE literal consumer name under a FORCED pull/ephemeral/`AckPolicy.None`/`DeliverPolicy.LastPerSubject`/memory config, bind-verified before use and unconditionally deleted after, its CREATE filter confined to the `oblig.` subtree, and the injected scanner bonded to its exact space so a hand-assembled or foreign-space scanner never enumerates; its fencing `STREAM.MSG.GET` rows are stream-level grants whose read exposure is space-wide, explicit per D32 (the terminal-cleanup row's same read residual); its reply inbox is connection-scoped (`_INBOX_<connId>.>`, never the account-wide default); the rows are NEVER-DELETED, a WRITER discipline the broker cannot fully enforce: the raw KV publish grant is operation/header-blind, so a compromised mediator can overwrite its own endpoint's row to a valid `terminal` value (hiding cleanup debt) or emit DEL/PURGE markers, where every reader refuses a deletion marker loud as corruption (\xA713.12 retention floor) and the records stream denies stream-API message-delete/purge, leaving the valid-row overwrite as a second explicit D32 residual, exactly parallel to the decision-forge residual and confined the same way (its own endpoint's rows only) | mediated |\n| Terminal pool cleanup (\xA713.1 barrier) | the retirement cleaner profile: minted per (retirement `op` \xD7 endpoint), its grant listing the EXACT pools of this operation's EFFECTIVE INVENTORY, DISCOVERY-ONLY: the target's accepted `oblig.<lifecycleUid>.>` pool routes (the barrier takes no caller-supplied hint, so every listed pool is one the target holds accepted work on), never a pool wildcard, never space-wide EPW rights, DISTINCT from every owner/agent/endpoint profile (never the revoked owner's credential), bounded-lived and, once the pool is proven quiescent (every prior owner ACK drained through `AckWait`, and a fresh consumer read shows zero `num_pending`/`ack_pending`; a fire-and-forget ACK confirmed with `AckSync`, never assumed), REVOKED and cluster-verified-EVICTED (its own principal) BEFORE any frontier records (\xA713.1 order), so no in-flight cleaner can ACK a redelivery after the alias is reused | runs only AFTER the target's obligation drain reached quiescence (\xA713.1 order) and BEFORE the frontiers; bind-only on each named pool's provisioner-pre-created durable: `$JS.API.CONSUMER.INFO.EPW_<space>.<poolD>`, `$JS.API.CONSUMER.MSG.NEXT.EPW_<space>.<poolD>`, `$JS.ACK.EPW_<space>.<poolD>.>` (re-proving at bind, per the work-pool row, that the durable's filter is exactly the named pool's subtree, pull mode, unlimited delivery ceiling), plus its own connection-scoped reply inbox `_INBOX_<connId>.>` (never the account-wide default) and leader-served terminal-observe reads `$JS.API.STREAM.MSG.GET.EPF_<space>` on `wrk.>`/`dec.>` item subjects, a STREAM-level grant whose read exposure is space-wide, explicit per D32; the cleaner holds NO lease or records authority, NO `wrk` (or any EPF/EPW) publish, NO consumer create/update/delete, NO raw stream DELETE: for each delivered message it hands the item's coordinates and requested disposition to the retirement settlement executor (next row; cleaner-supplied coordinates never authorize, the executor re-derives them from the durable acceptance), then re-reads and codec-validates the executor's lease-derived terminal, and ACKs ONLY a message whose item is durably terminal (a live, unexpired, foreign-target item is NEVER settled or ACKed, and the barrier refuses to close frontiers while one remains unsettled); this profile's explicit D32 residuals are terminal-free ACK suppression across its WHOLE EFFECTIVE INVENTORY (every discovered pool: a raw `$JS.ACK` cannot be broker-conditioned on a prior terminal, so compromise can silently drop effective-inventory-pool deliveries without settlement) and the space-wide `STREAM.MSG.GET` read exposure; it can forge NO terminal and mutate NO lease (it holds no write grant at all) | mediated |\n| Retirement settlement (\xA713.1 barrier executor) | the retirement barrier's op-bounded executor: a DISTINCT per-operation principal (`local.epexe_<opId-hash>`, CONNZ principal-tagged) minted per (op \xD7 endpoint) over this operation's EFFECTIVE INVENTORY bound to the durable intent (`opId`, target lifecycle; the pools are the target's accepted `oblig.<uid>.>` routes, DISCOVERY-ONLY (no caller-supplied hint)), its settlement code running on ITS OWN connection, live only for that operation and revoked + cluster-verified-evicted by the barrier at the same fence as the cleaner, BEFORE any frontier records; never the cleaner profile, never the barrier's standing connection, never a standing grant | the settlement seam is EFFECTIVE-INVENTORY-CLOSED: for every item the cleaner hands it, the executor re-derives the authority coordinates from the item's durable acceptance decision (a FENCING leader-served read; cleaner-supplied coordinates never authorize) and refuses a ref whose endpoint or pool is outside its EFFECTIVE-INVENTORY spec (the discovered pools), a decision that is not an accepted pool admission, an `expired` request before the item's OWN `workExpiry`, and a `retired` request for an accepted target that is not the intent's lifecycle (the confused-deputy closure: a cleaner chooses refs but can never borrow this authority beyond that effective inventory or the retirement lifecycle); it settles by CASing the item's `lease.<endpoint>.<pool>.<acceptance>.spec` record to a settled state, where the ONLY settlements it may INITIATE are `expired` (bound to the item's own horizon) and `retired` (re-bound to ITS operation's retiring target through the acceptance) and an ALREADY-settled lease DOMINATES (a crashed owner's `committed` lease is derived and its terminal published verbatim, never overwritten, never contradicted), then publishes/observes the exact lease-derived `wrk` terminal create-only (first terminal wins, \xA713.8 cancellation ordering) for the cleaner to validate; its authority is lease-record CAS plus `epf.<endpoint>.wrk.<pool>.>` publish on its effective-inventory pools plus the leader-served fencing reads its own code path performs (`STREAM.MSG.GET` on the facts stream and on the records store, plus the records store's bind-probe `STREAM.INFO` and `$JS.API.INFO`; NO work-stream read: the settlement path always settles or expires through the lease key before any EPW live-entry probe, so that read is unreachable and ungranted) and its connection-scoped reply inbox, and NOTHING else (no consumer authority anywhere, no work-enqueue publish, no auth-store access), and it carries the write residual the bounded cleaner does NOT: KV subject permissions cannot distinguish CAS from overwrite or DEL/PURGE markers, and the `wrk` publish is payload-blind, so a compromised executor can forge a lease settlement or work terminal within its WHOLE EFFECTIVE INVENTORY (every discovered pool; the per-item checks above bind honest execution, not a compromised bearer), explicit per D32, op-bounded and effective-inventory-confined, never standing, never beyond that inventory | mediated |\n| Drain commit applier (\xA713.8 accepted-self recovery) | a per-op, per-repair principal (`local.epapl_<opId-hash>`, CONNZ principal-tagged) the retirement drain mints ONLY after the commit key passes the CLOSED self-commit class: the key's kind must resolve in the canonical frozen kind registry to a NON-authority definition whose targeted `spec`/`status` half is registered to the \xA713.8 commit-path writer, at exact arity (which structurally excludes every authority HEAD, including the 3-token lifecycle head) with every qualifier token validated; a key outside the class refuses BEFORE any credential exists (the confused-deputy closure: a forged accepted-self row cannot turn `oblig.`/`govern.`/`policy.`/`uid.`/`frontier.`/a lifecycle head/an unregistered kind into a granted coordinate) | exactly ONE `$KV.cotal_records_<space>.<commitKey>` publish row plus its connection-scoped reply inbox; NO reads, NO wildcards. It executes the mediator-validated command verbatim: the resolved, canonically digest-verified intent bytes at the pinned base revision, written by guarded CAS; a CAS loss reports the another-writer conflict and the drain's re-enumeration re-classifies (landed / superseded), never a blind retry. NAMED residual: KV subject permissions cannot distinguish CAS from overwrite or DEL/PURGE, so within its one granted key a compromised applier can overwrite or delete for the credential's short life \u2014 the confinement is the exact key, the closed class, and the op-bounded lifetime, never write semantics. RETIREMENT-FENCE residual (\xA713.1/\xA713.13): no credential-ledger row backs this bearer, so the retirement fence guarantees KILL-LIVE (cluster-verified eviction of any live connection before the frontier), never deny-new \u2014 the connection is minted non-reconnecting so a KICK is durable in one round, and a fresh connect with a still-unexpired held bearer+seed after that point-in-time scan is the accepted residual, dominated by data-account signing-seed compromise (signing-key rotation is the only true deny-new) | mediated |\n| Drain route reconciler (\xA713.8 accepted-pool repair) | a per-op, per-repair principal (`local.eprec_<opId-hash>`, CONNZ principal-tagged) the retirement drain mints only to execute a MEDIATOR-DERIVED closed repair command: the mediator reads the item's durable acceptance decision itself (a leader-served fencing read), binds it to the obligation row (fingerprint/sourceSeq/route/horizon), and derives the exact EPW item subject plus the canonical acceptance item bytes (\xA713.6); the executor re-validates the exact six-token item shape for its own space and holds NO derivation authority (row-supplied coordinates or bytes never reach a grant) | exactly ONE `cotal.<space>.epw.<endpoint>.<pool>.<cOwner>.<cActor>.<cUid>.<id>` create-only publish row plus its connection-scoped reply inbox; a lost create is benign (a concurrent enqueue won; the drain re-reads establishment either way, so a no-op executor still fails closed); the payload-blind enqueue residual is confined to the one item subject for the credential's short life. RETIREMENT-FENCE residual (\xA713.1/\xA713.13): no credential-ledger row backs this bearer, so the retirement fence guarantees KILL-LIVE (cluster-verified eviction of any live connection before the frontier), never deny-new \u2014 the connection is minted non-reconnecting so a KICK is durable in one round, and a fresh connect with a still-unexpired held bearer+seed after that point-in-time scan is the accepted residual, dominated by data-account signing-seed compromise (signing-key rotation is the only true deny-new) | mediated |\n| Drain effects canceller (\xA713.8 option-(i) retirement cancel) | a per-op, per-repair principal (`local.epcan_<opId-hash>`, CONNZ principal-tagged) the retirement drain mints only to execute a MEDIATOR-DERIVED effects-cancel repair: the mediator reads and row-binds the acceptance decision itself and derives the exact completion subject (the `eff` marker or the goal `result` coordinate; the executor re-validates that exact shape for its own space); the cancelled terminal is built by the CORE validated builders, which refuse a foreign or absent target \u2014 a retirement cancels only ITS OWN target's accepted work \u2014 and never fabricate success (the effects union's `cancelled` member, or the goal union's first-class `cancelled` state with the digest-bound retirement attribution) | exactly ONE completion-subject create-publish row plus its connection-scoped reply inbox; CREATE-ONLY, so first-terminal-wins is structural (a racing real completion that landed first wins and the cancel loses its create harmlessly; the drain re-reads the winner either way, so a no-op executor still fails closed); the payload-blind single-subject create residual is confined to the one marker for the credential's short life. RETIREMENT-FENCE residual (\xA713.1/\xA713.13): no credential-ledger row backs this bearer, so the retirement fence guarantees KILL-LIVE (cluster-verified eviction of any live connection before the frontier), never deny-new \u2014 the connection is minted non-reconnecting so a KICK is durable in one round, and a fresh connect with a still-unexpired held bearer+seed after that point-in-time scan is the accepted residual, dominated by data-account signing-seed compromise (signing-key rotation is the only true deny-new) | mediated |\n| Auth control rail (the `auth-admin` listener, \xA713.2 reserved) | the auth service's dedicated LISTENER credential: serve + bounded replies on the `ctl.auth-admin` subtree, standing with the plane. The surface is GENERIC \u2014 \"retire a lifecycle (owner, actor, lifecycleUid)\" \u2014 never caller-specific; caller attribution is SUBJECT-derived (`ctl.auth-admin.<owner>.<actor>`, broker-ACL-enforced) and the reply target must live under the sender's own `<request>.reply.>` subtree (an unbound target is dropped before any processing). Serve-time authz is the RAIL-TIME space-manager-lease holder check: ONE leader-served `STREAM.MSG.GET` read of the manager bucket's single `lease` key, fresh per request, requiring `lease.holder == principalKey(subjectOwner, subjectActor)`; a DEL/PURGE marker or TTL-expunged row reads ABSENT and refuses fail-closed. The four-outcome idempotence table answers in operator vocabulary (already-retired = success; the same stable opId resumes; a foreign operation refuses naming it; a stale incarnation refuses naming the current one), and every refusal is a COMPLETE no-op stated as such | subscribe `ctl.auth-admin.*.*` + publish `ctl.auth-admin.*.*.reply.>` (replies ONLY: the handler only ever responds under `<request>.reply.>`, so a bare request subject is unpublishable by the listener credential, closing the self-forge where a compromised listener publishes a request as the current lease holder and passes its own subject-derived lease check) + `$JS.API.INFO` + the ONE lease read row + its connection-scoped inbox; NO store writes, NO consumer authority, NO scanner/plane reach \u2014 every executing right stays with the plane's own registry and retirement deps (the drain rides the plane's ONE sealed records scanner) | mediated |\n| Retirement requester (per-despawn, \xA713.2) | an EPHEMERAL one-shot credential the space manager mints per despawn (`retirement-requester` profile, five-minute window): request + reply ONLY, for exactly ITS OWN control subject. The manager derives a STABLE opId from the retiring lifecycleUid, so a despawn retry, a same-name-spawn nudge, and the auth service's boot resume all drive the SAME operation. The requester holds no executing right \u2014 a leaked credential can only ask the rail to retire a lifecycle, and the rail's fresh lease check + idempotence table bound what that ask can do | publish exactly `ctl.auth-admin.<owner>.<actor>` (its minting manager's own principal) + subscribe that subject's `reply.>` subtree and its connection-scoped inbox; nothing else | mediated |\n| Governance head (registration linearization) | the provisioner-registration principal | the **unsplit** governance head `$KV.cotal_records_<space>.govern.<endpoint>` (\xA713.7): it reads the head FRESH under the frozen registration gate (a FENCING read, read service above: leader-served `$JS.API.STREAM.MSG.GET.KV_cotal_records_<space>` last-by-subject on the head key, never the follower-served `DIRECT.GET` the records bucket would allow) and is the head's ONLY writer (slot-take CAS in phase 1, promote CAS after the spec publish); the SAME principal holds the write on `$KV.cotal_records_<space>.policy.<endpoint>.>` (each immutable policy version is published exactly once, before the stage CAS that names it). The immutability of a policy version is a TRUSTED-WRITER INVARIANT, not a broker-enforced subtraction: KV create/update/delete all publish to the one `$KV.\u2026policy.<endpoint>.<digest>` subject, and NATS subject permissions cannot distinguish the create-CAS header or the `KV-Operation` header, so a subject grant cannot forbid an overwrite or DEL. The invariant is upheld by the writer's create-only CAS plus every reader's SELF-CERTIFICATION (\xA713.7: the value must digest to the key), so a changed-byte overwrite is REFUSED on read; the residual, confined to this prefix, is that a buggy or compromised provisioner could still DEL or same-byte-overwrite an enforced version and (history 1) destroy its availability, at which point admission pauses fail-closed rather than admitting under a lost policy. No agent, endpoint, observer, admin, or host profile holds any grant. The head is NEVER-DELETED (the `lifecycle`-head discipline): no grant permits DEL/PURGE on `govern.>`; a reader treats only TRUE ABSENCE as a virgin head, and a deletion marker refuses loudly as corruption (\xA713.12 retention floor), never as absence | mediated |\n\nTerminal pool cleanup settlement is lease-fenced across the two profiles above: the executor\nCASes the item's lease (or observes the winning settled lease), publishes/observes the exact\nlease-derived `wrk` terminal, and only then does the cleaner, after re-reading and\ncodec-validating that terminal, ACK the delivery. A `wrk` create that bypasses the lease CAS is\nnon-conformant: it can contradict a racing commit.\n\nAn `eff` completion fact `epf.<endpoint>.eff.<cO>.<cA>.<cUid>.<id>` is a CLOSED two-member\nunion carrying a REQUIRED `outcome` discriminant on EVERY member (the goal union's `state`\nbar, applied to effects: a member is never structurally assignable to the other, and every\nreader is forced to read the outcome). The RAN member is\n`{ v: 1, id, fingerprint, caller, sourceSeq, ts, outcome: \"ran\" }`; the RETIREMENT-CANCELLED\nmember is `outcome: \"cancelled\"` plus exactly `cancelled: { opId, target }` \u2014 the same\nidentity spine, plus the binding to the retiring target's lifecycle and the retirement\noperation that cancelled it. A fact missing the discriminant, or claiming one outcome while\ncarrying the other's fields, refuses. A reader that sees `cancelled` KNOWS the effect did not run; the member is never\na forged success. Both members' caller triple and `id` are bound by the subject, and their\n`fingerprint` and `sourceSeq` MUST equal the accepted decision's. The cancelled member may be\nwritten ONLY for an acceptance whose own `target` names the retiring lifecycle (a retirement\nnever cancels a foreign target's work), publishes CREATE-ONLY on the SAME subject the real\nmarker would use \u2014 so first-terminal-wins is structural: a racing real completion that lands\nfirst wins and the cancel loses its create harmlessly, and vice versa \u2014 and is produced by\nthe drain's per-op canceller profile (\xA713.9). An ACTION needs no new member: the `goal\u2026.result`\nunion already carries the first-class `cancelled` outcome state, and a retirement-cancelled\ngoal terminalizes through it with the same acceptance-fingerprint binding and the retirement\nattribution in its digest-bound payload (`data.cancelledBy = { opId, target }`). An\neffects-route drain compares the PARSED fact against the acceptance and treats EITHER bound\nmember as established; an action's drain instead requires the parsed `goal\u2026.result` fact whose\n`fingerprint` matches the acceptance. Subject presence alone never proves completion: a bare,\nmalformed, or mismatched fact refuses the drain loud (\xA713.8).\n\nRaw `STREAM.MSG.GET` and `CONSUMER.MSG.NEXT` authority carries a caller-selected reply subject.\nFor every trusted profile holding those APIs, D32 includes confused-deputy response injection:\ncompromise can direct fetched API/message bytes onto a foreign subject even though its\nconnection-scoped inbox prevents subscribing there. This is injection, not foreign read access,\nand requires a future fixed-destination mediation boundary to remove.\n\nDeletes beyond these rows: only the lifecycle-keyed deprovisioner (exact names, \xA713.1) and\nstream retention.\n\nA **mediated** row means the raw storage grant is held only by a narrowly scoped writer\nprincipal (per endpoint, never a universal writer), with authenticated caller binding,\nidempotent request semantics, and bounded failure/backpressure; CAS headers, fingerprint\nrules, schema validity, and digest-correct bytes are *enforced* there. A **direct** row means\nthe broker guarantees writer/key containment only, and the row **explicitly downgrades**\nCAS/schema/header/byte correctness to a conforming-client guarantee; readers of direct-row\nstate fail loud on invalid content. No profile (agent, observer, admin, host) holds generic\n`$JS.API.>`/`$KV.>`/`$O.>` authority over control-surface state, for the contract store that\nmeans the REAL subjects and APIs: **write** on `cotal.<space>.epc.>` belongs\nto the contract publisher alone (create-only per digest subject); **read** is the\nsubject-scoped last-by-subject Direct Get of the reader row above, never a body-selected\nform and never a consumer, because there is nothing to replay: one message per digest\nsubject IS the store, with verify-on-read as the tamper\nboundary; and the **stream-management surface** of `EPC_<space>`\n(`$JS.API.STREAM.{UPDATE,DELETE,PURGE,MSG.DELETE}.\u2026`) is held by NO profile, publisher\nincluded, stream lifecycle belongs to space setup under operator provisioning authority\nonly, which is what \"immutable once published\" rests on (a `$OBJ.>` deny matches no NATS\nsubject and audits nothing).\nThe matrix is re-audited mechanically (decoded-credential fixture + live positive/negative\nprobes, with predicates over the real `$O.`/`$JS.API` subject forms) at every phase that\nadds a resource or changes ownership.\n\n**Writer table (core kinds, mediation decided, D7: authoritative CAS/schema record writes\nare mediated by separately scoped spec/status writer principals; an endpoint holds no raw\noverwrite grant on its own record keys).** `svc`, spec: the provisioner/registration path,\n**mediated** (CAS + schema enforced at registration); status: the owning instance's commit\npath, **mediated** with **epoch currency enforced at the writer**: the writing epoch is\nread from the broker-authenticated `epr` ingress subject (\xA713.2, the instance's serve\ncredential pins the epoch token there, so a stale process CANNOT claim the successor's\nepoch: the value is attested by the grant, never by payload), and the writer validates it\nagainst a FRESH read of the authoritative lifecycle mapping's `processEpoch`,\nrejecting a non-current epoch (`expired`), monotonicity against the stored status epoch\nalone is NOT sufficient, because between the takeover CAS (mapping N\u2192N+1) and the completed\nrevoke/evict barrier the superseded N would still equal the stored status epoch and pass a\nbelow-stored check, and additionally rejects a below-stored epoch (`conflict`). The record\nkey is restart-stable and\ncannot carry the epoch (\xA713.1), so this epoch-pinned-ingress-plus-fresh-equality mediation\nis the record's only stale-writer fence.\n`signer`, spec+status: the space operator's registry tooling as the scoped writer\nprincipal, **mediated**. `handle`; keys are **issuer-namespaced**,\n`handle.<issuerKeyId>.<id>`, so two issuers can never collide or cross-revoke; spec: the\nissuer through the record-writer seam, create-only; status/revocation: issuer or space\noperator, **mediated and monotonic** (revoked never un-revokes; the signature stays the\ncontent authority; mediation enforces key grammar, CAS, and schema). `contracts` index, the instance, **direct** (explicitly advisory and\nnon-authoritative; `describe` is authoritative; readers fail loud on invalid state).\n`goal`/`cp` projections, status: the owning instance's commit path, **mediated**. Lifecycle\nmapping records (\xA713.1), the minting manager's commit path, **mediated**, CAS-only. The\n`govern` head (\xA713.7), the provisioner-registration principal, **mediated**, CAS-only (the\nmatrix row above).\nCanonical acceptance, work-pool enqueue, lease state, and contract-artifact publication,\n**mediated** per the matrix above.\n\n**Trait seam.** Core owns the fail-closed pre-effect verification interfaces (guard call,\npriced-proof verification, governed-attachment verification); policy engines, token formats,\nand payment rails remain extensions behind those seams.\n\n### 13.10 Receipts and signing trust anchors\n\n**Receipts.** A receipt binds a request to its outcome, signed and non-repudiable, for\nmetering, disputes, and pipeline causality; payment semantics stay opaque to core.\n\n`Receipt` = `{ v: 1, requestId, sourceSeq (the accepted submission's sequence, the\nexecution identity its subject carries, \xA713.2), space, endpoint, command, instance: { id, instanceId, epoch },\ncaller: { id, lifecycleUid }, schemaDigests: { input, output }, argsDigest, outcome: { ok,\ncode? }, resultDigest?, ts, signer: { keyId }, sig }`, canonical JSON, Ed25519-signed\n(`space` per the unconditional artifact rule below).\nLifecycle and epoch are recorded as **evidence**, never redemption authority. A command\ncarrying `ai.cotal.priced` MUST verify an independently verifiable payment proof in the\n`auth` slot before effect (never a bare \"settled\" assertion) and emit a receipt fact\n(`epf\u2026.receipt.<cOwner>.<cActor>.<cUid>.<id>.<sourceSeq>`, the caller- and\nexecution-scoped subject of \xA713.2; receipts are create-only per subject). A priced command\nis therefore journal-class: its receipt derives its identity from the accepted submission's\ndecision fact and its outcome from the committed terminal, never from emitter-supplied\nparameters, so a command with no acceptance fact has no receipt to emit; a conforming\nimplementation refuses to serve `ai.cotal.priced` on an ephemeral command (an\nadmission-time refusal at serve construction, never a first-request surprise). Receipt\nretention: default 90 d, \u2265 the idempotency horizon (outcome-stated by the \xA713.12 retention\nfloor).\nVerification: signature against the anchor registry + digest recomputation; forged or\nrequest-mismatched receipts fail loud. Receipts MAY be emitted for unpriced commands.\n\n**Trust anchors.** One per-space registry covers every signed artifact of this section,\nauthorization slots, capability handles, checkpoint resumes, trait definitions and\nattachments, session grants, receipts. Anchors are `signer.<keyId>` records: spec =\n`{ keyId, publicKey (Ed25519), owner (the principal or reverse-DNS domain the key belongs\nto), roles \u2286 [handles, traits, receipts, resume, sessions, authz-slots, obligations,\npayments], scope: per-role structured ceilings, for a `handles`-role key the **full grant\ndimensions**, in the handle-grant shape itself: the endpoints/domains, and per entry the\nmaximal commands, authorization modes, target patterns, instance ids, and read subtrees the\nkey may issue for (a handles- or receipts-role key without a dimension ceiling has that\ndimension closed, not open); for other roles the endpoints/domains it may attest for,\nvalidFrom, validTo }`, status = revocation. `issuer-authority` is defined by exactly this\nrecord: a verifier resolves the artifact's keyId FRESH at verification and enforces the role\nAND its scope under the \xA713.6 containment order (`handle.grants \u2286 anchor.scope`), a\nhandles-role key scoped to `com.acme.>` cannot issue for `manager`, a receipts-role key\nscoped to one endpoint cannot attest as another, and a handles-role key whose scope names no\n`handle`-mode targets cannot issue actor-pinned grants. Verification (fail closed): resolve the key,\nreject unknown keys, out-of-window use, role mismatch, or revocation (immediate for new\nverifications; effected work is not retroactively unwound). Rotation registers a successor\nand closes the predecessor's window; overlap is permitted for handoff. Third-party trait\nauthorities register under their reverse-DNS domain claim. Trust roots never merge across\nspaces.\n\n**Signature encoding (normative, D28).** For every signed artifact: the signature input is\nthe UTF-8 bytes of the RFC 8785 canonical JSON of the artifact **with its `sig` field\nabsent**; the signature is Ed25519 (nkeys); `sig` carries it base64url-encoded (unpadded).\nVerification recomputes the canonical form, resolves `signer.keyId`/`issuer.keyId` in the\nanchor registry, and fails closed on any mismatch.\n\n**Replay and claims matrix (normative, per artifact type).** Every row below additionally\nand unconditionally requires `space`, the signing `keyId` (`issuer`/`signer` per shape), and\n`sig` (the \xA713.10 encoding): an artifact missing any of the three is invalid before its\nreplay rule is ever consulted, and each artifact type is a discriminated schema, a verifier\ndispatches on the type, never duck-types the claims.\n\n| Artifact | Required claims | Replay rule |\n| --- | --- | --- |\n| Capability handle | id, space, issuer, holder (principal+UID), structured grants, iat, exp (nbf, parentDigest, epoch as applicable) | reusable within TTL, holder-bound; revocable if sturdy |\n| Checkpoint resume | checkpoint token, goal id, holder (principal+UID), iat, exp, nonce | **one-use** (journaled by create-only CAS); duplicate = `conflict` |\n| Session grant | sessionId, subjects, holder (principal+UID+processEpoch), serving instance+epoch, window, iat, exp, nonce | **one-use** redemption (holder epoch fresh-checked), then live; dies with either side's epoch |\n| Guard obligation | goal/request id, attenuations, iat, exp | bound to its goal/request; reusable within it |\n| Payment proof | per the priced contract's declared policy | default one-use per request id |\n| Trait attachment | endpoint, command, contractDigest, traitUrn, value, signer, ts | revision-bound evidence; replaced only by an authorized contract revision |\n| Receipt | per \xA713.10 shape (ts, signer; no exp/nonce) | evidence, never authority; replay-irrelevant |\n\nEvery verifier rejects out-of-window use (where `exp` applies), wrong-holder presentation,\nand unknown/revoked keys.\n\n### 13.11 The hard cut\n\nThis section is an intentional hard cut on the pre-1.0 line per \xA711. The version marker is\nthe grammar itself: the `ep`/`epe`/`epf`/`epj`/`ept`/`epw`/`eps` subject kinds and the\nversioned envelope are disjoint from every v0.3 control subject and shape, and the old rails\nare removed, subjects, envelopes,\nhandlers, credential grants, minting paths. No compatibility adapter, dual serving, or\ntranslation window exists. A credential minted before the cut can publish only into dead v0\nsubjects: nothing subscribes them, no post-cut handler is reachable from them, no trusted\nreply can be elicited (a pre-cut grant matches no endpoint-surface subject by construction,\nverified adversarially with captured pre-cut credentials from every old profile). The one\nstructural exception is the pre-cut `admin` profile, whose space-wide `P.>` subscribe\npredates and therefore MATCHES the new rails: **admin credentials MUST be re-minted at the\ncutover** to the post-cut admin shape (Appendix B: messaging-plane subjects only, no\n`ep*`/`eps`/`epc` subscribe), and the pre-cut admin credential is revoked with the cut;\nthe hard-cut guarantee is not honest without it. The wire\n`protocolVersion` (\xA76, \xA711) targets `0.4` at the completion of this revision's migration, per\nthe \xA711 convention that the advertised version is the migration's normative target, and a\nv0.4-conformant participant MUST advertise it (the optional-field era ends at the marker\nboundary); `1.0` is a separate, later stability declaration (\xA711).\n\n### 13.12 NATS + JetStream binding\n\n**Broker floor.** The control surface REQUIRES NATS server \u2265 2.12 (message schedules, atomic\ncreate-CAS, counters) AND a `max_control_line` large enough for the deployment's\nmaximum-capability CONNECT line. The two floors are checked at the tier that can see them:\n\n- **Clients** check the server version from the pre-auth INFO and fail loud below 2.12 or\n when schedules are unavailable (including the offline-assets downgrade mode). The\n control-line limit is NOT discoverable pre-auth; an oversized CONNECT is silently dropped\n and looks like a network fault, so a client's obligation is bounded reconnect attempts\n plus the named diagnostic on a repeated pre-auth drop (\"CONNECT may exceed the broker's\n max_control_line; have the operator verify it\"), never an infinite retry loop.\n- **Operator tooling** (doctor/setup) asserts the cause before any credential is minted:\n read `max_control_line` over the system account (`$SYS.REQ.SERVER.PING.VARZ`) from\n **every server of the cluster the credential may connect to**; the ping is fanned out,\n the response set is checked complete against the expected server count, and a partial\n response set is a FAILED assertion, never a pass, and require, on each server,\n `max_control_line \u2265 (largest encoded CONNECT line of the \xA713.9 fixture set) + margin`.\n The fixtures are **byte-reproducible** (concrete maximum-length identities, the full\n grant set at the policy ceiling, the maximum-capability agent credential and the\n maximum-command serve credential, the encoded credentials, the resulting CONNECT\n lengths), so the floor is a measured quantity; the reference deployment's configured value\n is 65536; a derived number, not an assertion. The 16 KiB policy gate remains a distinct\n mint-time cap on credential authority, refused loudly at minting. The same assertion pass\n checks `max_payload \u2265` the largest serialized **bounded decision fact** fixture (the\n maximum `RejectionFact`/`QuarantineFact` under the token and detail bounds, \xA713.4) AND\n `max_payload \u2265` the 256 KiB contract-artifact document bound plus envelope margin\n (\xA713.7; a contract artifact is one message on its digest subject), so\n \"the rejection fact always fits by construction\" and \"an artifact is a single message\"\n are measured floors, not assumptions.\n\nNo sweeper fallback exists. Only 2.12 schedule semantics are assumed (same-subject\nreplacement; NOT the 2.14 stop-plus-publish path).\n\nPer-space resources, created at space setup (`STREAM.CREATE` remains denied to agents):\n\n| Resource | Captures / holds | Retention notes |\n| --- | --- | --- |\n| `EPJ_<space>` stream | `cotal.<space>.epj.>` (submissions, untrusted) | Limits; **native dedupe not relied upon**; submitters never set `Nats-Msg-Id` (\xA713.4; stream-wide header dedupe is a cross-caller suppression vector on a shared untrusted stream). A zero duplicate window is NOT server-accepted (`0` normalizes to the 120 s default; the minimum is 100 ms), so the config sets the server minimum and the guarantee is the header rule: a hostile header suppresses only another non-conformant header-bearing write; retention \u2265 recovery/redelivery lag |\n| `EPF_<space>` stream | `cotal.<space>.epf.>` (canonical facts) | Limits; acceptance via create-only CAS (`Nats-Expected-Last-Subject-Sequence: 0`); `allow_direct=true` (NON-fencing subject-confined reads only: every \xA713.9 matrix fact read is FENCING and leader-served `STREAM.MSG.GET`, \xA713.9 read service); retention \u2265 horizons, outcome-stated by the retention floor below |\n| `EPE_<space>` stream | `cotal.<space>.epe.>` (events, progress) | Limits; space policy |\n| `EPT_REQ_<space>` stream | `cotal.<space>.ept.*.*.*.*.schedule` (instance schedule REQUESTS, \xA713.2) | Limits; message schedules **DISABLED**; client-set scheduling headers are inert bytes here; retention \u2265 writer recovery lag |\n| `EPR_<space>` stream | `cotal.<space>.epr.>` (record-write ingress, \xA713.2) | Limits; epoch-pinned publish grants (\xA713.9); consumed only by the record writer; retention \u2265 writer recovery lag |\n| `EPT_<space>` stream | `cotal.<space>.ept.*.*.*.*.armed` + `\u2026.fire` (authoritative schedules + fires, \xA713.2) | `AllowMsgSchedules`; only the timer writer publishes `.armed` (\xA713.9); each schedule targets its sibling `.fire` subject (ADR-51 forbids target = publish subject); retention \u2265 max deadline + margin |\n| `EPW_<space>` stream | `cotal.<space>.epw.>` (work pools; one item per subject, \xA713.2) | WorkQueue; provisioner-pre-created non-overlapping exact-filter per-pool consumers (\xA713.9) with **`max_deliver=-1` pinned** (a finite delivery ceiling strands exhausted items outside `num_pending`/`num_ack_pending` and falsifies the \xA713.6 admission occupancy; the occupancy reader re-checks the pin at every read because MaxDeliver is editable post-create); **`allow_direct=false`**: EPW has NO non-fencing subject-confined reader (pool workers drain the WorkQueue via `CONSUMER.MSG.NEXT`, never a subject read), and its ONLY subject read is the reconciliation probe, which is FENCING and MUST be leader-served `STREAM.MSG.GET` (\xA713.9 read service; an acked item leaves the WorkQueue, an in-flight one remains readable, which is exactly the \xA713.6 predicate, and a stale follower miss would re-arm settled work). Disabling Direct Get on EPW makes that leader-served requirement STRUCTURAL: no reader (including virtual-endpoint activation reconciliation, \xA713.6) can take the follower path even by mistake. This differs from EPF, which keeps `allow_direct=true` because it DOES have non-fencing subject readers (the \xA713.9 last-by-subject fact reads); EPF's fencing CAS-winner read opts into the leader by caller choice |\n| (sessions: core-only, no stream) | `cotal.<space>.eps.>` | never captured; bounded in-memory window |\n| `cotal_records_<space>` KV | records: the \xA713.7 core-kind key grammars (`svc`, `signer`, `handle`, `contracts`, `goal`, `cp`, `lease`, `lifecycle`, `govern`, `uid`, `policy`, `oblig`) | per-key CAS; `.spec`/`.status`-split keys EXCEPT the unsplit atomic keys `lifecycle.<owner>.<actor>`, `govern.<endpoint>`, `uid.<lifecycleUid>`, `policy.<endpoint>.<digest-hex>`, and `oblig.>` (\xA713.1/\xA713.7/\xA713.8/\xA713.9); `allow_direct=true`, but the heads and every fencing read are leader-served `STREAM.MSG.GET` (\xA713.9 read service). **No age retention on authority keys:** `lifecycle` heads, `govern`, `uid` reservations, `policy` versions, and `oblig` rows are NEVER-DELETED (no grant permits DEL/PURGE; an age-evicted reservation would reopen UID reuse, an evicted obligation would orphan accepted work); a deletion marker on any of them refuses loudly as corruption, never as absence. **Shape is proved at bind, not assumed:** the stream MUST be primary (never a mirror/sourced copy) and MUST carry no bucket-wide silent-eviction limit (no `max_age`, no finite `max_msgs`/`max_bytes`: under `DiscardOld` a finite global limit evicts a prior authority key's latest row the moment an unrelated key is written); every trusted consumer of this store (the minting authority, the mapping reader, the mediator) verifies exactly this via `STREAM.INFO` when it binds and refuses to serve otherwise |\n| `cotal_auth_<space>` KV | the credential ledger (`cred.<lifecycleUid>.<credentialId>` + issuance gates `gate.<lifecycleUid>` + the disjoint endpoint families `epgate.<endpoint>.<instanceId>` / `epcred.<endpoint>.<instanceId>.<credentialId>` + the staging family `stage.>` + source gates `srcgate.<issuerKeyId>.<id>` + lineage index `bysrc.\u2026`, \xA713.1) + session ledger (`session.<sessionId>`, \xA713.6) | trusted auth path ONLY; no agent, endpoint, observer, admin, or host profile holds any grant (\xA713.9 matrix); **`allow_direct=false`** (every fence is a leader-served revision-pinned CAS write; Direct Get's follower/mirror reads would defeat read-your-writes, \xA713.1); CAS + monotonic states. **No bucket-wide age retention:** `gate.`, `epgate.`, `srcgate.`, and `session.` authority keys persist until their lifecycle/handle/session is explicitly terminal (an age-evicted `open` gate would silently reopen minting, or drop a `frozen`/`retired` fence); only `cred.`/`epcred.`/`bysrc.` rows carry a per-key TTL bounded by the credential TTL (NATS per-key message TTL, \u2265 2.12), never a bucket MaxAge; `stage.` rows follow their operation's retention, never a ledger row's. **Shape is proved at bind** (the records-store rule above, plus `allow_direct=false`): primary, un-mirrored, no bucket `max_age`, no finite `max_msgs`/`max_bytes`; the trusted auth path verifies this via `STREAM.INFO` when it binds and refuses to serve otherwise |\n| `EPC_<space>` stream | `cotal.<space>.epc.>` (content-addressed contract artifacts, one per digest subject, \xA713.7) | Limits, no age eviction (artifacts are permanent); create-only mediated publication (`Nats-Expected-Last-Subject-Sequence: 0`); `allow_direct=true` (the subject-scoped last-by-subject read IS the fetch path; non-fencing, verify-on-read); permanence is BROKER-ENFORCED: `deny_delete=true, deny_purge=true` (the broker rejects the message-delete and purge APIs even from a stream-API-holding principal). Permanence is the COMBINATION of these flags, the retention floor's no-early-removal rule (below: the flags alone stop delete/purge but not age eviction or a whole-stream teardown), verify-on-read pinning WHAT a subject carries, and the stream-management surface held by no profile (\xA713.9); no single flag makes deletion structurally impossible |\n\n**Retention floor (one-use-identity facts).** A stream or bucket whose messages carry\none-use identity, that is decision facts realizing the \xA713.4 idempotency horizon, goal\nterminal facts and tombstones (\xA713.6), receipt facts (\xA713.10), and the never-deleted\nauthority heads (`lifecycle`, `govern`, the auth-bucket gates), MUST retain every protected\nmessage until its governing horizon, stated by OUTCOME: NO removal cause may drop a\nprotected fact early. That forbids not only age eviction below the horizon but every\nconforming alternative that erases it while `MaxAge` still passes: a finite\n`MaxMsgs`/`MaxBytes`/`MaxMsgsPerSubject` with `DiscardOld`, a per-message TTL,\nrollup/compaction, or a retention-policy change; for these families finite count/byte\nlimits MUST fail loud or `DiscardNew` rather than evict protected history, and message TTL\nand rollup MUST be disabled on protected subjects (a per-key TTL is permitted only on\nnon-protected keys, e.g. the auth bucket's `cred.`/`bysrc.` index rows above, never on a\nprotected fact, head, or gate). NO principal, including operator, setup, and system tooling,\nnot only \xA713.9 profiles, may `MSG.DELETE`/`PURGE`, `STREAM.DELETE`, or issue a\n`STREAM.UPDATE` that weakens any of these limits; the never-deleted heads and gates carry\nan UNBOUNDED horizon. A KV writer MUST NOT publish a DEL/PURGE marker for a never-deleted\nkey, and a reader that encounters one treats it as corruption, never as absence. (Root can\nalways destroy a broker; such an act is explicitly non-conformant, not outside this\nclause.) `CONSUMER.DELETE` is distinct and permitted: it removes a reader cursor and can\nnever mutate stored facts. Concretely: `EPF_<space>` retention \u2265 max(idempotency horizon,\nresult retention, receipt retention), because the acceptance fact is the durable\nreconstruction source for receipts, while the raw submission stream is age-evicted by\ndesign.\n\nClaim pools are pull consumers on `EPW` with `AckExplicit`, held **only by the pool's owning\nendpoint** (\xA713.5): `ack_wait` is the broker's redelivery-to-owner timer and nothing more;\nthe authoritative lease token and deadline live in the owner's lease record, never in the\nitem value (stored bytes are work identity and input only), and the owner acks only after\nthe committed terminal state. Filtered replay of events/facts uses pinned single-filter\nconsumer creates (the CHAT-history containment mechanism, \xA78/\xA79). Timer scheduling is\n**mediated** (\xA713.2, \xA713.9): instances publish only `.schedule` REQUESTS into the\nschedules-disabled `EPT_REQ` stream, where a client-set `Nats-Schedule-Target` (or any\nscheduling header) is inert bytes and the timer writer rejects a request carrying one, this\ncloses the ADR-51 confused deputy, in which a direct publisher confined only to \"some\nsubject the schedules stream captures\" could target ANOTHER instance's `.schedule` (installing\nor replacing its schedule state, since schedule headers are copied to the target verbatim) or\nits `.fire`. The timer writer alone publishes the authoritative schedule on `.armed`, with\n`Nats-Schedule-Target` = the sibling `\u2026.fire` subject derived from the authenticated request\nsubject's own tokens; and **fire handling is the trusted seam** behind it, a `.fire`\nconsumer acts only on a fired message matching a current authoritative\nschedule it owns (`timerId` + generation + deadline, \xA713.2) AND whose broker-authored\nscheduler-origin header (`Nats-Scheduler`, the schedule's subject, set by the server on\nfire) equals its own exact sibling `.armed` subject, discarding anything else as\nforged. Replacement is the writer's same-subject publish on `.armed` (server rollup); fired\nmessages appear on `.fire` carrying `(timerId, generation)`.\n\n### 13.13 Plane ownership (the sealed-scanner claim)\n\nAt most ONE authority plane per space may hold the sealed scanners (\xA713.9's seventh-round\nseal). The scanners' serialization is process-local, so two same-space auth processes would\ninterleave the literal enumeration consumers' critical sections and return PARTIAL\nenumerations: a drain declares quiescence over undrained obligations and the retirement\nfrontiers close over live work. The exclusion is broker-visible, not host-local:\n\n- **The claim row.** One exact, never-deleted auth-KV key (`plane`, subject\n `$KV.cotal_auth_<space>.plane`) holds `{ v, generation, claimId, state: held | released,\n ledger, records, openedAt }`, where `ledger`/`records` are the two ownership-bearing sealed\n scanner connections' broker identities `(serverId, cid, userNkey)`. The barrier profile is\n the row's SOLE writer, at exact arity (never `plane.>`); reads are leader-served. The\n barrier's own identity is deliberately NOT in the row: barrier liveness is irrelevant to the\n literal consumers and could only falsely block a reclaim.\n- **Open order.** Ensure stores; open BOTH candidate scanner connections NON-RECONNECTING (the\n tuples must be stable and disappearance must be final) and keep them INERT (no scan\n capability exists or escapes); take the claim by broker-atomic create (virgin key) or\n revision-CAS (a `released` row, or a `held` row proven dead as below). Only the WINNER\n constructs the branded scanners; a loser closes both candidates and refuses with\n operator-legible copy. The brief dual connected-credential window before the CAS is inside\n the trusted signing-seed residual; there is no dual SCAN authority because the capability\n does not exist before the win.\n- **Plane credentials.** The two plane-owned scanner connections authenticate with\n NON-EXPIRING user JWTs, for exactly these two connections and no other profile: an expiring\n credential would have the broker hard-disconnect at expiry, and a renewal cannot be\n presented without the reconnect the non-reconnecting shape forbids \u2014 an expiry would fence\n the plane on a timer. The credentials never leave process memory, and the account signing\n seed co-resident in the same memory is strictly stronger authority, so the marginal\n exposure is the existing trusted-process residual class; revocation remains service-stop +\n seed rotation. Every other authority credential keeps the short-expiry + in-process-renewal\n boundary.\n- **Reclaim is liveness-only.** A `held` row is reclaimed only when BOTH claimed tuples are\n conclusively ABSENT under a COMPLETE connection sweep, adjudicated by the delivery daemon's\n read-only oracle over the privileged delivery-admin rail (the auth process holds no `$SYS`;\n the D5 rail split). The closed oracle verb takes exactly the two claimed tuples and returns\n two bound verdicts (`live | gone | unknown`) plus sweep completeness, echoing the queried\n identities; any live, unknown, incomplete, malformed, or foreign-echo answer REFUSES the\n takeover (at most one plane: dual-refuse is safe, dual-proceed is not). There is NO TTL, NO\n heartbeat, and NO \"did the last sealed scan finish\" bit: a mid-scan crash drops the\n non-reconnecting connections, a complete sweep proves them gone, and the successor's\n fail-closed pre-clean (\xA713.9) makes its full re-scan safe. A paused-but-live process still\n holds its TCP connections and therefore still holds the plane (no pause hazard).\n- **The single-server proof.** Connection absence alone cannot distinguish a RESTARTED\n claimed server (`server_id` is per-broker-run; genuinely gone, and requiring its reply\n forever would turn every whole-stack crash into a permanent reclaim wedge) from a\n PARTITIONED one (live, unreachable; treating its absence as death authorizes a split-brain\n steal). A `gone` verdict is therefore valid ONLY under the single-nats-server-process\n boundary, proven per observation from the responding server's OWN topology declaration in\n the `$SYS` reply envelope \u2014 never inferred from which servers happened to reply: every\n reply must declare NO cluster membership and exactly one distinct server may have replied.\n Any cluster self-report, multi-server observation, or reply without the declaration reads\n `unknown` and refuses. Only a SUCCESSFUL, well-formed page counts toward the sweep: a reply\n carrying an API error, a malformed or empty server envelope, a non-string cluster\n declaration, an envelope/data server-id mismatch, or a structurally incomplete data page\n poisons the whole observation (every verdict `unknown`). Each sweep's reply inbox carries a\n per-call collision-resistant nonce, so concurrent sweeps can never satisfy or falsely\n complete each other's rounds; and the auth plane closed-parses the oracle's result (exact\n keys at every level) before reasoning over it. NAMED residuals: a leafnode- or\n gateway-extended account is outside the cluster self-report, so such topologies are out of\n contract for the space's account; a backup restored onto a fresh broker can present a\n still-running foreign predecessor's `serverId` as dead. A clustered/multi-server deployment\n requires an authoritative server incarnation/roster authority in place of this proof.\n- **Holding invariant.** The winner re-validates the claim (state `held`, its `claimId`, its\n `generation`, AND both pinned scanner tuples \u2014 a row rewrite preserving the identifiers but\n swapping a tuple is a lost claim, never \"still ours\") BEFORE every sealed scan (refuse to\n enumerate) and AFTER it (discard the enumeration), inside the serialized critical section.\n An owned scanner disconnect is a FENCING event, and the fence is FATAL to the WHOLE\n authority plane: scan exposure is invalidated immediately, the sibling closes, every\n authority operation (connect authorization, credential mint) refuses from that moment, and\n the service goes DOWN loud rather than serving from a half-dead plane a successor may be\n reclaiming; a still-live sibling correctly blocks a successor until it is closed or proven\n absent.\n- **Clean close.** Scan-capable clients close FIRST, then the row CASes `held \u2192 released`\n (never released while either scanner can still act), then the barrier. A crash leaves\n `held`; the successor reclaims through the oracle. A `released` row is claimed without an\n oracle round.\n- **Operator faces.** The three refusal states carry DISTINCT copy: a live peer (\"stop the\n other auth process\", with the space and connection identities), an inconclusive observation\n (fail-safe wait/retry wording that never says \"stop the other process\"; when the oracle rail\n is down it names the delivery daemon and the restart order), and a mid-life scanner death\n (a deliberate fail-closed stop naming the restart path). An unparseable claim row refuses\n loudly and is never overwritten automatically.\n- **Host belt.** Launchers additionally claim an exclusive per-space pidfile, published\n ATOMICALLY and PRE-POPULATED: the claimant writes its pid to a unique temp inode, then\n publishes it as the slot with an atomic no-overwrite `link(2)` \u2014 no create-then-write window\n exists for a sibling to misread, and an empty slot is impossible to publish. A live holder\n is yielded to; a provably dead holder's slot \u2014 and an empty (pre-protocol crash shape) one \u2014\n is reclaimed exactly once; unattributable content is never stolen. A cheap belt only, never\n the exclusion.\n\n### 13.14 Conformance (control surface)\n\nA conformant endpoint (v0.4) MUST:\n\n1. Serve only under a credential whose serve grants match its registered name, stable\n instance id, and registered command set (publish-side grants pinned to the current\n epoch); register its service record before serving; advance the epoch by CAS on takeover\n and stop serving when superseded; a takeover is complete only after the \xA713.1 barrier\n (revoke + cluster-verified eviction of the superseded credential).\n2. Answer `describe` authoritatively, intersected only against the trusted authorization view\n (or declared-public), failing closed when that view is unavailable.\n3. Publish contract artifacts content-addressed and immutable; validate args/replies at\n runtime within the schema profile and budgets.\n4. Reply only on the reply rail derived from the authenticated request subject; ignore\n payload/transport reply targets; let attribution ride the reply subject.\n5. Enforce the envelope invariants (version/op/class/target/sender, catalog codes, monotonic\n attenuation); treat the subject, never the body, as the authorization boundary; resolve\n targets by `(alias, lifecycleUid)` against current mappings immediately before effect.\n6. Route effects by delivery class; journaled effects only from canonical accepted facts\n through the mediated writer; fingerprint-bind ids first-wins; hold the declared horizons,\n retentions, and floors.\n7. Validate every Cotal-owned commit through the mediated path (fencing token + unexpired\n lease + lifecycle + epoch as applicable); lose CAS loudly.\n8. Implement advertised composites per \xA713.6: the single action vocabulary, authorization\n linearized at acceptance, one-use resumes, generation- and scheduler-origin-validated\n timers (a fire counts only against its own sibling `.armed`, \xA713.12) with durable\n reconciliation, fail-closed governed traits, bounded sessions.\n9. Fail loud below the broker version floor (from the pre-auth INFO), with bounded\n reconnects and the named pre-auth-drop diagnostic (\xA713.12); the `max_control_line` floor\n is asserted by operator tooling (\xA713.12), never by the client, which cannot inspect it.\n10. Connect successfully while presenting the normative maximum-capability credential\n fixture for its profile (\xA713.9), the only test that exercises the control-line bound.\n\nA conformant caller (v0.4) MUST: hold a lifecycle-pinned credential and never present another\nlifecycle's artifacts; choose ids/goalIds/nonces within the token grammar and the 1024-byte\nsubject bound and reuse ids only per the idempotency rules; declare `class` and\n`replyExpected` and honor `contract-mismatch`/`conflict`; freeze scatter expectations from the\nregistry and classify partial results; verify digests of fetched artifacts and signed\nartifacts against the anchor registry, failing closed.\n\n---\n\n## Appendix A: Reference implementation map\n\n| Spec section | Source |\n| --- | --- |\n| \xA72 Identity | `packages/core/src/identity.ts` |\n| \xA73 Subjects | `packages/core/src/subjects.ts` |\n| \xA75 Envelopes, \xA76 Presence, \xA77 Channels | `packages/core/src/types.ts` |\n| \xA78 Streams | `packages/core/src/streams.ts`, `packages/core/src/endpoint.ts` |\n| \xA79 Security | `packages/core/src/provision.ts` |\n| \xA710 Join link | `packages/core/src/link.ts` |\n| \xA713 Endpoint control surface | `packages/core/src/` (endpoint rails, envelope, contracts; lands with the control-surface campaign) |\n\n## Appendix B: Profile ACLs\n\nThis appendix is normative for the NATS binding. *(The operator-facing summary of these\ngrants is [docs/identity-and-auth.md](docs/identity-and-auth.md).)* Names below use these\nplaceholders:\n\n- `P = cotal.<space>`\n- `CHAT = CHAT_<space>`, `DM = DM_<space>`, `TASK = TASK_<space>`\n- `DLV = <Plane-3 per-member delivery stream>`; `INBOX = <mixed pre-auth fan-out stream>` (the durable-backstop handoff, \xA78): fan-out writes `INBOX` (`dinbox.<owner>.<actor>.<uid>`; lifecycle-bound from v0.4, so an inactive-gap or predecessor entry can never migrate to a same-name successor), the trusted reader re-authorizes and transfers to `DLV` (`dlv.<owner>.<actor>.<uid>`, same binding), and the agent binds its own `DLV` DELIVER consumer (filter pinned to its own triple). An agent gets **no** grant on `INBOX` (the mixed pre-auth store).\n- `KV = KV_cotal_presence_<space>`\n- `CHKV = KV_cotal_channels_<space>`; `DLVKV = <delivery lease/readiness KV>`\n- `<owner>.<actor> = the authenticated principal` (\xA72): `<owner>` and `<actor>` are its two tokens; the dot-form is the wire/KV form, the dash-form `<owner>-<actor>` is the durable-name form\n- `connId = the authenticated connection id` (the connection nkey in static mode; the client-chosen nonce in user mode); distinct from the principal, and keys ONLY the reply inbox\n- `role = authenticated agent role`\n- `chatHistD = chathist_<owner>-<actor>-<uid>`, `dmD = dm_<owner>-<actor>-<uid>`, `dlvD = dlv_<owner>-<actor>-<uid>`, `svcD = svc_<role>` (per-instance durables are lifecycle-scoped from v0.4: keyed on the dash-form + lifecycle UID, \xA78/\xA713.1; `svcD` stays role-scoped)\n- `inbox = _INBOX_<connId>.>`\n\nGrouped placeholders such as `<CHAT|DM|TASK>` mean one concrete subject per listed token.\n\n### Agent\n\n`sub.allow`:\n\n- `inbox`\n- `P.ep.reply.*.*.*.<owner>.<actor>.<uid>.*` (exact arity; the agent's own endpoint reply rail: every endpoint's replies to THIS caller triple + nonce, \xA713.2; replies never ride the per-connection `inbox`)\n- `P.epe.\u2026`; the exact fully-qualified event subtrees of every minted read capability\n (\xA713.9 event-read row), incl. the caller's own per-goal subtree\n `P.epe.*.*.*.goal.<owner>.<actor>.<uid>.>`; the live tail of watch, granted per\n capability, none by default\n- `P.chat.*.*.<ch>` for every `allowSubscribe` channel, the **live read boundary**: native core-sub join/leave is a `sub.allow`-bounded subscribe to this subject (wildcard sender owner+actor), so an agent whose ACL permits a channel joins it alone with no manager. Wildcards preserved (e.g. `P.chat.*.*.team.>` for `allowSubscribe: team.>`); a `team.>` grant matches strictly deeper channels, not the bare `team`; a `>` grant is read-all chat in the space on credential compromise\n\n`pub.allow`:\n\n- `P.chat.<owner>.<actor>.<ch>` for every `allowPublish` channel (post ACL; none by default)\n- `P.inst.*.*.<owner>.<actor>` (DM any recipient, forge-locked to me as sender)\n- `P.svc.*.<owner>.<actor>` (anycast any role, as me)\n- endpoint request forms per minted capability (\xA713.9): every agent gets the baseline set\n (`describe` on all endpoints; the delivery endpoint's durable join/leave/list commands;\n self-targeted lifecycle commands with authz-mode `self`); the `spawn` capability adds the\n manager endpoint's lifecycle commands with authz-mode `owner`; `child`/`ledger` forms and\n wider target patterns only per explicitly minted capability. The caller triple\n `<owner>.<actor>.<uid>` is pinned in every granted form\n- control-surface durable reads (contract artifacts, decisions, goal results, receipts,\n event catch-up, record reads): **NO raw JetStream read grant of any kind**, no\n `DIRECT.GET`, no consumer `CREATE`, no bind-only `MSG.NEXT`/`ACK`, on `EPC`/`EPF`/`EPE`/the\n records KV. Per \xA713.9 \"Mediated reads\", every JetStream read delivers stored bytes to a\n caller-chosen destination the broker does not confine (push `deliver_subject`, pull\n `MSG.NEXT` reply, `DIRECT.GET` reply are the same vector), so an untrusted caller holds none\n of them. The caller reads through the trusted read mediator via a read command (an endpoint\n request form, above) and receives its own caller-scoped facts over its reply rail\n `P.ep.reply.*.*.*.<owner>.<actor>.<uid>.*` (already in `sub.allow`); the mediator owns the\n reader consumers and re-authorizes each read. Live event progress is the caller's own core\n subscription to granted `P.epe.\u2026` subtrees within `allowSubscribe` (bytes land only on its\n own subscription, never a caller-chosen subject)\n- `$JS.API.INFO`\n- `$JS.API.STREAM.INFO.<CHAT|KV|CHKV|DLVKV>`: CHAT plus the world-readable presence/registry/lease KVs only; **not** DM/TASK (agents bind those by name and never inspect them, so INFO there would only leak inbox/task metadata)\n- `$JS.API.CONSUMER.CREATE.<CHAT>.<chatHistD>.<P.chat.*.*.<ch>>` for every `allowSubscribe` channel (history reads; the single filter the server pins to the body, the agent's only CHAT consumer create. The live tail is the core `sub.allow` subscription above, not a JetStream consumer)\n- `$JS.API.CONSUMER.INFO.<CHAT>.<chatHistD>`\n- `$JS.API.CONSUMER.MSG.NEXT.<CHAT>.<chatHistD>`\n- `$JS.API.CONSUMER.DELETE.<CHAT>.<chatHistD>`\n- `$JS.API.CONSUMER.INFO.<DM>.<dmD>`\n- `$JS.API.CONSUMER.MSG.NEXT.<DM>.<dmD>`\n- `$JS.ACK.<DM>.<dmD>.>` (DM inbox: BIND-ONLY its own pre-created `dmD`, never create)\n- `$JS.API.CONSUMER.INFO.<DLV>.<dlvD>`\n- `$JS.API.CONSUMER.MSG.NEXT.<DLV>.<dlvD>`\n- `$JS.ACK.<DLV>.<dlvD>.>`, the **durable backstop**: BIND-ONLY its own pre-created per-member DELIVER consumer `dlvD` (the trusted reader's re-authorized handoff, \xA78). The agent holds NO grant on the mixed pre-auth `INBOX` fan-out stream.\n- `$JS.API.CONSUMER.CREATE.<KV>.>`\n- `$JS.API.CONSUMER.INFO.<KV>.>`\n- `$JS.FC.>`\n- `$KV.cotal_presence_<space>.<owner>.<actor>`\n- `$JS.API.STREAM.MSG.GET.<CHKV>`\n- `$JS.API.CONSUMER.CREATE.<CHKV>.>`\n- `$JS.API.CONSUMER.INFO.<CHKV>.>`\n- `$JS.API.STREAM.MSG.GET.<DLVKV>` (delivery lease/readiness; read-only, non-gating)\n- if `role` is set: `$JS.API.CONSUMER.INFO.<TASK>.<svcD>`,\n `$JS.API.CONSUMER.MSG.NEXT.<TASK>.<svcD>`, `$JS.ACK.<TASK>.<svcD>.>`\n\n`pub.deny` (the agent binds these consumers, never creates them; its only consumer-create grant is the pinned per-channel `chatHistD` history create):\n\n- `$JS.API.CONSUMER.CREATE.<DM>`\n- `$JS.API.CONSUMER.CREATE.<DM>.>`\n- `$JS.API.CONSUMER.DURABLE.CREATE.<DM>.>`\n- `$JS.API.CONSUMER.CREATE.<TASK>`\n- `$JS.API.CONSUMER.CREATE.<TASK>.>`\n- `$JS.API.CONSUMER.DURABLE.CREATE.<TASK>.>`\n- `$JS.API.CONSUMER.CREATE.<DLV>`\n- `$JS.API.CONSUMER.CREATE.<DLV>.>`\n- `$JS.API.CONSUMER.DURABLE.CREATE.<DLV>.>`\n\nA bare/multi-filter consumer create on `CHAT` is **not** explicitly denied (that would also deny the\npinned `chatHistD` create the agent needs), so it is default-denied (the agent holds no such allow),\nleaving the single-filter history consumer above as the agent's only CHAT consumer.\n\n### Observer\n\n`sub.allow`:\n\n- `P.chat.>`\n- `inbox`\n\nApplication publish is denied. `pub.allow` contains only read/control verbs needed to read\nCHAT history, presence, and channel registry:\n\n- `$JS.API.INFO`\n- `$JS.API.STREAM.INFO.<CHAT|KV|CHKV>`\n- `$JS.API.CONSUMER.CREATE.<CHAT>`\n- `$JS.API.CONSUMER.CREATE.<CHAT>.>`\n- `$JS.API.CONSUMER.INFO.<CHAT>.>`\n- `$JS.API.CONSUMER.MSG.NEXT.<CHAT>.>`\n- `$JS.API.CONSUMER.DELETE.<CHAT>.>`\n- `$JS.ACK.<CHAT>.>`\n- `$JS.API.CONSUMER.CREATE.<KV>.>`\n- `$JS.API.CONSUMER.INFO.<KV>.>`\n- `$JS.API.STREAM.MSG.GET.<CHKV>`\n- `$JS.API.CONSUMER.CREATE.<CHKV>.>`\n- `$JS.API.CONSUMER.INFO.<CHKV>.>`\n- `$JS.API.CONSUMER.DELETE.<CHKV>.>`\n- `$JS.FC.>`\n\n### Admin\n\nAdmin has observer grants, with `sub.allow = [P.chat.>, P.inst.>, P.svc.>, inbox]`, the\ngod-view is the **messaging plane only**, enumerated: it deliberately excludes `P.ep.>`,\n`P.epe.>`, `P.epf.>`, `P.epj.>`, `P.ept.>`, `P.epr.>`, `P.epw.>`, `P.eps.>`, and `P.epc.>`\n(a space-wide `P.>` would plain-subscribe every `ep.one` request rail, collecting reply\nnonces the queue-qualified-only rule exists to protect, and every core-only session\nframe; \xA713.2, \xA713.11). Plus DM history read grants:\n\n- `$JS.API.STREAM.INFO.<DM>`\n- `$JS.API.CONSUMER.CREATE.<DM>`\n- `$JS.API.CONSUMER.CREATE.<DM>.>`\n- `$JS.API.CONSUMER.INFO.<DM>.>`\n- `$JS.API.CONSUMER.MSG.NEXT.<DM>.>`\n- `$JS.API.CONSUMER.DELETE.<DM>.>`\n- `$JS.ACK.<DM>.>`\n\nAdmin still has no application publish grants.\n\n### Scoped host profiles (formerly `manager`)\n\nThere is **no allow-all credential**. The privileged host duties are split into scoped,\nsingle-function profiles, each granting only the verbs its function needs and none other:\n\n- `provisioner`: pre-creates the per-instance lifecycle-scoped durables (`dm_\u2026-<uid>`,\n `svc_\u2026`, the per-member `dlv_\u2026-<uid>` handoff) AND the trusted control-surface consumers of\n the \xA713.9 matrix; `poolD`, `effD`, and the read mediator's reader durables\n (`decD`/`goalD`/`eveD-n`/`recD-n`, owned by the mediator, never by callers, \xA713.9\n \"Mediated reads\"), all PULL with exact full-tail filters; and mints scoped credentials;\n ephemeral onboarding authority.\n- `deprovisioner`: target-pinned teardown of ONE retired lifecycle's footprint, minted per\n teardown with the target's `(principal, lifecycleUid)` in every exact-name grant; it can\n delete only lifecycle-keyed names, so it structurally cannot reach a same-name successor\n (\xA713.1).\n- `supervisor`: the always-on agent-lifecycle daemon (the manager process's own connection). It\n is the manager endpoint's serve credential (\xA713.9) and the ONLY holder of the capabilities for\n the delivery endpoint's admin commands (below).\n- `delivery`: the server-side Plane-3 infra: fan-out, trusted-reader re-authorization, and the\n membership/ACL records the durable backstop authorizes against (\xA77). It is the `delivery`\n endpoint's serve credential (\xA713.9); its admin commands, `reloadCreds`, the explicit adoption\n step of standing credential renewal (the daemon re-reads its re-signed creds file, pins the\n identity, swaps its connection, and reconnects the membership feed's rw connection, replying\n with the adopted JWT windows); and `evictPrincipal`, force-drop of a denied principal's live\n connections (system-account CONNZ scan \u2192 per-server KICK \u2192 re-scan verify, fail-closed on\n partial scans and on owners outside the principal namespace); carry a capability requirement\n minted to the `supervisor` profile **and to the trusted auth path** (\xA79/\xA710), which is the\n executor of the \xA713.1 takeover / terminal-retirement / handle-revocation barriers and calls\n `evictPrincipal` on each revoked credential's `holderPrincipal` (\xA713.1) as their eviction\n step; agents are broker-denied. `evictPrincipal` is\n wired into those barriers, not\n a standalone admin convenience. The former\n `delivery-admin` control tier is deleted with the v0 rail (\xA713.11).\n- `membership-rw`: the derived channel-membership graph feed reader/writer.\n- `operator`, `purger`, `teardown`, `channel-writer`, `control-caller-*`, `deployer`, `probe`: the\n human-CLI and maintenance surfaces, each scoped to its verbs.\n\nStanding host credentials are **bounded and renewed**: one-shot profiles carry minutes-scale\nexpiry; `supervisor`/`delivery`/`membership-rw` carry a 24h expiry with the manager as the named\nrenewal owner (self-remint for its own credential; same-nkey re-sign + explicit `reloadCreds`\nadoption for the seed-less daemons); the two system-account credentials (`membership-observer`,\n`connection-evictor`) carry a 30d expiry and are renewable ONLY by a system-account rotation +\nbroker restart; no persisted system-account minting secret exists, by design. On per-user-auth\nspaces, static `agent`/`observer`/`admin` minting is retired entirely (the flip): agent identities\nexist only as owner+actor principals under a logged-in user, and the elevated profiles of this\nappendix are reached per-connection via the exchange-authored view claim instead (\xA710). The flip is\ndeny-new: a static\ncredential signed before it (or minted out-of-band with the account signing key) remains\nbroker-valid until signing-key rotation, which is the revocation lever for static material; the\nguarantee therefore applies to spaces that never issued static user-facing credentials.\n\nThe live channel subscribe depends on none of these; it is broker-enforced via `sub.allow`, so\nself-serve live join works with no host present; only the durable backstop and its membership writes\nrequire a privileged host. None of these profiles is ever issued to ordinary agents. On the v0.4\nendpoint surface, every host profile's grant rows are **generated from the \xA713.9 ownership matrix**\n(matrix \u2192 grants, never the reverse): a profile with no matrix row holds no `ep*`, `$O.`, or\ncontrol-surface `$JS.API` authority, and `provision.ts` (`permissionsFor`) is the generated artifact\nthis appendix summarizes, not an independent authority. This appendix spells out the `agent`,\n`observer`, and `admin` profiles that make up the wire-facing security claim.\n\n## Appendix C: Normative references\n\n| Reference | Used for |\n| --- | --- |\n| RFC 2119, RFC 8174 | requirement keywords |\n| RFC 8259 | UTF-8 JSON envelopes (\xA75) |\n| RFC 4648 | base32 instance-id encoding (\xA72) |\n| RFC 8032 | Ed25519 keypairs behind nkeys (\xA72) |\n| [NATS client protocol](https://docs.nats.io/reference/reference-protocols/nats-protocol) + [JetStream](https://docs.nats.io/nats-concepts/jetstream) | the v0 transport binding (\xA78) |\n| [NATS decentralized JWT auth](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/jwt) + nkeys | identity and authorization (\xA72, \xA79) |\n\n## Appendix D: Change log\n\nNormative revisions of this document, newest first. Dated snapshots per \xA711; the wire\n`protocolVersion` is the compatibility signal, not these dates.\n\n| Date | Revision |\n| --- | --- |\n| 2026-07-19 | **v0.4 amendment continuation: retirement cleaner inventory is discovery-only.** The terminal retirement barrier no longer accepts a caller-supplied `(endpoint, pools)` hint: the per-op cleaner and settlement-executor pool set is now DISCOVERY-ONLY, exactly the retiring lifecycle's accepted `oblig.<uid>.>` pool routes discovered from the just-drained obligation set. This SUPERSEDES the round-11 optional-hint clause (the 2026-07-15 row): the hint was a TRUSTED ADDITIVE AUTHORITY input that would mint a bounded per-op credential for a pool with no backing obligation, and the despawn rail never exercised it (always an empty hint), so it was grant-widening surface with no production caller. Every grant now scopes to exactly the pools the target holds accepted work on, and the \xA713.9 residuals cover only those discovered pools. The intent's `endpoints` field is removed from the closed operation-intent schema; a pre-change durable intent that still carries it fails the closed-schema check on resume (the v0.4 hard-cut window, where a clean broker holds none). |\n| 2026-07-16 | **v0.4 amendment continuation: connect-arm deny-new (production activation R1).** Every bearer carries its incarnation's root credential id (`act.credentialId`); the exchange mints the root credential RELEASE-LAST (active `cred.` row durable, gate finalize, lifecycle-head current-root CAS, bearer bytes last) and the connect authority requires the LIVE row (leader-served from the shape-proved primary auth store, re-proved on every rebind) plus root head equality, so revoking the row denies the next connect and a superseded or crash-orphaned root issuance never authenticates. The root credential is **incarnation-wide** (ratified): one row per incarnation, re-stamped (the same id) every exchange for its 90d life, never a fresh id per exchange, so one revoke denies every bearer of the incarnation, and a crash after the head CAS re-exports the same id by design (nothing unobserved to revoke; the only pre-release crash window is a durable unstamped row, denied by head equality). The authority store shape proof binds the stream to the actual KV bucket (exactly the one `$KV.<bucket>.>` subject + durable file storage, in addition to the primary/un-mirrored/non-evicting/`allow_direct` flags) at every bind and at boot ensure. Claimless bearers, revoked/expired/absent rows, and an unreadable authority store deny outright (no file-only fallback; a failed reader-credential renewal downs the reader immediately and denies). The head's current-root stamp moves only ABSENT to value: root rotation without the full family-revoke barrier is refused structurally. Named R1 residuals: a same-alias re-grant while the predecessor incarnation is live refuses the exchange (production issuance runs no takeover barrier yet), and the auth service's reader/mint-writer are seed-signed infra credentials (revoked by service stop or signing-seed rotation) pending the ledgered infra-mint family. |\n| 2026-07-16 | **v0.4 amendment continuation: retirement settlement authority split.** A seventh round (an independent cold read on the landed barrier plus the panel's authority ruling) split terminal pool cleanup across two profiles: the bounded cleaner keeps ONLY bind-scoped fetch, leader-served EPF terminal-observe reads, and ACK (its former own-pool `wrk` terminal-forge residual is REMOVED with the grant; its remaining residuals are terminal-free ACK suppression and the space-wide read exposure), while the op-bounded retirement settlement executor (a new \xA713.9 row) owns the intent-closed lease-record CAS and the lease-derived `wrk` terminal publish, carrying the relocated, intent-confined forge residual. Settlement is lease-fenced: an already-settled lease (a crashed owner's `committed`) dominates and is never overwritten. Effects-route completion is a new CLOSED `eff` fact (subject-bound caller and id; `fingerprint` and `sourceSeq` bound to the accepted decision), an action's completion requires the parsed `goal\u2026.result` fingerprint match, and subject presence never proves quiescence. The mediator's obligation-row residual is stated honestly (an operation/header-blind KV publish: valid-terminal overwrite or DEL/PURGE markers, refused loud by readers; the records stream denies stream-API message-delete/purge), and the caller-selected-reply confused-deputy injection residual is named for every raw `MSG.GET`/`MSG.NEXT` profile. |\n| 2026-07-15 | **v0.4 amendment (folds into the in-flight \xA713 revision below): lifecycle and admission fences.** Three-state lifecycle head (`active | retiring | retired`; currency only at `active`; `mappingRevision` = the head key's store revision), space-global never-deleted UID reservation (`uid.<lifecycleUid>`), per-kind issuance-gate operation intents and their allowed-transition sets, the locked terminal barrier order (obligation drain to quiescence before the exact-pool cleaner, both before frontiers), the \xA713.8 authority-head reservation/drain protocol (create-fence + proof-gated admission + per-class decision coordinates + writer\u2260target reclamation), the endpoint-wide admission-policy coordinate (the governance head + `policyRevision`) with drain-gated policy enforcement, the `ep` sentinel for untargeted admissions, and bind-time store shape proofs (\xA713.12). Refined per the re-verify round: the govern head's NORMATIVE policy selector `{ enforcedPolicyKey, enforcedPolicyRevision, pendingPolicy\u2026 }` with a stage/drain/promote mutation order (so the enforced policy is machine-selectable during the drain window), the `self`-class obligation's complete commit intent `{ commitKey, commitBaseRevision, commitValue, commitDigest }` (the pinned BYTES, not just a digest) with deterministic `accepted \u2192 terminal` recovery and full-intent create-join (an accepted-but-uncommitted row never blocks quiescence), the retirement barrier's cleaner-credential revoke + verified-eviction BEFORE any frontier records, the LIMITS-retention bind-time proof (a non-Limits authority store deletes rows on consumer ack), and the runtime gate parse rejecting impossible `retired`-under-takeover/registration state. A second re-verify round added: the head's `lastTakeoverOpId` (the epoch advance stamps the completing op, so a losing concurrent takeover never claims the winner's completion), the immutable revision-addressed admission-policy key (a mutable per-instance slot loses the old revision under history 1 during the drain), the `epgate.principal` and the rule that a ledger row's `holderPrincipal` is ALWAYS a CONNZ-attributable principal (the endpoint NAME forms the `epcred.` key in a separate field, never the eviction target), and the lifecycle barrier's session-pair teardown (a takeover revoking a `session.`-derived credential terminalizes the session and revokes the paired serving row). A third round (a convergent panel + independent cold read) added: the normative immutable `policy` record kind `policy.<endpoint>.<digest-hex>` (self-certifying content-addressed key; the govern selector names exactly this kind, replacing the per-deployment \"versioned key\" allowance), the CLOSED `commitValue` union (`{ enc: \"b64u\", bytes }` exact base64url value bytes, or `{ enc: \"ref\", key }` naming an immutable records key; `commitDigest` = `sha256:<hex>` over the raw value bytes), proof-issuance PAUSE for policy-admitted decisions while a `pendingPolicy\u2026` is staged (which makes the policy drain converge and the after-final-enumeration no-admit rule hold for policy movement), the serving-principal JOIN into the lifecycle barrier's verified-eviction set (a session-pair teardown returns the paired serving row's holder principal and the barrier evicts it before the epoch CAS), and the torn-coordinate takeover guard (the intent capture re-proves head coherence, and the freeze CAS is preceded by a head-currency read, so a stale intent never freezes the winner's reopened gate). A fourth round (a convergent re-verify + independent cold read) added: the drain-window admission pause is now a NORMATIVE step of the \xA713.8 admission algorithm (the mediator's create-fence AND post-create recheck leader-read the govern head and refuse a policy-admitted decision while a `pendingPolicyKey` is staged, which also bounds the never-deleted `oblig` set during a long drain), the \xA713.9 matrix records the mediator's govern-head and policy-version read authority, the `policy` kind's immutability is stated honestly as a trusted-writer create-only-CAS invariant backed by read-time self-certification rather than a broker-level update/delete subtraction (KV operations share one subject), and the takeover barrier's crash-boundary recovery COMPLETES containment (revoke + reconcile + verified-evict every family holder) BEFORE it aborts a stale/torn freeze, so a crash after a partial revoke never leaves a revoked credential's connection live. A fifth round (panel + independent cold read on the B2 mediator) refined: `commitDigest` is the RFC-8785 canonical content digest of the committed value, `sha256:<hex>` (not a raw-bytes digest, so it is insensitive to a non-canonical storage stringify), and `commitValue`'s `b64u`/`ref` forms both resolve that same value; the policy publication is content-addressed by the same canonical digest (property-order-insensitive). The session expiry sweep now enumerates a marker-preserving stream read rather than the bucket's `keys()` (which filters DEL/PURGE), so a tombstoned session key is reported as corruption, not silently skipped. The terminal barrier's frontier record is pinned as the `frontier.<lifecycleUid>` kind (\xA713.7: create-only, never deleted, one key per retired lifecycle, recorded once under its own operation's `opId` before the gate/head terminals), and the exact-pool cleaner's `retired` disposition is a first-class `wrk` terminal fact carrying its operation and retiring-target binding. A sixth round (the D14 confinement review) pinned the two mediated-profile grant shapes: the admission mediator's enumeration consumer carries a deterministic (endpoint, connection)-bound name with name-literal CREATE/INFO/MSG.NEXT/DELETE rows (closing the name-wildcard cross-consumer reach; the own-name delete is what keeps the fixed name reusable across filters), both profiles' reply inboxes are connection-scoped (`_INBOX_<connId>.>`, never the account-wide default), and both payload-blind write residuals are named with equal explicitness: the mediator's own-endpoint acceptance-forge and the cleaner's own-pool `wrk` terminal-forge (work suppression or mis-settlement), each confined to its subject-expressible scope. A seventh round (the control-surface sealed-scanner seal) moved the dynamic-enumeration `CONSUMER.CREATE` off every standing/runtime credential (the takeover/retirement/handle-revocation barrier and the session sweep on `cotal_auth_<space>`, and the admission mediator plus the retirement obligation-drain on `cotal_records_<space>`) into dedicated SEALED scanners the trusted process opens for itself and NEVER hands out, because a consumer-create request BODY is not subject-ACL confinable (an extended name+filter grant still admits a `durable_name` + push `deliver_subject` exporter of every current/future row that survives connection close and revocation, nats-server#8274, reproduced live); each scanner is pinned to one literal consumer name under a forced pull/`LastPerSubject`/ephemeral/memory config, bind-verified before use and unconditionally deleted after, its CREATE filter confined to its subtree, space-bonded so a hand-assembled or foreign-space scanner never enumerates, and fence-free by construction (a `LastPerSubject` read carries no upper cutoff, so a same-subject overwrite during the scan is SEEN, not dropped). Its re-verify round hardened the seal from asserted to enforced: the scanner capability handle is immutable once branded (a swapped scan op throws rather than surviving the injection assert; that mutation vector was reachable only from inside the trusted process, the signing-seed residual class, never externally), every scan over a space's literal consumer name serializes process-wide (a second scanner instance can never interleave with a live scan and return a partial enumeration; cross-process duplication remains excluded by the one-authority-plane-per-space composition), every delivered subject is revalidated against the exact requested filter (an out-of-filter delivery from a foreign re-resolution of the literal name is refused loud; a foreign SAME-OR-NARROWER filter remains covered by the one-plane composition, not by this check), the two scanner profiles are explicit \xA713.9 matrix rows whose grant builders the mechanical matrix audit pins as the SOLE dynamic-enumeration `CONSUMER.CREATE` holders on the two authority streams (the provisioner's pre-created full-tail reader durables remain the one other records-stream consumer authority, and the audit pins that complete surface too), and the admission-mediator coordinate stays package-internal until a composition owns the one-records-scanner-per-space injection. An eighth round (the control-surface piece-2/4 wiring) landed: the record-reader provisioning seam is an ALLOWLIST over one canonical authority-def collection (a reader durable's kind must be a registered caller-readable record kind, so every authority-control kind and every unregistered kind refuse, and a dual-token kind whose atomic head is authority admits only a filter strictly deeper than the head, never one that can match or is shallower than the head key); that classification is runtime-frozen and the seam consults a private module-load snapshot, so a post-import mutation cannot remove the guard (the same integrity discipline is applied to every exported security-relevant collection: the baseline grant vocabularies, the credential-lifetime matrix, the session terminal states, the schema profile, and the broker floor are all frozen, and the minting-path consumers read private snapshots). The retirement barrier's cleaner authority is SPLIT into two per-operation credentials: a zero-write cleaner (its residual is terminal-free ACK suppression) and a settlement executor that alone holds the lease-record CAS and the lease-derived `wrk` terminal publish on the intent's exact pools plus the leader-served EPF and records fencing reads its own code path performs (NO EPW read: the settlement path settles or expires through the lease key before any EPW live-entry probe, so that read is unreachable and ungranted); the two are distinct CONNZ principals fenced independently before any frontier records, and the barrier runs settlement on the executor's own connection rather than its standing one. The retirement barrier is the `frontier.<lifecycleUid>` writer (the exact-arity `frontier.*` grant row), and the auth service's boot crash-resume finishes an owed retirement through the assembled deps (a per-endpoint short-lived drain client over the reviewed admission-mediator profile sharing the plane's sealed records scanner, and the per-op cleaner/executor split), fail-closed and loud like the takeover resume. Its re-verify round closed three composition gaps: the barrier now grants `STREAM.INFO` for exactly the CLOSED retirement-frontier stream set (the per-space lifecycle-data streams EPF/EPW/EPE/records, one source feeding both the intent validation and the grant, so a frontier read is never denied on a real broker nor a caller-selected arbitrary stream), the settlement executor drops the unreachable EPW live-entry read (the settlement path settles or expires through the lease key before any EPW probe, so that grant was dead), and the assembled drain completes every settleable obligation but fails CLOSED with an operator-legible frozen-not-lost message on accepted work that needs a confined commit-applier/route-reconciler authority (a scoped boundary whose full mechanics are a separate reviewed slice, never a broad records-write grant bolted onto the drain). A ninth round (the cross-process plane-ownership seal, \xA713.13) closed the last composition assumption the sealed scanners leaned on: at most one authority plane per space now holds them by a broker-visible claim, one exact never-deleted auth-KV `plane` row binding the two non-reconnecting scanner connections' broker identities, taken by create/revision-CAS with the candidates INERT until the win (no scan capability exists before it); a stale `held` row is reclaimed on LIVENESS ALONE (both claimed tuples conclusively absent under a COMPLETE connection sweep, adjudicated by the delivery daemon's closed read-only oracle over the delivery-admin rail; the auth process holds no `$SYS`), with no TTL, no heartbeat, and no sealed-scan-progress bit (a mid-scan crash reclaims; a paused-but-live plane keeps its connections and its ownership); the winner re-validates the claim before AND after every sealed scan (refuse or discard), an owned scanner disconnect fences the plane (invalidate exposure, close the sibling, never a transparent reconnect into a successor's consumer), clean close releases only after the scan clients are down, the three operator refusal faces carry distinct copy (live peer / inconclusive-fail-safe / mid-life fenced stop), and the launcher adds an exclusive-create pidfile belt. Its re-verify round hardened the reclaim and the fence: a `gone` verdict is valid only under the single-nats-server-process boundary, proven per observation from the responding server's own topology declaration in the `$SYS` reply envelope (any cluster self-report, multi-server observation, or missing declaration reads `unknown`; leafnode/gateway-extended accounts and backup-restore-onto-a-fresh-broker are named residuals; multi-server needs an incarnation/roster authority) \u2014 never inferred from which servers replied, which could neither be enforced by reply-counting (a partition shows one responder) nor flipped to require-the-claimed-server's-reply (a restarted server can never reply, the permanent-wedge horn); claim re-validation covers the two pinned scanner tuples (a tuple-only row rewrite is a lost claim); a scanner-death fence is FATAL to the whole authority plane (every authority operation refuses and the service exits loud, never a healthy-looking half-dead plane); the plane credentials' non-expiring boundary is normative (exactly the two non-reconnecting plane connections; every other authority credential keeps short-expiry + renewal); the claim row, connection tuple, oracle-query, and oracle-result schemas are closed exactly (unknown fields refuse, at every level); only successful well-formed CONNZ pages count toward a reclaim sweep (an API error, malformed envelope, non-string cluster declaration, id mismatch, or incomplete page poisons the observation); every sweep's reply inbox carries a per-call nonce (concurrent sweeps cannot cross-complete); the fenced plane's refusals are audience-split (a retryable unavailability to connecting agents, the state-3 restart copy to the operator's log and exit line); and the pidfile belt publishes atomically pre-populated (temp inode + no-overwrite `link(2)`; an empty slot is unpublishable and a pre-protocol one reclaims exactly once). A tenth round (the confined drain repairers) closed the retirement drain's accepted-work boundary functionally: the fail-closed applyCommit/reconcile interim is replaced by two per-op, per-repair principals \u2014 the COMMIT APPLIER (`local.epapl_<opId-hash>`, one exact records-KV publish row, minted only for a key inside the CLOSED self-commit class derived from the canonical frozen kind registry + the commit-path writer metadata, so a forged accepted-self row can never name an authority coordinate into a grant) and the POOL-ROUTE RECONCILER (`local.eprec_<opId-hash>`, one exact EPW item create-publish row, executing only a MEDIATOR-DERIVED closed repair command: the mediator reads and row-binds the durable acceptance decision itself and derives the exact subject + the \xA713.6 canonical acceptance item bytes, now a normative derivation so first enqueues and crash repairs are byte-identical) \u2014 each minted per repair, executed, closed, with the CAS-header and payload-blind residuals named per profile; an accepted self-commit now re-applies (or classifies landed/superseded) and an accepted pool route re-materializes, so a retirement with covered accepted work COMPLETES on resume, and an accepted EFFECTS route with no completion marker terminalizes through the RETIREMENT-CANCEL terminal (\xA713.8 option (i)): the effects completion fact becomes a closed two-member union (ran, or `cancelled: { opId, target }` \u2014 the same identity spine, never a forged success, written only for the retiring target's own acceptances), an action's goal union already carries the first-class `cancelled` state (the retirement attribution rides its digest-bound payload), the cancel publishes CREATE-ONLY on the SAME completion subject so first-terminal-wins is structural in both directions, and a third per-op principal (`local.epcan_<opId-hash>`, one exact completion-subject create row) executes the mediator-derived repair \u2014 so a retirement with in-flight accepted effects work now COMPLETES on resume with a reader-legible cancelled terminal instead of freezing. An eleventh round (the despawn\u2192retirement trigger, the P1 closure) reserved the `auth-admin` control service (SPEC 13.2): the AUTH plane serves the GENERIC \"retire a lifecycle\" operation on the `ctl` grammar's subject-attributed rail (the delivery-admin discipline: broker-ACL caller attribution, bound replies, an unbound reply target dropped before processing), authorized at SERVE TIME by the fresh space-manager-lease holder check (one leader-served read of the manager bucket's single lease key; holder == the subject-attributed requester principal; DEL/PURGE markers and TTL-expunged rows read absent and refuse fail-closed \u2014 never mint-time trust, closing the post-lease-loss window), answering the four-outcome idempotence table in operator vocabulary with every refusal a stated COMPLETE no-op; the space manager triggers it per despawn through an ephemeral request-and-reply-only `retirement-requester` credential with a STABLE per-lifecycle opId (retries, same-name-spawn nudges, and boot resumes converge on one operation), holds the despawned name RESERVED-pending-retirement until the terminal (a same-name spawn refuses legibly and re-drives the request; the in-memory reservation's restart residual is named \u2014 the durable truth is the lifecycle head itself), and the retirement executes through the plane's own reviewed deps over its ONE sealed records scanner. The barrier's terminal cleaner/executor pool set is the operation's EFFECTIVE INVENTORY: the target's accepted `oblig.<uid>.>` pool routes discovered from the just-drained obligation set UNIONED with the intent's OPTIONAL trusted hint (the despawn rail passes none), superseding the round-8 \"intent's exact pools\" enumeration so an empty-hint despawn still settles every accepted pool item before the frontier; the durable-intent hint is a TRUSTED ADDITIVE AUTHORITY input (a hinted pool with no accepted obligation still receives a bounded per-op credential), and the compromised cleaner/executor residuals scope to that whole effective inventory, including any hint-only pool. |\n| 2026-07-10 | **v0.4 binding revision: endpoint control surface (\xA713).** One standardized typed surface for every endpoint (manager, delivery, wrapped third-party servers): class/instance/scatter rails with per-command broker enforcement and an authorization-mode gradient, lifecycle identity (recyclable alias + never-reused lifecycle UID + fenced process epoch, \xA713.1, \xA72/\xA76/\xA78 extensions), versioned envelope with structured errors and signed slots, three delivery contracts (ephemeral, split-key records, untrusted submissions \u2192 mediated canonical facts), verbs call/cast/watch/claim/scatter (claim owner-mediated: workers hold no pool grant), composites (action, checkpoint, guard, capability handle with redemption-pinned `handle`-mode targets, session, virtual endpoints), content-addressed cluster contracts + governed traits + describe, the ownership matrix (incl. exact reader/consumer/ack rows and pinned consumer-name grammars), takeover/retirement revoke-and-evict barriers over the full ledgered credential family (credential ledger, \xA713.1), mediated timer arming (request/armed/fire split with a scheduler-origin fire check), poison quarantine facts, an epoch-pinned record-write ingress plane (`epr`), a single-message digest-subject contract store (`epc`), pre-created pull-only reader consumers (no dynamic reader creates: a create's delivery target is body-set and unconfined), an alias CAS head for lifecycle activation, and receipts and trust anchors. **Hard cut:** deletes the v0 `ctl` rail, `ControlRequest`/`ControlReply`, the `self`/`manager`/`admin`/`delivery-admin` tiers, and the reserved `control.<instance>` subject. `protocolVersion` targets `0.4` at migration completion; `1.0` stays reserved as a later stability declaration. |\n| 2026-07-07 | Documentation revision, no wire change: layered authority statement (schema authoritative for shapes, prose for semantics), document-snapshot policy and this change log (\xA711), reciprocal links to the informative docs. |\n| 2026-07-03 | **v0.3 binding revision: owner+actor identity.** The wire identity becomes the two-token principal `(owner, actor)`: subjects carry the sender as `<owner>.<actor>`, and grants, durables, presence, and `from.id` re-key onto the pair (\xA72, \xA73, \xA76, \xA78, \xA79). The connection nkey remains only the transport credential (the per-connection reply inbox). Adds the per-user-auth authorization grammar and the owner-token format (\xA72, \xA79). Supersedes the single-id grammar. |\n| 2026-06-21 | **v0.3 binding revision: channel live delivery.** Channel live delivery moves from the mediated per-instance live-tail durable to native `sub.allow`-bounded core subscriptions, with an explicit per-channel `live`/`durable` delivery class and the per-member durable backstop (\xA74, \xA77, \xA78); membership moves to a privileged-written registry (\xA77). Supersedes the v0.2 single-durable live-tail. |\n| earlier | v0.2 and before predate change control: the v0.2 contract (single mediated live-tail durable binding) is superseded by v0.3 and kept only in history. |\n"
384
384
  },
385
385
  "schema": {
386
386
  "title": "Cotal message schema (JSON Schema)",