Reversibility Gate.Test

loom-sprint-scaffoldtesttypescript
Path: loom-sprint-scaffold/loom/tests/execution/reversibility-gate.test.tsRelative: loom/tests/execution/reversibility-gate.test.tsSubproject: loom-sprint-scaffoldCategory: tests
Lines: 203Bytes: 6,855Imports: 3Exports: 0has tests

Content Preview

  1. /**
  2. * Tests for reversibility-gate (H3.3).
  3. *
  4. * Proves:
  5. * - allowlist lookup accepts allowed tools and denies unknown
  6. * - destructive tools require valid HMAC approval token
  7. * - valid HMAC token allows destructive action
  8. * - invalid/missing token denies destructive action
  9. * - read/recoverable tools pass without token
  10. * - makeTokenDeniedEvent has correct shape
  11. * - uses WebCrypto (not node:crypto)
  12. */
  13. import { describe, expect, test } from "bun:test";
  14. import {
  15. checkAllowlist,
  16. makeToke