Skip to content

DiagnosticsService

Defined in: src/diagnostics.ts:133

Server-side environment-readiness diagnostics (issue #623). Fans 7 dependency probes with Promise.all behind a TTL cache. Mirrors HerdrUpdateService: injectable runners for unit tests, check(now) (force re-run), current(now) (TTL-cached read).

Payload purity: every probe returns exactly { id, state, hintKey } where hintKey is a UI message-key STRING. No raw stdout, tokens, absolute paths, or account identity ever crosses into the snapshot — the gh probe inspects exit code only, the tailscale probe parses structured output into tri-state.

Timeout discipline: each probe is wrapped so a timeout/throw RESOLVES to its defined non-OK state — the Promise.all batch never rejects.

new DiagnosticsService(deps?): DiagnosticsService

Defined in: src/diagnostics.ts:144

DiagnosticsDeps = {}

DiagnosticsService

check(now): Promise<DiagnosticsSnapshot>

Defined in: src/diagnostics.ts:357

Force a fresh run of all probes; sets the TTL cache. A probe that throws / times out resolves to its defined non-OK fallback — the batch never rejects.

number

Promise<DiagnosticsSnapshot>


current(now): Promise<DiagnosticsSnapshot>

Defined in: src/diagnostics.ts:380

TTL-cached read: returns the cached snapshot when fresh, else re-checks.

number

Promise<DiagnosticsSnapshot>


fix(checkId, now): Promise<DiagnosticsSnapshot>

Defined in: src/diagnostics.ts:391

Run the verbatim remediation for checkId’s current hintKey, then force a fresh probe and return the new snapshot. Throws if the check is unknown or has no auto-fix command (guidance-only / prose-only). A failing command REJECTS (fail-closed) — the caller maps that to an explicit failure, never a false pass.

string

number

Promise<DiagnosticsSnapshot>