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