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

A queued pull check waits while a crew run holds the only core, and starts when it ends #11793

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

A 1-CPU forge now starts no queued pull check while a crew run is active. The held check starts once the run ends. `bun x tsc --noEmit`, `bun scripts/gate.ts` and `bun test test/checks-one-core.test.ts` pass in the sandbox; the full suite is left to the forge's check.

shipped production is serving it deploy 28f939d

opened this

A 1-CPU forge now starts no queued pull check while a crew run is active. The held check starts once the run ends. bun x tsc --noEmit, bun scripts/gate.ts and bun test test/checks-one-core.test.ts pass in the sandbox; the full suite is left to the forge's check.

  • Hold: schedule() in src/checks/service.ts drops pull checks from the queue it picks from while crewHoldsCore(cpus, activeRuns) is true. Held checks keep their place, so order is unchanged. The existing tick restarts them once the run is gone, so nothing new was needed to wake the loop. A check already running is left alone.
  • Gate: main's check, which is any queued check with no pull, is never held, so a red main is not held forever.
  • Injection: ChecksOptions.cpus and ChecksOptions.activeCrewRuns default to forgeCpus and the count of active agent runs. This is the same default src/looks/service.ts uses.
  • Tests: test/checks-one-core.test.ts has three cases, one per case in the issue. I stashed the service change and re-ran: the 1-CPU hold test failed. The 2-CPU and gate tests passed without the change, as they must, since they pin that the hold stays narrow.
  • Not touched: scripts/gate.ts finds tests by glob, so the new file needed no entry. There are no docs changes and no snapshot changes, and I did not read the earlier 11599 branch.

To try it, run the new test file with bun test test/checks-one-core.test.ts.

Closes #11775

commented

A 1-CPU forge now starts no queued pull check while a crew run is active. The held check starts once the run ends. bun x tsc --noEmit, bun scripts/gate.ts and bun test test/checks-one-core.test.ts pass in the sandbox; the full suite is left to the forge's check.

  • Hold: schedule() in src/checks/service.ts drops pull checks from the queue it picks from while crewHoldsCore(cpus, activeRuns) is true. Held checks keep their place, so order is unchanged. The existing tick restarts them once the run is gone, so nothing new was needed to wake the loop. A check already running is left alone.
  • Gate: main's check, which is any queued check with no pull, is never held, so a red main is not held forever.
  • Injection: ChecksOptions.cpus and ChecksOptions.activeCrewRuns default to forgeCpus and the count of active agent runs. This is the same default src/looks/service.ts uses.
  • Tests: test/checks-one-core.test.ts has three cases, one per case in the issue. I stashed the service change and re-ran: the 1-CPU hold test failed. The 2-CPU and gate tests passed without the change, as they must, since they pin that the hold stays narrow.
  • Not touched: scripts/gate.ts finds tests by glob, so the new file needed no entry. There are no docs changes and no snapshot changes, and I did not read the earlier 11599 branch.

To try it, run the new test file with bun test test/checks-one-core.test.ts.

Approved

Clean, narrow change. The hold filters queued runs with no pull (issueId null, the same convention the existing gate-slot hold uses) only when crewHoldsCore is true. Order is kept, running checks are untouched, and cpus/activeCrewRuns are injectable with the same defaults as the looks service. The three tests cover hold-then-release, 2 CPUs, and the gate. No security surface, no docs needed, no new dependency.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs