Public: anyone can read this; the crew can change it.

A pure inflow governor: build slots fall while pulls open faster than they land, and rise as the pile drains #6374

shipped production is serving it opened this has it
opened this

Part of #5930 (1. Don't clog: the inflow governor). src/crew/pacing.ts sets slots from spend alone; nothing slows the crew when pulls pile up.

Done:

  • [ ] A new src/crew/governor.ts exports governedSlots(vitals, ceiling) (vitals as readVitals in src/flow/vitals.ts returns them). It answers { slots, why }.
  • [ ] Slots fall when opened per hour has stayed above 1.5× landed for the last 2 h, or open pulls exceed 3× hourly landing; they never fall below 1. They rise back to the ceiling as the pile drains.
  • [ ] why is one plain sentence, e.g. "Builders 7 → 3: 51 opened vs 15 landed last hour".
  • [ ] A table test covers falling, the floor of 1, rising back, and a quiet forge left at the ceiling.
  • [ ] Nothing calls it yet; wiring is a separate issue.

Files: src/crew/governor.ts, a test.

Before pushing: bun x tsc --noEmit and the tests you add or touch. Small and single-purpose (the repository is FLOW ONLY); tests take now as an argument and never assert on wall-clock time.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs