Skip to main content

Module integrity

Module integrity 

Source
Expand description

Build-origin integrity verification and rebrand resistance.

Detects if the binary has been modified by automated rebranding tools (e.g. sed s/lean-ctx/better-ctx/g). The integrity seed is a compile-time constant; its hash is precomputed and embedded. If the seed is altered by a text-replacement tool, the hash will no longer match.

Structs§

BuildInfo
Which pipeline built this binary, stamped by build.rs at compile time (never a runtime git call). official is the upstream release workflow only; dogfood the promoted Instance state, dev any other checkout, source a packaged crate or a tree without git.
IntegrityReport

Functions§

build
The build stamped into this binary. A dev binary without a stamp (other binaries, tests) reports its kind with no commit.
check
origin_line
set_binary_stamp
Called once by the lean-ctx binary at start with its own compile-time stamp (crates/lean-ctx/build.rs): the binary links every crate, so its commit and dirty flag describe the whole build, and dogfood promotes a dev Engine kind when HEAD was the promoted Instance state. An empty commit (a packaged crate, no git) keeps the Engine’s stamp. An official build keeps its release commit.
version_json
lean-ctx --version --json.