Skip to main content

Diagnose Schema — diagnose.v1

This page documents the JSON output contract for stave diagnose --format json.

The contract is validated at runtime against the embedded schema:

  • schemas/diagnose/v1/diagnose.schema.json

Top-Level Structure

{
"schema_version": "diagnose.v1",
"report": {
"diagnostics": [ ... ],
"summary": { ... }
}
}
FieldTypeRequiredDescription
schema_versionstringYesAlways "diagnose.v1"
reportobjectYesDiagnose report payload

report.diagnostics[]

Each diagnostic explains one likely cause for unexpected evaluation outcomes.

FieldTypeRequiredDescription
casestringYesDiagnostic category
signalstringYesShort diagnosis signal
evidencestringYesSupporting evidence text
actionstringYesSuggested corrective action
commandstringNoOptional command hint

report.summary

FieldTypeRequiredDescription
total_snapshotsintegerYesNumber of loaded snapshots
total_assetsintegerYesNumber of assets observed
total_controlsintegerYesNumber of controls loaded
time_spanintegerYesObservation span (nanoseconds duration)
min_captured_atstring (RFC3339)YesEarliest snapshot time
max_captured_atstring (RFC3339)YesLatest snapshot time
evaluation_timestring (RFC3339)YesEffective evaluation time (--now or runtime clock)
max_unsafe_thresholdintegerYesMax unsafe threshold (nanoseconds duration)
violations_foundintegerYesViolations count in evaluated result
attack_surfaceintegerYesAttack surface assets count

Minimal Example

{
"schema_version": "diagnose.v1",
"report": {
"diagnostics": [],
"summary": {
"total_snapshots": 2,
"total_assets": 5,
"total_controls": 12,
"time_span": 86400000000000,
"min_captured_at": "2026-01-10T00:00:00Z",
"max_captured_at": "2026-01-11T00:00:00Z",
"evaluation_time": "2026-01-11T00:00:00Z",
"max_unsafe_threshold": 604800000000000,
"violations_found": 0,
"attack_surface": 0
}
}
}