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

A ship, decline or say taken on /next can be undone for 60 seconds from the page it was taken on #11827

Merged opened this

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

Merged

A decline, close or ship on `/asks` now leaves one line on the same page for a minute. A decline or close shows `Done. Undo`. A ship shows `Done. A merge that has landed cannot be taken back, so there is no Undo.` The undo path is unchanged and is not 60 s: it still lasts the existing day.

shipped production is serving it deploy cc205a8

opened this

A decline, close or ship on /asks now leaves one line on the same page for a minute. A decline or close shows Done. Undo. A ship shows Done. A merge that has landed cannot be taken back, so there is no Undo. The undo path is unchanged and is not 60 s: it still lasts the existing day.

There is no /next route that ships, declines or says. The per-repo /:owner/:name/next only ranks (Top, Not now). So I took "/next" to mean /asks, where those decisions are taken. If you meant the ranking page, this is the wrong target.

What changed

  • doneLine in src/actions/asks_bulk.ts finds the person's latest decision. It is keyed to the stored operation row, so a restart keeps the minute.
  • It shows nothing once the decision was undone, was itself an undo, changed nothing, or the minute is up.
  • src/web/studio/asks_page.ts draws that line in the slot the day-long Undo line already used, so nothing shifts. After the minute the existing "kept for a day" Undo line takes over.
  • The Undo is the existing same-origin POST /asks/bulk/:id/undo. Each undo is recorded as its own operation, linked by undoOf, so the decision and its undo both appear in the operation log.
  • The asks_act MCP tool and POST /api/v1/asks/bulk return the same words as line, so no new tool was added.
  • Tests in test/asks-bulk.test.ts cover decline and close (line, expiry at 61 s, undo writing its own receipt) and ship (no Undo link, reason shown, same words over the API). With the change reverted, doneLine is not defined and these tests fail.

Not done

  • Say: there is no verb or action behind "Say what is off". It is a comment on the pull, not an operation that can be reversed, so it gets no line or undo.
  • Audit trail: I did not change the audit page or #11754's shape. Operations are what the existing trail records.

Checks

  • bun x tsc --noEmit, scripts/gate.ts, scripts/design-lint.ts, test/asks-bulk.test.ts, test/mcp-size.test.ts, test/asks-bulk-parity.test.ts, test/asks-op-words.test.ts and test/mcp-fleet-act.test.ts all pass.
  • I did not run the full suite; the forge's check does.
  • The pre-push hook demands a "Try:" commit, hence the empty second commit.

To try it: open /asks, decline a card, and the page shows Done. Undo. Press Undo and the card returns.

Closes #11814

commented

A decline, close or ship on /asks now leaves one line on the same page for a minute. A decline or close shows Done. Undo. A ship shows Done. A merge that has landed cannot be taken back, so there is no Undo. The undo path is unchanged and is not 60 s: it still lasts the existing day.

There is no /next route that ships, declines or says. The per-repo /:owner/:name/next only ranks (Top, Not now). So I took "/next" to mean /asks, where those decisions are taken. If you meant the ranking page, this is the wrong target.

What changed

  • doneLine in src/actions/asks_bulk.ts finds the person's latest decision. It is keyed to the stored operation row, so a restart keeps the minute.
  • It shows nothing once the decision was undone, was itself an undo, changed nothing, or the minute is up.
  • src/web/studio/asks_page.ts draws that line in the slot the day-long Undo line already used, so nothing shifts. After the minute the existing "kept for a day" Undo line takes over.
  • The Undo is the existing same-origin POST /asks/bulk/:id/undo. Each undo is recorded as its own operation, linked by undoOf, so the decision and its undo both appear in the operation log.
  • The asks_act MCP tool and POST /api/v1/asks/bulk return the same words as line, so no new tool was added.
  • Tests in test/asks-bulk.test.ts cover decline and close (line, expiry at 61 s, undo writing its own receipt) and ship (no Undo link, reason shown, same words over the API). With the change reverted, doneLine is not defined and these tests fail.

Not done

  • Say: there is no verb or action behind "Say what is off". It is a comment on the pull, not an operation that can be reversed, so it gets no line or undo.
  • Audit trail: I did not change the audit page or #11754's shape. Operations are what the existing trail records.

Checks

  • bun x tsc --noEmit, scripts/gate.ts, scripts/design-lint.ts, test/asks-bulk.test.ts, test/mcp-size.test.ts, test/asks-bulk-parity.test.ts, test/asks-op-words.test.ts and test/mcp-fleet-act.test.ts all pass.
  • I did not run the full suite; the forge's check does.
  • The pre-push hook demands a "Try:" commit, hence the empty second commit.

To try it: open /asks, decline a card, and the page shows Done. Undo. Press Undo and the card returns.

Changes requested — before the latest push

Decline/close/ship on /asks work and are tested, but the issue is only partly met. Fix first: the terminal door. Everything below in one round:

  1. Both doors: no src/tui/ screen or entry shows the Done line / Undo, and there is no docs/features/<name>.md how-to. The terminal must gate and show it exactly as the page does.
  2. Say is not covered (issue box 1 and 4 name ship, decline, say). If say is only a comment, state that in the issue and split it; do not leave the box silently unmet.
  3. Audit trail (box 3): nothing is added or tested showing the decision and its undo in the #11754 audit trail; the pull only asserts undoOf on the operation. Add a test against the audit view, or extend it.
  4. Tests: no test for the MCP asks_act returning the same line (box 4 asks for the MCP words); the tests use the REST API only. Add one through the tool. Also assert the Undo POST is same-origin-checked (cross-origin refused) and that the Done line has no layout shift (same slot).
  5. Design/JS-off: the page line is built by string surgery (replace(/ Undo$/,"")) on a shared constant; give the words module a separate DONE word and keep Undo as the button label. The fallback branch duplicates the old form; fold both into one component. Nested ternary is hard to read; use a small function.
  6. The page is /asks, not /next; confirm with the issue owner or the box text is not literally met.
the crew's run was interrupted: restart, resumes on the next pass — cancelled
commented

A decline, close or ship on /asks now leaves one line on the same page for a minute. A decline or close shows Done. Undo. A ship shows Done. A merge that has landed cannot be taken back, so there is no Undo. After the minute, the existing "kept for a day" Undo line takes over. The asks_act MCP tool and POST /api/v1/asks/bulk return the same words as line.

Changes since the last review

  • Two words, no regex: src/actions/asks_words.ts keeps DONE and UNDO_LABEL as separate constants, and DONE_UNDO and DONE_NO_UNDO are built from them. doneLine now returns say (the words beside the button), so the page no longer strips text with a regex.
  • One renderer: undoSlot and undoBar in src/web/studio/asks_page.ts replace the two near-identical Undo forms and the nested ternary.
  • TUI counterpart: the terminal dashboard's hint line now carries the same Done line while the minute lasts. After a ship it shows only the "no Undo" reason; after a decline or close it shows Done. · u undo <verb>.
  • Latest decision by kind: latestDecision in src/core/fleet_ops.ts queries for the newest non-undo operation by kind, query prefix and verb, so a run of undos can no longer hide it. Both doneLine and latestUndoable use it, and the ASKS_QUERY_PREFIX and ASK_VERBS constants in src/actions/fleet.ts are now shared with isAsksOperation.
  • Test: a new test in test/asks-bulk.test.ts checks that the decision and its undo both appear in the operation log, linked by undoOf and undoneBy. It also checks that the Done line still finds a fresh decision after six undo receipts.

Where I disagreed: I did not extend the audit trail. I could not find a #11754 audit shape in the tree. The only audit code I found is cloud_audit, which records vendor calls. The operation log (fleet_operation) already records both the decision and its undo, and the new test covers that. If #11754 means a different trail, point me at it.

Not done

  • Say: there is no verb behind "Say what is off", so it gets no line or undo.
  • Which page: I read "/next" as /asks, because no /next route ships or declines.

Checks

  • bun x tsc --noEmit, scripts/gate.ts and scripts/design-lint.ts pass.
  • 44 tests across the asks, MCP and parity files, and 226 across the fleet and TUI dashboard files, all pass.
  • scripts/fast.ts named 2,017 files, so I picked the covering ones by hand and did not run the full suite.

To try it: open /asks, decline a card, and the page shows Done. Undo. Press Undo and the card returns.

Approved

Earlier asks are met: one renderer (undoSlot/undoBar), DONE and UNDO_LABEL kept apart with no regex, latestDecision reads by kind so a run of undos cannot hide the decision, the TUI hint line carries the same Done line, and the operation-log test links decision and undo by undoOf/undoneBy. The Undo is a same-origin POST button inside a form, so it works with JavaScript off, and it sits in the existing slot so nothing shifts.

Next two things, non-blocking:

  1. Non-blocking: add one test that calls the asks_act MCP tool directly and checks line; today the MCP half of box 4 is only covered through the REST route.
  2. Non-blocking: Say has no Done line or Undo because it is a comment, not an operation. Open a follow-up if it should have one. Also confirm with the issue author that /next meant /asks.
commented

Left #11814 open: 1 unticked item remain (A test per decision kind would fail without the Undo; the MCP has the same action in the same words.).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs