Expand description
Commercial-plane billing substrate (billing-plane-v1): plans, entitlements,
and usage metering derived from the signed savings ledger. Never gates local.
Commercial-plane billing substrate (billing-plane-v1, EPIC 13.6).
Turns the existing plan-upgrade flow into real plans + entitlements plus usage-based metering derived from the signed savings ledger (EPIC 12.20) — without touching the local experience.
§Two halves, one invariant
plans— the plan catalog and theirEntitlements. Commercial, additive.entitlement_allowsexpresses the Local-Free Invariant: every local-always-on capability is allowed on every plan, includingPlan::Free. No local feature is ever gated.metering—Usagederived read-only from the privacy-preserving, Ed25519-signed ledger aggregate. Only signed + intact chains are billable.
Crucially, this module computes and describes commercial state; it never
enforces anything against the local plane. Enforcement (checkout, plan
gating) lives on the hosted control plane, which is the only place an
account/plan is consulted. The local engine has no entitlement checks —
asserted by tests/local_free_invariant.rs.
Re-exports§
pub use metering::metered_usage;pub use metering::Usage;pub use plans::entitlement_allows;pub use plans::min_plan_for;pub use plans::Entitlements;pub use plans::Plan;