Budget Governor

_archivesourcetypescript
Path: _archive/loom-stale-pre-sprint-snapshot/src/execution/budget-governor.tsRelative: loom-stale-pre-sprint-snapshot/src/execution/budget-governor.tsSubproject: _archiveCategory: archived
Lines: 57Bytes: 1,685Imports: 2Exports: 2

Content Preview

  1. import type { StageBudget } from "../types/contracts";
  2. import type { Clock } from "./ports";
  3. /**
  4. * H3.6 — Budget governor (P6).
  5. * Hard caps from the envelope: tokens, tool calls, wallclock. Breach is a
  6. * graceful suspension decision point, never a mid-action kill — the harness
  7. * checks BETWEEN actions and writes a state summary before exiting.
  8. */
  9. export type BudgetStatus =
  10. | { breached: false }
  11. | { breached: true; which: "tokens" | "calls" | "wallclock"; detail: string };
  12. export clas