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

The queue:check sentence says when its checks are held by a red main, not waiting behind the lane #3125

Merged opened this

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

Merged

`queue:check` now ignores checks a red main holds, so a lane that is free no longer gets blamed for them. The new tests and `test/vitals.test.ts` pass. I couldn't run the type check: `bun x tsc` and `bun install` fail in this sandbox with "unable to write files to tempdir", so the forge's check will be the first type check.

shipped production is serving it deploy 4915f35

opened this

queue:check now ignores checks a red main holds, so a lane that is free no longer gets blamed for them. The new tests and test/vitals.test.ts pass. I couldn't run the type check: bun x tsc and bun install fail in this sandbox with "unable to write files to tempdir", so the forge's check will be the first type check.

  • Changed: vitals in src/kernel/vitals.ts now reads heldChecks once and subtracts the held checks from the queued ones.

- If every check past laneWait is held, queue:check is not raised. The red: card already names them. - If only some are held, the sentence counts just the free ones and ends "; N more held by a red main." laneSentence takes an optional held argument for that.

  • Tests: two cases in test/red-main.test.ts:

- 10 held pull checks past laneWait with an idle lane raise red: and not queue:check. - A mix of held and asked-for checks gives "1 check waits behind one lane; … ; 3 more held by a red main." - I put them there because that file already builds the red-main fixtures.

  • Left out: "the oldest since" is still the oldest queued check overall. When some checks are held and the free ones are fresh, the sentence can still be raised off a held check's age. Fixing that needs a per-run query, so I kept to the mechanical fix.

To try it, queue pull checks older than laneWait while main's last check has failed, then read /api/v1/health.

🤖 Generated with Claude Code

Closes #3120

commented

queue:check now ignores checks a red main holds, so a lane that is free no longer gets blamed for them. The new tests and test/vitals.test.ts pass. I couldn't run the type check: bun x tsc and bun install fail in this sandbox with "unable to write files to tempdir", so the forge's check will be the first type check.

  • Changed: vitals in src/kernel/vitals.ts now reads heldChecks once and subtracts the held checks from the queued ones.

- If every check past laneWait is held, queue:check is not raised. The red: card already names them. - If only some are held, the sentence counts just the free ones and ends "; N more held by a red main." laneSentence takes an optional held argument for that.

  • Tests: two cases in test/red-main.test.ts:

- 10 held pull checks past laneWait with an idle lane raise red: and not queue:check. - A mix of held and asked-for checks gives "1 check waits behind one lane; … ; 3 more held by a red main." - I put them there because that file already builds the red-main fixtures.

  • Left out: "the oldest since" is still the oldest queued check overall. When some checks are held and the free ones are fresh, the sentence can still be raised off a held check's age. Fixing that needs a per-run query, so I kept to the mechanical fix.

To try it, queue pull checks older than laneWait while main's last check has failed, then read /api/v1/health.

🤖 Generated with Claude Code

Changes requested — before the latest push

The idea is right, but the card can still blame the lane for a held check, which is what the issue was about. Fix first: judge the age and the "oldest since" from the free checks only. Right now the laneWait test and the sentence both use the oldest queued check overall, which may be a held one. Scenario: 3 old held checks plus 1 fresh free check gives "1 check waits behind one lane; the oldest since <held check time>", raised although nothing free has waited. scout named this gap and left it. It is a wrong sentence on a calm-pillar card, not a nicety. Either query the oldest queued check that is not held, or skip the card unless the free ones are old. Also add a test for exactly that case (old held, fresh free: no queue:check). The current second test makes the free check old too, so it cannot catch it. Also, the type check has not been run by anyone; run it before the next push.

commented

The queue:check card now takes both the age test and "the oldest since" from checks no red main holds, so three old held checks plus one fresh free check no longer raises it. The new test covers that case, and test/red-main.test.ts and test/vitals pass. I could not run a clean type check in this sandbox, so none has run on this change.

  • Fix: freeChecks in src/checks/red_main.ts returns the count and the oldest queue time of queued checks that are startable now. A check counts as held if it is a pull's check, was not asked for, and sits in a repository whose main is red. src/kernel/vitals.ts uses that count and that time for the 20-minute laneWait test and for the sentence.
  • Tests:

- New case: held checks aged 20 minutes plus a fresh asked check raises red:r1 and no queue:check. That fails with the oldest-overall behaviour. - Changed pin: the query-count pin in test/vitals.test.ts goes from 8 to 9, because vitals() now runs one extra query. It is one query however many runs there are.

  • Type check: bun install and bun x tsc fail here with "unable to write files to tempdir". I ran tsc from a sibling checkout's node_modules instead. It reported errors only in scripts/hollow.ts and test/shards.test.ts, which this change doesn't touch and which come from modules missing in this clone. The forge's check will give the real verdict.
  • Not changed: a held check that has waited past RED_HOLD_MS still counts as held until it runs, as before.
Approved

The queue:check card now counts only checks a red main does not hold, takes its age and since from those, and names the held ones. Pillar 0 (no red noise) is served, there is no new surface or dependency, and the tests would fail without the change. I read the code and served health only; I did not run the suite. Two things I would do next: (1) freeChecks treats a held check as held until it runs, even after RED_HOLD_MS, while the scheduler releases it at that point. A check past the hold that is waiting on a busy lane is then not blamed on the lane. Use heldByRed semantics (created_at older than the hold counts as free). (2) Make the lane sentence say what the owner can do when most checks are held, for example point at the red: card, since the free count can be 1 while 10 are held.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs