feat(version): bake git-sha + build-date; add --json to status and version subcommand#75
Merged
Merged
Conversation
…new version subcommand Closes #56. `--version` previously printed just the Cargo.toml version. `status` had no machine-readable output. Wire both via a build script. - `build.rs`: emit `VERISIMISER_GIT_SHA`, `VERISIMISER_GIT_DESCRIBE`, `VERISIMISER_BUILD_DATE` as compile-time env vars. No new runtime dependency — uses the `git` CLI directly and chrono in `[build-dependencies]`. Re-runs when `.git/HEAD` or `.git/refs` changes. - `clap` `version = LONG_VERSION`: shows `verisimiser 0.1.0 (<git-describe>, built <YYYY-MM-DD>)`. - New `verisimiser version [--json]` subcommand returns the same info as plain text or a structured JSON object. - New `--json` flag on `verisimiser status`. The schema is a stable `StatusReport` struct in `src/manifest/mod.rs` with documented field stability. Includes per-dimension enablement and the count. Quick check: ``` $ verisimiser --version verisimiser 0.1.0 (b255f20-dirty, built 2026-05-14) $ verisimiser version --json { "build_date": "2026-05-14", "git_describe": "b255f20-dirty", "git_sha": "b255f20afb70", "version": "0.1.0" } ``` `cargo clippy --all-targets -- -D warnings` clean; 32 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-J1: bake git-sha + build-date into the binary and expose via clap + a new
versionsubcommand. Add--jsontostatustoo.build.rs: emitsVERISIMISER_GIT_SHA,VERISIMISER_GIT_DESCRIBE,VERISIMISER_BUILD_DATEvia thegitCLI andchrono. No new runtime dep. Re-runs on.git/HEADor.git/refschanges.--versionnow showsverisimiser 0.1.0 (<git-describe>, built <YYYY-MM-DD>).verisimiser version [--json]subcommand for both human and machine-readable output.--jsonflag onverisimiser status. Schema documented asStatusReport/OctadStatusstructs with field-stability commitment.Closes
Test plan
cargo clippy --all-targets -- -D warningscleancargo test --lib --bins32/32 passverisimiser --version→verisimiser 0.1.0 (b255f20-dirty, built 2026-05-14)verisimiser version --json→ 4-field JSONverisimiser status --jsonsmoke-tested in CI