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
//! Trust bookkeeping: which predictors are trusted, and the search-plan
//! budget consequences (`docs/theory/dsfb-selection.md` §3).
//!
//! # Purpose
//!
//! The trust record that justifies search ordering: a per-channel weight
//! in [0, 1] (normalized across channels), the residual EMA it derives
//! from, and the observation count behind it. Also the regime→breadth
//! vocabulary (`SearchBreadth`) with its candidate budgets.
//!
//! # Model
//!
//! Weights come from `dsfb::trust::calculate_trust_weights` over the
//! per-channel EMA residuals of `|1 − y|` (evidence error): raw weight
//! `1/(σ0 + residual)`, then normalized across channels — a channel that
//! is consistently evaluated and accurate (residual ≈ 0) dominates; one
//! that is never evaluated keeps its placeholder weight. Trust only
//! orders the search and gates budget spending; it never selects a
//! representation (ADR-0004/0010).
//!
//! # Units and invariants
//!
//! - `weight ∈ [0, 1]`, normalized (vector sum ≈ 1 after the first
//! observation); `residual_ema ∈ [0, 1]`, lower = better.
//! - Budgets are candidate counts (4 / 12 / 32), the same values as
//! `SearchStrategy` in `selection.rs`. Note the Unknown case differs
//! between the two vocabularies: `ShardedStorageObserver::plan` treats
//! Unknown as Narrow, while `SearchBreadth::for_regime` treats Unknown as
//! Balanced — the plan path is the one the search actually consumes.
//!
//! # Boundary
//!
//! Trust affects only evaluation order and budget. `TrustSummary` is the
//! per-channel reporting record; `SearchBreadth` is the regime→breadth
//! mapping kept in this module.
use crateChannel;
/// Trust-weighted summary of a channel's history.
///
/// Role: the observable per-channel trust record (reporting and
/// `trusted()` gating). Invariants: `weight ∈ [0, 1]` (normalized across
/// channels after the first observation); `residual_ema ∈ [0, 1]` (EMA of
/// `|1 − y|`, lower = better); `observations` counts steps for this
/// channel.
/// Search breadth implied by the regime
/// (`docs/theory/dsfb-selection.md` §3).