Skip to main content

stave validate

Validate inputs without evaluation

Usage

stave validate [flags]

Description

Validate controls, observations, and configuration for correctness without evaluation.

Validate checks structural and semantic correctness of all evaluation inputs before running the full apply pipeline. It catches schema violations, invalid timestamps, and cross-file inconsistencies early, reducing time spent debugging failed evaluations.

What it checks:

  • Control schema (id, name, description)
  • Observation schema and timestamps
  • Cross-file consistency and time sanity
  • Duration format and feasibility

Inputs: --controls, -i Path to control definitions (default: controls) --observations, -o Path to observation snapshots (default: observations) --in Single input file or '-' for stdin --kind Contract kind: control|observation|finding (requires --in) --schema-version Contract schema version override --max-unsafe Maximum allowed unsafe duration --eval-time Evaluation reference timestamp (RFC3339) for deterministic output --format, -f Output format: text or json (default: text) --strict Treat warnings as errors (exit 2) --fix-hints Print remediation hints after issues --quiet Suppress output --template Custom output template

Outputs: stdout Validation report listing issues found (text or JSON) stderr Error messages (if any)

Exit Codes: 0 - All inputs are valid; no issues found 2 - Invalid input or validation failure (also used in --strict mode for warnings) 130 - Interrupted (SIGINT)

Examples:

Validate project controls and observations

stave validate

Validate with JSON output

stave validate --format json

Validate a single file from stdin

cat control.yaml | stave validate --in - --kind control

Strict mode: treat warnings as errors

stave validate --strict

Offline-only: reads local files; makes zero network connections; no cloud credentials.

Flags

FlagTypeDescription
--assert-recentstringFail if no snapshot newer than this duration (e.g. 48h)
-i, --controlsstringPath to control definitions (inferred if omitted) (default: controls)
--eval-timestringEvaluation reference timestamp (RFC3339). Durations and temporal risk are measured against this time. Defaults to wall clock.
--fix-hintsboolPrint remediation hints after issues
-f, --formatstringOutput format: text or json (default: text)
--instringSingle input file or '-' for stdin
--kindstringContract kind: control|observation|finding
--max-unsafestringMaximum allowed unsafe duration Resolved default may come from STAVE_* env vars, stave.yaml, user config, or built-in.
-o, --observationsstringPath to observation snapshots (inferred if omitted) (default: observations)
--schema-versionstringContract schema version override
--strictboolTreat warnings as errors (exit 2)
--templatestringCustom output template

Examples

stave validate --controls controls/s3 --observations observations