Expand description
The isolated core contract for Pacta.
Pacta operates on three axioms:
- Registry is Lifecycle (no business logic, no retry/delay logic).
- Execution is Middleware.
- This contract has no dependency on other workspace crates.
Modules§
- kernel
- The sans-I/O lifecycle kernel.
- lifecycle
- The pure lifecycle state machine every
Registrybackend composes over.
Structs§
- Claim
- A claimed pact and the retainer required to settle it.
- Pact
- A durable obligation, generated from a Signal, ready to be executed.
Note the deliberate absence of
attempts,delay, andpriority. - Retainer
- A retainer: the authority token a registry issues with a claim and validates
when settling it. Authority is registry-validated — a forged identifier does not
match an issued claim — not proven by the type system. Construct via
Retainer::newand read the identifier viaRetainer::id. DerivesPartialEq/Eq/Hashso a durable backend can index lease state by holder identity — the orphan rule makes providing these the contract’s responsibility. - Timestamp
- A point in time as milliseconds since an epoch the runtime chooses. This is a
pure value: the core names time but never reads it. There is deliberately no
nowconstructor — a runtime obtains the current time and injects it, keeping lease decisions deterministic and testable. - Uuid
- The identifier type the durable records and the fencing token are built on, re-exported from the
uuidcrate. A backend needs it to build aPact(Pact::new(id, …)) and to mint a freshRetainer(Retainer::new(Uuid…)), so it is part of the backend-author surface. A Universally Unique Identifier (UUID).
Enums§
- Outcome
- The lifecycle outcome an execution produces for a claimed pact.
Traits§
- Registry
- The Registry is the durable lifecycle-authority port: it preserves pacts and decides claim,
lease, and settlement authority over them. It is not itself the pure state machine — the pure,
colorless machine is
lifecycle, which every backend composes over; aRegistryimplementation is the I/O-owning port that persists that machine’s states and enforces its authority (the async twin is [AsyncRegistry]).
Type Aliases§
- Settlement
- The lifecycle conclusion applied to a claim, currently a fulfilled or breached
Outcome. - Transition
- A pure kernel transition decision — a
lifecycleon_X— passed to the transition portRegistry::apply(and its async twin). The same type is used by both bindings, so the port is literally one shape.