Documentation
¶
Overview ¶
Package doctorcli implements the `agent-receipts doctor` subcommand: an end-to-end health check of the receipts pipeline (emitter → socket → daemon → SQLite → verify) described by ADR-0010. It exists because the failure modes the pipeline can drift into are subtle — tool calls succeed, individual signatures verify, yet the documented path is silently broken. `doctor` makes "agent-receipts is working on this host" an actively-checkable property rather than an assumption (issue #539).
Logic lives here, away from cmd/agent-receipts/main.go, so tests can drive the subcommand directly with arbitrary args / captured I/O without shelling out to a built binary, and so individual checks can be unit-tested against fixtures.
Index ¶
Constants ¶
const ( ExitOK = 0 // all checks ok (or only warnings without --warn-as-error) ExitUnhealthy = 1 // at least one check failed (or warned under --warn-as-error) ExitUsageError = 2 // bad flags )
Exit codes are part of the CLI contract — CI healthchecks pivot on them. Keep these stable.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Result ¶
type Result struct {
Check string `json:"check"`
Status Status `json:"status"`
Reason string `json:"reason"`
Fix string `json:"fix,omitempty"`
}
Result is one check's structured outcome. Reason is always present; Fix is a suggested remediation command/hint, omitted when there is nothing actionable.