Skip to content

feat(doctor): add health check command for config and tooling - #92

Merged
LukasHirt merged 2 commits into
mainfrom
feature/doctor-command
Jul 21, 2026
Merged

feat(doctor): add health check command for config and tooling#92
LukasHirt merged 2 commits into
mainfrom
feature/doctor-command

Conversation

@LukasHirt

Copy link
Copy Markdown
Owner

Summary

  • Add extctl doctor — a read-only health check of the local installation: parses extctl.yaml and flags unsupported keys (e.g. the dangling top-level scaffold: block, derived via reflection over Config's yaml tags so the check can't drift out of sync), flags required-but-empty fields (jira.base_url, jira.project, target_repo.remote), confirms EXTCTL_JIRA_EMAIL/EXTCTL_JIRA_TOKEN are set, confirms git/gh/claude/docker/pnpm (and ffmpeg if media capture is enabled) are on PATH, confirms referenced prompt/idea-pool/scaffold paths exist, and reports the shape of target_repo.checkout.
  • Makes no network calls and never mutates anything (does not call git.EnsureCheckout) — safe to run at any time, including with a missing or broken extctl.yaml.
  • Exits non-zero if any error-level finding exists.

Test plan

  • go build ./...
  • go vet ./...
  • go test ./...
  • Manually ran extctl doctor against a real extctl.yaml — confirmed the scaffold: block is flagged as an unsupported key (WARN, exit 0)
  • Manually ran extctl doctor --config /nonexistent/extctl.yaml — confirmed it reports a clean Config-section error instead of crashing, still runs tool/secret checks, and exits 1

🤖 Generated with Claude Code

extctl.yaml grew several knobs and external-tool dependencies (git, gh,
claude, docker, pnpm, ffmpeg) with no upfront validation — misconfiguration
only surfaced deep inside gen/poll/approve-stages, and unknown config keys
(like the dangling top-level `scaffold:` block) were silently dropped by
yaml.v3's non-strict decode with no warning at all.

`extctl doctor` reports config validity, unsupported keys (derived via
reflection over Config's yaml tags so the check can't drift out of sync),
missing required fields/secrets, missing external tooling, and missing
referenced paths — all read-only, no network calls, no mutation. Exits
non-zero on any error-level finding.

Signed-off-by: Lukas Hirt <info@hirt.cz>
@LukasHirt LukasHirt self-assigned this Jul 21, 2026
@LukasHirt
LukasHirt enabled auto-merge (squash) July 21, 2026 13:27
- doctor/print.go: ignore fmt.Fprint* return values (_, _ = ...), matching
  the convention already used in internal/stats/print.go, to satisfy the
  errcheck linter.
- stats_test.go: replace hardcoded absolute dates (e.g. "2026-06-20") with
  a daysAgo(n) helper relative to time.Now(). The hardcoded dates were only
  ever "within the 30-day window" relative to when the test was written;
  today crossed that boundary and started failing CI on main independently
  of this PR.

Signed-off-by: Lukas Hirt <info@hirt.cz>
@LukasHirt
LukasHirt merged commit 4ad7ad7 into main Jul 21, 2026
3 checks passed
@LukasHirt
LukasHirt deleted the feature/doctor-command branch July 21, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant