feat(06-02): honest ETA — per-axis EMA + independent display deadbands + arrival clock (GREEN)
- updateEta(prev|null, remainingS, remainingM): numbers-only signature (D-07 structural — no Fix can enter); first update seeds directly - EMA alpha 0.25/fix per axis; display refreshes only past its axis deadband (+-1 min time / +-5% remaining, axes independent) - composeEtaClock: 24-hour HH:MM instrument format (local wall clock) - suite E1-E8 green: seed, jitter-holds-display, real-drop-updates, independent axes, deadband symmetry, pinned constants, purity gate
This commit is contained in:
@@ -78,7 +78,12 @@ test("E4 a genuine 5-minute drop updates within 2 fixes and converges to the tar
|
||||
// alpha 0.25 convergence: (1 - 0.25)^n < 0.1 at n = 9 — 12 fixes lands inside 10%
|
||||
for (let i = 0; i < 12; i++) s = updateEta(s, 300, 10000);
|
||||
assert.ok(Math.abs(s.etaS - 300) <= 30, `smoothed converges to the drop (got ${s.etaS})`);
|
||||
assert.ok(Math.abs(s.displayedEtaS - 300) <= 30, `display converges too (got ${s.displayedEtaS})`);
|
||||
// the display trails the converged value by at most the deadband — its
|
||||
// whole contract (and why the instrument never whiplashes)
|
||||
assert.ok(
|
||||
Math.abs(s.displayedEtaS - s.etaS) <= DEADBAND_MIN_S,
|
||||
`display within one deadband of the smoothed truth (got ${s.displayedEtaS} vs ${s.etaS})`,
|
||||
);
|
||||
});
|
||||
|
||||
/* ————— E5 — independent axes ————— */
|
||||
|
||||
Reference in New Issue
Block a user