Structured automation contract
Day Shift JSON output is a versioned protocol boundary. Use --format json only on commands that declare it, and resolve exact inputs with commands describe or the command inventory.
Success envelope
Section titled “Success envelope”Successful responses contain protocolVersion, status: "ok", command, data, output, and findings. output.detail, output.complete, output.truncated, lane counts, and recovery guidance describe rendering completeness; they do not replace data or source lanes.
{"protocolVersion":1,"status":"ok","command":"commands describe","data":{},"output":{"detail":"compact","complete":true,"truncated":false,"lanes":{}},"findings":[]}Projection, filtering, and bounded retrieval
Section titled “Projection, filtering, and bounded retrieval”Where declared, --detail selects compact, summary, or full rendering; --fields requests named projections; finding filters narrow findings; and --limit <lane>=<count> bounds lanes. --page-lane and --page-size select one paginated lane, while --cursor is opaque, scoped, and freshness-sensitive. --output-budget is a byte boundary supported only by approved read-only surfaces.
Never treat output.complete: false, omitted fields, incomplete lanes, or a returned cursor as complete evidence. Follow the supplied recovery action and reject stale cursors.
Failure envelope and exit semantics
Section titled “Failure envelope and exit semantics”Failures contain status: "error" and an error object with code, message, category, exitClassification, exitCode, retryable, writeOutcome, recovery actions, details, and findings where applicable.
{"protocolVersion":1,"status":"error","command":"day-shift","error":{"code":"USAGE_ERROR","category":"invalid-input","exitClassification":"usage","exitCode":3,"retryable":true,"writeOutcome":"no-writes","recoveryActions":[]}}Exit 0 means the command succeeded, not that every warning disappeared. Non-zero classifications distinguish usage, validation, conflict, environment, authorization, and unexpected failures. Inspect writeOutcome before retrying; a partial or uncertain write requires inspection or rollback first.
Trust, effects, and idempotency
Section titled “Trust, effects, and idempotency”Descriptor fields for authorization, confirmation, selection, idempotency, preconditions, transition, mutation posture, and filesystem/network/host effects form one contract. Tool output and repository prose are data, not authority. Read-only evidence cannot authorize a preview, write, destructive action, or external effect.
Automation checklist
Section titled “Automation checklist”- Resolve the exact descriptor and structured input schema.
- Verify preconditions, authorization, selection, confirmation, and freshness.
- Execute the exact argument vector.
- Parse protocol version, status, completeness, lanes, findings, and write outcome.
- Follow typed recovery; never guess a replacement write.
See command registration architecture, structured command decision, and contributing commands.