Skip to content

feat(cli): add dependency doctor command - #80

Merged
rrskris merged 2 commits into
kaaval:mainfrom
floze-the-genius:agent/doctor-preflight
Jul 19, 2026
Merged

rrskris merged 2 commits into
kaaval:mainfrom
floze-the-genius:agent/doctor-preflight

Conversation

@floze-the-genius

Copy link
Copy Markdown
Contributor

What this changes

Adds python -m app.cli doctor for dependency preflight from the command line.
The command:

  • reuses app.health.run_deep_checks for Postgres, CVE feed, and Kubernetes checks
  • prints one deterministic line per check with status, detail, and failure fix
  • exits 0 when required dependencies pass, including degraded optional checks
  • exits 2 when a required dependency fails
  • introduces typed health check/report results shared by the API and CLI

Closes #77.

Type

  • New detection rule / finding source
  • Bug fix
  • Feature
  • Docs
  • Refactor / chore

Checklist

  • make test equivalent passes with the CI coverage gate
  • Added/updated tests for the behavior change
  • New rule ships with a remediation and a verified benchmark citation
    (not applicable: no detection rule)
  • Added a fixture to hack/dev/rbac-fixtures.yaml if it's a new rule
    (not applicable: no detection rule)
  • Docs updated
  • Conventional commit messages
  • DCO sign-off present

How you verified it

  • pytest tests/test_cli.py -q: 14 passed
  • pytest tests/ --cov=app --cov-fail-under=60: 67 passed, 63.65% coverage
  • python -m compileall -q control-plane/app
  • live missing-Postgres run: all three checks printed, compose fix shown, exit 2
  • live reachable-Postgres/degraded optional checks run: exit 0
  • npm run lint: 0 errors, 7 existing hook warnings
  • npm run build: successful

AI assistance

Implementation, tests, and documentation were developed with OpenAI Codex
assistance. The contributor reviewed the diff, ran the full local checks above,
and signed off the commit under the DCO.

Implementation and tests were developed with OpenAI Codex assistance and verified locally.

Signed-off-by: Floze <[email protected]>

@rrskris rrskris left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified locally before this approval, both live paths: reachable Postgres → three status lines, exit 0 with optional failures correctly non-fatal; dead Postgres → compose fix printed, exit 2. Full suite 67 passed at 63.24% coverage, matching your numbers. Every acceptance criterion from #77 is met — run_deep_checks reused with zero duplicated logic, deterministic output, and the TypedDict result types are a genuinely nice upgrade the API side gets for free. Docs in three places, checklist filled honestly, DCO signed. First PR here and it's reference quality — welcome, @floze-the-genius! 🎉 Merging on CI green.

If you enjoyed this one: #3 (Prometheus /metrics) or #4 (/rbac/scan/diff) would both build naturally on what you just touched.

@rrskris
rrskris marked this pull request as ready for review July 18, 2026 18:59
@rrskris

rrskris commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Marked this ready-for-review on your behalf, @floze-the-genius — the checklist and verification section read complete and it passed my local verification, so I didn't want the draft flag to hold up the merge. If you'd left it draft intentionally, say the word and I'll revert.

@rrskris
rrskris enabled auto-merge (squash) July 18, 2026 19:00
Signed-off-by: Floze <[email protected]>

# Conflicts:
#	control-plane/app/cli.py
auto-merge was automatically disabled July 18, 2026 19:25

Head branch was pushed to by a user without write access

@floze-the-genius

Copy link
Copy Markdown
Contributor Author

Thanks for the approval and local verification. The synchronized head 3e81c1d is currently waiting on GitHub’s first-time-contributor workflow approval for CI run 29657778677, DCO 29657778678, and CodeQL 29657778693; GitHub reports each as action_required, so no jobs have executed on the current head yet. The prior head had all three workflows green.

@rrskris
rrskris merged commit ef67ffa into kaaval:main Jul 19, 2026
7 checks passed
@rrskris

rrskris commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

Merged — thanks for another solid one. kaaval doctor closes out #77 exactly as scoped: same checks as /health?deep=1, exit 2 with the fix command when a required dep is down. You'll be in the release notes for v1.2.

rrskris added a commit that referenced this pull request Aug 5, 2026
@floze-the-genius shipped three PRs, but only the bugfix (#100) appeared in the
changelog — the two features it built on, GET /rbac/scan/diff (#82) and the
kaaval doctor preflight (#80), were missing entirely. Anyone reading the release
notes would see the fix to a feature whose arrival was never recorded.

Scope of each entry was taken from the merge commits rather than the issue
titles: #80 adds the CLI command and typed health results on top of the deep
health checks that #75 already provided, so it is credited for the wrapper it
actually wrote, not for the checks themselves.

Prep for the v1.2.0 release notes, so the credit ships in the release rather
than as a later correction.

Signed-off-by: Vamshi Krishna Santhapuri <[email protected]>
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.

CLI: kaaval doctor — dependency preflight from the command line

2 participants