Skip to main content

zenkey_fleet/
model.rs

1//! **Layer 2 — the model.** What the observations *mean*, without asking the
2//! bus anything.
3//!
4//! One rule places a module here: *it can do its job from values already in
5//! hand*. Nothing below takes a session. A key becomes a described key
6//! ([`facts`]), a set of served slices becomes a queryable registry
7//! ([`registry`]) and a set of rows ([`project`]), a stream of samples
8//! becomes rates and latencies ([`stats`]) or a tree ([`tree`], [`skeleton`]),
9//! two payloads become a diff ([`diff`]), a payload plus a schema becomes a
10//! rendering ([`decode`]), a sample on the alert plane becomes an alert
11//! transition ([`alert`]), the admin space's declared readers become a
12//! ranked consumer list ([`consumers`]), a window of samples becomes a
13//! lane-partitioned ordering on a stated clock ([`timeline`]), a fan-in's
14//! replies become snapshot rows ([`snapshot`]), two snapshots become one
15//! comparison ([`snapshot_diff`]), two deployments' hosts become one
16//! alignment ([`origin_map`]), a sample seen after a call becomes a
17//! *relation* to that call's procedure ([`trace`]), and a stream of
18//! described samples becomes a metrics surface whose blind spots are series
19//! of their own ([`export`], [`prom`]).
20//!
21//! Being session-free is the useful property, not an accident of history: it
22//! is what lets a frontend replay a `.zrec` through the same projections it
23//! runs live, and what lets these modules be unit-tested without a bus. A
24//! function here that finds it needs a session belongs in [`crate::bus`],
25//! with this layer projecting what it brought back.
26//!
27//! The layer also owns the two mechanisms every long-running projection
28//! shares: [`bounded`] (the O6 ceiling and its eviction ledger) and
29//! [`retain`] (the retention budget). A model that grows without a bound is
30//! not a model of a fleet, it is a leak.
31//!
32//! Nothing here judges. `stats` reports a latency that contains clock skew
33//! and says so; it does not call the transport slow. Verdicts are
34//! [`crate::judge`]'s.
35
36pub mod acl;
37pub mod alert;
38pub mod bounded;
39pub mod consumers;
40pub mod diff;
41pub mod examples;
42pub mod export;
43pub mod facts;
44pub mod impact;
45pub mod jsonschema;
46pub mod origin_map;
47pub mod project;
48pub mod prom;
49pub mod registry;
50pub mod retain;
51pub mod skeleton;
52pub mod snapshot;
53pub mod snapshot_diff;
54pub mod stats;
55pub mod storage;
56pub mod timeline;
57pub mod trace;
58pub mod tree;
59
60#[cfg(feature = "decode")]
61pub mod decode;
62#[cfg(feature = "decode")]
63pub mod infer;