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, generate_backfill_migration,
56    generate_next_migration, render_migration_preview, try_acquire_migration_authoring_lock,
57    write_generated_migration_under_lock,
58};
59pub use history::{
60    CanonicalMigrationHistoryEvidence, MigrationHistoryGraph,
61    canonical_history_declared_legacy_bridge_count_in, canonical_history_declares_legacy_bridge_in,
62    discover_verified_migration_chain, discover_verified_migration_chain_in,
63    discover_verified_migration_chain_with_evidence_in, discover_verified_migrations,
64    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    SchemaMigrationDraft, VerifiedSchemaMigrationManifest, build_verified_manifest,
84    decode_verified_manifest, encode_verified_manifest, verified_manifest_digest,
85};
86pub use policy::{MigrationApplyApproval, MigrationSafetyPolicy, SafetyPolicyDecision};
87pub use rollback_plan::{
88    VerifiedMigrationRollbackBackfillStep, VerifiedMigrationRollbackManifest,
89    VerifiedMigrationRollbackOperation, VerifiedMigrationRollbackPlan,
90    VerifiedMigrationRollbackStep, build_verified_migration_rollback_plan,
91    build_verified_migration_rollback_preview,
92};
93pub use verify::{MigrationDriftFinding, MigrationVerifyReport, verify_migration_state};
94
95pub use profile::{
96    AnnotationKind, AnnotationSubjectKind, AnnotationTransition, EvidenceFlag, EvidenceRequirement,
97    FactKind, FactTransition, InterfaceDefault, InterfaceKind, LoweringMechanism, SafetyScenario,
98    SafetyScenarioRule, SchemaLoweringProfile, TransitionRule, annotation_transition_rule,
99    canonical_profile_bytes, fact_transition_rule, migration_runtime_capability_vocabulary,
100    profile_fingerprint, schema_lowering_profile_binding, typedb_3_12_1_profile,
101};
102pub use type_bridge_contract::schema_lowering::{
103    SCHEMA_LOWERING_PROFILE_CANONICALIZATION, SCHEMA_LOWERING_PROFILE_FINGERPRINT_DOMAIN,
104    SchemaLoweringProfileFingerprint, SchemaLoweringProfileId,
105    TYPEDB_3_12_1_SCHEMA_LOWERING_PROFILE_ID,
106};
107pub use type_bridge_schema::{SafetyClass, SafetyClassificationError, classify_operation_safety};