Artifact Contract.Test

loom-buildertesttypescript
Path: loom-builder/src/artifact-contract.test.tsRelative: src/artifact-contract.test.tsSubproject: loom-builderCategory: dispatch-system
Lines: 200Bytes: 7,726Imports: 5Exports: 0has tests

Content Preview

  1. /**
  2. * Artifact Contract Tests for run.ts dispatch paths.
  3. *
  4. * Proves that run.ts enforces the Dispatch Artifact Contract:
  5. * 1. payload.json is written with FULL untruncated messages array
  6. * 2. Archive mirror exists after simulated completion
  7. * 3. Archive mirror exists after simulated crash (throw inside run)
  8. *
  9. * Hermetic — uses mocks to avoid real provider calls.
  10. */
  11. import { afterEach, beforeEach, expect, test, mock } from "bun:test";
  12. import { existsSync, mkdirSync, mkdtempSync, readFile