Skip to main content

Module client_build

Module client_build 

Source
Expand description

Client build identification — the client_version / generated_by_client grammar and the build-embedded git commit. Always compiled: pure string formatting, no native deps. Client build identification — the client_version / generated_by_client grammar.

Every real manifest producer pins a write to the exact client build that authored it, so a defect in one shipped build — of any client, in-repo or not — is traceable across every asset it touched. The normative grammar (SSoT: Provenance — Client Build Identification) is:

client_version = client_id "/" semver "+" commit [".dirty"]
  • client_id — the client product, which also names the platform (capsule-ios, capsule-android, capsule-desktop, capsule-cli, capsule-web, or an out-of-repo client’s own stable id).
  • commit — the git commit of the client’s own source tree (a ≥ 12-hex prefix), embedded at build time by build.rs as BUILD_COMMIT.
  • .dirty — appended (BUILD_DIRTY_SUFFIX) when built from a modified tree.

The value is audit-only and never load-bearing for authorization: verify_asset does not gate on the grammar (a nonconforming string still verifies), so this module is producer discipline plus a parser for audit tooling and the grammar round-trip test.

In-repo clients inject only their client_id + own semver (via Workspace::with_client_id or the FFI constructor); the build-embedded commit and dirty flag are appended here so every client on this tree reports the same commit.

Structs§

ClientVersion
A parsed client_version, for the grammar round-trip in tests and for audit tooling. The grammar is producer discipline only — a manifest carrying a nonconforming string still verifies, so parsing is never a verify_asset gate.

Constants§

BUILD_COMMIT
Git commit (a ≥ 12-hex prefix) of the capsule-core source tree, embedded at build time.
BUILD_DIRTY_SUFFIX
".dirty" when capsule-core was built from a modified (tracked) tree, else "".
CORE_CLIENT_ID
The default in-repo product id a bare capsule-core producer reports until an app injects its own identity through the SDK/FFI surface.
UNKNOWN_COMMIT
The all-zero sentinel BUILD_COMMIT carries when no commit could be probed at build time. Kept at 16 hex digits so a fallback build still emits a grammar-conformant client_version.

Functions§

client_version
Compose a grammar-conformant client_version for an in-repo client. client_id names the product (capsule-cli, capsule-ios, …); semver is that client’s own crate version. The build-embedded BUILD_COMMIT and BUILD_DIRTY_SUFFIX are appended.
core_client_version
The default capsule-core/{semver}+{commit}[.dirty] identity, used until an app injects its own client_id. semver is capsule-core’s own crate version.