Public: anyone can read this; the crew can change it.
The agent can edit a reminder's words before sending, and the sent record keeps exactly what was approved #10
Check · Review · Land · Live done — Landed and live in production.
Opening a draft in a date's sheet or in Reminders for today now shows its subject and body in editable fields, and Send stores exactly what was posted. bun test passes (74 tests) and bun scripts/lint-design.ts is clean. bun x tsc --noEmit could not run: the repo has no tsconfig.json, so tsc only prints its help.
shipped production is serving it deploy d2eada7
3 earlier comments · 2 events
Opening a draft in a date's sheet or in Reminders for today now shows its subject and body in editable fields, and Send stores exactly what was posted. bun test passes (74 tests) and bun scripts/lint-design.ts is clean. bun x tsc --noEmit could not run: the repo has no tsconfig.json, so tsc only prints its help.
What changed
- Migration:
src/db.tsaddssubjectandbodytoreminder. Rows sent before the migration have empty words and read back as the draft they were sent from. - Sending:
sendReminderinsrc/deals.tstakes optionalsubjectandbody. Left out, the current draft is stored. Given, they are checked at the boundary:
- Subject is trimmed to one line, 1 to 150 characters.
- Body is trimmed, line breaks kept, control characters dropped, 1 to 2000 characters.
- A failure is invalid with the message "The message is 1 to 2000 characters."
- Permissions: it still asks
permit(who, "deal", "update", deal)and is audited. No cell incontract.jsonchanged. - Sent words: a second send changes nothing, and a sent draft in
src/reminders.tsreads back its stored words. A rename of the party afterwards does not alter them. - Doors:
- Page: /reminders takes subject and body from a plain form with no script. Each draft is a <details> holding the form, and a sent or read-only draft shows its stored words.
- API: /api/deals/:id carries the stored words in sent, and contract/openapi.json is re-emitted.
- MCP: send_reminder takes optional subject and body and answers with the sent record.
- Terminal: s sends the draft unchanged and stores its words, and enter reads the stored words.
- Sheet layout: the per-moment "Read the draft" preview is gone, because each party's message is now its own form or record. The inputs are 16px and the textarea is at least 88px tall. I added only a
textarea.inputrule tostatic/app.css, no new component class. I have not looked at the sheet in a browser at 360px. - Docs:
README.mddescribes the editing and the kept words.
Tests
- An edited send stores the edited words.
- An empty body, an empty subject, a 151-character subject, a 2001-character body and an anonymous caller are each refused, and nothing is stored.
- A second send keeps the first words.
- Renaming the party leaves a sent reminder's words unchanged.
- A send with no words stores the draft as it stands.
- The form route stores edited words, and a blank body flashes the named failure.
- The terminal test checks that
sstored the shown draft.
What I did not do
- Sending is still simulated, with no email or SMS.
- I did not backfill words for reminders sent before the migration.
To try it: open any date's sheet, open a draft, change the words, press Send, then reopen it or fetch /api/deals/:id.
🤖 Generated with Claude Code
Server side is sound: subject/body are validated at the boundary, escaped on output, stored at send, and a re-send keeps the first approved words; no contract cell changed. Three things to fix in one round:
- (first) The terminal cannot edit. The page lets the agent change the subject and message before Send; src/tty
scan only send the draft unchanged. Both doors must do the same work: add an edit step in the terminal (e.g.eto type a new subject and message, thens), gated like the page, and say so in the README. - Tests missing for behaviours added: the MCP send_reminder with subject/body (edited words stored, empty/over-length refused, and the answer holding the words), the page rendering the edit form for an unsent draft and the sent words (not the current draft) for a sent one, and the terminal edit path once it exists. The terminal test added only checks that an unchanged send keeps the body.
- Minor: README line wraps inconsistently with the surrounding paragraph; reflow it.
I've addressed all three of sentinel's points and pushed to the same branch. bun test passes (78 tests). The first push of this round included a failing terminal test. I fixed it in the next commit (60e64e8), so only the latest push is green. bun x tsc --noEmit still can't run, because the repo has no tsconfig.json.
Terminal edit (src/terminal.ts)
eon an unsent reminder asks for a subject, then a message. An empty answer keeps that part of the draft, and\nin the message is a line break.- The message can be up to 2000 characters, the same limit as the page.
- Edited words are held in the terminal until
ssends them. Enter shows the edited words before sending, and a sent reminder always shows its stored words. - Anon sees no deals in the terminal, so
enever opens a prompt for them, andegoes through the samecanChangecheck as the other prompts. With the current table any signed-in user may work a deal, so only anon is gated. A reminder already sent says so and cannot be edited. - The same subject and body limits apply at send as on the page, because the terminal calls the same
sendReminder.
Tests added
- MCP:
- send_reminder refuses an empty body, an empty subject, a 151-character subject and a 2001-character body.
- It refuses an anonymous caller.
- It stores edited words and answers with them.
- A re-send keeps the first words.
- get_deal shows the sent words.
- Page:
- An unsent draft renders the subject input and the body textarea; a guest sees no form.
- After a send, the sent words appear escaped and the raw <script> does not.
- Terminal:
- e stores words that s then sends.
- An empty answer keeps that part of the draft.
- A guest gets no edit prompt.
- The new server tests use their own identity,
editor, because the shared write limit of 20 foralicewas being used up and returning 429s.
README: the terminal paragraph now describes e and s. I also reflowed the MCP tools sentence. I did not touch the Send paragraph the review may have meant. If the line you meant is a different one, point me at it.
Not done: the terminal prompt has no prefill, so you retype the part you change (or press enter to keep it) rather than editing in place.
🤖 Generated with Claude Code
Approved. The terminal now has e (subject, then message, with the same 150/2000 limits) and s sends the edited words. Editing is gated by canChange, so a guest gets no prompt. MCP, page, API and terminal all go through sendReminder, which still asks permit. Bodies are validated and outputs escaped. The stored words survive a rename and a second send, and each added behaviour has a test. No contract.json cell is loosened. I could not diff against 544d8c6290f2 because the clone lacks that commit, so I judged the diff as shown. I did not run the preview or the tests. Non-blocking: the README paragraph edits have uneven line wrapping.
I merged main into the branch, resolved the two conflicts (src/db.ts and README.md), and pushed. bun test passes (82 tests).
src/db.ts: both migrations are kept.main'ssample_anchormigration stays in its original position, because it may already have run in production. MyALTER TABLE remindermigrations forsubjectandbodycome after it, so no migration that has run was reordered or edited.README.md: the MCP tools sentence now listsmain's new tools (open_deal,add_date,add_party, andmark_donewithdone: falseto reopen). It also keeps my note thatsend_remindertakes an optionalsubjectandbody.
I did not re-run scripts/lint-design.ts after the merge, since main's changes touched no files in src/web/ or static/.
🤖 Generated with Claude Code
The preview should now start. bun test passes (83 tests), but I haven't seen the preview deploy itself yet.
Cause: the preview's database had already run my two ALTER TABLE reminder migrations at their old positions in the list. The merge put main's sample_anchor migration ahead of them, so the preview's recorded version was one short and the body migration ran a second time. SQLite rejected it with "duplicate column name: body".
Why not reorder: production has already run sample_anchor at its position, so reordering would break production instead.
Fix: in migrate() in src/db.ts, an ALTER TABLE … ADD COLUMN that fails with "duplicate column name" now counts as already applied. Any other migration failure still throws.
Test: a new test in src/db.test.ts removes the last recorded version from a migrated database and reopens it. The database opens and the migration count is correct.
Side effect: the preview database never ran main's sample_anchor migration, so its sample deals keep their old dates. This affects the preview only.
🤖 Generated with Claude Code
Approved. The earlier asks are met. The terminal has e and s, gated by canChange, with the same limits as the page. MCP and the page are covered by tests, including escaping. The README is updated. The latest change, migrate() tolerating a duplicate-column ALTER, is narrow (only ALTER TABLE ADD COLUMN, other failures rethrow) and tested. No contract cell is loosened, sendReminder still goes through permit, and there are no new dependencies. I could not diff against 60e64e8 because the commit is not in the clone, so I judged the change as shown. Non-blocking: nobody has looked at the sheet at 360px, and there is still no tsconfig.json for tsc.
Opening a draft in a date's sheet or in Reminders for today now shows its subject and body in editable fields, and Send stores exactly what was posted.
bun testpasses (74 tests) andbun scripts/lint-design.tsis clean.bun x tsc --noEmitcould not run: the repo has notsconfig.json, sotsconly prints its help.What changed
src/db.tsaddssubjectandbodytoreminder. Rows sent before the migration have empty words and read back as the draft they were sent from.sendReminderinsrc/deals.tstakes optionalsubjectandbody. Left out, the current draft is stored. Given, they are checked at the boundary:- Subject is trimmed to one line, 1 to 150 characters. - Body is trimmed, line breaks kept, control characters dropped, 1 to 2000 characters. - A failure is
invalidwith the message "The message is 1 to 2000 characters."permit(who, "deal", "update", deal)and is audited. No cell incontract.jsonchanged.src/reminders.tsreads back its stored words. A rename of the party afterwards does not alter them.- Page:
/reminderstakessubjectandbodyfrom a plain form with no script. Each draft is a<details>holding the form, and a sent or read-only draft shows its stored words. - API:/api/deals/:idcarries the stored words insent, andcontract/openapi.jsonis re-emitted. - MCP:send_remindertakes optionalsubjectandbodyand answers with the sent record. - Terminal:ssends the draft unchanged and stores its words, and enter reads the stored words.textarea.inputrule tostatic/app.css, no new component class. I have not looked at the sheet in a browser at 360px.README.mddescribes the editing and the kept words.Tests
sstored the shown draft.What I did not do
To try it: open any date's sheet, open a draft, change the words, press Send, then reopen it or fetch
/api/deals/:id.🤖 Generated with Claude Code
Closes #5