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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
//! The DISCRIMINATOR — the shared classifier spine (P3a) that fuses the two
//! streamless sensors into one curation verdict per failure-class.
//!
//! # The build-once share is at the CLASSIFIER, not the sensors
//!
//! The v0.6 obsolete/dormant/evaded/well-defended classification was once imagined
//! as "one change-detector feeding one discriminator." The adversarial
//! corrected that: the *sensors* read DIFFERENT inputs with DIFFERENT mechanisms and
//! do NOT collapse — only the **classifier** is shared. This module IS that shared
//! classifier. It consumes:
//!
//! - **INPUT 1 — the SOURCE-AST axis** ([`SilentStatus`], from
//! [`silent_status`](crate::learn::reader::silent_status)): is the failure-shape
//! gone / present / mutated-just-past / undecidable in live code? STREAMLESS.
//! - **INPUT 2 — the WITNESS axis** (a `defended` bool, from P2's
//! [`is_class_defended`](crate::audit::AuditReport::is_class_defended)): does the
//! class still carry a live (`tier > None`) witness at its sites?
//!
//! A third axis — INPUT 3, the LOUD-minority rate-stream (ADWIN over the affinity
//! trajectory) — is intentionally NOT consumed here: it is a separate sensor
//! (different math, gated on the streaming change-detector) that, when built, refines
//! the EVADED/DORMANT split for the loud classes. This classifier is the silent-core
//! spine the four efferent loops hang off; the loud refinement layers on later.
//!
//! # Why the WITNESS axis OVERRIDES "shape gone"
//!
//! The single most load-bearing cell: a class whose **shape is gone** (the
//! SOURCE-AST axis would call it OBSOLETE) but which still carries a **live witness**
//! is **WELL-DEFENDED, not obsolete** — the witness is the plausible *reason* the
//! shape is gone (the guard held). Forgetting it would discard a working immunity
//! (antigen's own `RoutingTableStale` nightmare, re-introduced by the very organ
//! meant to fight noise). On the silence axis alone these are identical; the witness
//! axis is what keeps WELL-DEFENDED distinct from OBSOLETE (the same split P2' draws).
use crateSilentStatus;
/// The per-class curation verdict — what the efferent loops (CURATE / forgetting /
/// red-queen) act on. Derived purely from the two streamless sensor outputs.
/// Fuse the two streamless sensor outputs into a per-class [`ClassVerdict`] (P3a).
///
/// `silent` is INPUT 1 ([`silent_status`](crate::learn::reader::silent_status));
/// `defended` is INPUT 2 (`tier > None` per-class, from
/// [`is_class_defended`](crate::audit::AuditReport::is_class_defended)).
///
/// The fusion, in precedence order:
/// 1. [`SilentStatus::Evading`] → [`ClassVerdict::Evaded`] (a near-miss is active
/// evasion — the witness axis does not override an act-now red-queen signal).
/// 2. [`SilentStatus::Indeterminate`] → [`ClassVerdict::RouteToHuman`] (undecidable,
/// conservative).
/// 3. [`SilentStatus::Dormant`] → [`ClassVerdict::Dormant`] (shape alive).
/// 4. [`SilentStatus::Obsolete`] → **the witness axis decides**:
/// [`ClassVerdict::WellDefended`] if `defended` (a live witness holds it), else
/// [`ClassVerdict::Obsolete`] (truly gone — the only auto-forgettable cell).
pub const
/// **The canonical fused-classify (INPUT-3 wired)** — the three-axis per-class verdict
/// the curation pipeline consumes, consulting the ADWIN loud rate-stream alongside the
/// two streamless sensors.
///
/// This is the production-shaped entry: [`classify`] is the streamless 2-input
/// special-case (used when there is no trajectory / the loud axis is silent);
/// `fused_classify` is the FULL read — it derives the loud-axis [`DriftVerdict`] from
/// the class's affinity-trajectory and joins it via the conservatism-JOIN
/// ([`fuse_channels`](crate::learn::adwin::fuse_channels)). The loud axis is the third
/// sensor the docstring at the top of this module reserved (INPUT 3).
///
/// # Inputs
/// - `trajectory` — the class's affinity-trajectory
/// ([`score_trajectory`](crate::learn::life_record::LifeRecord::score_trajectory)),
/// the loud-axis input ADWIN reads.
/// - `silent` — INPUT 1, the streamless source-AST status
/// ([`silent_status`](crate::learn::reader::silent_status)).
/// - `defended` — INPUT 2, the witness axis (`tier > None`).
/// - `delta` — the ADWIN confidence (use
/// [`DEFAULT_DELTA`](crate::learn::adwin::DEFAULT_DELTA)).
///
/// # The conservatism-JOIN is preserved (INV-ADWIN-3)
/// If the loud axis is blind (`UnderPowered` — the default at antigen's n≈8 scale) OR
/// the silent axis is `Indeterminate`, the verdict is [`ClassVerdict::RouteToHuman`] —
/// never an irreversible forget. So at v0.6, where every class is loud-axis-blind, this
/// reduces to the streamless [`classify`] read for the *forget* decision (the loud axis
/// abstains, the streamless verdict stands) — the honest "ADWIN sees nothing yet, here's
/// the streamless call" behavior, NOT a fabricated loud signal.
///
/// **Honest scope:** this is the LIBRARY seam — the canonical entry the curation
/// pipeline will call. At v0.6 that pipeline has no production caller yet (the binary
/// wires only `propose`); `fused_classify` is the wired-and-ready fused-classify, not a
/// dormant duplicate of `classify` — it is the path that consults the loud axis, which
/// `classify` structurally cannot.
///
/// [`DriftVerdict`]: crate::learn::adwin::DriftVerdict