Reversibility Gate

_archivesourcetypescript
Path: _archive/loom-stale-pre-sprint-snapshot/src/execution/reversibility-gate.tsRelative: loom-stale-pre-sprint-snapshot/src/execution/reversibility-gate.tsSubproject: _archiveCategory: archived
Lines: 51Bytes: 1,860Imports: 2Exports: 2

Content Preview

  1. import { verifyApprovalToken } from "../lib/hmac";
  2. import type { AllowedTool, Reversibility } from "../types/contracts";
  3. /**
  4. * H3.3 — Reversibility gate (HC-4).
  5. * Tools are stamped read|recoverable|destructive by the envelope (H2.2).
  6. * Destructive execution requires a valid, unconsumed HMAC approval token
  7. * minted by Loop 1. Deny → TOKEN_DENIED, never a silent pass.
  8. */
  9. export type GateDecision =
  10. | { allow: true; reversibility: Reversibility }
  11. | { allow: false; detail: string };
  12. expor