Skip to main content

gaman_core/drift/
report.rs

1//! Structured semantic drift results shared by verification, repair, and CLI reporting.
2
3use crate::operations::Operation;
4use crate::states::EntityKind;
5
6/// Result of comparing replayed migration state with inspected database state.
7#[derive(Debug, Clone, Default)]
8pub struct VerificationReport {
9    /// Property and presence differences found in migration-owned entities.
10    pub findings: Vec<DriftFinding>,
11    /// Coarse repair operations that can restore registered expected state.
12    pub operations: Vec<Operation>,
13    /// Migration ids that must normally be applied before drift can be repaired.
14    pub pending_migrations: Vec<String>,
15}
16
17/// One actionable entity-property difference reported by semantic drift.
18#[derive(Debug, Clone, PartialEq, Eq)]
19pub struct DriftFinding {
20    /// Repair operation category associated with this difference.
21    pub operation: &'static str,
22    /// Gaman entity kind containing the differing property.
23    pub entity_kind: EntityKind,
24    /// Stable qualified identity used to locate the entity.
25    pub entity_name: String,
26    /// Registered property that failed semantic comparison.
27    pub property: &'static str,
28    /// Value expected from replayed migration state.
29    pub expected: String,
30    /// Value observed from live database inspection.
31    pub observed: String,
32    /// Optional explanation of comparison limits or canonicalization.
33    pub note: Option<String>,
34}