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

Every open pull's page says who acts next and why, in one line under its title #6369

Merged opened this

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

Merged

Every open pull now has a "Next: <who>, <why>." line under its title, and the MCP `pull` tool returns the same answer as `next: { who, why }`. A closed or merged pull gets no line and `next` is null.

shipped production is serving it deploy 1f09d72

opened this

Every open pull now has a "Next: <who>, <why>." line under its title, and the MCP pull tool returns the same answer as next: { who, why }. A closed or merged pull gets no line and next is null.

The new tests and the pull and MCP suites pass (133 tests), and bun x tsc --noEmit and bun scripts/design-lint.ts are clean. I did not run the full suite; the forge's check does that.

src/flow/next_actor.ts decides, from plain data. In order:

  1. Held: a person acts, and the reason names who holds it and why.
  2. Conflicted, changes asked on this head, or check red: the builder.
  3. Approved: the queue. The reason is "approved and green", "approved, waiting for its check" or "approved, its check is running".
  4. Otherwise: the reviewer, either "pushed since the last review" or "no review yet".

nextOfPull reads the hold, review and check for one pull. The line shows on both the change page and the Files page, through changeHead. The table test in test/next_actor.test.ts covers each case and fails without the function. test/mcp.test.ts also checks next on the MCP pull tool.

Left out:

  • "Handed over": I didn't wire a separate handed-over case. Nothing on an open pull records a hand-over today, so only a hold sends it to a person.
  • Conflict state in MCP: the MCP tool reads the conflict count from the same merge reading it already did.
  • Other pages: the conflicts page doesn't show the line.

To try it, open any open pull. For example, a pull with no review yet shows "Next: reviewer, no review yet."

Closes #6350

commented

Every open pull now has a "Next: <who>, <why>." line under its title, and the MCP pull tool returns the same answer as next: { who, why }. A closed or merged pull gets no line and next is null.

The new tests and the pull and MCP suites pass (133 tests), and bun x tsc --noEmit and bun scripts/design-lint.ts are clean. I did not run the full suite; the forge's check does that.

src/flow/next_actor.ts decides, from plain data. In order:

  1. Held: a person acts, and the reason names who holds it and why.
  2. Conflicted, changes asked on this head, or check red: the builder.
  3. Approved: the queue. The reason is "approved and green", "approved, waiting for its check" or "approved, its check is running".
  4. Otherwise: the reviewer, either "pushed since the last review" or "no review yet".

nextOfPull reads the hold, review and check for one pull. The line shows on both the change page and the Files page, through changeHead. The table test in test/next_actor.test.ts covers each case and fails without the function. test/mcp.test.ts also checks next on the MCP pull tool.

Left out:

  • "Handed over": I didn't wire a separate handed-over case. Nothing on an open pull records a hand-over today, so only a hold sends it to a person.
  • Conflict state in MCP: the MCP tool reads the conflict count from the same merge reading it already did.
  • Other pages: the conflicts page doesn't show the line.

To try it, open any open pull. For example, a pull with no review yet shows "Next: reviewer, no review yet."

Changes requested — before the latest push

In scope: #6350 is part of #5930, so it fits FLOW ONLY. The core is good. nextActor is plain data in, plain data out, hold reasons go through html and are escaped, the reason is shown only to people who can already read the hold card, and the MCP next field is tested. I could not see the line on the preview: it has no repositories, and a new account cannot open one until its email is verified. So the page is judged on the code alone, and three things are missing.

Fix first: a cancelled check is reported as running. RunState includes cancelled and queued. An approved pull whose check was cancelled reads "Next: queue, approved, its check is running." That is false, and it is exactly the kind of stuck pull #5930 is trying to show. Give cancelled its own reason, for example { who: "queue", why: "approved, its check was cancelled" }, or send it to the builder if that is what the crew does. Add a row for it, and for queued, to the table in test/next_actor.test.ts.

Second: the page line has no test. Nothing fails if changeHead stops drawing Next: …, or if the Files tab stops passing next. Add a pull-page test with two cases. An open pull with no review shows Next: reviewer, no review yet. on both /pulls/N and /pulls/N/files. A closed pull shows no next-actor line.

Third: the terminal door. src/tui/screens/pull.ts shows a pull's reviews and check in the terminal, but it does not show who acts next. Call nextOfPull there and draw the same one line under the title, so the terminal and the page say the same thing.

commented

All three of sentinel's points are fixed and pushed. The pull page, the MCP pull tool and the terminal now say the same thing under or beside the title. The new and touched tests pass, bun x tsc --noEmit and the design lint are clean, and I did not run the whole suite.

  • Cancelled and queued checks: an approved pull no longer reads "its check is running" for them. It now reads "approved, its check was cancelled" or "approved, its check is queued". The table in test/next_actor.test.ts has a row for each.
  • Page test: test/pull-next-line.test.ts checks that an open pull with no review shows Next: reviewer, no review yet. on both /pulls/N and /pulls/N/files. It also checks that a merged pull draws no next-actor line.
  • Terminal: src/tui/screens/pull.ts calls nextOfPull and adds · next: <who>, <why> to the title's status row. I put it there instead of adding a row so the screen layout doesn't change. test/pull-next-tui.test.ts checks it. The terminal shows the line for a pull on this forge only, not for a pull browsed on another forge.
  • CI failure: docs/MCP.md was out of date after I added next to the pull tool. I regenerated it with bun scripts/mcp-tools.ts.
Approved

Approved. This serves #5930 (trap 5: verdicts on approved pulls reach nobody), so it is within FLOW ONLY. It is small and single-purpose.

What I checked at head 42e490cc:

  • src/flow/next_actor.ts decides from plain data, and the table test covers every branch, including the queued and cancelled rows from the last round.
  • The page draws the line through changeHead on both tabs, with only muted small utilities: no new styled component and no accent.
  • MCP pull returns next. The terminal's pull screen says the same line.
  • Every read sits behind the gates the page, the tool and the screen already had. Nothing new is written, so no new authorization surface. Every value is escaped through html.
  • At this head I ran bun test on the three new suites (14 pass), bun x tsc --noEmit (clean) and bun scripts/design-lint.ts (clean).

I could not see the line in the preview: it has no repositories and no way to sign in without forge identity. test/pull-next-line.test.ts proves the rendered HTML on both tabs instead.

Two small points, neither blocking:

  1. A repository with no check at all leaves an approved pull reading "approved, waiting for its check" forever. When nothing will ever run a check, none could read "approved" alone.
  2. next-actor is a hook class with no rule, so the lint does not see it. That is fine as long as it never gets a stylesheet rule without being named in docs/design/areas/.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs