Skip to main content

zenkey_fleet/
judge.rs

1//! **Layer 3 — the judges.** Where an observation becomes a verdict.
2//!
3//! One rule places a module here: *it says whether something is wrong*.
4//! Everything below reads what [`crate::bus`] gathered and [`crate::model`]
5//! projected, and returns a document that takes a position — a doctor
6//! finding, an expectation met or unmet, a rung explaining why a key is
7//! silent, a cutover that did or did not finish.
8//!
9//! Because a verdict is the only thing here worth having, the honesty rules
10//! (RFC 13, v1.24; RFC 09 §5.1 O1–O7 for the individual rules) bite hardest
11//! in this layer. Three of them shape every module:
12//!
13//! * **Not asked is not answered no** (O4). A check that did not run reports
14//!   that it did not run.
15//! * **An observation that cannot carry the claim is neither pass nor fail**
16//!   (O6) — a drop under a completeness claim, a window shorter than the
17//!   claim's span.
18//! * **Silence is never a verdict** (RFC 05 §2.1). A judge that heard
19//!   nothing says what it asked and what did not answer.
20//!
21//! [`crate::report::Judgement`] is where those three become a type: the
22//! four-pole core every surface verdict maps onto, and the 0/1/2 exit
23//! projection beside it. It sits under `report/` rather than here because it
24//! is serde-pinned — `{"answer": "not_asked"}` reaches a script — and the
25//! placement rule on [`crate::report`] admits no exceptions, not even for the
26//! vocabulary the judges are written in.
27//!
28//! [`common`] holds the rest of that vocabulary: the check- and rung-id
29//! registries, the synthetic-traffic marker, the definition of "the new
30//! plane", the scope statement a passive observation watches, and the caps on
31//! how many offenders a report names. It exists because those had lived
32//! wherever they were first needed and the other judges reached across for
33//! them — `doctor` into `field`, `expect` and `condition` into `doctor`,
34//! `retired` into `cutover`. A judge importing another judge is now the
35//! signal it should be: it means one of them is doing the other's work.
36//!
37//! What a judge returns is a **report**, and every serialized report shape
38//! lives in [`crate::report`], not here (see that module's placement rule).
39
40pub mod budget;
41pub mod common;
42pub mod cutover;
43pub mod retired;
44pub mod why;
45
46#[cfg(feature = "decode")]
47pub mod condition;
48#[cfg(feature = "decode")]
49pub mod doctor;
50#[cfg(feature = "decode")]
51pub mod expect;
52#[cfg(feature = "decode")]
53pub mod field;