Skip to content

feat(version): bake git-sha + build-date; add --json to status and version subcommand#75

Merged
hyperpolymath merged 1 commit into
mainfrom
feat/vergen-version-json
May 14, 2026
Merged

feat(version): bake git-sha + build-date; add --json to status and version subcommand#75
hyperpolymath merged 1 commit into
mainfrom
feat/vergen-version-json

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Summary

Per V-L3-J1: bake git-sha + build-date into the binary and expose via clap + a new version subcommand. Add --json to status too.

  • build.rs: emits VERISIMISER_GIT_SHA, VERISIMISER_GIT_DESCRIBE, VERISIMISER_BUILD_DATE via the git CLI and chrono. No new runtime dep. Re-runs on .git/HEAD or .git/refs changes.
  • --version now shows verisimiser 0.1.0 (<git-describe>, built <YYYY-MM-DD>).
  • New verisimiser version [--json] subcommand for both human and machine-readable output.
  • New --json flag on verisimiser status. Schema documented as StatusReport / OctadStatus structs with field-stability commitment.

Closes

Test plan

  • cargo clippy --all-targets -- -D warnings clean
  • cargo test --lib --bins 32/32 pass
  • verisimiser --versionverisimiser 0.1.0 (b255f20-dirty, built 2026-05-14)
  • verisimiser version --json → 4-field JSON
  • verisimiser status --json smoke-tested in CI

…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>
@hyperpolymath hyperpolymath merged commit 2456845 into main May 14, 2026
16 of 18 checks passed
@hyperpolymath hyperpolymath deleted the feat/vergen-version-json branch May 14, 2026 14:15
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-J1: bake git-sha + build-date into --version; add --json to status

1 participant