Documentation
¶
Overview ¶
Package health composes read-only diagnostics for `semantica doctor`.
Each check returns one or more Check results without mutating state. Run combines them into a Report, and render.go formats the result.
Index ¶
Constants ¶
View Source
const SchemaVersion = 1
SchemaVersion is the JSON schema version for the doctor report. Increment on breaking changes to the JSON shape.
Variables ¶
This section is empty.
Functions ¶
func RenderJSON ¶
RenderJSON writes the report as pretty-printed JSON.
Types ¶
type Check ¶
type Check struct {
Category string `json:"category"`
ID string `json:"id"`
Status Status `json:"status"`
Message string `json:"message"`
Remediation string `json:"remediation,omitempty"`
}
Check is a single diagnostic result.
type Options ¶
type Options struct {
// RepoPath is the working repository (default: cwd). Hook,
// git-hook, and connect/auth checks are scoped to this repo.
RepoPath string
// DoctorBinary overrides `os.Executable()` for self-binary
// matching. Used by tests.
DoctorBinary string
// LookPath overrides exec.LookPath. Used by tests.
LookPath func(string) (string, error)
// Registry is the explicit hook-provider registry used by the
// hook-related checks (footguns, SQL inspection, provider hook
// installation). Production callers must set this from
// providers.NewHookRegistry(); the doctor command does so. A
// nil Registry is treated as the empty set: hook-related
// checks become no-ops and report no findings, which is
// useful only for tests that exercise the non-hook paths
// without wiring providers.
Registry *hooks.Registry
}
Options configure a doctor run. All fields are optional; zero values are safe defaults. Tests inject DoctorBinary and lookPath to avoid touching the real PATH.
type Report ¶
type Report struct {
SchemaVersion int `json:"schema_version"`
Result Status `json:"result"`
Summary Summary `json:"summary"`
Checks []Check `json:"checks"`
}
Report is the full doctor result.
Click to show internal directories.
Click to hide internal directories.