Drift Sentinel

loom-sprint-scaffoldsourcetypescript
Path: loom-sprint-scaffold/loom/src/orchestrator/core/drift-sentinel.tsRelative: loom/src/orchestrator/core/drift-sentinel.tsSubproject: loom-sprint-scaffoldCategory: other
Lines: 137Bytes: 4,012Imports: 2Exports: 2

Content Preview

  1. /**
  2. * H1.6 — Drift Sentinel: embed last N stage summaries, compare cosine distance
  3. * against the original_spec embedding (computed once, stored on GoalState).
  4. *
  5. * Sustained divergence (distance > threshold for ≥2 consecutive checkpoints)
  6. * produces a DRIFT signal included in checkpoint decisions.
  7. */
  8. import { createLogger } from "../../lib/logger";
  9. import type { Embedder } from "./types";
  10. const log = createLogger({ component: "drift-sentinel" });
  11. export interface DriftConfig {
  12. /** Numb