Saphan StudioDocs
Reference/Commands

saphan channel

Inspects and repairs the channel documents of a stream: the orders, status reports and review notes exchanged between Saphan Studio and the agents working on it, kept in the channel store.

Inspects and repairs the channel documents of a stream: the orders, status reports and review notes exchanged between Saphan Studio and the agents working on it, kept in the channel store. The store is append-only, so a document that lands there is never edited afterwards. Most documents are written automatically by saphan run and saphan return; the subcommands here list them, count them, and land the few that a person writes or that an outage kept out of the store.

saphan channel backfill

Lands the channel documents a finished stream's teardown archived but the store does not hold, so saphan teardown can proceed. It reads only the stream's own archive under the workspace, checks every file against the archive's checksum manifest, and refuses the whole act on any mismatch. A backfilled document is marked as such and never reads as a returned one. Prefix with saphan dry-run to see what would land without writing anything.

saphan channel backfill --stream <slug>
flagtypedefaultwhat it does
--filestringLand only this archived file (for example _EXEC_STATUS.md) instead of every archived document the store lacks.
--jsonboolfalsePrint the result as JSON.
--streamstringThe stream whose archive is read and whose documents are landed (required).

saphan channel census

Counts, for each kind of channel document, whether anything writes it, how many documents exist, how many of them carry a valid signature this machine can verify, and how many of the documents found in worktrees on disk also reached the store. Every unreadable document is listed by id with the reason. A second table shows, per store bucket and write method, whether anything in this build writes it.

saphan channel census
flagtypedefaultwhat it does
--jsonboolfalsePrint the census as JSON.
--workspacestringThe workspace whose worktrees are scanned for documents on disk; defaults to the current workspace.

saphan channel close

Closes the channel of an executor whose process has died, so the stream is no longer shown as running. The check and the closing write to the executor's status file are made on the host that ran it: a process that is still alive is refused, and so is a host that cannot be reached, since neither proves the process is gone. A stream with no running entry in the run record, or more than one, is refused.

saphan channel close <stream>
flagtypedefaultwhat it does
--actorstringThe name recorded as closing the channel; defaults to SAPHAN_ACTOR, then the identity in your configuration. It is recorded, not authenticated.
--jsonboolfalsePrint the result as JSON.

saphan channel ls

Lists the channel documents stored for one stream.

saphan channel ls <stream>
flagtypedefaultwhat it does
--db-namestringsaphan_workThe store database to read; defaults to the channel store your configuration names.
--db-urlstringhttp://127.0.0.1:5984The store's base URL; defaults to the channel store your configuration names. ⚠ The configured channel-store user name and password are sent to whatever address you give, including plain http://, so name only a store you trust with them.

saphan channel put

Lands a hand-written document in the channel store: a train order (train-order, a plan spanning several streams), a coordinator's order for one stream (master-order) or a verification note (master-verify, which needs --round). Documents of a kind that has a grammar are checked in full first, and a malformed one is refused with the first error and the smallest document that would pass. Kinds Saphan Studio writes itself are refused, naming the command that writes them. Re-running with identical content is harmless.

saphan channel put --stream payments-refactor --kind master-verify --round 2 VERIFY.md
saphan channel put --stream <slug> --kind <doc-type> [--round <N>] <path>
flagtypedefaultwhat it does
--jsonboolfalsePrint the result as JSON.
--kindstringThe document kind (required); only train-order, master-order and master-verify are accepted, and the other kinds are refused with the command that writes them.
--move-worktreeboolfalseConfirm that a re-landed master-order deliberately moves the stream's registered worktree; without it, such a move is refused.
--roundint0The round a verification note belongs to; required for master-verify and refused for every other kind, whose round is worked out from the store.
--streamstringThe stream the document belongs to (required).

saphan channel recover

Lands channel documents that exist in a stream's worktree but never reached the store, for example because the store was unreachable when the round ran, so the stream can move again. It reads only the stream's own worktree; you choose the stream, never a path. Each recovered document carries a mark stating only that these bytes were in the worktree when read. A later saphan return will accept a recovered order, but a gate will not accept a recovered review verdict.

saphan channel recover --stream <slug>
flagtypedefaultwhat it does
--allboolfalseRehearse recovery for every stream in the workspace and report the results grouped by outcome; only valid with the saphan dry-run prefix and never writes.
--jsonboolfalsePrint the result as JSON.
--streamstringThe stream whose worktree is read and whose documents are landed.

Global options apply to every command — see Every command.

On this page