Conf Monitor
Path:
loom-sprint-scaffold/loom/src/execution/conf-monitor.tsRelative: loom/src/execution/conf-monitor.tsSubproject: loom-sprint-scaffoldCategory: otherLines: 108Bytes: 3,011Imports: 3Exports: 7
Content Preview
- /**
- * H3.5 — Confidence Monitor: every assistant turn must include conf ∈ [0,1]
- * (schema-enforced; extract from a trailing JSON line `{"conf": 0.8}` in the turn).
- * EWMA α=0.4; EWMA < 0.40 for 5 consecutive steps → emit kind=escalation,
- * reason=ESCALATE_CONFIDENCE, stop the stage.
- */
- import { newEventId } from "../lib/ids";
- import { createLogger } from "../lib/logger";
- import type { ExecutionTraceEvent, Sha256Hex } from "../types/execution";
- const ALPHA = 0.4;
- const THRESHOLD = 0.40;
- co