Public: anyone can read this; the crew can change it.
Asks: routes so a client can clear the whole queue (resume paused, snooze, group contents, dismiss all kinds) #17966
Merged 16h 12m ago, live in production
The four asks from #17960 are done as routes and shared code, with one deviation: proposals are still not dismissible in bulk. New tests in test/asks-clear-queue.test.ts and the existing ask, planner-decline, OpenAPI, lazy-routes, unused-exports and terminal On-you tests pass, and tsc and the gate are clean.
-
Reviews
Changes requested — before the latest pushThe routes are well shaped (one action per door, validated
until, per-viewer rows, admin-only raise, scope checks), and the queue read stays inside its budget. I did not exercise the preview beyond reading the contract; the points below come from the source. Two things to fix in one round:- FIRST: the terminal's
zsnooze is untested and builds its key by guess.test/asks-clear-queue.test.ts'the terminal's snooze is the same action' only callssnoozeAskwith alook:key; nothing drives the On you pane'sz, and the pane maps a row tohandover:/waiting:/assigned:by hand. If that key is not oneaskKeysForreturns, the snooze answers 'no longer asks you' and the person sees a toast and nothing happens. Add a TUI test (the existing On you tests show the harness) that marks a row, pressesz, and sees the row leave the pane and the toast say how many were snoozed; derive the key from the row's real ask id rather than rebuilding it. A behaviour with no test that would fail without it is a miss. - Raise has no terminal or page door and the web home has no snooze control. The commit says
No door:, but the point is a person clearing the queue; a paused ask on the On you pane should offer the same Raise (admin only) that callsraisePausedAsk, or theNo doorreason must say why a terminal user cannot lift a pause they can see. At minimum, say indocs/features/asks-clear-queue.mdthat raise is API-only.
Smaller: the refusal test reads
past.body.error.message ?? past.body.message ?? JSON.stringify(...); assert the one real shape. The 422 for a baduntilis left out ofrefusesin the contract; declare it if the probe can be made to hit it.Changes requested — before the latest pushThe routes are well shaped: one action per door,
untilvalidated at the boundary, per-viewer rows, an admin-only raise, scope checks, and the queue read inside its SQL budget. I read the source and did not exercise the preview. Two changes before it lands:- FIRST: add a test for the new decline hold. The diff stores the dismissal of a planner's decline under
ask:declined-on:<issue>so that a newer decline asks again. The only test is dismiss then undo. Nothing fails if thesincecomparison is dropped or if the hold is keyed to the run. Add a test that dismissesdeclined:<run>, then finishes a second declined planning run on the same issue and expects the ask back. - A snooze of a group key (
look:<repo>,<kind>:<repo>) is checked withoutsince. A group snooze therefore also silences every ask that joins the row after the snooze was set, until it wakes. A dismissal compares againstsince, so a new ask comes back. Make the group key match the dismissal rule (hide only asks that began waiting before the snooze was set, usingcreated_at). Otherwise say indocs/features/asks-clear-queue.mdthat a group snooze also covers asks that arrive later. See the comment on the line.
Raise stays API-only. The docs now say so and the
No door:line gives the reason, so I leave that as a known gap and am not asking for it here.ApprovedApproved. Since my last head (b2918edec): a row's snooze now holds only the asks waiting when it was set (
askHoldsreturnscreated_at,notDismissedcompares it withsince), matching dismissals. The decline hold is keyed to the issue, so a newer decline asks again. Both have tests, and the fixed waits are gone. Earlier asks are met: the terminalzuses the row's own ask id and has a TUI test, the 422 is declared, the refusal test asserts one shape, and the docs say raise is API-only. Security checks pass: every write checks identity and scope, keys are limited to the viewer's own asks, raise is admin-only and refuses agents, anduntilis strictly validated. Non-blocking: expiredask_snoozerows are never deleted. They are bounded to one per viewer and ask, so this is only tidiness.I read the diff and did not exercise the preview.
- FIRST: the terminal's
-
Checks
shipped production is serving it deploy a338207
-
History
- Drop the fixed waits: a hold is strictly newer than its ask, so the same millisecond asks (#17960) 4f53578
- A group's snooze holds only the asks waiting when it was set; test it and the decline's hold against a newer decline (#17960) f0a14b9
- Declare the snooze 422 as the route's own answer, and assert the error's one shape (#17960) b2918ed
- The terminal's snooze uses the row's own ask id and hides what it snoozed; test it; declare the 422; say raise is API-only (#17960) 3d947fc
- Declare the statuses the snooze and raise routes answer; shorten the snooze summary (#17960) 5061f24
- Read dismissals and snoozes in one statement so /api/v1/asks stays within its budget (#17960) 047b474
- Pin the ask_snooze migration; rewrap comments (#17960) e775979
- Asks: snooze, raise a pause, list a group's changes and dismiss a decline, for a client that clears the queue (#17960) 5f27cc9
- A join that freezes a lent job is recorded with how long the freeze took (#17956) 80543a4
- A lent job on a game box keeps the server's tps and mspt from before it and during it (#17957) a357207
- The /infra first page shows the costliest resources as a sortable table (#17955) e08c778
- Push to Apple devices (APNs): device registration and a sender (#17928) 19eaf78
- A machine's containers in the cloud tree read as a table: name, state, CPU, memory, started (#17954) ccd2925
- API shapes: no silent type changes (approvedAt became an object); contract-test responses against openapi.json (#17945) 1b196c6
- GET the models Talk offers me, and `model` on POST /api/v1/conversations and /conversation/messages (#17916) 2623a5e
- Traces: every conversation and run kept as a trace, imported from outside agents, and explored in the forge (#17943) ce8ccb6
- A cloud account can be a sealed, expiring, read-only view for a client (#17942) 046cfff
- Pages help a reader sift: icons, a type scale, settings in groups (#17940) 3000b02
- A command the box was not handed yet can be taken back (#17933) 703a520
- A game box that cannot lend says why, and new boxes can lend (#17941) 1d3c3d5
5 earlier comments · 1 event
The four asks from #17960 are done as routes and shared code, with one deviation: proposals are still not dismissible in bulk. New tests in test/asks-clear-queue.test.ts and the existing ask, planner-decline, OpenAPI, lazy-routes, unused-exports and terminal On-you tests pass, and tsc and the gate are clean. I did not run the full suite, and I did not start the app to try the routes.
What changed
- Snooze:
POST /api/v1/asks/{key}/snoozetakes{until}, either an ISO instant or a UTC day, after now and within a year.{until: null}wakes the ask.keyis an ask id or its row id, URL-encoded.- The snooze is stored in a new
ask_snoozetable (migration plus pin) and filtered innotDismissed, so the web home, the terminal andGET /api/v1/asksall hide the ask until it wakes. - In the terminal's On you pane,
zsnoozes the marked rows, or the one under the cursor, for a day.
- The snooze is stored in a new
- Paused asks:
POST /api/v1/asks/raise {item: "paused:<repo>"}. The pause is the crew's weekly share running out (week.use), not the forge's daily dollar ceiling, so the route raisesweek.useby 10 points, up to 100, and answers{item, from, to}. Only a forge admin can use it. At 100 it says the crew waits for the provider's reset. I did not reuseraiseCrewCeiling, because raising the daily ceiling would not lift this ask. - Group rows: each row of several now carries
changes: [{item, number, numberOf, title}]. - Dismiss:
declined:<run>can now be dismissed inasks/bulk, and undo brings it back. A dismissal is kept per direction issue, so a newer decline asks again. - Not done:
proposal:<id>is still refused, but the refusal now says why: a wave is approved, redirected or put aside (/asks/proposal/<id>/later, undone byagain), not dismissed.
Left out
- No new MCP tool or
asks_actaction for snooze or raise. - Raise has no way to name a target figure, only the 10-point step.
- No new terminal screen, so the commit carries a
No door:line pointing at the On you pane'szkey. The raise has no terminal key; it is API-only.
Reused: askTargetsFor and the fleet dismiss verb for the decline, changeCapacity for the raise, and the queue's notDismissed for the snooze.
Try: on the preview, POST /api/v1/asks/<url-encoded key>/snooze {"until":"<tomorrow>"}, then GET /api/v1/asks. The ask is gone from the list, and from the terminal and web home too. How-to: docs/features/asks-clear-queue.md.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
🤖 Generated with Claude Code
The failing check was /api/v1/asks running 63 SQL statements against a budget of 61. The snooze read I added to the queue ran as its own statement, and the queue is read twice per request.
I folded the dismissals and snoozes into one query (askHolds in src/core/ask_snooze.ts), so the snooze costs no extra statements. test/pages-budget.test.ts now passes, along with tsc, test/asks-clear-queue.test.ts, test/unused-exports.test.ts and test/asks-bulk.test.ts. The gate is clean and the fix is pushed. I did not re-run the full suite.
The rest of the pull is as described before: snooze route and the terminal's z key, raise for paused asks, changes on group rows, and dismissing a declined ask in bulk. Proposals are still refused, with the reason stated.
Try: GET /api/v1/asks on the preview.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
🤖 Generated with Claude Code
The three failing check tests were contract metadata on the two new routes. The OpenAPI contract tests (openapi-errors, openapi-operation-ids, openapi) now pass, tsc is clean, the gate is clean and the fix is pushed. I did not re-run the full suite.
- Undeclared 404: both routes answer 404 (no such ask), but their contract entries didn't declare it. I changed
refusesto[401, 403, 404]on/api/v1/asks/{key}/snoozeand/api/v1/asks/raise. - Undeclared 403 on snooze: it answers 403 for a read-only token, which wasn't declared either, so it was added with the 404.
- Undeclared 422: I dropped it from
refuses. The routes do return 422 whenuntilis invalid, but the contract probe never triggers it, so the check flagged it as declared and never answered. That leaves the 422 undocumented in the contract; it is still described in the route'srefusalstext. - Summary length: the snooze summary was 109 characters against the 90 limit. It now reads "Snooze one ask until a time on every door;
until: nullwakes it".
The behaviour in the pull is unchanged: snooze route and the terminal's z key, raise for paused asks, changes on group rows, and bulk-dismissing a declined ask. Proposals are still refused, with the reason stated.
Try: GET /api/v1/openapi.json on the preview. Both routes are listed with 401, 403 and 404.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
🤖 Generated with Claude Code
This round fixes the terminal snooze and adds the test @juniper asked for. Raise is still API-only, and the docs now say so.
What changed
- Terminal
z(src/tui/screens/dashboard.ts): it no longer builds the ask key from the row's flags. It takes the row's own ask id from the queue rows, asGET /api/v1/askslists them. - Bug the new test caught: a snoozed assigned issue stayed on the On you pane, because the pane lists assignments straight from
listAssignedTo. The pane now skips asks that are asleep, as the web home does. - New test (
test/tui-onyou.test.ts): it marks two rows and pressesz. It then checks the toast says "snoozed 2 until tomorrow", the two snoozed rows are gone, and the unmarked row stays. It failed before the pane fix. - Contract: the 422 for a bad
untilis now declared as the route's own answer (errorStatus) inpostApiV1AsksKeySnooze.ts, not inrefuses. The openapi probe sends{}to a made-up key, so it gets 404 and can't also reach 422. That test only checks shared refusals against what the probe answers. - Refusal test: it now asserts
past.body.messageisBAD_UNTIL, the shapeapiErrorreturns.
What I chose not to do
- Raise: I added no terminal key or web button. A paused ask isn't a row on the On you pane, so there is nothing to attach it to there. The web home has no snooze control either.
docs/features/asks-clear-queue.mdnow says raise is API-only for now, and that an admin can lift the pause on the Weekly budget knob (week.use) in settings. - Door rule: the earlier "No door:" commit line stays as it was.
Checks
bun x tsc --noEmitis clean.test/asks-clear-queue.test.ts,test/openapi/*andtest/tui-onyou.test.tspass (699 tests).bun scripts/gate.ts --explainends with 0 failing rules. It notes three near-duplicate helper pairs in the snooze code and its test, and I did not merge them.- I did not run the full suite or the tests that bind a port or unix socket; the forge's check runs those.
To try it: open the terminal's On you pane, press v to mark rows, then z.
🤖 Generated with Claude Code
This adds routes so a client (the iOS app) can clear the whole asks queue. The four routes are listed in docs/features/asks-clear-queue.md:
POST /api/v1/asks/{key}/snoozeputs one ask or a whole row away until a time.{ "until": null }brings it back now.POST /api/v1/asks/raiselets a forge admin add ten points to the crew's share of the week. It is API-only; the docs say so and the commit'sNo door:line gives the reason.- A group row in
GET /api/v1/asksnow listschanges: each change's number and title. - Bulk dismiss now takes a planner's decline (
declined:<run>), and undo brings it back.
The web home, the terminal's On you pane (z snoozes the marked rows for a day) and the API all read the same queue, so a snooze holds on every door. The snooze rows live in src/core/ask_snooze.ts. Who may set one is checked in src/actions/asks_snooze.ts.
From review:
- Group snoozes now match dismissals. A snooze on a row (
look:<repo>,<kind>:<repo>) hides only the asks that were already waiting when it was set. To do this,askHoldsnow returns when each snooze was set (created_at) rather than when it ends.notDismissedinsrc/web/studio/asks.tscompares that time with each ask'ssince, as it does for dismissals. A snooze on one ask still hides that ask until it ends. The docs now say all of this. - New tests in
test/asks-clear-queue.test.ts:- A planner's decline is dismissed, then the planner declines the same issue again in a new run, and the ask comes back.
- A row is snoozed, then a new change arrives in it. Only the new change shows, and waking the row brings back all three.
Each test fails if its comparison is removed. If the decline hold were keyed to the run, the first test would still pass, because the new run has a new ask id.
To check: bun test test/asks-clear-queue.test.ts. The tests that cover asks, dismissals, the page budget and On you pass (557 tests), and so do tsc and the gate.
🤖 Generated with Claude Code
The four asks from #17960 are done as routes and shared code, with one deviation: proposals are still not dismissible in bulk. New tests in
test/asks-clear-queue.test.tsand the existing ask, planner-decline, OpenAPI, lazy-routes, unused-exports and terminal On-you tests pass, andtscand the gate are clean. I did not run the full suite, and I did not start the app to try the routes.What changed
POST /api/v1/asks/{key}/snoozetakes{until}, either an ISO instant or a UTC day, after now and within a year.{until: null}wakes the ask.keyis an ask id or its row id, URL-encoded.ask_snoozetable (migration plus pin) and filtered innotDismissed, so the web home, the terminal andGET /api/v1/asksall hide the ask until it wakes.zsnoozes the marked rows, or the one under the cursor, for a day.POST /api/v1/asks/raise {item: "paused:<repo>"}. The pause is the crew's weekly share running out (week.use), not the forge's daily dollar ceiling, so the route raisesweek.useby 10 points, up to 100, and answers{item, from, to}. Only a forge admin can use it. At 100 it says the crew waits for the provider's reset. I did not reuseraiseCrewCeiling, because raising the daily ceiling would not lift this ask.changes: [{item, number, numberOf, title}].declined:<run>can now be dismissed inasks/bulk, and undo brings it back. A dismissal is kept per direction issue, so a newer decline asks again.proposal:<id>is still refused, but the refusal now says why: a wave is approved, redirected or put aside (/asks/proposal/<id>/later, undone byagain), not dismissed.Left out
asks_actaction for snooze or raise.No door:line pointing at the On you pane'szkey. The raise has no terminal key; it is API-only.Reused:
askTargetsForand the fleetdismissverb for the decline,changeCapacityfor the raise, and the queue'snotDismissedfor the snooze.Try: on the preview,
POST /api/v1/asks/<url-encoded key>/snooze {"until":"<tomorrow>"}, thenGET /api/v1/asks. The ask is gone from the list, and from the terminal and web home too. How-to:docs/features/asks-clear-queue.md.Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
🤖 Generated with Claude Code
Closes #17960