system/harness/Cargo.toml (in hex-foundation) is the single source of truth for the hex version. Everything derives from this file:
- Rust binary —
build.rsinjects only the git SHA.main.rsreadsenv!("CARGO_PKG_VERSION")at compile time. The binary printshex 0.13.3 (abc1234). - git tag — must match
v$(Cargo.toml version). Enforced byrelease.sh bump-version. - hex VERSIONS file —
HEX_FOUNDATION_VERSIONis pinned by/hex-upgradefrom foundation's Cargo.toml at the pulled tag. .hex/version.txt— plain-text semver synced from foundation during/hex-upgrade; read byextension-validate.pyfor local tooling checks.hex version— reads the compiled-inCARGO_PKG_VERSION+HEX_GIT_SHA.hex --version— Clap built-in, readsCARGO_PKG_VERSION.
system/harness/Cargo.toml (source of truth)
├── env!("CARGO_PKG_VERSION") → embedded in binary at compile time
├── git tag must match (enforced by release.sh)
└── hex VERSIONS pinned by /hex-upgrade
Use release.sh bump-version <new-version> in hex-foundation:
cd ~/github.com/mrap/hex-foundation
system/scripts/release.sh bump-version 0.12.0This will:
- Validate semver shape
- Bump
system/harness/Cargo.tomlversion - Verify it compiles (
cargo build --release) - Commit and tag
v0.12.0
Then in hex, run /hex-upgrade to pull the new release and pin VERSIONS.
hex-doctor includes a version-sync check that asserts:
- Compiled binary version == Cargo.toml version (FAIL if mismatch)
- Latest git tag == Cargo.toml version (WARN if mismatch — Cargo.toml may be ahead between bumps)