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 bybuild.rsasBUILD_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§
- Client
Version - 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 averify_assetgate.
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_COMMITcarries when no commit could be probed at build time. Kept at 16 hex digits so a fallback build still emits a grammar-conformantclient_version.
Functions§
- client_
version - Compose a grammar-conformant
client_versionfor an in-repo client.client_idnames the product (capsule-cli,capsule-ios, …);semveris that client’s own crate version. The build-embeddedBUILD_COMMITandBUILD_DIRTY_SUFFIXare appended. - core_
client_ version - The default
capsule-core/{semver}+{commit}[.dirty]identity, used until an app injects its ownclient_id.semveris capsule-core’s own crate version.