feat(cli): add verisimiser doctor subcommand#86
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Per V-L3-G2:
validateanswers "is this manifest sane?".doctoranswers "is this host fit to run verisimiser at all?" — environment-level diagnostics that surface before users hit cryptic permission/PATH errors.src/doctor.rsmodule withrun_doctor(Option<&str>) -> ValidationReportreusing the same report shape asvalidate.path-cargo,path-git,cwd-writable.validate_manifest.verisimiser doctor [--manifest <path>] [--json].emit_reporthelper inmain.rsso text + JSON output is consistent acrossvalidateanddoctor.Closes
Test plan
cargo clippy --all-targets -- -D warningscleancargo test --lib --bins48/48 (2 new indoctor::tests)doctor_without_manifest_runs_env_checks_onlyverifies the no-manifest casedoctor_with_manifest_runs_both_setsverifies env + manifest checks combine