Skip to content

Operation YAML reference ​

Field tables below are derived from src/schemas/operation.schema.json, the same schema samaritan validate enforces and samaritan schema exports.

For guides and worked examples see the operation authoring pages; this page is the exhaustive field list.

Operation ​

Top-level fields of an operation document.

FieldTypeRequiredDefaultDescription
namestringyes—Operation name (min length 1)
versionstringyes—Semantic version (e.g., 1.0.0) (pattern ^\d+\.\d+\.\d+$)
descriptionstringno—Operation description
authorstringno—Operation author
categorystringno—Operation category
overviewobjectno—Flexible overview/metadata section with custom fields (e.g., Release Date, Release Notes, etc.)
needsstring[]no—Required operation dependencies
usesstringno—Marketplace operation reference
withobjectno—Parameters for marketplace operation
environmentsobject[]no—Environments this operation targets. Each entry declares a name and its variable values; an entry may instead be { uses: <file> } to import an environment manifest wholesale. (min items 1)
variablesobjectno—Variables shared across all environments (convenience alias of common_variables; common_variables wins on key conflict)
common_variablesobjectno—Common variables shared across all environments (can be overridden by environment-specific variables)
env_filestringno—Path to .env file for loading variables (lowest priority in variable lookup)
sessionsobjectno—Named tmux sessions for execution engine (map of session name -> config). ${VAR} in a session name/key is resolved against common variables, so sessions can be derived from e.g. a ticket id.
runobjectno—Run-mode configuration for the execution engine
stepsobject[]yes—The ordered steps of the operation. An entry may instead be { uses: <file>, with: {...} } to expand the steps of another file inline. (min items 1)
rollbackobjectno—Operation-level rollback plan, offered as [g] global rollback at any step prompt during a run.
metadataobjectno—Provenance for the operation document. Normally populated automatically and embedded in generated manuals rather than authored by hand.

Environment ​

Entries of environments:. An entry may instead be { uses: <file> } to import an environment manifest wholesale.

FieldTypeRequiredDefaultDescription
namestringyes—(min length 1)
fromstringno—Inherit environment definition from manifest
descriptionstringno—
variablesobjectno—
targetsstring[]no—
approval_requiredbooleanno—
validation_requiredbooleanno—
restrictionsstring[]no—

Step ​

Entries of steps:. A step may instead be { uses: <file>, with: {...} } to expand the steps of another file inline.

FieldTypeRequiredDefaultDescription
idstringno—
namestringyes—(min length 1)
typeautomatic | manual | approval | conditionalyes—
phasepreflight | flight | postflightno—Execution phase of the step
descriptionstringno—
commandstringno—
scriptstringno—Path to an external shell script (relative to operation file). Content is read and embedded in generated manuals.
instructionstringno—
ifstringno—Condition for conditional steps
timeoutnumberno—(min 0)
estimated_durationnumberno—(min 0)
envobjectno—
usesstringno—Path to a file whose steps are expanded inline here (relative to operation file)
withobjectno—Variables to pass to the included file (all ${VAR} placeholders must be provided)
variablesobjectno—Step-scoped variables that override environment and common variables
evidenceobjectno—
continue_on_errorbooleanno—
needsstring[]no—
sub_stepsStep[]no—
manual_overridebooleanno—
manual_instructionsstringno—
ticketstring | string[]no—Bug/issue ticket references
foreachForeachno—Loop/matrix support for repeatable steps
section_headingbooleanno—If true, render as a new markdown heading instead of table row
picstringno—Person In Charge for this step
reviewerstringno—Reviewer/buddy who monitors and verifies the PIC's work
sessionstringno—Named tmux session to use for this step (execution engine)
captureobjectno—Extract named values from command output for use in later steps
expectstring | Expect config | Expect config[]no—Assert this step's output. String shorthand = expect contains.
verifystring | objectno—DEPRECATED - use expect: instead. Backward-compatible shorthand only: a bare string, or an object whose expect key is lifted into expect. EVERY OTHER KEY IS DISCARDED - in particular verify.command: is silently dropped and never runs. There is no separate verification command: a step runs its own command:, and expect is matched against that output. (deprecated)
timelinestring | objectno—Expected date/time or duration for this step (string or structured format)
optionsobjectno—Step-level rendering and substitution options
whenstring[]no—Conditional rendering: only show this step for specified environments (min items 1)
variantsobjectno—Environment-specific step overrides (can override any step field except 'when' and 'variants')
rollbackRollback step[] | Rollback stepno—Rollback steps for this step. A rollback step is a full step with the same field surface (see the Rollback step reference). Array format preferred; object format accepted for backward compatibility (parser normalizes to array).
retryobjectno—
approvalobjectno—

Expect config ​

Assertion rules used by expect: on a step, sub-step or rollback step.

FieldTypeRequiredDefaultDescription
containsstringno—
not_containsstringno—
equalsstringno—
matchesstringno—
not_emptybooleanno—
any_line_containsstringno—
no_line_containsstringno—
all_lines_matchstringno—
any_line_matchesstringno—
no_line_matchesstringno—
line_countnumberno—(min 0)
line_count_gtenumberno—(min 0)
numeric_gtenumberno—
numeric_ltenumberno—
jsonpathstringno—
equals_capturedstringno—
retryobjectno—

Rollback step ​

Entries of a step-level or operation-level rollback.steps: list.

FieldTypeRequiredDefaultDescription
idstringno—
namestringno—
typestringno—
phasepreflight | flight | postflightno—Execution phase of the step
ifstringno—Condition for conditional steps
descriptionstringno—
commandstringno—
scriptstringno—Path to an external shell script whose content is embedded in the manual
instructionstringno—
timeoutnumberno—(min 0)
estimated_durationnumberno—(min 0)
envobjectno—
usesstringno—Path to a file whose steps are expanded inline here as rollback steps (relative to operation file). Same file composition as normal-step uses: — expanded at parse time into a flat list of rollback steps.
withobjectno—Variables to pass to the included file (all ${VAR} placeholders must be provided)
variablesobjectno—Step-scoped variables that override environment and common variables
sessionstringno—Session to run rollback in (defaults to step session)
picstringno—Person In Charge of executing this rollback step
reviewerstringno—Reviewer/buddy who verifies this rollback step
continue_on_errorbooleanno—
needsstring[]no—
manual_overridebooleanno—
manual_instructionsstringno—
section_headingbooleanno—If true, render as a new markdown heading instead of table row
foreachForeachno—Loop/matrix support for repeatable steps
captureobjectno—Extract named values from command output for use in later steps
ticketstring | string[]no—Bug/issue ticket references
timelinestring | objectno—Expected date/time or duration for this step (string or structured format)
whenstring[]no—Conditional rendering: only show this step for specified environments (min items 1)
variantsobjectno—Environment-specific step overrides (can override any step field except 'when' and 'variants')
retryobjectno—
approvalobjectno—
evidenceobjectno—
expectstring | Expect config | Expect config[]no—Assert this rollback step's output. String shorthand = expect contains.
verifystring | objectno—DEPRECATED - use expect: instead. Backward-compatible shorthand only: a bare string, or an object whose expect key is lifted into expect. EVERY OTHER KEY IS DISCARDED - in particular verify.command: is silently dropped and never runs. There is no separate verification command: a step runs its own command:, and expect is matched against that output. (deprecated)
sub_stepsRollback step[]no—Nested rollback sub-steps, rendered recursively under this step
optionsobjectno—Step-level rendering and substitution options

Rollback plan ​

The operation-level rollback: object.

FieldTypeRequiredDefaultDescription
automaticbooleanno—Marks the plan as automatic. Non-interactive execution is NOT implemented - see ROADMAP.md; the plan is still offered interactively.
conditionsstring[]no—Human-readable conditions under which this rollback plan should be run
aggregate_step_rollbacksbooleannofalseWhen true, the global rollback also groups every step's own rollback (reverse step order), appended after the explicit steps below. In generated manuals this centralizes per-step rollbacks: each step's inline rollback collapses to a jump-link into the Rollback Plan (which carries the anchor target) and the duplicate Rollback Procedures section is dropped. Lets operators author rollback next to the step it undoes while still seeing/running one consolidated recovery.
stepsRollback step[]no—Explicit rollback steps, run in the order given

Metadata ​

FieldTypeRequiredDefaultDescription
created_atstringno—When the operation was created (ISO 8601)
updated_atstringno—When the operation was last modified (ISO 8601)
sourcestringno—Where the operation originated (e.g. the source file or template it was created from)
git_hashstringno—Git commit the operation was generated from, for traceability

Step sub-objects ​

evidence ​

FieldTypeRequiredDefaultDescription
requiredbooleanno—
types(screenshot | log | command_output | file | photo | video)[]no—
resultsobjectno—Environment-keyed evidence results (e.g., { staging: [...], production: [...] })

options ​

Step-level rendering and substitution options

FieldTypeRequiredDefaultDescription
substitute_varsbooleannotrueSubstitute ${VAR} in instruction and command (default: true)
show_command_separatelybooleannofalseShow command in separate section from instruction (default: false)

retry ​

FieldTypeRequiredDefaultDescription
attemptsnumberno—(min 1)
delaynumberno—(min 0)
backofflinear | exponentialno—

approval ​

FieldTypeRequiredDefaultDescription
requiredbooleanno—
approversstring[]no—
timeoutstringno—

Foreach ​

Loop a step over one variable or a matrix of variables.

FieldTypeRequiredDefaultDescription
varstringyes—Variable name to use in iteration (min length 1)
valuesany[]yes—Array of values to iterate over (min items 1)
FieldTypeRequiredDefaultDescription
matrixobjectyes—Matrix of variables for cartesian product expansion
includeobject[]no—Additional specific variable combinations to include
excludeobject[]no—Specific variable combinations to exclude

Released under the ISC License.