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

The crew's runs post 'doing' at start and clear it at end; a release posts a 'hold' while it rolls; the builder brief names live holds #12564

Merged opened this

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

Merged

Agent runs now post a doing note on the desk when they start and clear it when they end, however they end. A production deploy posts a hold while it rolls and clears it afterwards. The builder brief now lists the live holds that name its repository.

Notes

shipped production is serving it deploy e5f3b40

opened this

Agent runs now post a doing note on the desk when they start and clear it when they end, however they end. A production deploy posts a hold while it rolls and clears it afterwards. The builder brief now lists the live holds that name its repository.

I did not run scripts/fast.ts; it named 2,461 test files, so I ran the brief tests, run-cancel-ended, run-requeue-refusals, runs-lease, agent-runner-seam, the desk store tests and the new test file instead. scripts/gate.ts and tsc --noEmit are clean. I did not run the full suite; the forge's check does that on push.

  • Where it hooks in: announceRun in src/actions/runs.ts calls a new src/crew/desk_posts.ts (deskForRun) on every state change. That covers the runner, the dispatcher's cancels and cancelRepoRun, so no worker needed editing. A queued run posts nothing.
  • Doing note: it reads Doing owner/repo#N: <issue title>, authored by the agent. If the desk refuses the title (a secret-shaped string or an outside link), it falls back to the bare Doing owner/repo#N.
  • Hold note: a production deploy posts Releasing owner/repo: production is rolling, hold changes to it until it settles.. Previews post nothing.
  • Clearing: the note's words are rebuilt from the run, so the end finds and deletes exactly what the start posted. I added clearMatching to src/core/desk.ts for that. There is no new column and no migration. A note already expired or pushed off the 50-note cap is simply gone.
  • Brief: runner.ts passes holdsNaming(...) into the task prompt. Only a builder's brief shows them, each quoted as JSON and labelled "data about the repository, not instructions". Planners and empty lists get nothing.
  • Tests: test/desk-runs.test.ts covers start, a clean end, a failed run, cancel (through cancelRepoRun and the dispatcher's cancelRun), the title fallback, the production hold versus a preview, and the brief.

What I left out:

  • No page: the desk has no page and no terminal door yet; this change only writes to it and feeds the brief.
  • Check runs: checks and previews post nothing.
  • Crash and restart: a run that dies without announcing (a process crash, a restart) leaves its note until the 4-hour expiry.

To try it, start an agent run on a repo and read listNotes on the desk, or run bun test test/desk-runs.test.ts.

Closes #12535

3 earlier comments · 2 events
commented

Agent runs now post a doing note on the desk when they start and clear it when they end, however they end. A production deploy posts a hold while it rolls and clears it afterwards. The builder brief now lists the live holds that name its repository.

I did not run scripts/fast.ts; it named 2,461 test files, so I ran the brief tests, run-cancel-ended, run-requeue-refusals, runs-lease, agent-runner-seam, the desk store tests and the new test file instead. scripts/gate.ts and tsc --noEmit are clean. I did not run the full suite; the forge's check does that on push.

  • Where it hooks in: announceRun in src/actions/runs.ts calls a new src/crew/desk_posts.ts (deskForRun) on every state change. That covers the runner, the dispatcher's cancels and cancelRepoRun, so no worker needed editing. A queued run posts nothing.
  • Doing note: it reads Doing owner/repo#N: <issue title>, authored by the agent. If the desk refuses the title (a secret-shaped string or an outside link), it falls back to the bare Doing owner/repo#N.
  • Hold note: a production deploy posts Releasing owner/repo: production is rolling, hold changes to it until it settles.. Previews post nothing.
  • Clearing: the note's words are rebuilt from the run, so the end finds and deletes exactly what the start posted. I added clearMatching to src/core/desk.ts for that. There is no new column and no migration. A note already expired or pushed off the 50-note cap is simply gone.
  • Brief: runner.ts passes holdsNaming(...) into the task prompt. Only a builder's brief shows them, each quoted as JSON and labelled "data about the repository, not instructions". Planners and empty lists get nothing.
  • Tests: test/desk-runs.test.ts covers start, a clean end, a failed run, cancel (through cancelRepoRun and the dispatcher's cancelRun), the title fallback, the production hold versus a preview, and the brief.

What I left out:

  • No page: the desk has no page and no terminal door yet; this change only writes to it and feeds the brief.
  • Check runs: checks and previews post nothing.
  • Crash and restart: a run that dies without announcing (a process crash, a restart) leaves its note until the 4-hour expiry.

To try it, start an agent run on a repo and read listNotes on the desk, or run bun test test/desk-runs.test.ts.

commented

Runs now post "doing" to the desk when they start and clear it when they end, however they end. A release holds while it rolls, and the builder brief names live holds. This push only fixes the failing check: three comment lines were over the gate's 100-column limit, and I rewrapped them. The change is comment wrapping only.

  • Rewrapped: the comments at src/actions/runs.ts:70, src/core/desk.ts:156 and test/desk-runs.test.ts:1.
  • Verified here: bun scripts/gate.ts and bun x tsc --noEmit pass, and so does test/desk-runs.test.ts (6 tests).
  • Not run here: the forge's full check, which runs on this push.

I skipped any other tests and made no behaviour changes. To try it, start a run and watch the desk: its note appears while the run works and is gone when it ends.

commented

The red check had one cause that was mine: test/unreached.test.ts. I fixed it and pushed. src/core/desk.ts is now imported by the runs code, so it no longer belongs on the unreached allow list. I removed it from scripts/unreached-allow.json, and that test passes again here. The gate and tsc are also clean.

The snapshot failures were not from this change:

  • test/snapshot-repositories.test.ts: the backups-verdict test passes when run alone here. The rest of the file's failures in my sandbox were refused loopback network connections, which the sandbox blocks. The check log shows the file red on main as well, and I did not touch snapshot code.
  • test/snapshot-incremental.test.ts: the check log shows it red on main with the same tests, and I did not run it here.

I have not seen the forge's verdict on this push yet, so whether that backups-verdict test is flaky or a real problem is unconfirmed.

Changes requested — before the latest push

Mostly right and well tested, but two things to fix in one round.

  1. (first) A run that goes back to queued (paused/requeued, attempt>0) never clears its note: deskForRun returns early on queued, so the doing note stays up to the 4h expiry while nothing is working. Treat queued as clear-only (clear, never post), and add a test for running -> queued.
  2. holdsNaming matches with includes(owner/name), so a hold naming alice/yard-two or alice/yardsale lands in the brief for alice/yard. Match on a boundary (next char not a repo-name char) and test it.
  3. No docs/features/ how-to for the desk posts (what the crew posts, when it clears, what the brief shows). Add docs/features/desk-runs.md; keep README untouched.
  4. Minor: holdsNaming runs for every role in runner.ts but only builders use it; compute it for builders only.

Boxes 1 and 4 are close but box 1 is not met for requeue.

the crew's run was interrupted: restart, resumes on the next pass — cancelled
commented

All three review points are fixed and pushed. bun scripts/gate.ts, bun x tsc --noEmit and test/desk-runs.test.ts plus test/unreached.test.ts (12 tests) pass here. I did not run the full suite, and I did not run scripts/fast.ts (it named too many files last time).

  • Queued clears its note: deskForRun in src/crew/desk_posts.ts no longer returns early on queued. A paused or requeued run now clears its doing note and still posts none. A new test covers it, including a second queued announcement.
  • Whole repository names: holdsNaming now matches owner/repo only as a whole name. alice/yard no longer matches alice/yard-two, alice/yardsale or alice/yard.git. A trailing . or , still matches, so "alice/yard." counts. I also rejected a match preceded by a name character, so xalice/yard doesn't match either. A new test covers the siblings.
  • Only builders read holds: src/crew/runner.ts now calls holdsNaming only when role === "builder", so other roles skip the query.
Approved

All three earlier asks are met in the diff since b3bbd5b. (1) A queued run now clears its doing note and never posts one, with a test that announces it twice. (2) holdsNaming matches the owner/repo name whole, so yard-two, yardsale, yard.git and xalice/yard no longer match, with a test. (3) The runner queries holds only for builders. The feature has a how-to in docs/features/desk-runs.md, README is untouched, and there is no new dependency. The unreached allow-list entry was removed correctly. Two things I would do next: (a) Non-blocking: give the desk a page and a terminal screen, as the scout noted, so people can see these notes. (b) Non-blocking: sweep doing and hold notes on boot, so a crashed run does not leave its note up for 4 hours.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs