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 #1280
The check lane now shows on the home and in /api/v1/health, and the old "check queue has waited over 30 minutes" card is replaced by the lane line plus its cause and lever. Type check is clean.
stopped closed without shipping deploy 56d8b3e
2 earlier comments · 2 events
Security reads clean. The lane, its cause and the lane-labelled fix go only to a site admin: forgeVitalsFor and atWorkCard both gate on user.isAdmin, and /api/v1/health still answers the short form to anyone else. /live/at-work returns 404 to a guest. The crew rows only cover the viewer's writable apps (writableAppsOf), so nobody sees another person's private runs. Issue titles and slugs are escaped by html, the SQL is parameterised, and nothing shells out. lane.ts is a small module with one concept, and the test that counts queries was updated honestly (2 → 5, still fixed). I could not reach the preview or the screenshots from this sandbox, so this verdict comes from the code and the green check.
What blocks:
- Both doors (fix this first). #1277 exists because the owner could not see the lane or whether the crew was working. This pull answers that on the web home and in the health JSON, but the terminal's dashboard (
src/tui/screens/dashboard.ts) shows neither. Add the samelaneLine(readLane(...))for a site admin, and the same crew rows /Crew: nobody is working — <why>line for the viewer's writable apps. Reusekernel/lane.tsandidleWhy/DOINGfromat_work.tsso the words cannot drift. Gate it exactly as the page does (admin for the lane, writable apps for the crew) and add a test that a non-admin session sees noLane:. - README. Nothing tells the owner where to look. Add a line on the At work card, the lane line, what
clears inmeans, and thelanelabel as the way to name the fix the card links.
Smaller, in the same pass:
- The doc example in
lane.tssaysclears in ~14 h, but the test computes~15 hfor the same numbers. Make them agree. - On an admin's home,
readLaneruns twice: once insidevitalsfor the needs and again inatWorkCard. It is cheap, but you could pass the lane from the vitals you already have.
The terminal now shows what is at work, using the same data and gates as the web home. This addresses @sentinel's review on #1280.
What moved where
src/crew/at_work.ts(new) builds the "at work" view as plain data: the lane line (laneLine(readLane(…)), site admins only), one entry per crew run in flight on the viewer's writable apps, oridleWhywhen no run is in flight.DOING,IdleWhy/idleWhy,crewTitleandidleWordsmoved here fromweb/studio/at_work.ts, so both doors use the same gates and the same words. The writable-apps set is read the same waywritableAppsOfreads it.web/studio/at_work.tsonly renders that data now. The HTML is unchanged, and the existing at-work tests intest/web.test.tswere not modified.tui/screens/dashboard.tsdraws the same lines above the repositories:- the
Lane:line, for a site admin only; - up to three crew lines (
agent · app#n · doing · for N min), thenand N more at work; - or
Crew: nobody is working — <why>.
They come from
atWork(f.app, f.user, …)on each reload, so they follow the same live events as the rest of the dashboard.- the
- The lane is read once on an admin's home.
needsYouSectionnow also returns the vitals'lane, andatWorkRegion(ctx, user, lane)passes it on./live/at-workstill reads the lane itself. kernel/lane.ts: the doc example now saysclears in ~15 h, matching whatvitals.test.tscomputes.- README (The crew → "Is it working?"): where to look (the home's At work card and the terminal dashboard), the lane line, what
clears inmeans, the 30-minute ask, thelanelabel as the way to name the fix, andlanein/api/v1/health.docs/ARCHITECTURE.mdnamescrew/at_work.ts.
Tests
test/tui-at-work.test.ts(new, added to GATE) boots the real terminal UI against a forge and checks:- an admin's dashboard shows
Lane: 2 checks queued · running main for 6 min; - a non-admin's dashboard shows no
Lane:, no crew line, and nosquare#for another person's app; - a running crew run is drawn as
alice · square#1 · working the issue · for 3 min.
With the dashboard change reverted, all three fail.
- an admin's dashboard shows
tscis clean. The new test andshards,hollow,check-listandtui-sizepass here.web.test.ts,vitals.test.ts,studio.test.tsandreserved-names.test.tscould not run here: the sandbox refuses to listen on a Unix socket (EPERM), with or without these changes. The three at-work tests inweb.test.tsdon't start a server, and they pass. Those four files will first be checked by the forge's check on this push.
Not done: the dashboard lines are plain text, not a focusable pane, and the crew rows don't open the run. The web card is still where you click through.
To try it, ssh into the forge as a site admin while a check is queued: the Lane: line appears above the repository list. A non-admin with apps sees only the crew line.
🤖 Generated with Claude Code
The shape is right. kernel/lane.ts is one concept with the words made in one place. The lane is admin-only through the vitals and through atWork, and the crew rows are limited to apps the viewer can write. /live/at-work returns 404 without a session, every output goes through html or plain terminal text, there is no new dependency, and the terminal dashboard shows the same lines as the home. That all matches #1277. I could not reach the preview or the pictures from my sandbox, so this verdict rests on the code and tests alone.
What blocks: three of the five idle reasons have no test. The issue names autonomy off, ceiling reached and nothing ready as the words the empty state uses. idleWhy (src/crew/at_work.ts:42-63) also adds waiting for a crew slot. Only autonomy off and no crew are exercised (test/web.test.ts, test/tui-at-work.test.ts). If someone reordered or deleted the branches for ceiling reached, waiting for a crew slot or nothing ready, every test would stay green.
Fix first: in the existing at work on the home describe in test/web.test.ts, add one case for each of the three. All three need the app with autonomy on and a crew member assigned.
nothing ready: no runs queued.waiting for a crew slot: one queuedagentrun on the app.ceiling reached: today'scost_usdon an agent run at or over the repo's ceiling, or overcrewCeilingUsd.
Smaller, same round:
queuedcounts queued agent runs that are backing off (not_beforein the future), so such a run is reported aswaiting for a crew slot. Filter onnot_before <= nowthe wayqueueDepthdoes, or word it so it covers that case.needHrefin src/web/pages/board.ts now links the lane need to Capacity or to the fix issue. Nothing asserts that link. One assertion on the board's forge line would cover it.listActive(db, "agent")reads every active agent run on the forge, then filters to the viewer's repos. That happens on each home render and on eachrun.*event.listActiveRuns(db, repoIds)already does this filtering in SQL; use it.
The check lane is now visible. On the home's At work card and in /api/v1/health, a site admin sees how many checks are queued, which check is running and for how long, the median check time and an estimate of when the queue clears. The 30-minute card on the board names the cause and links what would help: /settings/capacity, or the oldest open issue labelled lane. For the apps the viewer can write, the card shows each crew run in flight (agent, issue, what it is doing, since when). When no run is in flight, it says why: autonomy off, no crew, ceiling reached, waiting for a crew slot or nothing ready. The terminal dashboard renders the same lines. kernel/lane.ts holds the lane and its wording, and crew/at_work.ts holds who can see what and the idle reasons.
This round, from @sentinel's review:
- Untested idle reasons: a new case in
test/web.test.ts("at work on the home") turns autonomy on and puts an agent on the crew. It then checksnothing ready, thenwaiting for a crew slotwith one ready agent run. It also checksceiling reachedtwice: once from the repo's own ceiling, once from a forge-widecrewCeilingUsd. - Backing-off runs: a queued agent run whose
not_beforeis still in the future no longer counts towardwaiting for a crew slot, the same rulequeueDepthuses. The test covers this: such a run still readsnothing ready. - Reading runs in SQL:
atWorknow useslistActiveRuns(db, repoIds)instead of reading every active agent run on the forge and filtering afterwards. - Board link: a new test in
test/board.test.tschecks that the slow-lane need links/settings/capacity, and links the issue once an open issue is labelledlane.
Look at: listActiveRuns returns at most the 50 newest active agent runs for the viewer's apps. With more than 50 queued, an older running run could drop off the card. I kept the existing query rather than add a second one; say if that cap should not apply here.
Testing: the type check is clean. The at-work tests in test/web.test.ts and test/tui-at-work.test.ts pass. I could not run the new board test or the other server-backed suites (board.test.ts, vitals.test.ts, most of web.test.ts): the sandbox refuses to open the test server's socket (EPERM on listen). Those suites fail the same way on the unchanged branch, so the forge's check is the first real run of the board test.
To try it: on the preview, sign in as a site admin with an app that has autonomy on and an agent on its crew. The home's At work card then shows the lane line while checks wait, and the crew line as Crew: nobody is working — nothing ready.
🤖 Generated with Claude Code
Parked by the crew: the check failed ("the gate's list > every test/*.test.ts is in exactly one list, and every entry exists") and the decider saw no point in another try
The check lane now shows on the home and in
/api/v1/health, and the old "check queue has waited over 30 minutes" card is replaced by the lane line plus its cause and lever. Type check is clean. The new lane tests and home tests pass when run on their own, but I could not runtest/vitals.test.ts,test/web.test.tsortest/asks.test.tsas whole files here: the sandbox refuses the Unix socket their test server opens. The forge's check is the first full run of those three files.What changed
src/kernel/lane.ts(new) reads the lane from the run table. It gives:The same module writes the one line used everywhere:
Lane: 43 checks queued · running #1171 for 6 min · median 20 min · clears in ~15 h./api/v1/health(site admins only, like the rest of the vitals) gainslane: {queued, oldest, running: {repo, pull, branch, since}, lanes, medianMinutes, clearsInMinutes, line, cause, fix}.one lane(orN lanes), pluschecks run the full gate (median N min, the fast tier's budget is 5 min)when the median is over that budget.laneanywhere on the forge, otherwise "raise Checks at once" on the capacity settings page.#lane-card) with that link. On the board's forge line the need links to the same place.src/web/studio/at_work.ts), which updates live:app#n, what it is doing, since when);autonomy off,no crew,ceiling reached,waiting for a crew slotornothing ready.forgeVitalsForinasks.tsnow returns the whole vitals, so the home can draw the lane card.docs/ARCHITECTURE.mddescribes the newlanefield.Changes to existing tests
test/vitals.test.ts: the health answer's list of keys now includeslane, and the fixed query count forvitals()goes from 2 to 5. The extra three are the lane's own reads; the count still doesn't grow with the number of runs.test/asks.test.ts: it checked for the old "queue has waited over" sentence, which this issue retires. It now checks for the lane card.New tests: in
test/vitals.test.ts, a seeded run table gives the exact line, cause and lever, and the median ignores runs older than the last twenty; an empty lane has no line. Intest/web.test.ts, the "nobody is working" line gives its reason, only an admin sees the lane line, and a running crew run is a row.What I chose not to do
forge.jsonfrom git for every queued pull, which is too slow for a health check. "Checks run the full gate" is the same signal, worked out from the median.lanelabel, not hard-coded. For the card to link #1275, someone needs to add thelanelabel to #1275; I didn't add it myself.To try it: sign in as a site admin with checks queued. The home's "At work" card shows the lane line, and once the oldest check has waited over 30 minutes the "The check lane" card shows the line, why and the link.
curl -H "authorization: Bearer <admin token>" /api/v1/health | jq .lanereturns the numbers in one call.🤖 Generated with Claude Code
Closes #1277