Forma Orchestrator: CLI and operations
The orchestrator ships one operational binary, formasl_orchestrator, and one
executor binary, orch_executor. The CLI has four subcommands — provision,
cycle, status, demo — and one law that shapes everything else: it fabricates
nothing. Every identity, authority and admission input is either restored from
persisted coordinates the operator passes explicitly (OwnerRuleRef::restore and
kin — restore confers no standing and mints nothing), or read from the closure
provisioning envelope verified by its own identity digest. There are no default
serials, no fallback identities, no implicit authorities; a missing required flag is
a usage refusal, never a guess.
Every example below was executed against the real binaries; outputs are verbatim.
Building and running the executor
cargo build -p formasl-orchestrator --bins
The executor is an independent OS process: it binds a loopback port, performs real local effects for the dispatches it receives, prints its port for the provisioning act, and serves until killed:
$ orch_executor <node> <effects-dir>
node=cli-node
PORT=46679
Effects land in <effects-dir>/<node>/<target>.effect, written with the exact payload
bytes that crossed the wire. The roster entry’s node label names the executor
process — the effects directory follows the executor’s own node name, and the
endpoint (ip:port) is what routes dispatches.
The four subcommands
provision is the first authorized provisioning act (BOOT-P1): it opens the
designated control state, establishes the first fence generation, and publishes the
initial durable registration — checkpoint, fence, roster, rollout — so the state is
complete from birth. It writes a production marker (provisioning.json) whose
failure to land means the provision did not happen. A second provisioning for the
same designated state is refused:
$ formasl_orchestrator provision --deployment book-example --root rel2/control ...
provisioned book-example generation Some(2)
$ formasl_orchestrator provision --deployment book-example --root rel2/control ...
activation refused: WriterExclusivityNotEstablished { root: "rel2/control" }
cycle is recovery-only: it reopens the designated state (never provisions
another one) and runs one level-triggered cycle. Against a never-provisioned root it
fails closed — the missing state is never auto-created (BOOT-N2):
$ formasl_orchestrator cycle --root rel/control ...
activation refused: ControlStateLost { designated: "rel/control" }
A working cycle evaluates the desired artifact, dispatches under the exact-coordinate authority, and settles over the real socket; a repeated cycle at the same revision coalesces with zero new exposure:
$ formasl_orchestrator cycle --root control ... --artifact plan.fsl --rev 1 --payload amount=10 --authority-origin plan-decision.fsl --authority-serial 105
DispatchedAndSettled { operation: ExecutionOperationId { origin: ContractRevisionRef { artifact: "plan.fsl", revision: 0 }, serial: 0 } }
wire_exposures 1
$ formasl_orchestrator cycle --root control ... --rev 1 ...
Coalesced { artifact: "plan.fsl", revision: 1 }
wire_exposures 0
status inspects the persisted control state — the durable fence generation and
the checkpoint entry count:
$ formasl_orchestrator status --root control
generation 6
checkpoint_entries 1
The generation is a publication counter, not a cycle counter: each cycle advances it
twice (one claim at activation, one publication at the checkpoint), so a healthy
deployment’s generation grows monotonically with activity. On a never-provisioned
root, status reports generation 0 and checkpoint_entries 0 without touching
anything.
demo exists to show the loop end-to-end with a fully synthetic designation —
fixed coordinates, no production provenance — and it says so on every run. The
separation is enforced, not just announced: the demo refuses to drive a
production-provisioned control state.
$ formasl_orchestrator demo --root demo-control --endpoint 127.0.0.1:46679 --node demo-node --target Deploy --artifact demo-desired.fsl --rev 1 --payload demo-payload
=== DEMONSTRATION MODE — synthetic designation, NO production provenance ===
DispatchedAndSettled { operation: ExecutionOperationId { origin: ContractRevisionRef { artifact: "demo-desired.fsl", revision: 0 }, serial: 0 } }
wire_exposures 1
$ formasl_orchestrator demo --root rel2/control ...
=== DEMONSTRATION MODE — synthetic designation, NO production provenance ===
demo refused: rel2/control is a PRODUCTION-provisioned control state
The demo’s reconcile-or-provision convenience exists nowhere else: the productive
cycle never provisions.
The provisioned-coordinate flag set
Because nothing is fabricated, provision and cycle require the full designation
coordinate set. The durable set (both subcommands) names the deployment, root, node,
endpoint, target, action, the basis artifact, the binding and requirement identities
with their origin artifact and serials, the candidate capability origin/revision/
serial, the runtime binding, the adapter registration serial, the observer rule
coordinates, the evaluation gas, and the provisioned outcome-classification policy —
--guarantee-claim and --not-applied-statuses are operator flags, never binary
constants. cycle adds the desired artifact, its revision, the payload, and the
authority coordinates (--authority-origin, --authority-serial). An admission
closure may be supplied with --closure as the canonical provisioning envelope;
absent, the generic path is preserved.
Omitting a required flag is a typed usage refusal:
$ formasl_orchestrator cycle --root control ... --payload amount=10
missing required --authority-origin
The exit contract
| Code | Class | Meaning |
|---|---|---|
| 0 | settled / coalesced / cancelled | the cycle’s lanes all reached definite, lawful outcomes |
| 3 | uncertainty | a lane is DispatchedUncertain or has an open window-law resolution — an exposure may have occurred |
| 4 | typed refusal | activation, admission, provision or usage-input refusal (nothing fabricated, nothing dispatched) |
| 5 | persistence error | the cycle could not durably publish — never reported as operational success |
| 64 | usage | missing or malformed required flag |
The classes dominate in a fixed order, and the order is the safety property: a mechanism refusal never masquerades as a persistence failure, and uncertainty dominates refusal — an operator must never read “typed refusal” (4) on a cycle where an exposure may have occurred. A persistence-blocked cycle demonstrates the honesty concretely: the dispatch happened (the executor performed the effect — the marker holds the payload bytes) but the exit is 5:
$ formasl_orchestrator cycle --root control ... --rev 2 --payload amount=20 ...
DispatchedAndSettled { operation: ExecutionOperationId { origin: ContractRevisionRef { artifact: "plan.fsl", revision: 0 }, serial: 1 } }
wire_exposures 1
persistence_error: checkpoint write: Is a directory (os error 21)
The remedy is the recovery path — durability and recovery walks it — never a re-provision.
Operator diagnostics
status is the first probe: a non-zero, advancing generation with a stable
checkpoint count is a healthy, converged deployment. Activation refusals are always
typed and are journaled outside the control state they could not open, in an
activation-refusals sibling directory — the record never depends on the
inaccessible state. The typed refusal names the law that fired
(ControlStateLost, ControlStateCorrupt, WriterExclusivityNotEstablished,
InitialPublicationRefused), and each maps to a distinct recovery procedure, covered
in the next chapter.