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
//! # Residual Sign (`τ_σ`)
//!
//! Encodes the triple `σ(k) = (‖r(k)‖, ṙ(k), r̈(k))` as defined in Section 2.1 of the
//! DSSC paper. The sign is the fundamental semiotic primitive: it captures magnitude,
//! first-order drift, and second-order slew of the residual at a single time step.
//!
//! The `ResidualSign` type is `Copy` and `Clone` because sign values are passed freely
//! through grammar transitions and provenance tags without ownership transfer.
/// The residual sign triple `σ(k) = (‖r(k)‖, ṙ(k), r̈(k))`.
///
/// All three components are `f64` to support arbitrary normed spaces projected to scalar
/// observables. Multi-channel residuals are handled by `Vec<ResidualSign>` (one per channel).
///
/// # Formal correspondence
/// | Field | Paper notation | Meaning |
/// |-------|---------------|---------|
/// | `magnitude` | `‖r(k)‖` | Residual norm at step k |
/// | `drift` | `ṙ(k) = r(k) − r(k−1)` | First discrete derivative |
/// | `slew` | `r̈(k) = ṙ(k) − ṙ(k−1)` | Second discrete derivative |