Conf Monitor
Path:
_archive/loom-stale-pre-sprint-snapshot/src/execution/conf-monitor.tsRelative: loom-stale-pre-sprint-snapshot/src/execution/conf-monitor.tsSubproject: _archiveCategory: archivedLines: 40Bytes: 1,274Imports: 0Exports: 2
Content Preview
- /**
- * H3.5 — Confidence EWMA monitor (P5).
- * Each assistant turn must carry <conf>0.NN</conf>. EWMA(alpha=0.4) below
- * conf_min for 5 consecutive numeric readings → ESCALATE_CONFIDENCE:
- * stop grinding, surface to Loop 1.
- */
- const CONF_RE = /<conf>\s*(0(?:\.\d+)?|1(?:\.0+)?)\s*<\/conf>/;
- export function extractConf(text: string): number | null {
- const m = CONF_RE.exec(text);
- if (!m || !m[1]) return null;
- const v = Number(m[1]);
- return Number.isFinite(v) && v >= 0 && v <= 1 ? v : n