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

The /next inbox's Undo covers a whole batch of decisions made in one tap #13311

Merged opened this

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

Merged

Most of this was already on main, so the change is smaller than the issue suggests. The one thing missing was saying which rows stayed when an undo couldn't restore everything. What was already there: a batch decision on /next (ship, decline, dismiss, close) is one fleet operation.

Notes

shipped production is serving it deploy 59903fa

opened this

Most of this was already on main, so the change is smaller than the issue suggests. The one thing missing was saying which rows stayed when an undo couldn't restore everything.

What was already there: a batch decision on /next (ship, decline, dismiss, close) is one fleet operation. One Undo restores every row, and the page's "Done. Undo" line lasts 60 s. MCP asks_act (undo + operation) uses the same undo and the same receipt words.

What changed:

  • An undo that can't put every row back now says which stayed and why. For example: Dismiss undone: 1; 1 stayed: a/b#2 (it is gone).
  • The sentence comes from receiptOf in src/actions/asks_bulk.ts, with the wording in stayedSentence in src/actions/asks_words.ts. So the page, the terminal and MCP all say it.
  • Tests are in test/asks-bulk.test.ts. One declines three asks, undoes once, and checks that all three are back on the board. It also checks that the Done line is offered at first and gone after 61 s.
  • A second test covers the "stayed" sentence, using a hand-built operation rather than a real failed undo.

Not done: I added no new MCP tool, and the MCP size ceilings are unchanged. I made no change to the undo itself; a row it can't restore is still refused and reported, as before.

Checks: test/asks-bulk.test.ts and test/mcp-size.test.ts pass, and tsc and scripts/gate.ts --fix are clean. I did not run the full suite, only those two files.

To try: on /next, select three asks and decline them, then press Undo once; all three come back. Over MCP, asks_act with action: "undo", the operation id and dryRun: false does the same.

Push hook: the repo's pre-push hook demanded a commit message starting with Try:, so I added an empty one.

Closes #13305

2 earlier comments · 1 event
commented

Most of this was already on main, so the change is smaller than the issue suggests. The one thing missing was saying which rows stayed when an undo couldn't restore everything.

What was already there: a batch decision on /next (ship, decline, dismiss, close) is one fleet operation. One Undo restores every row, and the page's "Done. Undo" line lasts 60 s. MCP asks_act (undo + operation) uses the same undo and the same receipt words.

What changed:

  • An undo that can't put every row back now says which stayed and why. For example: Dismiss undone: 1; 1 stayed: a/b#2 (it is gone).
  • The sentence comes from receiptOf in src/actions/asks_bulk.ts, with the wording in stayedSentence in src/actions/asks_words.ts. So the page, the terminal and MCP all say it.
  • Tests are in test/asks-bulk.test.ts. One declines three asks, undoes once, and checks that all three are back on the board. It also checks that the Done line is offered at first and gone after 61 s.
  • A second test covers the "stayed" sentence, using a hand-built operation rather than a real failed undo.

Not done: I added no new MCP tool, and the MCP size ceilings are unchanged. I made no change to the undo itself; a row it can't restore is still refused and reported, as before.

Checks: test/asks-bulk.test.ts and test/mcp-size.test.ts pass, and tsc and scripts/gate.ts --fix are clean. I did not run the full suite, only those two files.

To try: on /next, select three asks and decline them, then press Undo once; all three come back. Over MCP, asks_act with action: "undo", the operation id and dryRun: false does the same.

Push hook: the repo's pre-push hook demanded a commit message starting with Try:, so I added an empty one.

commented

The two batch-undo tests now build real Operation and OperationRow records instead of casting as never, which was what the gate refused. bun scripts/gate.ts and bun x tsc --noEmit are clean, and test/asks-bulk.test.ts passes (27 tests). I pushed the fix to pull #13311; the forge's check has not run on it yet.

The gate only reads the committed diff, so it kept flagging the old lines until I committed the fix.

What changed: an undo of a batch decision (ship, decline, dismiss, close) on /next now says which rows stayed and why, for example Dismiss undone: 1; 1 stayed: a/b#2 (it is gone). The page, the terminal and MCP all use that sentence. One undo already restored every row; before this, an undo that left a row behind just gave a count.

Tests: one declines three asks and undoes once, and all three are open again. It also checks the "Done. Undo" line is offered at first and gone after 61 s. The other checks the "stayed" sentence against a hand-built operation; a real undo that leaves a row behind isn't exercised.

Not done: no new MCP tool, and the MCP size ceilings are unchanged. test/mcp-size.test.ts passed on the earlier push but I did not re-run it after this fix, since only the test file changed. The undo itself is untouched.

To try: on /next, decline three asks and press Undo once; all three return. Over MCP, asks_act with action: "undo", the operation id and dryRun: false does the same.

Changes requested — before the latest push

Changes needed, all in one round:

  1. The 'stayed' sentence is only tested against a hand-built Operation. Add a test where a real undo leaves a row behind (for example one row changed or gone after the decision) and assert the receipt that undoAsksBulk returns, so the wiring through the fleet undo is covered, not only the string join.
  2. Prove the filter is right: receiptOf lists every row whose outcome is not 'ok'. If the undo can also record rows as skipped or unchanged, those are not 'stayed'. Restrict to refused/failed outcomes and test that case.
  3. Show that the page, the terminal screen and the MCP asks_act reply all carry the new sentence (one assertion each), and that the page escapes label and reason; the reason text comes from the fleet and is interpolated unescaped here.
  4. Direction: the owner asked for pipeline work before any feature. This is a feature polish on /next with most of it already on main, so say in the pull which pipeline issue it serves or park it. Drop the empty 'Try:' commit and the unrelated doc-comment rewraps if the gate does not require them.
  5. stayedSentence in asks_words.ts is one very long line; split it.
commented

An undo on the asks inbox now says which rows stayed, and a real undo that leaves a row behind is tested on the page, over MCP and in the terminal. bun x tsc --noEmit, scripts/gate.ts --fix and the tests for this change pass locally (test/asks-bulk.test.ts, test/tui-bulk.test.ts and three other asks test files); I did not run the full suite.

What changed

  • Filter: receiptOf in src/actions/asks_bulk.ts now lists only rows an undo refused or failed. Rows that were already as they should be (unchanged) are not "stayed". A hand-built operation with ok, refused, failed and unchanged rows tests this, and a decision that is not an undo says nothing about stayed rows.
  • Sentence: stayedSentence in src/actions/asks_words.ts is split into a StayedRow type, a one-row formatter and the join.
  • Real undo: a test declines two pulls in one batch, lifts one row's dismissal by hand, and calls undoAsksBulk. The receipt reads Dismiss undone: 1; 1 stayed: <repo>#<n> (changed since: …).
  • Page and MCP: the same setup is undone through POST /asks/bulk/:id/undo and through MCP asks_act with action: "undo". Each reply carries the sentence.
  • Terminal: a tui-bulk test closes an issue, reopens it, presses u, and sees 1 stayed and the row's label.
  • Escaping: a recorded undo with the label <b>label</b> and reason <script>alert(1)</script> renders escaped at /asks?op=…. The page already escaped these, because the html template does it, so no production change was needed. The test pins it.
  • Rewraps: the doc-comment rewraps are what scripts/gate.ts --fix produced, so I kept them.

Where I disagree or did not act

  • Empty "Try:" commit: I did not drop it. Removing it needs a force push, which this setup refuses. It is empty and harmless, and a squash merge will remove it.
  • Direction: I could not name a pipeline issue this serves, so it is parked on that point for a person to decide. It is a small polish on /next's undo receipt, and the owner's pipeline-first ordering applies to it.

To try it Decline two asks in one batch on /next (or /asks). Lift the dismissal on one row by hand. Press Undo, and the receipt names the row that stayed and why.

Approved

Approved. Since fed5862bde99 the earlier asks are met. A real undo that leaves a row behind is now tested through undoAsksBulk, the page, MCP asks_act and the terminal (u in test/tui-bulk.test.ts). Only refused and failed rows count as stayed, and unchanged rows do not (receiptOf, src/actions/asks_bulk.ts). The page escaping of a stayed row's label and reason is pinned by a test. The sentence comes from one place (stayedSentence), so the page, the terminal and MCP carry the same words. The phone and desktop experience is unchanged: this is a receipt sentence, with no layout or markup change.

Two things I would do next:

  1. Non-blocking: the empty Try: commit and the comment rewraps are noise, so squash on merge. The work is a small /next polish that serves no pipeline issue, and the owner's pipeline-first order still applies to the next pull.
  2. Non-blocking: add one line to the how-to under docs/features/ for the inbox undo saying that an undo names the rows that stayed and why. It is not in README.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs