Saphan StudioDocs
Reference/Commands

saphan doc

Checks record documents — orders, status returns, review returns, train orders, relays, notices and defect reports — against the format each family requires.

Checks record documents — orders, status returns, review returns, train orders, relays, notices and defect reports — against the format each family requires. Run it with a subcommand.

saphan doc census

Checks every *.md file in one directory against a family's rules and prints one row per file: what the file says about itself and every rule it missed. It writes nothing and exits 0 even when every file fails, because it is a report, not a gate (an unreadable directory or unsupported family exits 1); use saphan doc check to gate one document. It does not descend into subdirectories, and the limits of what it reads are printed as remark: lines.

saphan doc census --family defect ./bugs --json
saphan doc census <dir>
flagtypedefaultwhat it does
--familystringdefectThe family whose rules judge every file; only defect is supported for a directory today.

saphan doc check

Validates one document against its family's rules and, on a refusal, prints the smallest document that would pass so you can compare. With the default --family auto it identifies the family from the document's first heading and exits 0 when it recognises none; naming a family is a claim the document must meet.

Exit codes: 0 valid (or no family recognised) · 1 bad invocation · 2 checked and failed · 3 nothing was checked, under --require-checked or --record. A document that was not checked prints UNMEASURED, never ok.

saphan doc check --family exec-status _EXEC_STATUS.md --json
saphan doc check <file>
flagtypedefaultwhat it does
--actorstringThe name recorded on the receipt --record writes, as given and not verified; defaults to SAPHAN_ACTOR, then the configured identity.
--as-returnboolfalseAssert that this status or review-status document is an agent's return, and refuse it (doc-skeleton-not-a-return, exit 2) if it is still the untouched template the engine wrote. ⚠ With --record, the receipt is written before this check runs, so a refused template can still leave a receipt.
--familystringautoThe document family to check against: auto (the default, detected from the first heading), defect, exec-status, master-order, notice, order, relay, review, review-status or train-order; a defect report is only checked when you name defect.
--recordboolfalseAfter a passing check, write a receipt to the record holding the document's digest and the stream named in its first heading; needs --workspace, never records a failing document, and cannot record a defect report, which names no stream.
--require-checkedboolfalseRefuse with doc-unmeasured (exit 3) when nothing was validated, so a script can tell "checked and clean" from "not checked".

Global options apply to every command — see Every command.

On this page