crates/autonom/src/lib.rs
//! # autonom — the nordisk completeness / anti-drift subsystem
//!
//! `autonom` is THE single shared home for **coverage** in the constellation.
//! Two orthogonal senses of "coverage" meet here:
//!
//! 1. **WIRING / surface coverage** — is *every testable surface* reached by a
//! real inject-assert test? The gate: `Gap = Surface − Covered − Allowlist`,
//! `GREEN ⟺ Gap == ∅ AND no stale allowlist entry` (HARD zero, not a ratchet).
//! 2. **TEST-matrix coverage** — the per-repo × per-aspect pass/fail matrix.
//!
//! The *pure engines* for both already live in the sibling crate
//! [`nornir_testmatrix`] ([`discover`](nornir_testmatrix::discover) builds the
//! [`Surface`](nornir_testmatrix::discover::Surface) and
//! [`compute_gap`](nornir_testmatrix::compute_gap) differences it;
//! [`coverage`](nornir_testmatrix::coverage) holds the [`Allowlist`]/
//! [`GateReport`] model). `autonom` is a **façade** over those, and it *owns* the
//! two pieces that had no shared home:
//!
//! * [`allowlist`] — the checked-in `autonom-allow.toml` **file model** (load /
//! save / canonical path). Lifted verbatim out of `nornir::autonom` so robotui
//! and dwarves can read/write an allowlist without a warehouse or the `toml`
//! dep in their own tree.
//! * [`sentinel`] — the reusable **sentinel-ban** scan (`todo` / `not wired` /
//! `not yet` / `coming soon`). Was copy-pasted into three nornir test files;
//! now one implementation.
//!
//! See `.nornir/autonom-consolidation.md` for the crate boundary vs
//! `nornir-testmatrix` and the staged move-map for the rest of the glue.
pub mod allowlist;
pub mod sentinel;
// ─── the runnable feeder (feature `scan`) ────────────────────────────────────
//
// The pure engine above computes a gap from pre-built facts; these modules are
// the self-contained source-scanning FEEDER + report shaping that make the gate
// actually RUNNABLE against a real repo (the `autonom` CLI binary drives them),
// without the warehouse/facett feeders that live in nornir.
#[cfg(feature = "scan")]
pub mod feeder;
#[cfg(feature = "scan")]
pub mod report;
/// Bench the scan hot path (feature `bench`) — registers a `nornir-bench`
/// [`Bencher`](bench::ScanFold) for the scan-and-gap fold.
#[cfg(feature = "bench")]
pub mod bench;
// ─── the coverage façade: re-export the pure engine verbatim ────────────────
//
// So consumers say `autonom::{Surface, Gap, GateReport, Allowlist, …}` and never
// need to know the split between discover.rs and coverage.rs, nor depend on
// nornir-testmatrix directly for the gate. This is the COMPLETE gate-facing
// surface: the fact types + every Surface enumerator + the difference engine
// (discover) and the verdict/allowlist/report model + SVG twin (coverage).
// autonom's own feeder/report/bench consume the engine through THIS façade
// (`crate::…`), never `nornir_testmatrix::…` directly — so any gap in the
// re-export is a compile error, not a silently-bypassed boundary.
pub use nornir_testmatrix::coverage::{
coverage_svg, covered_with_utfallsrum, rows_for, rows_for_with_utfallsrum, seed_allowlist,
stale_allowlist_entries, AllowEntry, Allowlist, CoverageRow, CoverageSummary, GateReport,
SurfaceUtfallsrum, Verdict, DEFAULT_UTFALLSRUM_THRESHOLD,
};
pub use nornir_testmatrix::discover::{
benchers, cli_commands, compute_gap, covered_atoms, covered_benchers, covered_facetts,
facett_components, grpc_handlers, mcp_tools, test_reachable, ui_atoms, unreached_functions,
viz_tabs, workspace_keys, workspace_surface_key, BencherRow, CallEdge, DiscoveredAtom, FacetRow,
Gap, Mode, Surface, SurfaceKind, SurfaceNode, SymbolRow, SERVED_WORKSPACES,
};
pub use allowlist::{allowlist_path, load_allowlist, save_allowlist};
pub use sentinel::{find_sentinel, SentinelHit, SENTINELS};