Loop Detector
Path:
loom-sprint-scaffold/loom/src/execution/loop-detector.tsRelative: loom/src/execution/loop-detector.tsSubproject: loom-sprint-scaffoldCategory: otherLines: 96Bytes: 2,531Imports: 3Exports: 3
Content Preview
- /**
- * H3.2 — Loop Detector: actionHash(tool, args) via src/lib/ids.ts;
- * ring buffer W=10; ≥3 identical in window → HALT_LOOP.
- *
- * The stage fails fast and the trace event carries the repeated action hash.
- */
- import { actionHash, newEventId } from "../lib/ids";
- import { createLogger } from "../lib/logger";
- import type { ExecutionTraceEvent, Sha256Hex } from "../types/execution";
- const DEFAULT_WINDOW = 10;
- const REPEAT_THRESHOLD = 3;
- const log = createLogger({ component: "loop-detector" }