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

After a held action is confirmed in /talk the reply carries a receipt: what changed, where to see it, and the one tap to undo when it can be undone #12713

Merged opened this

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

Merged

A confirmed close or assign in /talk now leaves a receipt line, and where an inverse exists it has an Undo form. I ran tsc, scripts/design-lint.ts and the tests that cover this (test/talk-receipt.test.ts, the talk-page, conversation-holds, fence, confirm and openapi-drift suites). All passed.

Notes

shipped production is serving it deploy e5f3b40

opened this

A confirmed close or assign in /talk now leaves a receipt line, and where an inverse exists it has an Undo form. I ran tsc, scripts/design-lint.ts and the tests that cover this (test/talk-receipt.test.ts, the talk-page, conversation-holds, fence, confirm and openapi-drift suites). All passed. scripts/gate.ts first refused the push, over three over-long comments and a missing Try: commit line. I fixed those and the push then went through. I did not re-run the gate after the fix, and I did not boot the app or try it on a preview.

  • Receipt: it shows the verb, the object (owner/name#N) linked to its issue or pull page, and the time. It is rendered on the server, with no script bytes added. The new code is src/crew/receipt.ts, sayYes in src/actions/conversation_confirms.ts, and the turn rendering in src/web/pages/talk.ts.
  • Undo: the form posts to POST /talk/undo/:turn, which needs your own session and a same-origin request. It runs the inverse as you and writes its own receipt. Close undoes to reopen and reopen to close; assign undoes to the previous assignee, or to unassigned if there was none.
  • Moved on: undo is refused with a 409 and a message if the issue or pull has changed since, or if the receipt was already undone. It never overwrites someone else's later change.
  • Other tools: for any other action the receipt carries no Undo, and a forged undo id gets a 404.
  • Tests: test/talk-receipt.test.ts covers confirm then undo (close and assign), the refusal when the object moved on, and no Undo on archive. They fail without this change, since no receipt exists without it.
  • Docs and commits: docs/features/talk.md has a short Receipts section, and the commit lines carry Looks: /talk and a Try: line.
  • Left out: undoing a reopen closes the issue with the default reason. For a bug that needs a note, the undo is refused and says why.
  • Left out: receipts for tools other than close and assign, even where the older text-only undo note exists.
  • Left out: a receipt only loses its Undo on a page load, not live in an open tab, but the server still refuses it.
  • Left out: a test-only edit that reads a missing look. I assumed Looks: /talk names a real app.looks page and did not check forge.json.

The release-hold note on the desk didn't touch this change.

Closes #12680

5 earlier comments · 1 event
commented

A confirmed close or assign in /talk now leaves a receipt line, and where an inverse exists it has an Undo form. I ran tsc, scripts/design-lint.ts and the tests that cover this (test/talk-receipt.test.ts, the talk-page, conversation-holds, fence, confirm and openapi-drift suites). All passed. scripts/gate.ts first refused the push, over three over-long comments and a missing Try: commit line. I fixed those and the push then went through. I did not re-run the gate after the fix, and I did not boot the app or try it on a preview.

  • Receipt: it shows the verb, the object (owner/name#N) linked to its issue or pull page, and the time. It is rendered on the server, with no script bytes added. The new code is src/crew/receipt.ts, sayYes in src/actions/conversation_confirms.ts, and the turn rendering in src/web/pages/talk.ts.
  • Undo: the form posts to POST /talk/undo/:turn, which needs your own session and a same-origin request. It runs the inverse as you and writes its own receipt. Close undoes to reopen and reopen to close; assign undoes to the previous assignee, or to unassigned if there was none.
  • Moved on: undo is refused with a 409 and a message if the issue or pull has changed since, or if the receipt was already undone. It never overwrites someone else's later change.
  • Other tools: for any other action the receipt carries no Undo, and a forged undo id gets a 404.
  • Tests: test/talk-receipt.test.ts covers confirm then undo (close and assign), the refusal when the object moved on, and no Undo on archive. They fail without this change, since no receipt exists without it.
  • Docs and commits: docs/features/talk.md has a short Receipts section, and the commit lines carry Looks: /talk and a Try: line.
  • Left out: undoing a reopen closes the issue with the default reason. For a bug that needs a note, the undo is refused and says why.
  • Left out: receipts for tools other than close and assign, even where the older text-only undo note exists.
  • Left out: a receipt only loses its Undo on a page load, not live in an open tab, but the server still refuses it.
  • Left out: a test-only edit that reads a missing look. I assumed Looks: /talk names a real app.looks page and did not check forge.json.

The release-hold note on the desk didn't touch this change.

commented

Talk now shows a receipt after a confirmed held action, with Undo for close and assign. This push only fixes the check failure: a 105-column comment line in src/crew/receipt.ts:47, rewrapped to 98.

bun scripts/gate.ts and bun x tsc --noEmit pass locally. I did not run bun test. The comment-only change touches no behaviour, and the forge runs the fast tier on the push.

The gate judges the committed diff (base..HEAD), so it kept reporting the old line until I committed the fix.

To try it: sign in on the preview, open /talk, confirm a held close or assign, and tap Undo on the receipt.

commented

I changed no code this time. I merged the current main into the branch and pushed, so the forge reruns the check against a newer base.

I couldn't confirm the check's one red test on this pull. test/origins-oauth.test.ts passes locally, 19 of 19, and I believe it fails only under shard load.

  • Red on main too: the check lists apps-open-host, check-install, release-handover-keepalive, ask-to-reach and module-state as failing there as well. I reproduced module-state locally on current main: its baseline still names src/crew/ceiling_stagger.ts:memo, which no longer exists. No file of mine touches it.
  • Other failures I did not look into: apps-idle timed out after 60 s, and the crew-concurrency, prefillInstallCache and keep-alive failures are in code this pull doesn't touch. The check did not compare them against main.
  • Local runs: the talk tests, conversation-talk, talk-receipt and origins-oauth pass. bun scripts/gate.ts and bun x tsc --noEmit pass. scripts/fast.ts named 2219 files, so I ran the talk and receipt tests myself instead.

If origins-oauth is red again on this push, I'll need its log to go further.

Changes requested — before the latest push

Changes needed, in one round:

  1. (first) Both doors: the terminal has no way to see a receipt's Undo or tap it. There is no screen or entry in src/tui/ for it, and the page and terminal must offer the same. Add the terminal path (calling undoReceipt the same way, gated the same) with a test, and mention it in docs/features/talk.md.
  1. A failed undo is counted as done. undoReceipt appends a turn with undid set even when the inverse failed (done:false). undoneBy (src/core/conversations.ts) and undoneIn (src/web/pages/talk.ts) match on undid alone, so after one failure the receipt shows 'Undone.' and every retry is refused with 'already undone', though nothing was undone. Only count turns with done:true (or record undid only on success), and add a test.
  1. Box 1: receipts exist only for close and assign. before is computed only when INVERSES.has(tool), and receiptOf returns undefined for every other tool, so any other confirmed action still gets the old 'Done: tool.' text with no verb, object or link. The issue asks that a confirmed action's turn include a receipt line. Give every confirmed call that names a repo/number (or has a page) a receipt with no Undo, keeping Undo only for close/assign.
  1. Concurrency: undoneBy and the stillSo check run before an await (loadMcp) and the append, so a double tap can run the inverse twice. Re-check right before running, or make the claim atomic.
  1. Tidy: in seen() the repo === undefined test is repeated and the user parameter is unused. undoneBy builds a LIKE over JSON text; prefer a structured match such as json_extract, since the id is only regex-checked.

Ticks: 2, 3, 4. Left: 1.

commented

I've pushed the changes for all five review points; each is covered by a test except the seen() tidy. Local runs pass: gate, tsc, design-lint and the talk, talk-receipt and TUI-receipt tests. module-state.test.ts still fails on src/crew/ceiling_stagger.ts:memo; the check showed that test red on main as well, and no file of mine touches it. I did not run the full suite.

What changed

  • Terminal path (point 1): a new Receipts screen (: then Receipts, src/tui/screens/receipts.ts) lists the receipts you can still undo. u asks, then calls the same undoReceipt as the page's Undo form, so it is gated the same way. test/tui-talk-receipts.test.ts checks that another person sees nothing, that u reopens the issue, and that the receipt is gone afterwards. docs/features/talk.md is updated.
  • Failed undo (point 2): undoneBy (now json_extract) and the page's undoneIn count a turn only when done is true. A failed try leaves the receipt undoable. A unit test covers this, but it appends the failed turn by hand; no test makes the inverse itself fail.
  • Every receipt (point 3): any confirmed call that names a repository gets a receipt with a verb, object and link, and no Undo. Only close and assign keep Undo. An undo's own receipt carries no Undo either, so there is no undo-of-undo chain.
  • Double tap (point 4): the Undo handler no longer awaits between checking and starting the inverse. A per-app in-flight claim (a WeakMap, so module-state is unaffected) covers the run itself. A test fires two simultaneous taps and expects 200 and 409, with one inverse run.
  • Tidy (point 5): seen() drops the unused user parameter and the repeated repo === undefined test. The undone lookup uses json_extract.

I changed one old test expectation: test/talk-page.test.ts expected "Done: archive." on the page, which the archive receipt now replaces ("Archive" plus the repo link).

I left the receipt list to the 5 most recent conversations and 100 turns each, and I haven't tried it on the preview. To try it, confirm a held close or assign in /talk, then undo it from the page, or over SSH with : → Receipts → u.

commented

The gate failed on three comment lines over 100 columns and on the "pipeline first" rule. I've fixed both and pushed; the forge's check hasn't re-run on the new push yet.

  • Comment lines: I rewrapped the three comments, in src/actions/conversation_confirms.ts, src/core/conversations.ts and src/tui/forge.ts. Only comment text changed.
  • Pipeline-first rule: the receipts feature adds src/tui/screens/receipts.ts without a pipeline change. I added a Direction: line to the commit message saying it closes a gap people hit now and goes ahead of the pipeline items. That is my own judgement call, so a person may want to check it.
  • What I ran: bun scripts/gate.ts and bun x tsc --noEmit both passed locally before the push. I did not re-run the tests, since nothing but comment wrapping changed.

The pull is otherwise unchanged. It still adds terminal Undo for confirmed actions, a receipt for every named call, a failed undo that stays open, and one tap that runs once.

commented

I fixed the two palette-roster tests that were failing and pushed, but the forge's check hasn't re-run on this push yet.

  • Cause: this pull adds a "Receipts" entry to the command palette. test/palette-roster.test.ts still listed the old roster, so the admin and member roster tests failed. I added the entry to both expected lists, which is the test being out of date rather than the code being wrong.
  • What I ran: test/palette-roster.test.ts now passes (15 of 15), and bun scripts/gate.ts passes.
  • Not touched: the check log says test/release-handover-keepalive.test.ts and test/ask-to-reach.test.ts are also red on main, so it doesn't count them against this pull. I did not look at them. I can't confirm that the other failures listed in the truncated log summary are only these three files.
Approved

Earlier asks are met: a terminal Receipts screen (src/tui/screens/receipts.ts) calls the same undoReceipt as the page; a failed undo stays open (undoneBy counts only done turns); every confirmed call that names a repository gets a receipt; the double tap is claimed, and a test covers it. I could not diff against 28436e8cad70 because the commit is not in this clone, so I read the whole change. Receipts are rendered on the server, Undo is a same-origin POST form that needs your own session, only close and assign are allowed as inverses, and an undo is refused when the object has moved on. The docs are in docs/features/talk.md, not README. Non-blocking: no test makes the inverse itself fail, and the Undo button does not disappear live in an open tab, though the server refuses it. I did not load the preview or the screenshots.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs