Skip to main content

lean_ctx_protocol/
lib.rs

1// SPDX-License-Identifier: Apache-2.0
2
3mod evidence;
4mod experiment;
5mod gap;
6mod money;
7mod policy;
8mod receipt_document;
9pub mod savings;
10mod seat_value;
11mod team_seat_value_capability;
12mod usage;
13
14pub mod auto_routing;
15mod capability;
16pub mod circuit_breaker;
17pub mod cloud;
18mod common;
19pub mod context_checkpoint;
20pub mod context_checkpoint_unicode;
21pub mod context_gateway;
22pub mod context_lineage;
23mod context_plan;
24pub mod context_policy_evidence;
25mod context_session;
26pub mod control_plane;
27pub mod credential_redaction;
28pub mod decision;
29pub mod edge_via;
30pub mod eligibility;
31mod engine_context_materialization;
32mod engine_context_materialization_v2;
33mod engine_context_plan;
34mod engine_context_source_execution;
35mod engine_context_source_execution_v2;
36mod engine_context_sources;
37mod engine_egress;
38mod engine_interface;
39mod engine_outcome;
40mod engine_presented_use;
41mod engine_provider_execution;
42mod entitlement;
43mod execution;
44pub mod fleet_control;
45mod identity;
46pub mod knowledge;
47#[doc(hidden)]
48pub mod knowledge_routing;
49pub mod landing_receipt;
50pub mod org_policy_verifier;
51pub mod outcome;
52pub mod outcome_engine;
53pub mod rollout;
54pub mod runtime_exchange;
55pub mod runtime_frame;
56pub mod runtime_handshake;
57pub mod runtime_session;
58mod task;
59pub mod team_context;
60pub mod triage;
61pub mod value_share;
62mod via_receipt;
63
64pub use capability::*;
65pub use common::*;
66pub use context_checkpoint::{
67    CONTEXT_CHECKPOINT_CARRIER_ENVELOPE_DIGEST_DOMAIN,
68    CONTEXT_CHECKPOINT_CARRIER_LOGICAL_STATE_KEYS,
69    CONTEXT_CHECKPOINT_CARRIER_LOGICAL_STATE_SCHEMA_ID, CONTEXT_CHECKPOINT_CARRIER_SCHEMA_ID,
70    CONTEXT_CHECKPOINT_CARRIER_STATE_DIGEST_DOMAIN, CONTEXT_CHECKPOINT_DIGEST_DOMAIN,
71    CONTEXT_CHECKPOINT_IDENTITY_DIGEST_DOMAIN, CONTEXT_CHECKPOINT_LINEAGE_DIGEST_DOMAIN,
72    CONTEXT_CHECKPOINT_LIVE_STATE_DIGEST_DOMAIN, CONTEXT_CHECKPOINT_SCHEMA_ID,
73    CONTEXT_CHECKPOINT_SIGNATURE_DOMAIN, CONTEXT_CHECKPOINT_V2_DIGEST_DOMAIN,
74    CONTEXT_CHECKPOINT_V2_LINEAGE_DIGEST_DOMAIN, CONTEXT_CHECKPOINT_V2_SCHEMA_ID,
75    CONTEXT_CHECKPOINT_V2_SIGNATURE_DOMAIN, ContextCheckpointArtifactLineageV1,
76    ContextCheckpointBranchIdV1, ContextCheckpointCarrierBindingV1,
77    ContextCheckpointDecisionStatusV1, ContextCheckpointDecisionV1, ContextCheckpointDeviceIdV1,
78    ContextCheckpointDigestInputsV1, ContextCheckpointEncryptionAlgorithmV1,
79    ContextCheckpointEncryptionMetadataV1, ContextCheckpointFileRoleV1, ContextCheckpointFileV1,
80    ContextCheckpointIdV1, ContextCheckpointIdentityV1, ContextCheckpointLearningStateV1,
81    ContextCheckpointLineageV1, ContextCheckpointLineageV2, ContextCheckpointLiveStateV1,
82    ContextCheckpointMergePolicyV1, ContextCheckpointMigrationV1, ContextCheckpointPackagePinV1,
83    ContextCheckpointPolicyPinV1, ContextCheckpointProgressV1, ContextCheckpointProjectionV1,
84    ContextCheckpointSessionStateV1, ContextCheckpointSignerV1, ContextCheckpointSigningPayloadV1,
85    ContextCheckpointTaskStatusV1, ContextCheckpointTaskV1, ContextCheckpointTextV1,
86    ContextCheckpointV1, ContextCheckpointV2, MAX_CONTEXT_CHECKPOINT_DECISION_REFS,
87    MAX_CONTEXT_CHECKPOINT_DECISIONS, MAX_CONTEXT_CHECKPOINT_ENCODED_BYTES,
88    MAX_CONTEXT_CHECKPOINT_FILES, MAX_CONTEXT_CHECKPOINT_FINDINGS, MAX_CONTEXT_CHECKPOINT_ID_BYTES,
89    MAX_CONTEXT_CHECKPOINT_LINEAGE_REFS, MAX_CONTEXT_CHECKPOINT_NEXT_STEPS,
90    MAX_CONTEXT_CHECKPOINT_PACKAGE_PINS, MAX_CONTEXT_CHECKPOINT_POLICY_PINS,
91    MAX_CONTEXT_CHECKPOINT_REFERENCE_BYTES, MAX_CONTEXT_CHECKPOINT_SLUG_BYTES,
92    MAX_CONTEXT_CHECKPOINT_STEPS, MAX_CONTEXT_CHECKPOINT_TEXT_BYTES,
93};
94pub use context_checkpoint_unicode::{
95    CONTEXT_CHECKPOINT_V3_DIGEST_DOMAIN, CONTEXT_CHECKPOINT_V3_SCHEMA_ID,
96    CONTEXT_CHECKPOINT_V3_SIGNATURE_DOMAIN, ContextCheckpointDecisionV2,
97    ContextCheckpointLiveStateV2, ContextCheckpointProgressV2, ContextCheckpointTaskV2,
98    ContextCheckpointTextV2, ContextCheckpointV3, MAX_CONTEXT_CHECKPOINT_V3_ENCODED_BYTES,
99};
100pub use context_plan::*;
101pub use context_session::{
102    ContextKitPinV1, ContextSdkIntegrationDepthV1, ContextSessionConfigurationV1,
103    ContextSessionPhaseV1, ContextSessionRecoveryStateV1, ContextSessionSnapshotV1,
104    ContextSessionStateV1, SessionIdentityV1, TuningProfilePinV1,
105};
106pub use control_plane::*;
107pub use decision::*;
108pub use engine_context_materialization::*;
109pub use engine_context_materialization_v2::*;
110pub use engine_context_plan::*;
111pub use engine_context_source_execution::*;
112pub use engine_context_source_execution_v2::*;
113pub use engine_context_sources::*;
114pub use engine_egress::*;
115pub use engine_interface::*;
116pub use engine_outcome::*;
117pub use engine_presented_use::*;
118pub use engine_provider_execution::*;
119pub use entitlement::*;
120pub use evidence::{EvidenceKind, EvidenceRefV1, SignatureStatus};
121pub use execution::*;
122pub use experiment::{DataClassification, ExperimentArm, ExperimentAssignmentV1, SideEffectPolicy};
123pub use fleet_control::*;
124pub use gap::{BillingPeriodStatus, EvidenceGapClosedV1, EvidenceGapOpenedV1, GapReason};
125pub use identity::{
126    EventId, HandoffId, KitId, PackageId, PolicyId, ProfileId, ProjectContextId, ProtocolReference,
127    RunId, SemanticVersion, Sha256Digest, SourceId, UtcTimestamp, ViewId, WorkspaceId,
128};
129pub use knowledge::{ClassificationLevel, KnowledgeObjectV1, ValidityWindow};
130#[doc(hidden)]
131pub use knowledge_routing::{
132    ContextBundleV1, ContextCandidateV1, ContextReceiptV1, CostClass, KnowledgeSourceManifestV1,
133    SourceCapabilities,
134};
135pub use money::{CurrencyCode, MoneyV1};
136pub use outcome::*;
137pub use outcome_engine::*;
138pub use policy::{ExpiryBehavior, PolicyClassification, PolicyCriticality};
139pub use receipt_document::*;
140pub use savings::{MeasurementMethod, SavingsObservationV1, SavingsReceiptV1};
141pub use seat_value::*;
142pub use task::*;
143pub use team_context::*;
144pub use team_seat_value_capability::*;
145pub use triage::{TaskProfileV1, TaskScope, TriageBackend, TriageResultV1};
146pub use usage::{MeasuredUnitV1, UsageBreakdownV1};
147pub use value_share::*;
148pub use via_receipt::*;
149
150// The contract tests (tests/main.rs and its modules), compiled into this
151// crate's unit-test binary instead of a test binary of their own. A test is
152// `protocol::<file stem>::<test>`; `extern crate self` keeps their
153// `lean_ctx_protocol::` paths.
154// They compile against this crate's cfg(test) build and could reach private
155// items, so they use only the public API (no `crate::`, guarded by
156// scripts/tests/test_mr_quick.py). A test that must exercise the production
157// build or the public API only stays a separate test target.
158#[cfg(test)]
159extern crate self as lean_ctx_protocol;
160#[cfg(test)]
161#[path = "../tests/main.rs"]
162mod protocol;