Entropy Monitors

loom-sprint-scaffoldsourcetypescript
Path: loom-sprint-scaffold/loom/src/synthesis/core/entropy-monitors.tsRelative: loom/src/synthesis/core/entropy-monitors.tsSubproject: loom-sprint-scaffoldCategory: other
Lines: 177Bytes: 5,757Imports: 1Exports: 7

Content Preview

  1. /**
  2. * H5.4 — Entropy Monitors.
  3. *
  4. * Queries entropy H(q) (dispatch outcome entropy) and H(s) (source/variety_class
  5. * entropy) over sliding dispatch windows using Shannon entropy with natural log.
  6. *
  7. * Shannon entropy: H(X) = -Σ p(x_i) * ln(p(x_i))
  8. *
  9. * Window size tunable (default 20 dispatches). Collapse below thresholds
  10. * → flag exploration_failure / confirmation_bias entries in the report.
  11. *
  12. * Pure functions, table-tested with hand-computed entropy values.
  13. */
  14. import type { EnrichedT