Envelope Compiler.Test

loom-sprint-scaffoldtesttypescript
Path: loom-sprint-scaffold/loom/tests/dispatcher/envelope-compiler.test.tsRelative: loom/tests/dispatcher/envelope-compiler.test.tsSubproject: loom-sprint-scaffoldCategory: tests
Lines: 262Bytes: 10,508Imports: 6Exports: 0has tests

Content Preview

  1. /**
  2. * Tests for EnvelopeCompiler (H2.2 + H2.3).
  3. *
  4. * Proves:
  5. * - compiled envelope validates against dispatch-envelope.schema.json
  6. * - allowlist excludes undeclared tools (only tools for the stage's variety_class)
  7. * - every allowlisted tool carries a reversibility stamp
  8. * - budget scaling with cost multiplier and deficit widening (exact 1.5×)
  9. * - dispatch_id is deterministic hash of goal_id, stage_id, attempt
  10. * - ContractViolationError on invalid output
  11. */
  12. import { describe, expect, te