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

A hand-over card has "Give back to the crew": one press assigns the pull back to the builder that opened it, and its run starts #6430

opened this

Merged 37d 20h ago, live in production

A handed-over pull's card now has a "Give back to the crew" button. Pressing it assigns the pull to the agent that opened it and comments "Given back to the crew by @who". The card leaves the board, and the next tick dispatches the pull like any assigned one.

Notes

opened this

A handed-over pull's card now has a "Give back to the crew" button. Pressing it assigns the pull to the agent that opened it and comments "Given back to the crew by @who". The card leaves the board, and the next tick dispatches the pull like any assigned one. The new tests, the neighbouring asks/hand-over suites, tsc and design-lint pass. I have not run the full bun test; the forge's check does that.

What changed

  • Where the button lives: the hand-over cards are the handover asks that /asks and the studio draw (src/web/studio/asks.ts). src/web/pages/board.ts doesn't draw them, so I put the button there.
  • Who gets the button: only a pull opened by an agent still on the crew. A person's pull, or an agent's that left the crew, gets none. giveBack in src/actions/give_back.ts does the work.
  • The POST: it goes to POST /asks/give-back. It uses the same readForm same-origin check as /asks/decide, so a foreign Origin gets 403. A reader or anyone who can't write gets 404, and so does a pull that has no hand-over or is closed.
  • What it assigns: the pull, and the open issue it closes if a person holds that issue. An issue already held by an agent is left alone.
  • How the card leaves: the comment is a director's word newer than the third review, which is what already ends a hand-over (handoversSince in crew/guard.ts). No new state was added.
  • Card cost: the button's builder check reads the crew once per page, because per-card queries broke asks-counts' statement-count guard.

Tests: test/handover-give-back.test.ts covers the button on a crew pull and not a person's, a person's pull refused, the foreign Origin and the reader's 404, and the reassign plus comment with the card gone. scripts/gate.ts picks up every test/*.test.ts, so nothing was listed by hand.

Left out: the terminal, API and MCP have no give-back action yet, only the web form.

Try it: sign in as the owner of an app whose crew pull got three "changes requested" reviews, open /asks, and press "Give back to the crew" on its card.

Closes #6419

commented

A handed-over pull's card now has a "Give back to the crew" button. Pressing it assigns the pull to the agent that opened it and comments "Given back to the crew by @who". The card leaves the board, and the next tick dispatches the pull like any assigned one. The new tests, the neighbouring asks/hand-over suites, tsc and design-lint pass. I have not run the full bun test; the forge's check does that.

What changed

  • Where the button lives: the hand-over cards are the handover asks that /asks and the studio draw (src/web/studio/asks.ts). src/web/pages/board.ts doesn't draw them, so I put the button there.
  • Who gets the button: only a pull opened by an agent still on the crew. A person's pull, or an agent's that left the crew, gets none. giveBack in src/actions/give_back.ts does the work.
  • The POST: it goes to POST /asks/give-back. It uses the same readForm same-origin check as /asks/decide, so a foreign Origin gets 403. A reader or anyone who can't write gets 404, and so does a pull that has no hand-over or is closed.
  • What it assigns: the pull, and the open issue it closes if a person holds that issue. An issue already held by an agent is left alone.
  • How the card leaves: the comment is a director's word newer than the third review, which is what already ends a hand-over (handoversSince in crew/guard.ts). No new state was added.
  • Card cost: the button's builder check reads the crew once per page, because per-card queries broke asks-counts' statement-count guard.

Tests: test/handover-give-back.test.ts covers the button on a crew pull and not a person's, a person's pull refused, the foreign Origin and the reader's 404, and the reassign plus comment with the card gone. scripts/gate.ts picks up every test/*.test.ts, so nothing was listed by hand.

Left out: the terminal, API and MCP have no give-back action yet, only the web form.

Try it: sign in as the owner of an app whose crew pull got three "changes requested" reviews, open /asks, and press "Give back to the crew" on its card.

commented

All three review points and both line comments are addressed on the same branch. The new tests, the neighbouring asks and hand-over suites, the test/tui files, tsc and design-lint pass. I have not run the full bun test; the forge's check does that.

  • Terminal door: b on a handed-over row of the On you pane calls giveBack(app, f.user, "handover:<id>") (src/tui/screens/dashboard.ts), refreshes the list and toasts "#N given back to @builder" or the refusal. The key hint appears in the status line only on such a row.
  • Key choice, a deviation: I used b, not G. G is already "jump to bottom" in the list handler (src/tui/screens/common.ts) and swallowed the key before it reached the dashboard, which I found when the first tty test failed.
  • Issue loop: two new cases cover the Closes #N reassignment. An issue held by alice goes to the builder, and an issue an agent already holds is left alone.
  • tty test: b reassigns the pull and the row leaves the pane. A reader's b does nothing.
  • All or nothing (both line comments): giveBack now runs the pull assignment, each issue assignment and the comment in one transact. A refusal (for example an archived repository) rolls everything back, and the error names what failed ("could not assign #N to @builder: archived"). A test archives the repository and checks that nothing was assigned, no comment was written and the card is still on the board. The transaction replaces comment-first because comment-first would take the card off the board even when the assignment failed.
  • README: one paragraph says where the button is, what it does, who gets it, and b in the terminal.
Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs