Skip to main content

Crate type_history_build

Crate type_history_build 

Source
Expand description

Check frozen schemas during builds and manage the schema ledger.

When a shop freezes its first receipt version, the ledger records that version’s serialized shape. Later builds must keep it unchanged so stored receipts remain readable. Call compile() from the application’s or shared types crate’s build.rs to enable those checks.

Initialize type-history/schemas.json with cargo type-history init --package NAME before declaring histories, and commit it with the source. Builds check the declared histories against that ledger and configure the macro’s schema checks. They do not rewrite the ledger.

Development builds warn about drafts. Set TYPE_HISTORY_REQUIRE_FROZEN=1 to reject them during development too; release-derived profiles always reject drafts. The lifecycle module provides the checked operations used by the CLI to initialize, check, freeze, reset, and import histories. They reuse compiled dependencies in type-history-snapshot inside Cargo’s target directory; TYPE_HISTORY_PRIVATE_SNAPSHOT=1 selects a private temporary snapshot.

Re-exports§

pub use compile::compile;

Modules§

check_report
Stable version-one reports for read-only history checks.
compile
Ordinary build enforcement for Type History packages.
contract
Type History package paths and compiler signals.
discover
Complete Type History source inventory.
inventory
Complete package declaration inventories under the shared history authority.
lifecycle
Shared package lifecycle with one captured candidate and one commit point.
options
Exact package and lifecycle selectors.
package
Cargo manifest inputs needed by source declaration selectors.
snapshot
Owned copies of all local Cargo inputs; live source never sees a candidate ledger.
standalone_export
Validate generated standalone export rows against complete source inventory.
workspace
Cargo’s resolved workspace and local source graph.

Structs§

HistoryLedger
Validated complete history inventory for one package and schema-ID policy.

Type Aliases§

Result
Build or authoring operation result with its original actionable failure.