# `@volter/supercode-orchestrator`

This is currently a private workspace package. Examples assume the checkout's
workspace dependencies and a built Volter Harness CLI; the package name is not a claim
that an installable npm release exists.

Verified worker binding replaces superseded worker notice subscriptions across
an arc and its subtasks. Native notices wait with their event cursor intact when
liveness is unread; agent and board mailboxes keep their independent routes.
Read the [worker-notice contract](../../docs/reference/board-worker-notices.md)
and [retained subscription evidence](../../docs/evidence/board-worker-notices-2026-10-09.md)
for source behavior and the remaining native/publication qualification.

`supercode workflow claim <card>` opens a manual run and commits the declared
`running` workflow stage with its claim. Readiness is checked against the
workflow stage; the home must declare `running`. Creating with
`--initial-status running` uses the same path. Subsequent `block` follows that
stage's own transition, which ends the run in the default workflow. See the
[private manual reading](../../docs/evidence/board-manual-claim-2026-10-09.md)
for scope and limits; existing inconsistent claims are not repaired automatically.

The candidate board supports manager-set pause deadlines and an independent
backlog flag. `workflow pause CARD --reason "why" --until 2h` stops its attempt;
another pause changes the deadline without ending a second run. Manual resume
or expiry takes the same `resume` transition and retains its conversation.
`workflow backlog CARD --reason "why"` accepts settled work for later;
`workflow plan CARD` returns it to Todo for ordinary capacity admission.
Backlog blocks every start and holds no execution capacity. Existing homes need
compatible rules and storage before adoption. The
[resting-state contract](../../docs/reference/board-resting-states.md) covers
authority, migration revisions, remaining holds and deliberate replacement.

Completing a task with `--commit` inherits its arc's workspace when the task is
scratch. When that workspace belongs to another machine, the board verifies the
commit against the declared repository's pushed branch head through GitHub,
without requiring the checkout on the board host. A legacy directory path is
resolved through its own machine's workspace door to obtain that identity.
Remote commits take a full SHA or at least seven hexadecimal characters; a
different head or an unread remote refuses completion. Local checkouts keep
their existing Git commit resolution. This source check does not replace the
arc's independent review.

The orchestrator's runtime over the ontology: one typed operational model
(`OrchestratorState` = an orchestration value plus a runtime half) whose folder is its serialization.
`docs/ORCHESTRATOR-IR.md` is normative. The orchestration value and every codec are the ontology's, in
Rust (`crates/interchange/src/orchestration/`); this package reads and writes its home through the
harness's orchestration doors (`harness.v1.orchestration.*`), never a codec of its own.

```js
import { load, save, compile, importFrom, exportTo, closeWorld } from '@volter/supercode-orchestrator';
import { homedir } from 'node:os';
import { join } from 'node:path';

const root = process.env.SUPERCODE_ORCHESTRATOR_HOME || join(homedir(), '.supercode/orchestrator');
const { state, vault } = await load(root);                        // strict; secrets in `vault`, never `state`
await save(state, root);                                          // runtime state; preserves workflow.yaml

const { state: hermesState } = await compile('hermes', process.env.HERMES_HOME); // a home as a state value
await closeWorld();                                              // close the shared door when done
```

The doors are `orchestration.mjs`: `load`/`save`/`compile`/`importFrom`/`exportTo`/`closeWorld` over one
`SupercodeHarnessClient`. A secret VALUE never crosses the wire — `load` and `compile` answer with
the `.env` KEY NAMES, and `load` reads the values out of the home's own `.env`. The door is held
open while a loop runs (`retainWorld`/`releaseWorld`, the loop's `start`/`stop`) and closes itself
when idle, so a one-shot verb (a test, a migration) exits on its own.

Rules the codec keeps (enforced in Rust, observed here):

- Unknown keys in an orchestrator-owned block (`worker`) fail the
  load, naming the file and key. Hermes-shaped records keep unmodeled fields in `residue`, verbatim.
- A file whose decoded record is unchanged is written back byte for byte; a changed record is
  emitted canonically in Hermes's own field order.
- Secret values live in the vault (`.env` in our folder; inline in a Hermes export because that
  is where Hermes reads them). A value pasted inline into our folder is moved into `.env` on
  first load and the file rewritten with the ref. `JSON.stringify(state)` never contains one.
- Exporting to Hermes refuses to write Hermes's session store when bindings or obligations changed
  since import (UNI-22); it copies the store byte for byte when they did not.
- Files the IR does not model are never touched by `save` and are carried by path on a migration.

Runtime `save` and load-time credential normalization leave `workflow.yaml` untouched,
including a symlink or an absent file. The board reads policy from the live home;
an older runtime snapshot cannot replace an edited cap. For intentional full-home
creation or replacement, use `orchestrationSave` (which writes the workflow by
default), `supercode orchestration save --from-json`, or `importFrom`.
Other SDK callers that persist runtime state set `preserve_workflow: true` on
`orchestrationSave`. See [workflow ownership](../../docs/adr/0067-live-workflow-ownership.md).

## Board machine-call deadlines

`workflow serve` retains its public socket and kernel lock while dispatcher generations change.
`workflow handover --entry /absolute/path/to/bin/orchestrator.mjs --supercode /absolute/path/to/native --root HOME`
prepares a successor through the normal source checks, drains admitted work, and transfers its writer epoch.
It routes calls only after a clean round and a successful stats reply. A candidate lost before the handover finishes
rolls back to a fresh generation started from the predecessor's selection, so the parked predecessor is ended
(TERM, then KILL) once the successor's first round is clean, and each end is said in the owner's log; one that does not
exit is named in `board-generation.json` and the owner's status until it does. A request already sent to a lost generation returns an unknown outcome and
is never replayed. This source mechanism still needs the complete machine release integration and recorded
qualification described in [ADR 0080](../../docs/adr/0080-serving-generation-handovers.md).

The board owner's machine calls share one timeout budget across channel admission,
node or harness admission, and the method request. A call whose admission expires
never sends the method after its caller has stopped waiting. It leaves the owner's
shared channel and clients available to other callers. Once a method request has
started, a timeout reports that whether it ran is unknown.

Timing steps name each admission phase and the request. The SDK request receives
the remaining budget and cancellation signal; node requests receive the remaining
budget, with their existing request/reply cleanup. The workflow caller also records
session lookup, request preparation and the wait for the owner's answer, including
an owner call that ends by throwing. These steps contain durations, not request bodies.
These bounds do not establish
subsecond board verbs or identify the cause of a historical slow call. The retained
readings and limits are in
[board call admission evidence](../../docs/evidence/board-call-admission-2026-10-10.md).

## Read a card's attachment

List a card's recorded uploads, then download one onto the calling machine:

```sh
supercode workflow attachments <card> --at sc:<host>:board:<name> --json
supercode workflow attachment-get <card> <attachment-id> --at sc:<host>:board:<name> --out ./artifact.png
```

The npm front door serves `attachment-get`. Without `--at`, use `--root <home>`
and optionally `--board <slug>`. `--out` names a local file; its parent directory
must exist. A completed download replaces that file. An interrupted download
keeps every byte it received in a partial file beside `--out` (named for the
output, card, attachment and version) and reports its path; running the same
command again continues from that partial's end, as long as the attachment's
version is unchanged.
The board host needs an orchestrator that serves `attachment-read` and its normal
running board owner. Remote reads keep the board door's caller and grant checks.

A card's published snapshot lists its attachments (`attachments`: each `{ id, name, content_type, size, by, at }`,
never where the board keeps it), and attaching or removing a file publishes the card, so an integration that reads only
the board (runhuman-2 ADR 0063 decision 3: Project Rooms reposting a card's images and videos) learns of a new file from
the card's change and reads its bytes through the board door with `attachment-get` or `attachment-read`.

`workflow attachment-read <card> <attachment-id>` returns JSON with at most 1 MiB
of `content_base64`, metadata, offsets, `eof` and a filesystem metadata `version`.
Subsequent reads pass `--offset`, `--length` and the first response's `--version`.
It accepts a recorded attachment id rather than an arbitrary host path. Version
checking detects metadata changes; it is not a content digest or writer attestation.
The worker's existing `kanban_attachments` MCP tool lists uploads as before;
adding `attachment_id`, and optionally `offset`, `length` and `version`, reads a
range under the same worker scope. The maximum `length` is 1,048,576 bytes.
## Board GitHub REST receipts

`supercode workflow github-usage --since 1h --json` reads this user's local
`github-rest.sqlite` in `SUPERCODE_HOME` (default: `~/.config/supercode`, respecting
`XDG_CONFIG_HOME`). It needs neither a running board nor a GitHub request. It
groups retained wire attempts by caller and endpoint, includes their purposes
and outcomes, and shows the latest 32 response-header receipts. Unknown transport
completion remains counted. Tokens and raw response bodies are not retained in
the attempts ledger. Budget refusals have separate local receipts, exposed as
`refusals`; `refusals_since` and `refusals_complete` say whether collection covers
the requested window. An older ledger cannot prove the absence of refusals.

Board actions check their local role, guard and validator rules before GitHub.
Fresh source observations are reused only within that action, with at most eight
concurrent REST operations per process. Owner receipts retain the return code and
redacted refusal even when a failed call is fast. See
[acceptance latency readings](../../docs/evidence/board-acceptance-latency-2026-10-14.md).

Board discovery persists advisory projections in this same private SQLite file:
one open-PR list per API origin, credential digest and repository for five minutes,
independent of which card declares that repository. Default-branch metadata has
its own entry; acquiring it never repeats the list. Branch histories last fifteen
minutes, merged PR observations an hour and other PR observations a minute.
Failures remain failures for the entry's interval. In-process readers share a
pending result; another process defers on its durable claim instead of duplicating
the request. A claim expires after six minutes if its process disappears.
Successful fresh validation refreshes advisory discovery, including after restart.

Review requests, verdicts
and acceptance refresh the complete source set in the arc's repositories,
including previously draft or closed declared sources, and validate its current
heads. That scope includes its workspace, registered branches, declared sources,
previous candidate and discovered sibling work, and is retained in the source
receipt. Broad known-repository discovery remains advisory; unrelated checkouts
spend no validation calls. Every fresh source entry first acquires that advisory
scope, even for old receipts and sibling checkouts now on main; an unread scope
refuses authorization. A round with every head judged stops at advisory
eligibility, and the review evidence door refuses a redundant proposed head set
before a fresh scan. An unread set defers
the action. Before the dispatcher spends those validation reads, it checks the
advisory candidate's PR properties and local worktrees. An invalid PR state,
draft, head or base refuses before the full validation scan, including a declared
PR on the wrong base. Discovery refreshes changes to those properties. A mismatched
HEAD or uncommitted work also refuses locally. Each later round rechecks the checkout, so
a repair wakes it; a successful preflight still needs the fresh complete-source,
local and pushed-head checks before review is recorded. Unread commit dates also defer eligibility and are never cached as
old work. An arc that already named a PR for review cannot become a no-code
disposition merely because it merged; it skips the repeated no-code history
validation. Advisory no-code and commit eligibility use discovery's allowance.
Merge validation still reads the current head. Every request page, retry, redirect and merge PUT
reserves its own attempt. All processes and credentials sharing this supercode
home share a rolling-hour ceiling of 1,200 attempts, including at most 600
discovery attempts. Endpoint exhaustion/Retry-After also defers subsequent work.
A deferred source remains unknown, with its reason; it is not an empty success.
Other homes and external GitHub clients are outside this ledger and ceiling.
See [F104 evidence and qualification limits](../../docs/evidence/f104-github-2026-10-14.md).

## Local native session recovery

`supercode sessions recover --once --retry-after 300` runs a bounded opt-in
recovery pass over this user's local Claude Code and Codex panes. The shared
terminal classifier identifies the current transient failure; the machine's
`panes.retry` door owns the guarded native input and retained receipt. This
package owns the retry interval, durable input IDs and reporting. A separate
SQLite owner lease prevents overlapping passes without retaining a lock after a
process dies. It does not change a board's dispatch policy or restart an
intentionally suspended session. See the [session guide](../../docs/guides/sessions.md#retry-transient-native-session-failures).

## OpenClaw, and the two migration verbs (ORC-12)

```js
import { compile, importFrom, exportTo } from '@volter/supercode-orchestrator';

const { state } = await compile('openclaw', process.env.OPENCLAW_STATE_DIR); // a home as a state value
```

```sh
node bin/orchestrator.mjs import --from hermes|openclaw [--home <path>] [--into <root>]
node bin/orchestrator.mjs export --to   hermes|openclaw [--from <root>] [--into <dest>]
```

`import` (`orchestration.import`) compiles that harness's home and saves ours, credentials along; `export`
(`orchestration.export`) loads our folder and decompiles it back, printing the tier of every file it wrote.
Because a migration moves credentials, both are composed inside the harness process, not from the
value-level doors — a client composing them would have to send the secret over the wire. A refused
write exits **2** with its reason — a partial migration is never reported as a whole one.

What OpenClaw's state directory compiles to, at the pinned `v2026.7.1-2`:

- `agents.*` → profiles. The DEFAULT agent (the entry flagged `default`, else the first declared,
  else `main`) is the IR's `default` profile; every other agent keeps its id. Each is rooted at its
  own `agents/<id>/`.
- `channels.<name>[.accounts.<id>]` → one `ChannelConfig` per row `channels list` shows, keyed by
  that row's name (`slack/T0FIXTURE`); the transport is `extra.kind` and the source blocks ride
  verbatim in `extra.channel_block` / `extra.account_block`.
- `bindings[]` → `Route`. The IR's match carries the three fields it has a noun for (`channel` →
  `platform`, `guildId` → `guild_id`, `peer.id` → `chat_id` — the projection `routes list` makes);
  `accountId`, `teamId`, `roles`, `peer.kind` and the binding's `type` ride in residue.
- `hooks.mappings[]` → `WebhookSubscription`s (the inbound-trigger noun `triggers list` reports),
  with the block's shared `token` as each subscription's secret.
- `cron_jobs` → `Job`. `sessionTarget` has no IR field: it stays in residue verbatim AND surfaces
  as `attach_to_session` when it names an existing conversation (`main` → `agent:<id>:main`,
  `current` → the row's own session key, `session:<id>` → `<id>`; `isolated` opens a fresh one).
- `cron_run_logs` → `Fire`. `ok | error | skipped` map to `succeeded | failed | unknown` and the
  native word stays in residue. OpenClaw's run log is written once, at finish, and records no
  claim, so the fire's start stands in for `claimed_at` and `residue.__no_claim` says so.
  `delivery_status` / `delivery_error` / `delivered` ride in residue, and the queue entry on the
  same conversation key becomes the fire's `obligation_id`.
- `delivery_queue_entries` → `Obligation`, partitioned by the agent segment of its session key.
- each agent's `sessions/*.jsonl` header key → a `Binding`. `agent:<id>:main` is OpenClaw's DM
  COLLAPSE: it becomes `{platform: 'main', kind: 'dm', chat_id: 'main'}` and the collapse is
  recorded in residue, because the IR cannot recover which transport a collapsed DM arrived on.

Tiers on the way out:

- **byte** — `state/openclaw.sqlite` when every record decoded from it is unchanged (the file is
  copied); any row whose own record is unchanged when the store must be rewritten (its columns go
  back verbatim, and `report.rows` counts them); every unmodeled file under the state directory;
  and `openclaw.json` when its decoded record is unchanged.
- **semantic** — a CHANGED `openclaw.json`. It is re-emitted as JSON, which openclaw's JSON5
  parser reads, but the source's comments, trailing commas and key order are lost; `report.notes`
  says so every time that path is taken.
- **refused** — bindings. An OpenClaw conversation's surface lives in its session KEY inside the
  transcript header, so writing them back is behind the UNI-22 stability gate, exactly as
  the Hermes export refuses Hermes's session store. A credential ref the vault cannot resolve is refused
  too, rather than written as its own reference.

Secrets never enter the model: any string under a credential-shaped key — openclaw's own rule
(`sdk/interchange/orchestration-openclaw.mjs`: the lower-cased key ENDS WITH `token|key|secret|password|
credential`), minus the names it spells that way for non-secrets (`sessionKey`, `store_key`, …) —
moves to the vault as a `{dotenv}` ref and is re-inlined on export where openclaw reads it.

Two limits worth naming. `save` writes our folder in the IR's own serialization, so a home
imported from another harness loses that harness's file COMMENTS and, for fires, any run-log
column our Hermes-shaped `cron/executions.db` has no room for (OpenClaw's `delivery_status`,
`session_key`, `summary`, `model`, token counts): a direct compile-then-decompile of an OpenClaw
home is byte tier, the same trip through our folder is not. And `import` carries the source home's
unmodeled files by path, because `save` only ever writes the files the IR owns.

## The loop (ORC-4)

```js
import { Orchestrator, LoopbackAdapter, events, load } from '@volter/supercode-orchestrator';
import { SupercodeHarnessClient } from '@volter/supercode-harness-sdk';

const { state, vault } = await load(root);
const orch = new Orchestrator({ state, vault, client: new SupercodeHarnessClient(), adapters: { loopback: new LoopbackAdapter() } });
await orch.start();                      // adapters connect; inbound messages become events
const now = new Date().toISOString();
await orch.dispatch(events.tick(now));   // the clock is an event too
```

`step(state, event)` is the pure reducer (§4): it mutates the one state value and returns effects
(§5); the `Orchestrator` performs them over the SDK (`runtimes.start|send_input|respond`) and the
adapters (`deliver`). A worker runs with the profile folder as cwd and the profile's harness home
inside it (`activationEnv`), so its AGENTS.md is in context by the ordinary instruction-file walk.

The board's held profile view follows root/profile `AGENTS.md` changes, including
linked targets, and reloads on its next call. The current call retains its basis.
This file refresh does not replace instructions in a running native session;
[c60's source record](../../docs/evidence/persona-file-invalidation-2026-10-10.md)
keeps running-main delivery and readback open.

## Cron and webhooks (ORC-5)

```js
await orch.dispatch(events.tick(now));       // §4.3: expiry, due jobs, obligation retry, breakers
await orch.tick();                           // the same, on the orchestrator's own clock
// POST /webhooks/<name> on orch.webhookPort (config `gateway.webhook_port`, else any free port)
```

- A due job is **claimed before it runs**: the fire row (`cron_<job_id>_<YYYYMMDD_HHMMSS>`, which is
  both the fire's id and its session name) is saved before the `runtime_start` effect, and a second
  tick that sees a `claimed`/`running` fire for that job does nothing.
- The fire runs on a synthetic key `{platform: 'cron', kind: 'dm', chat_id: job_id}` with a
  binding carrying `recurrence`. Its `final` delivers to the job's resolved target — `origin` →
  `job.origin`, `home` → `profile.home`, `explicit` → as given, `local` → `cron/output/<fire_id>.md`
  under the profile — never to the synthetic key. An error or timeout goes to `failure_deliver`,
  else to `deliver` with a `Cron job <id> failed:` prefix.
- `next_run_at` is recomputed after every fire: `once` is spent (unless a numeric `repeat` remains),
  `interval` counts from the run, `cron` evaluates five fields in `schedule.tz`. `context_from`
  prepends a note naming the session; the transcript is never loaded.
- The daemon does not die on a failed event: a timer tick, an adapter's inbound, the webhook listener
  or a queued follow-up whose effect fails (a save on a full disk) is logged, where before its
  unhandled rejection ended the process. History is bounded as Hermes bounds it: run files per job
  (`cron.output_retention`, 50), completed one-shots (`cron.completed_retention_days`, 7), 1000
  finished fires, and obligations as its delivery ledger (7 days, 500 rows).
- Slack, Telegram and Discord blocks from a Hermes home connect through the Chat SDK sidecar with
  Hermes's own `.env` variables and ingress (Socket Mode, polling, the gateway); install the platform
  package (`@chat-adapter/slack`, …) beside the orchestrator.
- The agent-setup applier (`orchestrator apply plan|apply|adopt|provision --home-id <id> --hermes <home> | --orchestrator <root> --spec <setup.json>`):
  a package's declared jobs and `Inference` reach one home through its own functions (Hermes's cron
  and config functions under its own interpreter; the orchestrator's operator verbs), owned by
  harness id against a base in the applier's own state. A home with no state is plan-only until
  `provision` or `adopt`; `delete` runs only with `--reviewed`.
- Limits as Hermes sets them: `cron.max_parallel_jobs` / `HERMES_CRON_MAX_PARALLEL` caps the fires in
  flight across the daemon; an `agent.max_turns` a worker cannot take at launch is reported as not
  enforced.
- A webhook subscription with `deliver_only: true` (Hermes's direct-delivery mode) runs no agent: the
  rendered prompt is delivered as the message.
- A job's gate runs before any model, as in Hermes: `script` (its stdout leads the prompt, or skips
  the model when empty or `{"wakeAgent": false}`), `no_agent` (the script IS the job), and
  `monitor_script`/`monitor_url` (unchanged output suppresses the run; a change puts a diff in the
  prompt). Scripts live under the profile's `scripts/`.
- A fire whose explicit delivery target is on a platform no adapter serves is blocked before its
  worker runs (Hermes's delivery preflight), alerting once until a healthy run. Each run resets the
  job's `last_delivery_error`; a delivery that finally fails writes it.
- A fire whose worker has been silent for `HERMES_CRON_TIMEOUT` seconds (600 by default, 0 for no
  limit, as in Hermes) is closed as a timeout, its failure delivered, and its runtime closed; before,
  a hung fire kept its job from ever running again. A fire in flight when the daemon stopped or crashed
  is not that: the next daemon reopens its session and tells it to carry the run on.
- A job's `model` (and a profile's, and `/model`'s) reaches the worker's launch (`claude --model`,
  `codex app-server -c model=…`, `gemini -m`). For a harness with no such flag it is refused where it is
  set (`/model`, `jobs.create|update`, `cronjob_create`) and again at the start, rather than run on
  the harness's default. A job's `skills`
  are invoked as Hermes invokes them: each is found through the worker harness's own skill loader, from
  the fire's own working directory, and its `SKILL.md` (with `${HERMES_SKILL_DIR}` resolved) goes ahead
  of the prompt, which follows Hermes's instruction marker; a skill that is not there is named in a
  notice.
- A schedule nothing can evaluate — a cron expression that does not parse, a `tz` that is not an IANA
  zone (`America/New_Yrok`) — is refused by name at every door a job enters by (`jobs.create|update`,
  `jobs.resume`, `cronjob_create`). One that reached the folder by hand is caught fail-closed: the
  tick that finds it due, or the fire that cannot re-arm it, disables the job (`enabled: false`,
  `next_run_at: null`, the reason in Hermes's `last_error`) and sends one notice to
  `failure_deliver`, else `deliver`, else home. It is never left due.
- A pending obligation is retried on the tick with a 1 / 2 / 4-minute backoff up to three attempts.
  Three consecutive send failures on one adapter open its breaker for five minutes
  (`state.runtime.adapters[platform].breaker`); while it is open, obligations stay `pending` and
  their `attempts` are untouched. An adapter an `adapter` event has already declared `down`
  (`state.runtime.adapters[platform].state`) is treated the same way before the breaker has counted
  to three, so a single delivery cannot spend its three attempts inside a known outage and die
  `failed` while the transport is still gone.
- `POST /webhooks/<name>` verifies an HMAC-SHA256 `X-Signature-256` header against the
  subscription's secret **from the vault** and is fail-closed: unverified is dropped and logged.
  A verified call renders `prompt_template` with `{field}` substitution from the JSON payload,
  opens a turn on `{platform: 'webhook', kind: 'dm', chat_id: name}` in the subscription's
  profile, and delivers the answer per `subscription.deliver`.
- A subscription's `events` filter on the event the SOURCE names: `X-GitHub-Event`, `X-GitLab-Event`,
  `X-Event-Key` (Bitbucket), `X-Event-Type`, else the body's own `event`/`type`/`action`. An entry with
  a dot names the action too (`pull_request.opened` matches `<event>.<payload.action>`); a call naming
  no event is not a subscribed one. A delivery id (`X-GitHub-Delivery`, `X-GitLab-Event-UUID`,
  `Webhook-Id`, `X-Request-Id`) already handled for that subscription — the last 200 are remembered —
  is dropped with an info log, so a redelivery runs once. The memory is runtime state, as in
  Hermes's own adapter: a daemon restart forgets it.
- A permission prompt raised inside a fire or a webhook turn has nobody to ask, so it is answered
  at once — never left to `worker.permission.timeout_seconds` — with `worker.permission.unattended`
  (`deny`, the default, or `approve`; Hermes's `approvals.cron_mode`), and one line saying what was
  decided goes to the job's `failure_deliver`, else `deliver`, else home (a webhook's: its
  `deliver`). A chat's prompt is still relayed to the chat.
- A Codex worker asks only when started with an approval policy: where the profile keeps Hermes's
  approvals (`approvals.mode` unset or not `off`) it starts with `approval_policy: untrusted` and
  `approvals_reviewer: user` on its thread (`APPROVAL_POLICY`, `APPROVALS_REVIEWER`), so it asks before
  every command and Hermes's rule answers, whatever reviewer the worker's config names. A headful
  main takes its policy on Codex's CLI, which refuses `untrusted` (codex-cli 0.163.0), so it starts
  with `--ask-for-approval on-request -c approvals_reviewer="user"` (`MAIN_ASKING_ARGUMENTS`): what Codex
  asks about comes to a person. With approvals off it asks no person: it starts with
  `approval_policy: on-request`, sandbox `danger-full-access` and Codex's auto-reviewer
  (`approvals_reviewer = "auto_review"`) under an `auto_review.policy` that approves every request
  (`OPEN_POLICY`, `OPEN_ARGUMENTS` in `activation.mjs`). It never starts with `never`, under which
  Codex refuses outright any command its own check flags as dangerous.

```yaml
worker:
  harness: codex
  permission:
    unattended: approve   # deny | approve; what a cron fire or webhook turn's prompts get
```

Known gap: `Fire.session_id` and `Fire.obligation_id` are live-record fields with no column in
Hermes's `executions` table, whose schema is frozen. They round-trip by construction instead — the
fire's id **is** its session name (`fireSessionId`), its obligation is `obl-<fire_id>`, and the
binding carries `residue.fire_id` — so `load()` still joins a fire to its session and its delivery.

## The model-facing door (ORC-6)

One stdio MCP server per worker session, spawned by the worker itself and bound to the conversation
that spawned it (§7). `Orchestrator.start()` opens a Unix socket at `<root>/orchestrator.sock`
(`mcp/bridge.mjs`); `startRuntime` mounts `mcp/server.mjs` through whatever door the worker's harness
publishes (`mcp/mount.mjs`), with the binding in the server's environment — the three variables
`activationEnv` already sets, plus `SUPERCODE_ORCHESTRATOR_SOCK`.

| Harness | Door | What is written |
|---|---|---|
| claude-code | `--mcp-config <file>` in the launch arguments | `<profile>/claude-code/mcp-orchestrator-<surface>.json`, `.mcp.json`-shaped |
| codex | `[mcp_servers.orchestrator]` | appended (idempotently) to `<profile>/codex/config.toml` |
| opencode | `mcp.orchestrator` | `<profile>/opencode/opencode.json` |
| pi | none | pi ships no MCP client by design; the mount refuses and says so |
| hermes, openclaw, any other ACP agent | `session/new`'s `mcpServers` | `harness.v1.runtimes.start`'s `mcp_servers` |

Only the flag and ACP doors are named per launch, so only they carry the per-session
`SUPERCODE_ORCHESTRATOR_SURFACE`; under codex and opencode the server inherits it from the worker
process the loop already activated for this session.

Tools, one per verb, names and argument shapes transcribed from Hermes's `tools/cronjob_tools.py`
(`cronjob_manage`) and `tools/send_message_tool.py` (`send_message`): `cronjob_create`,
`cronjob_list`, `cronjob_delete`, `send_message`, `session_search`, `session_handoff`, `memory_show`,
`skills_list`. Every result names what it did in `ran`.

- `cronjob_create` captures `origin` from the binding, never from an argument, so a job created in a
  conversation delivers back to it. Hermes's `name` has no IR field and rides the residue channel.
- `schedule` takes the IR's typed `Schedule` or the four Hermes string forms that map onto it
  exactly (`30m` / `every 2h`, `in 30m`, five-field cron, an ISO timestamp); natural day/time
  phrasing is refused by name rather than re-implemented.
- `send_message` defaults to this session's own surface; a target that routes to another profile is
  refused, naming that profile.
- `memory_show` and `skills_list` proxy `harness.v1.memory.show` / `skills.list` for the worker
  harness against this profile's own config home.

`supercode mcp serve` (the coding tools) is a different server for a different purpose and is
untouched.

## Board model selection and native refusals

Board pane lanes take the card's model override, then `worker.model`, then the
profile's `model.default` when the harness accepts a native model flag. With no
declared model the harness retains its own default. For a fresh Claude launch,
the dispatcher reads the native first assistant outcome through the session door:
an API error fails the run even if the terminal is still alive. The workflow's
existing incident policy decides the card state and recovery; a monitor board
retains the failed run and holds dispatch without closing its pane. This requires
the matching TypeScript session reader and is not resumed-turn or general
completion monitoring. See the [owned Mac reading](../../docs/evidence/board-claude-model-first-response-2026-10-09.md).

## Board reviewer selection

The workflow can select a reviewer from the latest coding run's harness, while
retaining a card's or request's explicit profile. Review-machine choices stay in
workflow parameters. Default same-harness review retains the coding model; an
explicit reviewer uses its profile's model. The review request records the
implementer's machine and model/provider overrides for a return with changes.
See [the configuration contract](../../docs/reference/board-reviewers.md) and
[source qualification](../../docs/evidence/board-reviewer-selection-2026-10-09.md).
A custom home needs its own workflow update; this source does not rewrite it.

## Acceptance (ORC-8)

The bar of `docs/ORCHESTRATOR-IR.md` §8 — one scripted week of realistic use replayed against
Hermes and against this package, compile-diffed, only zero defects done — closed on 2026-09-04 at
defect 0 (61 scenes, 21/21 expectations, 28 seconds, both subjects on the scripted clock). §8
carries the record, the defects fixed on the way and the Hermes evidence boundary; the instrument
was deleted after its run (owner rule: the roadmap's one test run, then gone).

## The two borrowed adapters (ORC-9)

Every adapter is the same three methods — `connect(emit)` / `send(target, content)` / `close()` —
and every one of them reaches the reducer through `inbound` and nothing else (§3: *"An adapter that
cannot express something as an `inbound` event does not get a private path into the loop"*). A
`platforms:` block picks its adapter by `extra.adapter` when it names one and by the block's own
name otherwise:

```yaml
platforms:
  slack:                      # one block = one (platform, account)
    enabled: true
    extra:
      adapter: chat-sdk       # -> adapters/chat-sdk.mjs
      botToken: ${SLACK_BOT_TOKEN}              # a reference, as Hermes writes one; the value lives in .env
  api_server:                 # -> adapters/api-server.mjs, by the block's name
    enabled: true
    extra:
      host: 127.0.0.1
      port: 8090
      key: ${API_SERVER_KEY}
```

RH2 Room chat is an installed app ([ADR 0017](../../docs/adr/0017-room-chat-is-an-installed-app.md)).
Register the Room-chat app in the RH2 organization (`organization.read`, `room.read`; a Room's
manager seats its principal where it should answer), have an admin install it, and exchange the
code the install returns:

```sh
supercode orchestrator apps install room-chat --origin https://pilot.runhuman.com \
  --client-id app_… --client-secret-file ./room-chat.secret --code … --profile default
supercode orchestrator apps list
supercode orchestrator apps remove room-chat
```

The record (with the installation's token) is kept owner-only under `<home>/apps/`; the next
daemon start attaches the `rh2` channel for that profile. Uninstalling in RH2 revokes the token and
the channel stops. A `platforms: rh2` block grants no integration authority and the runtime reports
it as unsupported. Native Hermes channel configuration remains the worker's configuration.

A mail agent the RH2 organization declares is one participant there, as its own agent principal, with one record per
Workplace in the home: the Agents → Room agents integration (`sdk/teams/workplace`, `launch.root`) provisions one for
every agent it provides, the token of its principal minted at RH2's agent-token door on that registration's own
installation (`rh2-agent.<agent id>@<Workplace host>`, renewed before it lapses, revoked when Teams ends the agent); one
can also be kept by hand. Every session of the agent acts through them (the `rh2` CLI and MCP read the record for the
Workplace each call goes to, from `RH2_AGENT_HOMES` or `SUPERCODE_AGENT_HOME`; a board pane of the agent on another
machine reads the copies the board keeps in the agent's home on that machine, `harness.v1.agent.credentials.keep`),
the agent's channel joins its Room's conversation on its record, and orchestrator-launched sessions mount them as the `rh2-agent` MCP server, never in another agent's that shares its
name or profile. Kept by hand:

```sh
supercode orchestrator apps install rh2-agent --origin https://pilot.runhuman.com --organization volter \
  --principal prn_… --agent agent_… --token-file ./account-manager.token --profile account-manager
supercode orchestrator apps remove rh2-agent.account-manager
```

**The Chat SDK sidecar** mounts `chat@4.39.0` (npm package `chat`, repo `vercel/chat`; a
devDependency of this package, installed alongside `@chat-adapter/state-memory@4.39.0`). The
platform packages (`@chat-adapter/slack`, …) are **not** dependencies: the one the block names is
imported lazily at `connect`, and the credential **key names in the block are that factory's own
option names** — Volter Harness renames nothing and resolves the refs out of the vault at connect, never
earlier. Surface identity is read off the handler's `Thread` (`adapter.name`, `channelId`, `id`,
`isDM`, `channelVisibility`) and content off the `Message` (`author.userId/userName/isMe/isBot`,
`isMention`, `id`, `metadata.dateSent`, `attachments` with `fetchMetadata` as the IR's
`Attachment.ref`) — ORC-1 F4's table, transcribed. Two decisions the IR left open are made in
`adapters/chat-sdk.mjs` and nowhere else:

- **`kind`** (the surface key's chat type) (F4 finding 4, which named this as a rule the IR "would have to invent"):
  `isDM` → `dm`; else `channelVisibility: private` → `group`; else (`workspace` / `external` /
  `unknown`) → `channel`. `thread` is never produced — a thread is the key's own `thread_id`.
- **Queueing** (F4 finding 11): the SDK's per-thread concurrency is set to `concurrent`, so §4.1
  step 5's queue is the only queue on a surface. `extra.concurrency` overrides it.

`is_me` is now on the event and the reducer drops such an inbound at step 0 (§4.1): a platform that
replays what we posted is not a turn. `send` returns the platform's handle and `deliver` records it
as `Obligation.posted.message_id` (§2.6) — the thing §4.2's edit-in-place would edit.

**The api_server surface** serves Hermes's own client API on its own `node:http` listener bound to
`platforms.api_server.extra.host|port` (exactly Hermes's keys, `api_server.py:1515-1519`). It is
deliberately *not* mounted on the webhook listener: that one binds `gateway.webhook_port`, a
different key with a different meaning. Auth is `Authorization: Bearer <extra.key>` —
Hermes's `_check_auth` (`:1916-1968`) — and every route quotes the handler it was matched against.
Routes: `GET /v1/health` (the one unauthenticated one), `GET /v1/capabilities`,
`POST /api/sessions`, `POST /api/sessions/{id}/chat`, `GET /api/sessions/{id}/messages`,
`POST /v1/runs`, `GET /v1/runs/{id}`, `GET /v1/runs/{id}/events`, and
`POST /v1/runs/{id}/approval|steer|stop`.

Everything it makes the loop do is an `inbound`: a chat is one; a run is one on a fresh binding
`{platform: 'api_server', kind: 'dm', chat_id: <run id>}`; a steer is one queued behind the
running turn (§4.1 step 5); a stop is `/reset` (§2.7); and an approval is resolved to the worker's
own option and answered as the **number** §4.2's permission prompt asked for. The run event stream
is derived from §2.8 runtime state — the turn's text buffer, the pending permission requests, and
the obligation the turn's `final` produces — because the loop publishes no event bus and ORC-9 does
not add one.

**Where Hermes's shape has a field the IR has no source for, it is returned empty**, never guessed:

| route | empty field(s) | why |
|---|---|---|
| `POST /api/sessions/{id}/chat` | `usage`, `runtime` | the IR records no token accounting and no provider/model routing |
| `GET /api/sessions/{id}/messages` | `token_count`, `tool_calls`, `tool_call_id`, `tool_name`, `finish_reason`, `reasoning` | §2.5 keeps no per-message tool or token record; the transcript stays native and is read through `sessions.load` |
| `POST /api/sessions` (`session` object) | `user_id`, `model`, `tool_call_count`, `input_tokens`, `output_tokens`, `parent_session_id` | same |
| `GET /v1/runs/{id}` | `model` | the run does not choose a provider model; `profile.worker` does |

Four honest divergences, stated rather than hidden:

- `platform` reads `supercode-orchestrator`, not `hermes-agent`, on `/v1/health` and
  `/v1/capabilities`: it names the server that answered.
- `X-Hermes-Session-Key` is **not** an auth credential in Hermes either — `_parse_session_key_header`
  (`:2403-2440`) reads it as the caller-declared conversation scope, and it is read with that
  meaning here. Bearer is the trust boundary.
- `/v1/runs/{id}/approval` accepts Hermes's `once|session|always|deny` (with
  `approve|approved|allow` aliasing to `once`), but the IR has no standing-grant store: `session`
  and `always` resolve the pending request exactly as `once` does and no grant outlives it.
- `/v1/chat/completions`, `/v1/responses`, `/api/sessions/{id}/chat/stream`, `/api/jobs/*`,
  idempotency (`Idempotency-Key`) and the `/p/<profile>/` route mirrors are **not** served;
  `/v1/capabilities` reports each as `false` rather than copying Hermes's `true`.
- A run is `running` from the moment it is accepted (Hermes passes through `queued` first), and
  `/stop` leaves it `cancelled` once the `/reset` lands rather than in `stopping`.

Known gaps, named:

- `Obligation.posted` lives on the in-memory record only. Hermes's `delivery_obligations` table has
  no column for it and the store is byte-compatible with that schema, so a save/reload loses the
  handle. Adding it is a schema change to §2.6's codec, not an adapter change.
- `deliver` projects the obligation to `{ text, at }` before calling `send`, so
  `OutboundContent.reply_to` and `attachments` never reach an adapter today even though §2.1
  declares both and the Chat SDK sidecar honours both (`thread.reply`) when a caller supplies them.
- The production path that builds a real platform adapter from a block (`@chat-adapter/*` →
  `createSlackAdapter(...)`) is **not** exercised by the suite: the tests drive a hand-written
  `Adapter` (the SDK's `packages/chat/src/mock-adapter.ts` shape, transcribed — that file is not
  re-exported from the package entry, is outside its published `files` list, and imports `vitest`).
  Evidence for the sidecar stops at the SDK boundary; the platform packages are extrapolation.

## Access, the daemon's lease, and coming back (ORC-10)

```sh
node bin/orchestrator.mjs access pair-list                    --root <home> [--profile <name>]
node bin/orchestrator.mjs access pair-approve <code>          --root <home>
node bin/orchestrator.mjs access allow|revoke <platform> <user_id>          --root <home>
node bin/orchestrator.mjs access admin-add|admin-remove <platform> <user_id> --root <home>
```

`supercode orchestrator pair approve|list` and `access allow|revoke|admin add|remove` spawn exactly
these: the folder has one encoder (`save()`), and it is not in the Rust binary. Each verb loads the
home, applies the reducer's own `operator` event and saves; a verb the reducer refuses exits
non-zero with the reducer's own words and writes nothing it did not ask for. They are the COLD path
— for a running daemon the same verbs go through its socket (ORC-13).

- **Access lives in Hermes's own stores, and only there.** A platform is open when the profile's
  own `.env` sets `<PLATFORM>_ALLOW_ALL_USERS=true` (or `GATEWAY_ALLOW_ALL_USERS=true` for every
  platform); its allowlist is `<PLATFORM>_ALLOWED_USERS` plus the pairings Hermes approved
  (`platforms/pairing/<platform>-approved.json`). **A platform with neither is allowlist-only.**
  An unknown sender is answered with a pairing code from Hermes's own `PairingStore` (its expiry,
  rate limit and lockout) and nothing else: no worker starts.
- **Admins** are each platform's `allow_admin_from` / `group_allow_admin_from` in `config.yaml`:
  the tier whose numeric reply resolves a relayed permission prompt (§4.2). An allowlisted
  non-admin's number is an ordinary message.
- No other file grants access. `approve`, `allow`, `revoke` and `admin` go through Hermes's store
  and writers, live or cold.

The **lease** `<home>/orchestrator.lock` is written by this daemon, not by `supercode orchestrator
start`: one writer means a launchd/systemd-managed daemon reports the same lease a foreground one
does. The lock names the process and its machine (hostname, and Linux's boot id). A home whose
lock names a live process on this machine, since this boot, is refused; a lock naming a process
that is **gone**, or one another machine or an earlier boot wrote (a home on a volume the
sandbox before this one mounted), is the mark of a daemon that died, and the daemon dispatches
`restart` (§4.7) before it accepts anything. Nothing is signalled on the word of a lock from
elsewhere. `leaseIsLive` and `readLease` are observations; PID liveness never
authorizes stop. A clean stop removes its own lock, so an ordinary start replays nothing.

`supercode orchestrator stop --root <home> [--json]` requests the daemon's
incarnation-bound local control socket. Its issued lease names the canonical
home, host, boot and random incarnation. The daemon checks that exact record
before accepting shutdown, joins its owners and removes only its own unchanged
lease. The CLI sends no PID signal and deletes no lease. Old leases without an
incarnation refuse; their actual process/service owner retains shutdown authority.
JSON results name the selected daemon and `stopped`, `failed` or `refused`.
Lost replies or a five-second deadline report an unknown outcome and retain the
incarnation; there is no automatic retry. Shutdown continues in the daemon.
Successful completion concerns that incarnation; a service manager may launch a
successor. See the [stop contract](../../docs/adr/0165-the-complete-orchestrator-entry-is-owned-by-node.md#stop-names-the-issued-daemon-2026-10-19-t_b37f54c7).
Foreground start reports that same actual daemon only after its live control
door confirms the invocation's issued lease. A gateway re-exec never turns the
launcher PID into an invented daemon lease; unconfirmed startup refuses.
Channel close retains the actual Chat SDK platform/state disconnect results,
including failures swallowed by `chat@4.39.0` itself, and joins the owned gateway
and its pending work. A failed channel keeps its token claim and yields failed
stop/exit status; it cannot become `stopped` merely because SDK shutdown fulfilled.
The daemon retains its lease on cleanup failure. Passive webhook bodies are
cancelled on close while complete-body handlers already admitted are joined.
Ingress closes before adapter connection waits. Already-admitted bodies keep
their processing authority through asynchronous signature verification and are
joined before the loop's stopping event. Direct-delivery HTTP 202 follows dispatch
and persistence. Worker-backed HTTP 202 also waits for actual runtime input
handoff; a memory queue alone receives no success acknowledgement. Stop refuses
unsent input with retryable HTTP 503, joins sends already in progress, drains
internal completion events and records interrupted handed turns before teardown.
Refusal removes only that unhanded input's queue/turn and dedup entry, permitting
retry. Concurrent matching delivery IDs share the handoff result. Intentional
refusal permits clean stop; actual processing/cleanup failures still fail close.

On `restart`: every pending obligation goes out again, and every binding that held a lease is
re-opened. The lease table is never persisted (§2.8), so a lease start records `runtime_id` on the
binding's residue; the loop tries `runtimes.attach_existing` where the harness's registry row says
`attach_existing_process`, and otherwise marks the binding interrupted and tells its surface once
(`Session interrupted by a restart; send your message again.`). Cron and webhook surfaces get the
mark without the notice — nobody is reading them.

The repo's Hermes fixture home (`crates/harness/fixtures/hermes_home`) is a ready home to drive it
against by hand after the source tree's locked SDK dependencies are installed.
The source orchestrator selects that tree's Node front door; it requires no
debug native build. A source lock must explicitly bind Node at its exact root,
version and commit. Legacy native-bound declarations refuse until explicitly
re-pinned; no source lock or installed service is migrated by a command start.

## Board session cleanup

A manager or creator changing a card's assignee can release its ended worker
from a `needs_input` dialog. The board requires its retained reassignment and
release, a fresh reading of the exact harness/session, and an unexpired close
claim. It closes the pane through the owning board's door and retains the
reading; it sends no dialog key or approval response. Working turns, adopted sessions and panes held by an active successor keep
their existing protection. Unknown activity retains main’s native-record quiet
watch; this exception requires a positive needs_input reading for the exact
launched worker. The candidate's [source and package record](../../docs/evidence/board-reassignment-input-dialog-2026-10-10.md)
leaves native closing and replacement-launch qualification open.

## Remote card text

The npm front door's `workflow … --at sc:<machine>:board:<name>` uses
`prepareBoardText(argv)` from `@volter/supercode-orchestrator/board-input` before calling
the machine's board door. It returns `{ argv, stdin }`: the board parser selects a
comment's `--file` or a create/specify verb's `--body-file`, reads that file on the
caller (`-` reads standard input), and appends the selected file flag with `-`.
The last flag value wins, preserving the other arguments. Other verbs and help
do not read a text file. The helper opens no transport and makes no card write;
the daemon carries the input to the board owner under the caller's existing grants
and card permissions. See the [Teams guide](../../docs/guides/teams.md#call-a-board-on-another-machine).

## The operator door (ORC-13)

The orchestrator's WRITE door — what `supercode jobs|profiles|sessions <verb> --harness orchestrator`
drives, the way Hermes's write door is `hermes cron …` (§4.6). Volter Harness writes no file of this
folder: `save()` here stays the only writer, so the IR's byte-stability and residue rules hold by
construction.

Two doors, **one** implementation (`applyOperator` in `operator.mjs`); only how the event is
dispatched differs.

**Live** — the same socket the model-facing door uses, a second line family beside it, told apart by
the `op` key:

```
in   {"op":"jobs.create","args":{"prompt":"…","schedule":"every 30m"},"profile":"coder"}
out  {"ok":true,"result":{"ran":"created cron job job_… …","job_id":"…","job":{…}}}
     {"ok":false,"error":"jobs_delete: no job job_x"}
```

`op` is one of `jobs.create|update|pause|resume|run|delete`, `profiles.create|delete`,
`sessions.new|reset`, `sessions.launch|launch_status|launch_close` (live only: a concurrent session of the profile's
agent started on request, under a launch key; `supercode agent launch` drives them; a launch's refusal is answered
`{ok:false, error, code}` with `code` `conflict`, `budget` or `invalid_request`), `access.pair_approve`. The verb dispatches its `events.operator(...)` on the
**loop's own queue**, so an operator write is ordered against inbound messages and ticks like
anything else and the running loop's state and the folder can never disagree. `result` re-reads the
affected record out of state after the reducer ran.

**Cold** — the same verbs when no daemon is serving the home:

```
node bin/orchestrator.mjs <op> --root <home> [--profile <p>] [--at <rfc3339>] --json '<args>'
```

It loads, applies through `applyOperator`, performs the effects the loop would (`save`,
`remove_profile_dir`), prints the same `{ok, result}` line and exits 0, or 1 on a refusal.
`crates/harness/src/orchestrator_door.rs` picks between the two: the socket when
`<root>/orchestrator.lock` names a live pid *and* the socket answers, the CLI otherwise. A refusal on
the live door is final — only a broken socket falls through, so a verb the daemon already answered is
never run twice.

- **A refusal names its reason.** The reducer refuses by emitting a `warn` log effect and no `save`;
  that sentence becomes `{ok:false, error}` verbatim, and nothing is written.
- **`sessions.new|reset` name a BINDING by its SURFACE** (`platform|kind|chat_id|thread_id|participant_id`),
  not by a session id — a binding has none of its own. A surface with no live conversation refuses.
- **`profiles.delete` never unlinks.** It removes the record and emits `remove_profile_dir`, which
  renames the home to `profiles/.trash/<name>-<stamp>/`. A dot-prefixed folder is not a profile to
  either loader, so a trashed home neither loads nor lists.


## Hosted scheduled tasks

A host can retain its existing conversation and deterministic action runtime while
this package owns schedules, durable fire claims, run output and the operator socket:

```sh
supercode-orchestrator --root /instance/var/orchestrator \
  --executor-url http://127.0.0.1:5200/os/scheduled-task \
  --executor-token-file /instance/var/executor.token
```

The executor URL must be loopback HTTP. Its private token file contains at least
32 characters. Each authenticated POST carries `{root, profile, job, fire}`; the
host returns `{accepted: true, profile, fire_id, output, delivery?}` only after
accepting that exact fire. A delivery receipt is `{platform, chat_id, id}` and
confirms the submitted task, not a model's eventual answer. The output must say
which milestone it confirms. `jobs.create` accepts opaque JSON `metadata`, stored
in `job.residue.host`, and `enabled: false` for initially paused tasks.

Hosted execution starts no worker and uses no channel adapter. The host must
persist an idempotency record before its side effect, return the saved receipt
on duplicates, and refuse to repeat an uncertain dispatch. The daemon records
failed/timeout fires without replaying them; a restart advances a stale claim
once. `callOperator` addresses the live socket, with no cold-write fallback.
`Orchestrator({executeJob})` is the corresponding in-process API for embedders.

The daemon serves a home only while it holds the home's claim, Hermes's
`gateway.lock` (an flock the kernel releases when its holder dies). A second
daemon on the home waits for the claim and serves the home as soon as the first
is gone, however it ended; nothing fails closed or waits for a person. The
serving daemon records itself in `orchestrator.lock` for `supercode orchestrator
status` and the operator verbs; a normal stop removes only its own record. Native `jobs.resume` computes the first fire
for a job that was created paused with no next-run timestamp.

## Hosted daemon lifecycle

`stopHostedDaemon({ root, executorUrl?, timeoutMs? })` validates the hosted lease
and signals this package's daemon through its native shutdown handler. A foreign
root/executor is refused; the lease is retained until shutdown completes. The
helper does not clear a live lease or escalate to SIGKILL. Embedders can stop their
owned clock before disabling the integration and start it again on the next boot.
Hosted HTTP refusal messages preserve the executor's bounded JSON error reason.

Review source metadata admits four active GitHub reads and 64 waiting owners,
using four ordered source workers and a shared stored-token lookup. A source
verification reuses its one PR observation, retaining head and authority
checks; failed fetches retain their cause and available native code.
[The source record](../../docs/evidence/board-review-metadata-admission-2026-10-12.md)
states the current handoff and adoption limits.

## Board session custody

The candidate Node board CLI adds `supercode workflow detach <card> --to person:<id>`.
It retains the native identity, records the person's custody and removes the
dispatcher run, subscriptions and capacity counts without closing the session.
Queued effects and later continuation cannot take it back; the existing `adopt`
door must verify a live native session before the board owns it again.

The [command contract](../../docs/reference/board-session-detach.md) describes
authority, in-progress-operation refusals and already-issued-request boundaries.
[Source observations](../../docs/evidence/board-session-detach-2026-10-09.md)
cover actual help, compilation and read-only retained records. Live handback,
return through adoption and released availability remain unqualified.

## Readable card ids

Every card has a `readable_id` beside its number and native id, given by its
creator: `supercode workflow create "Voice calls" --readable-id voice-calls --root HOME`.
A create without one is refused. Names are a few lowercase words joined by
hyphens, start with a letter, have at most 32 characters and are unique on the
board, among open and ended cards alike. A subtask, which no person names, takes
one from its title; so do rows an older board or a hand-written document left
without one.

`workflow list`, `show`, `create`, capacity, notices and mail subjects lead with
the name (`voice-calls (VO-42 t_4406c88a)`), and every verb takes it where it
takes a card id. `workflow specify CARD --readable-id voice-calls --root HOME`
changes it; the same `readable_id` property is editable in a ztrack card's
metadata in `arcs.md`. A title edit keeps its existing id.

A new worktree card's branch and worktree folder are its readable id
(`voice-calls`, under a project's `<slug>/` for the branch), refused when another
card's branch already has that name. Until the card's worktree is first made, its
machine refuses a branch of that name already in the checkout or on origin, or a
folder of that name, that the card did not make; `main`, `master`, `publish` and the
repository's default branch are never a card's. Fresh sessions are named `voice-calls-3f`
(a reviewer's `voice-calls-reviewer-3f`). Card agents become
`implementer-voice-calls` or `reviewer-voice-calls`, with the same immutable agent
id and sessions; the ordinary delivery pass sends existing agents' renames to
the machine. The Workplace updates its existing principal and spoken name.
A card's recorded branch and worktree folder never follow a later rename, and
existing sessions keep their names. Merge and release remain separate from this
source behavior.
