Skip to main content

zero_operator_state/
lib.rs

1//! Operator-state honesty.
2//!
3//! This crate answers one question, in one pure data structure, with
4//! no I/O:
5//!
6//! > *"Given the operator's event history up to now, what behavioral
7//! > state are they in and what friction level is appropriate?"*
8//!
9//! The crate does not talk to the engine. It does not read the
10//! filesystem. It does not render anything. It takes events in, it
11//! produces a snapshot out. Persistence lives in `zero-session`.
12//! Rendering lives in `zero-tui`. Friction enforcement lives in
13//! `zero-commands`. The separation is deliberate — this crate is the
14//! only place where behavioral classification lives, and it must be
15//! testable in isolation with nothing but `Vec<Event>` and
16//! `DateTime<Utc>`.
17//!
18//! See **`ZERO_OS_CLI_SPEC_ADDENDUM_A.md`** §§ 1-3, 10. ADR-013 locks
19//! this crate's position in the system; ADR-014 locks the
20//! [`RiskDirection`] invariant this crate exports.
21
22#![allow(clippy::module_name_repetitions)]
23
24pub mod classifier;
25pub mod events;
26pub mod friction;
27pub mod label;
28pub mod snapshot;
29pub mod vector;
30
31pub use classifier::Classifier;
32pub use events::{Event, EventKind, Outcome, Source};
33pub use friction::{FrictionGate, FrictionLevel, RiskContext, RiskDirection};
34pub use label::Label;
35pub use snapshot::Snapshot;
36pub use vector::StateVector;