Skip to main content

type_bridge_schema_migration/
lib.rs

1//! Verified offline schema migration contracts and provider lowering policy.
2
3#![deny(missing_docs)]
4
5mod apply_plan;
6mod catalog;
7mod coordinator;
8mod directory;
9mod execution;
10mod generate;
11mod history;
12mod history_bundle;
13mod legacy;
14pub mod lowering;
15mod manifest;
16mod policy;
17pub mod profile;
18mod rollback_plan;
19mod verify;
20
21pub use apply_plan::{
22    MigrationApplyPlanError, MigrationApplyTarget, VerifiedMigrationApplyManifest,
23    VerifiedMigrationApplyPlan, VerifiedMigrationApplyStep, VerifiedMigrationTransactionGroup,
24    build_verified_migration_apply_plan, build_verified_migration_apply_preview,
25    partition_transaction_groups,
26};
27pub use catalog::MigrationCatalog;
28pub use coordinator::{
29    BackfillExecutionFuture, GroupCommitFailure, GroupCommitFuture, MigrationBackfillObservation,
30    MigrationExecutionDirection, MigrationExecutionOutcome, MigrationExecutionPosition,
31    MigrationExecutionProvider, MigrationExecutionReport, MigrationExecutionReportPosition,
32    MigrationExecutionStatus, MigrationRollbackOutcome, PreparedMigrationGroup,
33    await_interruptible_operation, execute_verified_migration_apply_plan,
34    execute_verified_migration_apply_plan_controlled, execute_verified_migration_rollback_plan,
35    execute_verified_migration_rollback_plan_controlled, require_authorized_apply_plan,
36    require_authorized_rollback_plan,
37};
38pub use directory::{
39    MigrationAuthoringLock, MigrationDirectory, MigrationDirectoryEntry,
40    validate_portable_direct_child,
41};
42pub use execution::{
43    AppliedRecord, BackfillCompletionEvidence, BackfillEventRecord, BackfillExecutionCounts,
44    BackfillExecutionDirection, BackfillRecoveryObservation, ExecutionBindingToken, ExecutionFence,
45    ExecutionFuture, ExecutionScope, GroupCommitCertainty, GroupEventRecord, GroupJournalEventKind,
46    GroupRecoveryDecision, GroupRecoveryObservation, JournalEntry, JournalSequence, LeaseHolderId,
47    MAX_MIGRATION_BACKFILL_OBSERVATIONS, MAX_MIGRATION_EXECUTION_GROUPS, MigrationCancellation,
48    MigrationExecutionControl, MigrationExecutionJournal, MigrationExecutionResourceLimits,
49    MigrationLease, MigrationLeaseStore, OpenPlanRecord, OpenRollbackPlanRecord, PlanRecord,
50    RollbackPlanRecord, RollbackStepEventRecord, RolledBackRecord, active_applied_entries,
51    decide_backfill_recovery, decide_group_recovery,
52};
53pub use generate::{
54    BackfillMigrationGenerationRequest, GeneratedMigration, MigrationGenerationOutcome,
55    MigrationGenerationRequest, MigrationPreviewError, allocate_migration_name,
56    generate_backfill_migration, generate_next_migration, render_migration_preview,
57    try_acquire_migration_authoring_lock, write_generated_migration_under_lock,
58};
59pub use history::{
60    CanonicalMigrationHistoryEvidence, MigrationHistoryGraph, MigrationProfileUpgrade,
61    canonical_history_declared_legacy_bridge_count_in, canonical_history_declares_legacy_bridge_in,
62    discover_history_for_profile_upgrade_in, discover_verified_migration_chain,
63    discover_verified_migration_chain_in, discover_verified_migration_chain_with_evidence_in,
64    discover_verified_migrations, discover_verified_migrations_in, require_adoption_authority_pair,
65    require_adoption_authority_pair_state,
66};
67pub use history_bundle::{
68    MAX_MIGRATION_HISTORY_BUNDLE_BYTES, MIGRATION_HISTORY_BUNDLE_FINGERPRINT_CANONICALIZATION,
69    MIGRATION_HISTORY_BUNDLE_FINGERPRINT_DOMAIN, MIGRATION_HISTORY_BUNDLE_V1,
70    VerifiedMigrationHistoryBundle, VerifiedMigrationHistoryBundleEntry,
71    decode_verified_migration_history_bundle, encode_verified_migration_history_bundle,
72};
73pub use legacy::{
74    LEGACY_APPLIED_SET_ALGORITHM, LEGACY_APPLIED_SET_CANONICALIZATION, LEGACY_CHECKSUM_ALGORITHM,
75    LegacyAppliedSetDigest, LegacyMigrationAppLabel, LegacyMigrationChecksum, LegacyMigrationId,
76    LegacyMigrationName, LegacyMigrationReference, build_legacy_frontier_bridge,
77};
78pub use lowering::{
79    SchemaFactCatalog, SchemaLoweringBinding, SchemaLoweringDiagnostic, SchemaLoweringPlan,
80    StatementOperationKind, StatementUnit, TypeQlStatement, TypeQlVerb, lower_schema_delta,
81};
82pub use manifest::{
83    MigrationProfileBridge, SchemaMigrationDraft, VerifiedSchemaMigrationManifest,
84    build_verified_manifest, decode_verified_manifest, encode_verified_manifest,
85    verified_manifest_digest,
86};
87pub use policy::{MigrationApplyApproval, MigrationSafetyPolicy, SafetyPolicyDecision};
88pub use rollback_plan::{
89    VerifiedMigrationRollbackBackfillStep, VerifiedMigrationRollbackManifest,
90    VerifiedMigrationRollbackOperation, VerifiedMigrationRollbackPlan,
91    VerifiedMigrationRollbackStep, build_verified_migration_rollback_plan,
92    build_verified_migration_rollback_preview,
93};
94pub use verify::{MigrationDriftFinding, MigrationVerifyReport, verify_migration_state};
95
96pub use profile::{
97    AnnotationKind, AnnotationSubjectKind, AnnotationTransition, EvidenceFlag, EvidenceRequirement,
98    FactKind, FactTransition, InterfaceDefault, InterfaceKind, LoweringMechanism, MigrationProfile,
99    SafetyScenario, SafetyScenarioRule, SchemaLoweringProfile, TransitionRule,
100    annotation_transition_rule, canonical_profile_bytes, fact_transition_rule,
101    lowering_profile_binding, migration_runtime_capability_vocabulary, profile_fingerprint,
102    schema_lowering_profile_binding, typedb_3_12_1_profile,
103};
104pub use type_bridge_contract::schema_lowering::{
105    SCHEMA_LOWERING_PROFILE_CANONICALIZATION, SCHEMA_LOWERING_PROFILE_FINGERPRINT_DOMAIN,
106    SchemaLoweringProfileFingerprint, SchemaLoweringProfileId,
107    TYPEDB_3_12_1_SCHEMA_LOWERING_PROFILE_ID, TYPEDB_3_13_6_SCHEMA_LOWERING_PROFILE_ID,
108};
109pub use type_bridge_schema::{SafetyClass, SafetyClassificationError, classify_operation_safety};