Skip to main content

doover_core/
lib.rs

1//! doover-core — snapshot, journal, and undo primitives for AI agent shell actions.
2//!
3//! Module map (built strictly test-first; see doover-implementation-plan.md):
4//! - `registry` (step 1): reversibility classification of commands
5//! - `parser` (step 2): bash parsing + affected-path scope resolution
6//! - `snapshot` (step 3): content-addressed CoW snapshot store
7//! - `journal` (step 4): SQLite action journal
8//! - `hooks` (step 5): harness adapters (Claude Code first)
9//! - `undo` (step 6): restore engine with conflict detection
10
11pub mod hooks;
12pub mod inspect;
13pub mod journal;
14pub mod maintenance;
15pub mod redact;
16pub mod registry;
17pub mod resolver;
18pub mod snapshot;
19pub mod undo;
20
21/// Crate version, single source of truth for the CLI `--version` output.
22pub const VERSION: &str = env!("CARGO_PKG_VERSION");
23
24#[cfg(test)]
25mod tests {
26    #[test]
27    fn version_matches_cargo() {
28        assert_eq!(super::VERSION, env!("CARGO_PKG_VERSION"));
29        assert!(!super::VERSION.is_empty());
30    }
31
32    /// Honest-failure canary. With `DOOVER_CI_CANARY=1` this test MUST fail;
33    /// the CI job `honesty-canary` runs it that way and passes only if it fails.
34    /// This proves, on every CI run, that test failures are actually reported —
35    /// the precondition for the project rule "no claim of completion without
36    /// green tests" (see CLAUDE.md).
37    #[test]
38    fn ci_canary() {
39        if std::env::var_os("DOOVER_CI_CANARY").is_some() {
40            panic!(
41                "canary tripped: failure reporting verified (this is the expected outcome under DOOVER_CI_CANARY=1)"
42            );
43        }
44    }
45}