Chaos.Test

loom-sprint-scaffoldtesttypescript
Path: loom-sprint-scaffold/loom/tests/e2e/chaos.test.tsRelative: loom/tests/e2e/chaos.test.tsSubproject: loom-sprint-scaffoldCategory: tests
Lines: 253Bytes: 10,016Imports: 7Exports: 1has tests

Content Preview

  1. /**
  2. * Chaos Tests — fault injection, one scenario per test.
  3. *
  4. * Five scenarios:
  5. * 1. dropped-tool-result — ack gate catches missing ack → GATE_REJECT
  6. * 2. duplicate-delivery — same stage_id dispatched twice → idempotent
  7. * 3. loop-detection — identical action ≥3× → HALT_LOOP
  8. * 4. forged-token — forged/expired approval token → TOKEN_DENIED
  9. * 5. decomposer-error — non-machine-evaluable criteria → DecompositionError
  10. */
  11. import { describe, expect, test } from "bun:test";
  12. import { r