pub mod metering;
pub mod plans;
pub mod settlement_evidence;
pub mod signed_entitlements;
pub use metering::{Usage, metered_usage};
pub use plans::{
Entitlements, PRO_LOCAL_WORK_GRAPH, Plan, PlanSelection, entitlement_allows, min_plan_for,
};
pub use settlement_evidence::{
SettlementEligibilityV2, SettlementEvidenceManifestV2, reconcile_settlement_evidence_v2,
};
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn local_aha_is_free_despite_historical_pro_id() {
assert!(entitlement_allows(Plan::Community, "compression"));
assert!(entitlement_allows(Plan::Community, "pro.agent_bus.local"));
assert!(entitlement_allows(Plan::Pro, "pro.agent_bus.local"));
}
#[test]
fn commercial_entitlements_follow_the_plan_ladder() {
assert!(!entitlement_allows(Plan::Community, "sso_scim"));
assert!(entitlement_allows(Plan::Enterprise, "sso_scim"));
assert!(entitlement_allows(Plan::Team, "private_registry"));
assert!(!entitlement_allows(Plan::Community, "private_registry"));
assert!(!entitlement_allows(Plan::Enterprise, "unknown"));
}
}