Budget Governor.Test

loom-sprint-scaffoldtesttypescript
Path: loom-sprint-scaffold/loom/tests/execution/budget-governor.test.tsRelative: loom/tests/execution/budget-governor.test.tsSubproject: loom-sprint-scaffoldCategory: tests
Lines: 190Bytes: 6,388Imports: 3Exports: 0has tests

Content Preview

  1. /**
  2. * Tests for budget-governor (H3.6).
  3. *
  4. * Proves:
  5. * - all 3 hard cap types (calls, tokens, wallclock) are enforced
  6. * - calls breach at b_calls threshold
  7. * - tokens breach at b_tokens threshold
  8. * - wallclock breach at b_wallclock_s threshold
  9. * - recordCall correctly increments counters
  10. * - makeBudgetMemoryRecord creates valid state-summary record
  11. * - makeBudgetBreachEvent has correct shape
  12. * - Never kills mid-action (check at safe points only)
  13. */
  14. import { describe, expect, test } fr