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

The lane is visible: queue depth, the running check and its age, median duration and the time to clear, on the home and in /api/v1/health; the 30-minute card names the cause #1440

Closed opened this in answer to
Closed without merging

The home and /api/v1/health now show the check lane. The first version of this pull failed the check because test/plan-route.test.ts was in neither list in scripts/gate.ts, and I fixed that here. I couldn't run the type check because the sandbox has no nodemodules, so the forge's check is its first run.

Notes

stopped closed without shipping deploy 93b3ac9

opened this

The home and /api/v1/health now show the check lane. The first version of this pull failed the check because test/plan-route.test.ts was in neither list in scripts/gate.ts, and I fixed that here. I couldn't run the type check because the sandbox has no node_modules, so the forge's check is its first run. bun test passes on the vitals, board and gate-list suites. test/plan-route.test.ts fails here with a 30-second timeout and I couldn't tell why.

What changed

  • Health: vitals() in src/kernel/vitals.ts now returns lane: {queued, running: {pull, since} | null, medianMinutes, clearsInMinutes}. The queued count and the median of the last 20 finished checks come from two queries, so the number of queries doesn't grow with runs.
  • Home line: an admin sees Lane: 6 checks queued · running #1171 for 6 min · median 20 min · clears in ~2 h whenever checks are queued.
  • 30-minute card: the check version now carries the lane line plus one lane, checks run one at a time.
  • Crew rows: each running agent run shows as a row (agent on repo#pull since HH:MMZ) linking to the run. When none is running, the strip says Crew idle: autonomy off or Crew idle: nothing ready.
  • Gate fix: I added test/plan-route.test.ts to GATE, since its absence is what turned the previous check red.
  • Tests: the lane tests are in test/vitals.test.ts. I put the home test in test/board.test.ts rather than test/web.test.ts, because that is where the home strip is already tested. I also changed two existing expectations: the health key list now includes lane, and the query count goes from 2 to 4 because of the lane's two queries.

Check this one test/plan-route.test.ts times out at 30 seconds in the sandbox, waiting for a stand-in agent's output file that never appears. I haven't confirmed the cause. It is now in the gate, so if it also fails under the forge's check, that is where to look.

Left out

  • The cause text doesn't name the fast-tier branch date or the issue that fixes it, and the card doesn't link an open fixing issue. Neither is stored anywhere I could read it from.
  • ceiling reached isn't one of the reasons shown when no crew member is working.
  • The crew row has no "what it is doing" line. The run summary leaked into the app-narrowed board and failed an existing test, so I dropped it.
  • The lane line and crew rows are admin-only, like the rest of the vitals strip.

To try it: sign in as an admin, queue a few check runs, and open /. GET /api/v1/health with an admin token returns the same lane.

🤖 Generated with Claude Code

Closes #1277

3 earlier comments
commented

The home now shows a running run as working only while its heartbeat is fresh. This covers the owner's note that dead runs kept the label until the boot sweep marked them. The vitals, board and gate-list suites pass. I haven't run the type check, since the sandbox has no node_modules.

  • Badge: a run still marked running with no heartbeat for more than 90 seconds now reads lost, re-queuing ("its process is gone"). It no longer gets data-state="working". The 90 seconds is the existing STALE_AFTER_MS.
  • No inflated counts: a lapsed run no longer appears as a crew-member row, and it no longer counts as the lane's "running" check in the lane line and /api/v1/health. The home therefore can't show more working than there are live processes.
  • Test: a new test in test/board.test.ts claims a run and checks it reads working. It then backdates the heartbeat 120 seconds and checks the run reads lost, re-queuing with no working state and no crew row.

I only changed the Working-now list and the forge strip on the home. Other working labels (the pull map, the following page) still derive from crew marks and weren't touched.

🤖 Generated with Claude Code

commented

I merged origin/main into this branch and pushed, which should clear the "does not merge into main" failure. I haven't seen the forge's check re-run on the new push.

The only conflict was in test/vitals.test.ts. Both sides had added a test at the same spot, so I kept both: the lane test from this pull and the "unauthenticated internal call is refused" test from main. No source code changed in the conflict resolution.

bun test test/vitals.test.ts passes (7 tests). The type check is clean, but only after a bun install, since the bun types were missing at first. I didn't run the full suite, since the forge runs it on push.

The lane visibility work from #1277 is unchanged: queue depth, the running check and its age, the median, and time to clear on the home page and in /api/v1/health. A lapsed lease still reads "lost, re-queuing" instead of counting as working.

commented

The check failure is fixed and pushed. I haven't seen the forge's check result for the new push yet.

The merge of main into this pull left test/plan-route.test.ts listed in both GATE and EXCLUDED in scripts/gate.ts. Main had already excluded it (issue #261: it can wait up to 30 s on a fake planner run, over the 1 s budget). I removed the duplicate GATE entry, so the file is now only in EXCLUDED, as on main.

Locally, tsc --noEmit is clean and a scan of GATE finds no duplicates. I didn't run the shard script or bun test, because the change only touches scripts/gate.ts. My attempt to run a gate test failed because no test/gate.test.ts exists.

commented

Parked by the crew: the check stayed red through 2 automatic tries

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs