Public: anyone can read this; the crew can change it.
The agent can decline a reminder with a reason, so a message they chose not to send stops asking and the record says why #24
Check · Review · Land · Live done — Landed and live in production.
An agent can now decline a reminder with a reason, at every door, and undo it later. The full suite passes (97 tests) and lint:design is clean. I did not run tsc --noEmit: the repo has no tsconfig and no TypeScript dependency, so bun x tsc only printed its help.
shipped production is serving it deploy d2eada7
An agent can now decline a reminder with a reason, at every door, and undo it later. The full suite passes (97 tests) and lint:design is clean. I did not run tsc --noEmit: the repo has no tsconfig and no TypeScript dependency, so bun x tsc only printed its help. There is no scripts/gate.ts or scripts/fast.ts. I did not look at the sheet at 360px, so the two-forms-per-draft layout is untested by eye.
What changed
- Record: migration 11 in
src/db.tsadds areminder_declinedtable. It holds the reason (1–200 characters), who declined, when, and the date's and party's words, so it outlives both. It is written to be safe to re-run. - Actions:
declineReminderandundoDeclineinsrc/deals.tsaskpermit(who, "deal", "update", deal), are audited against the deal's id, and emitdeal.changed.DealViewgainsdeclined, and eachDraftgainsdeclined: {reason, by_name} | null. - Out of the lists: the new
unsent()insrc/reminders.tskeeps a declined reminder out ofdueOn(so/tickandreminders_today), the "N to send" count, and the terminal's late list. - Refusals: a reminder that was declined cannot be sent until it is undone, and one that was already sent cannot be declined.
- Page:
src/pages/sheet.tsputs a Don't send form (required reason, 200-character limit, no script) under the Send form, both in a date's sheet and in Reminders for today. A declined draft shows "Not sent: <reason> · <who>", escaped, and anyone who may change the deal gets an Undo button. Routes arePOST /reminders/declineand/reminders/undo. - API:
POST /api/deals/:id/reminders/declineand.../undo, described incontract/openapi.json(re-emitted). - MCP:
decline_reminderandundo_decline_reminder. - Terminal: on the reminders list,
nasks for the reason anduundoes.nstill opens a new deal everywhere else. - Docs: the README says an agent can decline a message and the reason is kept, and adds a step to the walk.
docs/TECHNICAL.mdhas the technical detail.
Tests
src/deals.test.ts: a declined reminder leaves the unsent count and/tick; an empty, blank, non-string or 201-character reason is refused asinvalid; undo returns it to the draft list; anon is refused withsignin_required.src/terminal.test.ts:nandu, an empty reason, and anon.src/server.test.ts: the API statuses, the escaped page text, and the new MCP tools.
Please look at
- Door change (
src/security.ts):doorOfonly treated PATCH and DELETE inside a row (/api/deals/:id/x/:y) as an update of that row. I made it treat POST the same, so the new routes are checked against the deal'supdatecell. It only decides which cell a request is checked against, and nocontract.jsoncell changed. - Not done: I left alone the existing behaviour that moving a date makes its reminders unsent again. A decline is tied to the date it was made for, like a send.
I haven't rebased on #17 or #13. Any conflict in src/mcp.ts or src/pages/clock.ts will be small.
To try it: open a date's sheet or Reminders for today, tap a draft, enter a reason and press Don't send. In the terminal, press r, then n and the reason.
🤖 Generated with Claude Code
Read in full. Decline and undo are update of deal through permit (via deadlineFor), on all four doors: page, JSON API, MCP and terminal. Reason is validated at 1 to 200 characters in code and in the DB CHECK, output is escaped, and the existing body cap and same-origin path are reused. Declined reminders leave /tick, reminders_today and the to-send count, and cannot be sent until undone. Tests cover the behaviour, including guest refusal and escaping. No contract cell is loosened, no dependency added, and README and TECHNICAL are updated. The doorOf change maps POST on api/:id/x/:y to update, which is consistent with the rest. I did not exercise the preview.
An agent can now decline a reminder with a reason, at every door, and undo it later. The full suite passes (97 tests) and
lint:designis clean. I did not runtsc --noEmit: the repo has no tsconfig and no TypeScript dependency, sobun x tsconly printed its help. There is noscripts/gate.tsorscripts/fast.ts. I did not look at the sheet at 360px, so the two-forms-per-draft layout is untested by eye.What changed
src/db.tsadds areminder_declinedtable. It holds the reason (1–200 characters), who declined, when, and the date's and party's words, so it outlives both. It is written to be safe to re-run.declineReminderandundoDeclineinsrc/deals.tsaskpermit(who, "deal", "update", deal), are audited against the deal's id, and emitdeal.changed.DealViewgainsdeclined, and eachDraftgainsdeclined: {reason, by_name} | null.unsent()insrc/reminders.tskeeps a declined reminder out ofdueOn(so/tickandreminders_today), the "N to send" count, and the terminal's late list.src/pages/sheet.tsputs a Don't send form (required reason, 200-character limit, no script) under the Send form, both in a date's sheet and in Reminders for today. A declined draft shows "Not sent: <reason> · <who>", escaped, and anyone who may change the deal gets an Undo button. Routes arePOST /reminders/declineand/reminders/undo.POST /api/deals/:id/reminders/declineand.../undo, described incontract/openapi.json(re-emitted).decline_reminderandundo_decline_reminder.nasks for the reason anduundoes.nstill opens a new deal everywhere else.docs/TECHNICAL.mdhas the technical detail.Tests
src/deals.test.ts: a declined reminder leaves the unsent count and/tick; an empty, blank, non-string or 201-character reason is refused asinvalid; undo returns it to the draft list; anon is refused withsignin_required.src/terminal.test.ts:nandu, an empty reason, and anon.src/server.test.ts: the API statuses, the escaped page text, and the new MCP tools.Please look at
src/security.ts):doorOfonly treated PATCH and DELETE inside a row (/api/deals/:id/x/:y) as an update of that row. I made it treat POST the same, so the new routes are checked against the deal'supdatecell. It only decides which cell a request is checked against, and nocontract.jsoncell changed.I haven't rebased on #17 or #13. Any conflict in
src/mcp.tsorsrc/pages/clock.tswill be small.To try it: open a date's sheet or Reminders for today, tap a draft, enter a reason and press Don't send. In the terminal, press
r, thennand the reason.🤖 Generated with Claude Code
Closes #21