Entropy Monitors.Test
Path:
loom-sprint-scaffold/loom/tests/synthesis/entropy-monitors.test.tsRelative: loom/tests/synthesis/entropy-monitors.test.tsSubproject: loom-sprint-scaffoldCategory: testsLines: 191Bytes: 6,905Imports: 4Exports: 0has tests
Content Preview
- /**
- * Tests for H5.4 — Entropy Monitors.
- *
- * Proves:
- * - Shannon entropy computed correctly with natural log (hand-computed values)
- * - sliceEntropyWindows groups events into sliding windows correctly
- * - analyzeEntropy flags windows below thresholds
- * - Empty input → no flags
- * - High-entropy input → no flags
- * - Low-entropy input → flags fire
- */
- import { describe, expect, test } from "bun:test";
- import {
- shannonEntropy,
- sliceEntropyWindows,
- analyzeEntropy,
- runEnt