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
//! Drift Detection Module
//!
//! Detects when ontology changes make generated code stale by tracking
//! SHA256 hashes of ontology files, manifests, and inference rules.
//!
//! ## Overview
//!
//! The drift detector:
//! - Stores SHA256 hashes after each sync
//! - Compares current hashes against stored state
//! - Warns users when ontology changes since last sync
//! - Tracks timestamps for age-based warnings
//!
//! ## Usage
//!
//! ```rust,no_run
//! use crate::drift::{DriftDetector, DriftStatus};
//! use std::path::Path;
//!
//! # fn main() -> crate::utils::error::Result<()> {
//! let detector = DriftDetector::new(Path::new(".ggen"))?;
//! let status = detector.check_drift(
//! Path::new("ontology.ttl"),
//! Path::new("ggen.toml"),
//! )?;
//!
//! match status {
//! DriftStatus::Clean => println!("No drift detected"),
//! DriftStatus::Drifted { changes } => {
//! for change in changes {
//! eprintln!("⚠️ {}", change);
//! }
//! }
//! }
//! # Ok(())
//! # }
//! ```
//!
//! ## Constitutional Requirements
//!
//! - No unwrap/expect in production code
//! - Result<T,E> throughout
//! - Non-blocking warnings (don't fail commands)
//! - Performance: drift check <100ms
pub use ;
pub use ;