Conf Monitor.Test

loom-sprint-scaffoldtesttypescript
Path: loom-sprint-scaffold/loom/tests/execution/conf-monitor.test.tsRelative: loom/tests/execution/conf-monitor.test.tsSubproject: loom-sprint-scaffoldCategory: tests
Lines: 159Bytes: 5,452Imports: 2Exports: 0has tests

Content Preview

  1. /**
  2. * Tests for conf-monitor (H3.5).
  3. *
  4. * Proves:
  5. * - extractConf finds trailing JSON line `{"conf": 0.8}` in assistant content
  6. * - extractConf returns null when no conf line present
  7. * - EWMA calculation with α=0.4
  8. * - escalation when EWMA < 0.40 for 5 consecutive steps
  9. * - lowStreak resets when EWMA climbs above threshold
  10. * - makeEscalationEvent has correct shape
  11. *
  12. * EWMA details: α=0.4, initial=1.0
  13. * With conf=0.05: step1 ewma=0.62, step2 ewma=0.392 (below 0.40 → streak=1),
  14. * step3