Envelope Compiler

loom-sprint-scaffoldsourcetypescript
Path: loom-sprint-scaffold/loom/src/dispatcher/core/envelope-compiler.tsRelative: loom/src/dispatcher/core/envelope-compiler.tsSubproject: loom-sprint-scaffoldCategory: other
Lines: 130Bytes: 4,998Imports: 7Exports: 1

Content Preview

  1. /**
  2. * H2.2 + H2.3 — Envelope Compiler.
  3. *
  4. * compile(stage, mode, opts): DispatchEnvelope
  5. * - Tool allowlist: only the tools appropriate for the stage's variety_class,
  6. * each stamped with a reversibility class from TOOL_REVERSIBILITY_MAP.
  7. * - Budget stamping (H2.3): B_tokens / B_calls / B_wallclock =
  8. * stage.budget_defaults × mode cost_multiplier × deficit widening.
  9. * - dispatch_id = hash(goal_id, stage_id, attempt) via src/lib/ids.ts.
  10. * - Output validates against dispatch-envelope.sc