Loop Detector.Test
Path:
loom-sprint-scaffold/loom/tests/execution/loop-detector.test.tsRelative: loom/tests/execution/loop-detector.test.tsSubproject: loom-sprint-scaffoldCategory: testsLines: 152Bytes: 5,256Imports: 2Exports: 0has tests
Content Preview
- /**
- * Tests for loop-detector (H3.2).
- *
- * Proves:
- * - the identical action halts at exactly the 3rd occurrence (not 2nd, not 4th)
- * - window eviction: after W=10 actions, old entries fall off
- * - reset clears the buffer
- * - makeHaltLoopEvent has correct shape
- */
- import { describe, expect, test } from "bun:test";
- import { LoopDetector, makeHaltLoopEvent } from "../../src/execution/loop-detector";
- describe("LoopDetector", () => {
- test("returns halted=false for first unique action", asyn