1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
//! Live-migration layer — skeleton.
//! `live_migrate` is the home for operator-driven
//! compatibility-window rollouts (the spec's expand → backfill →
//! flip → contract sequence). It sits *above* the segment
//! planner: every type that flows through this module is imported
//! from [`crate::migrate`] rather than redefined here. The boundary
//! between the two layers is the [`OnlineSafetyClassification`] enum
//! frozen in `migrate::schema`.
//! # What this module consumes
//! `live_migrate` accepts **only**
//! [`OnlineSafetyClassification::ExpandContract`]. That is the spec's
//! `RequiresLivePlan` handoff marker — the one variant whose
//! orchestration cannot complete inside a single segment.
//! The remaining three variants stay inside :
//! - `OnlineSafe` — the runner applies it directly.
//! - `FastLockDestructiveGuarded` — the runner applies it behind
//! the `--allow-destructive` gate.
//! - `OfflineOnly` — Djogi refuses to emit SQL; the operator must
//! acknowledge downtime or handle the change manually.
//! Those three are operator-acknowledgement or direct-apply
//! branches; none of them are live-plan branches.
//! # What this module does *not* consume
//! Primary-key type flips are routed through their own dedicated
//! [`SchemaOperation::PkTypeFlipGroup`] /
//! [`SchemaOperation::PkTypeFlipMultiGroup`] cascade emitters in
//! [`crate::migrate::pk_flip`]. PK-flip orchestration is below
//! `live_migrate`'s layer — no file under `live_migrate/` should
//! ever match on a PK-flip operation. The classifier short-circuits
//! before classification when a delta carries a PK-flip group, so
//! `OnlineSafetyClassification::ExpandContract` and PK-flip routing
//! are mutually exclusive by construction. The exclusion is
//! architectural: PK-flip routing lives on
//! [`crate::migrate::diff::Classification::PkTypeFlip`] (a
//! per-delta severity verdict), while `ExpandContract` lives on
//! [`OnlineSafetyClassification`] (a per-operation online-safety
//! verdict). The two enums are different by design, and the
//! live-plan layer only ever consumes the latter.
//! # Naming note
//! Throughout this module, [`OnlineSafetyClassification`] is the
//! four-variant online-safety enum (`OnlineSafe`,
//! `FastLockDestructiveGuarded`, `ExpandContract`, `OfflineOnly`)
//! defined in `migrate::schema`. The unrelated per-delta severity
//! classifier [`crate::migrate::diff::Classification`] (which
//! carries the `PkTypeFlip` variant) is reached only by its fully
//! qualified path on the rare occasions this module needs to
//! reason about it. The two enums coexist on `SchemaDelta` at
//! different granularities; the disjoint names ensure they cannot
//! be confused.
//! [`SchemaOperation::PkTypeFlipGroup`]: crate::migrate::SchemaOperation::PkTypeFlipGroup
//! [`SchemaOperation::PkTypeFlipMultiGroup`]: crate::migrate::SchemaOperation::PkTypeFlipMultiGroup
use crateOnlineSafetyClassification;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
/// Logging-profile axis read from `Djogi.toml`'s `[logging] profile`
/// at compose time and threaded into [`ClassifyContext`].
/// The profile drives the §6.5 three-DB short-circuit: under `Light`
/// and `Balanced` the CRUD-log database degrades audit writes
/// gracefully, so brief lock windows on crud-log mirror tables don't
/// block production application writes. Under `StrictAudit` the audit
/// contract is fail-closed — a lock on a crud-log mirror blocks every
/// `INSERT` / `UPDATE` / `DELETE` on the corresponding application
/// table — so populated crud-log mirrors classify the same way as
/// the application database.
/// Defined here (rather than in [`crate::config`]) because
/// has not yet shipped the logging profile config plumbing; the classifier
/// needs this type to drive its `ClassifyContext`. When the logging
/// substrate lands, this enum becomes the canonical home and config
/// parsing maps the `[logging] profile = "..."` string into one of
/// these variants.
/// `#[non_exhaustive]` so future profiles (e.g. a `BestEffort` or
/// `Replicated` variant) can be added without breaking downstream
/// matches.
/// Returns `true` iff `classification` is the variant `live_migrate`
/// is allowed to consume. This is the load-bearing contract
/// assertion — every later live-plan entry point gates on it so the
/// boundary contract documented in [`OnlineSafetyClassification`]
/// cannot be silently violated by a future addition.