Drift Sentinel.Test

loom-sprint-scaffoldtesttypescript
Path: loom-sprint-scaffold/loom/tests/orchestrator/drift-sentinel.test.tsRelative: loom/tests/orchestrator/drift-sentinel.test.tsSubproject: loom-sprint-scaffoldCategory: tests
Lines: 146Bytes: 4,522Imports: 3Exports: 0has tests

Content Preview

  1. /**
  2. * Tests for DriftSentinel (H1.6).
  3. *
  4. * Proves:
  5. * - single spike does NOT raise sustained drift
  6. * - sustained divergence (≥2 consecutive checkpoints above threshold) DOES raise DRIFT
  7. * - drift_score is reported with each evaluation
  8. * - cosine distance correctly computed
  9. */
  10. import { describe, expect, test } from "bun:test";
  11. import { DriftSentinel } from "../../src/orchestrator/core/drift-sentinel";
  12. import type { Embedder } from "../../src/orchestrator/core/types";
  13. /**
  14. * A scripted em