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

The agent reviews today's reminders one after another from a single page, approving or declining each and landing on the next, so the morning round takes a minute #75

Merged opened this

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

Merged

Review all on the clock now opens one page that walks today's unsent reminders one at a time, and the agent still approves every message. I ran the review tests, the speed test and 11 neighbouring suites (123 tests, all green).

Notes

shipped production is serving it deploy d2eada7

opened this

Review all on the clock now opens one page that walks today's unsent reminders one at a time, and the agent still approves every message. I ran the review tests, the speed test and 11 neighbouring suites (123 tests, all green). I did not run the full suite or bun x tsc --noEmit: the repo has no tsconfig.json, so tsc only printed its help. scripts/gate.ts and scripts/fast.ts don't exist here. bun scripts/design-lint.ts is named bun run lint:design in this repo; it passed.

What moved where

  • src/reminders.ts gains todaysDrafts(deals, day, agent), the one ordering of today's drafts. The clock's "Reminders for today" rows now come from it, so the page and the clock can't disagree, including after #68 changes when "before" is due. Stored moment keys are unchanged.
  • The clock's "Reminders for today" card shows a Review all link only when something is left to send; it carries the Find query.
  • GET /reminders/today (src/pages/review.ts) shows one draft: address, date and moment, who it goes to and their contact, editable subject and message (150 / 2000), and a counter such as "2 of 14".
  • Send and Don't send post to POST /reminders/today/send and /decline. Both call sendReminder and declineReminder, the same actions the sheet uses, so permit for a deal update, the same-origin check and the audit trail apply unchanged. Success redirects to the next unsent draft, and the notice keeps Open in Mail / Messages for the one just sent.
  • Skip is a plain link that changes nothing. Past the last draft it wraps to the first one still unsent, so a skipped draft is never lost. The at and done query values only keep the "k of n" counter honest.
  • A refused form (too long, empty) answers 422 with the same draft, what was typed, and the field named, for example "Message:". When nothing is left it says "All of today's reminders are sent or declined" with a link back to the clock; signed out, it is the sign-in notice.

Tests

  • src/review.test.ts (7 tests) covers: queue order matches the clock; Send on draft 1 shows draft 2 and records the edited words; Don't send records the reason; Skip changes nothing; a refused form keeps what was typed and names the field; Find narrows the queue; anon and cross-origin requests are refused.
  • src/speed.test.ts now includes the review page in its 200-deal, under-50 ms checks.
  • README walk step 4 has one sentence on Review all, and docs/TECHNICAL.md lists the route.

What I chose not to do

  • No new contract cell, and no loosened cell.
  • No new CSS classes. The page reuses .card, .move, .conflict and the button classes, so there is nothing to add to docs/design/areas/.
  • Undo is not on the review page, because it only walks unsent drafts; Undo stays on the sheet.

To try it: sign in, open the clock, tap Review all under "Reminders for today", edit the words, Send, and watch draft 2 appear.

Closes #73

2 earlier comments · 1 event
commented

Review all on the clock now opens one page that walks today's unsent reminders one at a time, and the agent still approves every message. I ran the review tests, the speed test and 11 neighbouring suites (123 tests, all green). I did not run the full suite or bun x tsc --noEmit: the repo has no tsconfig.json, so tsc only printed its help. scripts/gate.ts and scripts/fast.ts don't exist here. bun scripts/design-lint.ts is named bun run lint:design in this repo; it passed.

What moved where

  • src/reminders.ts gains todaysDrafts(deals, day, agent), the one ordering of today's drafts. The clock's "Reminders for today" rows now come from it, so the page and the clock can't disagree, including after #68 changes when "before" is due. Stored moment keys are unchanged.
  • The clock's "Reminders for today" card shows a Review all link only when something is left to send; it carries the Find query.
  • GET /reminders/today (src/pages/review.ts) shows one draft: address, date and moment, who it goes to and their contact, editable subject and message (150 / 2000), and a counter such as "2 of 14".
  • Send and Don't send post to POST /reminders/today/send and /decline. Both call sendReminder and declineReminder, the same actions the sheet uses, so permit for a deal update, the same-origin check and the audit trail apply unchanged. Success redirects to the next unsent draft, and the notice keeps Open in Mail / Messages for the one just sent.
  • Skip is a plain link that changes nothing. Past the last draft it wraps to the first one still unsent, so a skipped draft is never lost. The at and done query values only keep the "k of n" counter honest.
  • A refused form (too long, empty) answers 422 with the same draft, what was typed, and the field named, for example "Message:". When nothing is left it says "All of today's reminders are sent or declined" with a link back to the clock; signed out, it is the sign-in notice.

Tests

  • src/review.test.ts (7 tests) covers: queue order matches the clock; Send on draft 1 shows draft 2 and records the edited words; Don't send records the reason; Skip changes nothing; a refused form keeps what was typed and names the field; Find narrows the queue; anon and cross-origin requests are refused.
  • src/speed.test.ts now includes the review page in its 200-deal, under-50 ms checks.
  • README walk step 4 has one sentence on Review all, and docs/TECHNICAL.md lists the route.

What I chose not to do

  • No new contract cell, and no loosened cell.
  • No new CSS classes. The page reuses .card, .move, .conflict and the button classes, so there is nothing to add to docs/design/areas/.
  • Undo is not on the review page, because it only walks unsent drafts; Undo stays on the sheet.

To try it: sign in, open the clock, tap Review all under "Reminders for today", edit the words, Send, and watch draft 2 appear.

commented

I merged main into the branch and pushed it. The full suite passes (240 tests, 0 failures) and bun run lint:design is clean. I did not run bun x tsc --noEmit, because the repo has no tsconfig.json.

  • Conflict: src/pages/clock.ts was the only file that conflicted. main now passes the agent profile into the clock instead of reading it from the environment. I kept that, and kept my todaysDrafts call, so the clock's list and the review page still come from one function.
  • Review page: because the agent now comes from agentOf(c.db), I made the review page and its three routes use it too. reviewPage takes an agent, and the routes pass it to the page, the sign-in and refusal pages, and the queue. Without that, the review page would have shown the environment's agent while the rest of the app showed the saved one.
  • Contract: there is no change to contract.json, and no cell is loosened.
Approved

Clean. The review page reuses sendReminder and declineReminder, so permit, the same-origin check and the audit apply unchanged. No contract cell changes. Output is escaped, and q, at and done are validated before they reach a redirect. Tests cover order, Send, Don't send, Skip, a refused form, Find, anon and cross-origin. I read the diff and did not exercise the preview.

commented

Left #73 open: 1 unticked item remain (The page shows one draft at a time, in the same order as the clock's list: the deal's address, the date and moment, who it goes to and their contact, and the subject and message fields already filled in and editable (same 150 / 2000 limits, validated at the boundary as on the sheet), with a counter ("3 of 14").).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs