Skip to content

feat(cli): add verisimiser doctor subcommand#86

Merged
hyperpolymath merged 1 commit into
mainfrom
feat/doctor-subcommand
May 14, 2026
Merged

feat(cli): add verisimiser doctor subcommand#86
hyperpolymath merged 1 commit into
mainfrom
feat/doctor-subcommand

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Summary

Per V-L3-G2: validate answers "is this manifest sane?". doctor answers "is this host fit to run verisimiser at all?" — environment-level diagnostics that surface before users hit cryptic permission/PATH errors.

  • New src/doctor.rs module with run_doctor(Option<&str>) -> ValidationReport reusing the same report shape as validate.
  • Env checks: path-cargo, path-git, cwd-writable.
  • Optional manifest path appends manifest checks from validate_manifest.
  • New verisimiser doctor [--manifest <path>] [--json].
  • Shared emit_report helper in main.rs so text + JSON output is consistent across validate and doctor.

Closes

Test plan

  • cargo clippy --all-targets -- -D warnings clean
  • cargo test --lib --bins 48/48 (2 new in doctor::tests)
  • doctor_without_manifest_runs_env_checks_only verifies the no-manifest case
  • doctor_with_manifest_runs_both_sets verifies env + manifest checks combine

Closes #53.

`validate` answers "is this manifest sane?". `doctor` answers "is this
host fit to run verisimiser at all?" — environment-level diagnostics
that surface before users hit cryptic permission/PATH errors at
runtime.

New module `src/doctor.rs`:

  - `run_doctor(manifest_path: Option<&str>) -> ValidationReport` —
    reuses the same `ValidationReport`/`ValidationCheck` shape as
    `validate`, so consumers (text + JSON) share rendering.
  - Environment checks:
    - `path-cargo` — Rust toolchain reachable for development.
    - `path-git` — git on PATH (used by `verisimiser status`
      provenance and the build script).
    - `cwd-writable` — sidecar databases and generated DDL all land
      under cwd by default.
  - If `manifest_path` is supplied, the full manifest validation
    checks from `validate_manifest` are appended.

New CLI subcommand `verisimiser doctor [--manifest <path>] [--json]`.
Shares an `emit_report` helper with `validate` so plain-text and JSON
output stay in lockstep across both.

New tests in `doctor::tests`:

  - `doctor_without_manifest_runs_env_checks_only` — names contain
    `path-cargo`, `path-git`, `cwd-writable`; no `manifest-*`.
  - `doctor_with_manifest_runs_both_sets` — env checks still present;
    `manifest-loads` appended.

`cargo clippy --all-targets -- -D warnings` clean; 48 unit tests pass.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@hyperpolymath hyperpolymath merged commit 885cb92 into main May 14, 2026
16 of 18 checks passed
@hyperpolymath hyperpolymath deleted the feat/doctor-subcommand branch May 14, 2026 15:29
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.

V-L3-G2: add verisimiser doctor subcommand (CLI analogue of just doctor)

1 participant