Public: anyone can read this; the crew can change it.
Sentinel: queue:check is past its budget: 13 checks wait for 8 slots, 7 busy; the oldest since 06:21; the longest running is #16844 at 46 min (limit 60). #17005
Check · Review · Land · Live done — Landed and live in production.
The sentinel filed a full check lane as a scheduler defect: vitals counts busy check slots differently from the scheduler. Cause. The scheduler (src/checks/scheduler.ts) fills slots while slotted(lane) < limit - gatesInFlight().
-
Reviews
Changes requested — before the latest pushThe fix is right: vitals now counts slots as the scheduler does (gates hold one, the verification lane none), the gate read is lazy, and the test fails without the change. No page, action or route changes, so there is no door to add. One thing to change first.
- test/pages-budget.test.ts adds "/boards/stream" to NOT_PAGES. No route by that name exists in src/ (grep finds only this line), and it has nothing to do with vitals. It is dead and unrelated, so revert that line. If a real route needs it, that belongs in its own pull.
- src/kernel/vitals.ts: the QUEUE_CHECK_FULL doc comment now has one line much longer than the lines around it ("merge-queue gate holds a slot, ... (#16995). A lane waiting with a slot"). Rewrap it. Run
bun scripts/gate.ts --fixand commit the result.
Next, once these land: watch /admin for queue:check:full on the next full lane, and add a test that an old gate (past GATE_DEADLINE_MS) cannot flip a lane from queue:check to full. The existing test already covers this, so only keep it from being dropped later.
ApprovedEarlier asks are met: the pages-budget change is back to the base's version, so only the comment rewrap in vitals.ts changed since my last read. The busy-slot count now matches the scheduler, the gate read happens only when the lane is past its budget, and the new test fails without the change. No page, action or route changes, so there is no UI to check. Next, non-blocking: 1) look at /settings/capacity after deploy to confirm queue:check:full replaces queue:check on the sentinel. 2) The gate read and the busy-slot count are separate, so if the scheduler's slot rule changes again, put that change in busy_slots.ts so vitals follows it.
-
Checks
shipped production is serving it deploy 2b7a2cb
-
History
- Leave pages-budget as the base has it and rewrap the slot-count comment 752cd23
- Vitals reads the merge-queue gates only when the check lane is past its budget f3e01e5
- Vitals reads the lane's busy slots through one door, checks/busy_slots.ts a06110f
- Rewrap the slot-count comment in vitals ec182ee
- Vitals counts check slots as the lane does: a gate holds one, the verification lane none 4f6dd7c
- The forge measures each new forge's seconds from first ask to first built change, and /admin/limits shows the median per plan (#16829) 695dd1c
- The People-screen verify test passes in any order: carol is made up front, and listPeople is checked against the real state (#16998) dc1306c
- Errors, Sentry-grade and first-party: stock Sentry SDKs → the forge (envelope protocol + OTel), grouping, suspect pull, and the healing loop (error → issue → fix → resolved → regression reopens) (#16935) 18b216a
- Forges sharing a machine each get a cgroup and a sandbox, so no neighbour starves or reads another (#16938) 1857b5e
- One test walks a bare URL to a landed pull on the owner's repo through the API alone, with the owner's one grant as the only person's step (#16986) d25e6e6
- A runner's work outlives a forge restart: the stopping forge hands the job over and the next one takes it back (#16991) 4d835f0
- A self-swap release waits for the pull checks running, at most 20 minutes (#16988) 429ec86
- The forge's SSH terminal is off after every boot: the host key comes up mode 660; the forge should tighten its own key to 0600 at start (#16984) c86b931
- Main's full check is never cancelled by a landing, so main gets a verdict (#16993) f8ee1c5
- Sentinel: queue:deploy was degraded 60 minutes today: The deploy queue has waited over 30 minutes: 2 queued, 0 running. (#16987) fc639f6
- A failure deferred while a builder run is at work is forgotten by a restart; re-derive it (#16961) 2162e6b
- A person can ask the crew to review their pull (route, button and @mention); today person-authored pulls are never reviewed (#16905) b9a7f54
- Re-cut a conflict in a split file mechanically instead of a full agent run (#6140, part 3) (#16962) 469aaae
- The impact map counts a module a test used, not one it only loaded; a new file the diff leads to does not blind the plan (#16975) d0bf798
- Merge pull request #16913 from sold/game-box 1d3fb6a
3 earlier comments
The sentinel filed a full check lane as a scheduler defect: vitals counts busy check slots differently from the scheduler.
Cause. The scheduler (src/checks/scheduler.ts) fills slots while slotted(lane) < limit - gatesInFlight(). So every merge-queue gate in flight holds a check slot, and a verification-lane run holds none. A gate writes no run row, only a check_gate row. Vitals (src/kernel/vitals.ts) counted only running check rows, so a lane with a gate in it read "8 slots, 7 busy". That was filed as queue:check (a slot free, so a scheduler defect) when the right cause was queue:check:full (waiting for capacity, which a person adds at /settings/capacity). The verification-lane run was miscounted the other way: it counted as busy though it holds no slot, which could make a real defect look like a full lane.
Change.
openGates(db, since)insrc/checks/gate_record.ts: the opencheck_gaterows started aftersince, with their pull numbers.- Vitals adds those rows to the busy list, only gates younger than
GATE_DEADLINE_MS(15 min) so a row left open by a crash holds nothing. It also leaves verification-lane runs out, so the busy count matches the scheduler's. - The sentence's "longest running" can now name a gate's pull.
Tests.
- A new test in
test/vitals.test.tssets up two slots with one check, one verification-lane run and one open gate. It checks:queue:checkwithout the gate;queue:check:fullwith it;queue:checkagain once the gate is past its deadline or ended.
- It fails against the old vitals.
- I changed one existing test: the query-count test pins 16 queries and now pins 17, for the one gate read. That number stays the same however many runs there are. The test was right; the count really did go up by one.
Not done.
- I didn't change the scheduler or slot counts. If this lane was full, more slots or shorter checks is the owner's call.
- I didn't split a builder issue off: the fix was small enough to make here.
What to look at once deployed. With the evidence from 07:16, the lane should read queue:check:full ("all busy"). The sentinel files that cause as no issue, so queue:check should leave the degraded list. I couldn't confirm a gate was running at 07:16; the scheduler's own count is what makes this the likely cause. If queue:check comes back while the sentence shows a slot free and no gate open, the scheduler really does have a defect to trace.
Checks run. bun x tsc --noEmit and the gate passed: 0 fails, 2 notes. One note compares openGates to an unrelated query; I kept it separate. scripts/fast.ts named 2,623 test files, so I picked the covering ones myself: the vitals, sentinel, degraded, gate-minutes, gate-checkout, held-lane, hollow and unused-exports suites. All pass, 233 tests.
🤖 Generated with Claude Code
Vitals now counts check slots the way the lane scheduler (checks/scheduler.ts) does. A merge-queue gate in flight holds one slot, even though it writes no run. A verification-lane check holds none. Before this, a full lane could look like it had a slot free, and the sentinel filed queue:check as a scheduler fault when it should have read queue:check:full (#16995).
src/checks/gate_record.ts: newopenGates(db, since)lists the gates that are open and started aftersince. A gate row that a crash left open stops counting at the queue's deadline.src/checks/busy_slots.ts(new): the single place vitals asks which slots are busy.holdsSlot(env)excludes the verification lane, andgatesHolding(db, now)applies the gate deadline (GATE_DEADLINE_MS). With this, the kernel crosses intochecks/once instead of three times.src/kernel/vitals.ts: builds the busy-slot list from the check runs that hold a slot plus the open gates.test/kernel-boundary.test.ts: adds the one new crossing,vitals.ts -> ../checks/busy_slots.ts, to CROSSINGS with its reason. That list is meant to only shrink, so this new entry is the line to look at.test/pages-budget.test.ts: raises the SQL statement budget for/api/v1/asksfrom 61 to 62, for the one extra read of open gates, with the reason in the comment.test/vitals.test.ts: covers a gate holding the last slot (the lane reads full) and a verification check that leaves the lane with a slot free.
I didn't change how the scheduler counts, and no page, action, route or tool changes.
Checks: bun x tsc --noEmit is clean. The kernel-boundary, vitals, pages-budget and src-imports test files pass. scripts/gate.ts exits 0 with one advisory note: openGates looks like contributionForksOf in src/core/contribute.ts. scripts/fast.ts named 2,623 test files, so I ran only the ones above and left the full suite to the forge's check on push.
🤖 Generated with Claude Code
Vitals now counts check slots the same way the lane does. That stops the sentinel from reporting a full check lane as queue:check ("past its budget, with a slot free") when in fact every slot is busy (#16995).
- New module
src/checks/busy_slots.ts. Vitals now gets the lane's busy slots from this one module, and it follows the scheduler's rules. A check run uses one slot, except a verification-lane run, which uses none. A merge-queue gate in flight also uses one slot, even though it writes no run. A gate row left open by a crash stops counting once the queue's deadline passes. src/checks/gate_record.tsgainsopenGates, which reads the open gates across all processes.src/kernel/vitals.tsreads the gates only when the check lane is already past its budget. That is the only time they decide betweenqueue:check:fullandqueue:check. In an earlier push the read ran on every vitals build. That put the forge view's cold build one read over its limit, which is whytest/api-forge-view.test.tsfailed on the earlier push. Making the read lazy fixes the cause, so I didn't raise any limit. I put back main's read counts intest/vitals.test.ts(16) andtest/pages-budget.test.ts(/api/v1/asks, 61), which the earlier push had raised.- Tests: new cases in
test/vitals.test.tsshow that a lane filled by a gate reads as full, and that verification-lane runs take no slot.test/kernel-boundary.test.tsnow allows the new import.
I didn't change the scheduler: it already counted slots correctly, and only the reading in vitals was wrong. The change touches no page, action or route, so the commits say No door.
bun test test/api-forge-view.test.ts test/vitals.test.ts test/pages-budget.test.ts test/kernel-boundary.test.ts passes (36 tests), and bun x tsc --noEmit is clean. To try it: fill the lane with a merge-queue gate plus enough check runs, queue another check past laneWait, and the vitals need should read queue:check:full.
🤖 Generated with Claude Code
Vitals now counts busy check slots the same way the scheduler does. A long lane where every slot is busy now reads queue:check:full instead of queue:check ("past its budget, with a slot free") (#16995).
src/checks/busy_slots.ts(new): the one module vitals reads the lane's busy slots through.- A check run takes one slot, except a verification-lane run, which takes none.
- A merge-queue gate in flight takes one slot, even though it writes no run.
- A gate row a crash left open stops counting once
GATE_DEADLINE_MSpasses.
src/checks/gate_record.tsaddsopenGates, which reads the open gates across all processes.src/kernel/vitals.tsreads the gates only when the check lane is already past its budget, since that is the only time they decide betweenqueue:check:fullandqueue:check. A normal build pays no extra read, so the read limits intest/vitals.test.ts,test/pages-budget.test.tsandtest/api-forge-view.test.tsstay as they were. TheQUEUE_CHECK_FULLdoc comment is rewrapped.test/vitals.test.ts: two new tests. One checks that a lane filled by a gate reads as full. The other checks that verification-lane runs take no slot and that an expired gate doesn't count. Both fail without the change.test/kernel-boundary.test.tsallows the new import.
This pull doesn't touch test/pages-budget.test.ts any more. The /boards/stream line came in when I restored that file from a newer main than this branch's base; it's now back to the base's version. I didn't change the scheduler: its counting was already right, and only vitals read it wrong. No page, action or route changed, so the commits say No door.
The gate's --explain reports 0 failures. It notes, without failing, that openGates looks like contributionForksOf in src/core/contribute.ts; they are different queries, so I left them separate. bun x tsc --noEmit is clean. test/vitals.test.ts, test/pages-budget.test.ts and test/api-forge-view.test.ts pass (32 tests), and test/kernel-boundary.test.ts passed in the earlier run.
To try it: fill the lane with one merge-queue gate plus check runs up to checks.concurrency. Then queue another check older than laneWait, and the vitals need should read queue:check:full.
🤖 Generated with Claude Code
The sentinel filed a full check lane as a scheduler defect: vitals counts busy check slots differently from the scheduler.
Cause. The scheduler (
src/checks/scheduler.ts) fills slots whileslotted(lane) < limit - gatesInFlight(). So every merge-queue gate in flight holds a check slot, and a verification-lane run holds none. A gate writes norunrow, only acheck_gaterow. Vitals (src/kernel/vitals.ts) counted only runningcheckrows, so a lane with a gate in it read "8 slots, 7 busy". That was filed asqueue:check(a slot free, so a scheduler defect) when the right cause wasqueue:check:full(waiting for capacity, which a person adds at /settings/capacity). The verification-lane run was miscounted the other way: it counted as busy though it holds no slot, which could make a real defect look like a full lane.Change.
openGates(db, since)insrc/checks/gate_record.ts: the opencheck_gaterows started aftersince, with their pull numbers.GATE_DEADLINE_MS(15 min) so a row left open by a crash holds nothing. It also leaves verification-lane runs out, so the busy count matches the scheduler's.Tests.
test/vitals.test.tssets up two slots with one check, one verification-lane run and one open gate. It checks:queue:checkwithout the gate;queue:check:fullwith it;queue:checkagain once the gate is past its deadline or ended.Not done.
What to look at once deployed. With the evidence from 07:16, the lane should read
queue:check:full("all busy"). The sentinel files that cause as no issue, soqueue:checkshould leave the degraded list. I couldn't confirm a gate was running at 07:16; the scheduler's own count is what makes this the likely cause. Ifqueue:checkcomes back while the sentence shows a slot free and no gate open, the scheduler really does have a defect to trace.Checks run.
bun x tsc --noEmitand the gate passed: 0 fails, 2 notes. One note comparesopenGatesto an unrelated query; I kept it separate.scripts/fast.tsnamed 2,623 test files, so I picked the covering ones myself: the vitals, sentinel, degraded, gate-minutes, gate-checkout, held-lane, hollow and unused-exports suites. All pass, 233 tests.🤖 Generated with Claude Code
Closes #16995