Skip to main content
A SOP (standard operating procedure) is how a machine does the same job the same way every time. It names what starts it, lists the steps in order, and says which tools each step may call. The SOP engine runs it, tracks each run, and enforces approvals. A SOP lives in a directory with two files:
SOPs installed by a plugin package go to <sops_dir>/<package name>/. The default directory is ~/.kinetic/sops.

SOP.toml

string
required
The procedure name.
string
required
What it does. The model sees this when deciding whether to run it.
string
default:"normal"
low, normal, high, or critical.
string
default:"supervised"
How much human approval the run needs:
integer
default:"0"
Minimum time between runs.
integer
default:"1"
How many runs may be active at once.
string
default:"parallel"
What happens when a trigger fires and no run slot is free: parallel defers it, hold admits only when no run of this SOP is active, coalesce drops it because the in-flight run covers it, drop discards it.
string
The agent alias that owns runs. Required when any trigger other than manual can start the SOP, because a hardware event or a cron tick has no conversation to borrow an agent from. Quickstart names the agent device.

Triggers

A SOP can have several [[triggers]]. Any one of them starts a run.
A board sent {"event":"message","signal":"keypad","text":"1234"} over serial. Matched as board/signal. The text is the payload.
The runtime also supports filesystem (path glob and change kinds), channel (an inbound message on a channel), and amqp (routing key) triggers. Conditions filter a trigger against its payload. $.path.to.field >= 85 reads a JSON field. A bare comparison such as > 0 treats the whole payload as a number. An empty condition always matches. A condition that cannot be evaluated does not match.

Steps

SOP.md must contain a ## Steps section. Each numbered item is a step. Leading bold text is the step title, and the rest of the line is its body. Sub-bullets set step properties: Any other sub-bullet is added to the step body as instructions.

Passing data between steps

A planned call’s arguments can refer to output captured from earlier steps with {{steps.N.path}}, or to an earlier call in the same step with {{calls.K.path}}:

Ending with an attestation

A procedure that completes a business operation should end by calling monad_attest with the operation record. With a record schema configured, the record is checked, canonicalized, attested, and stored as one line. That line is what the owner can later list for sale.

Inspecting runs

pending, approve, deny, and logs talk to the running daemon. The agent can also check runs with the sop_status tool and approve a waiting step with sop_approve.