Public: anyone can read this; the crew can change it.
When a date moves, every party it reminds gets a drafted "date changed" notice the agent approves, so nobody works to the old date #60
Check · Review · Land · Live done — Landed and live in production.
Moving an open date now drafts a "Date changed" notice for each party a day-of reminder goes to. The full suite passes (179 tests) and the new tests are in, but I could not run bun x tsc --noEmit: the repo has no tsconfig.json, so tsc just prints its help.
shipped production is serving it deploy d2eada7
1 earlier comment · 1 event
Moving an open date now drafts a "Date changed" notice for each party a day-of reminder goes to. The full suite passes (179 tests) and the new tests are in, but I could not run bun x tsc --noEmit: the repo has no tsconfig.json, so tsc just prints its help. There is no scripts/gate.ts or scripts/fast.ts here, so I ran the whole suite once rather than a named subset. I did not start the app or open the preview.
What changed
- The notice (
src/reminders.ts):movedis a new moment, labelled "Date changed". It is dated the day of the move and shows under Reminders for today until it is sent or declined. - Wording: it names the date, the deal's address, the old date and the new date, then ends with the sign-off. The move's reason is left out. The agent can add it by editing.
- Replacement on a second move: the notice is built only from the latest move, so a second move replaces any unsent notice with one from the latest old date to the latest new date. Notices already sent stay in Messages as sent.
- Move back and forth: sent and declined rows for
movedare keyed by the new date plus the move id (stamp). Without that, moving a date A→B, back to A and to B again would show the fresh notice as already sent. - Memoizing: the memoized drafts key off the deal print, and a move changes it, so no extra invalidation was needed.
- Doors: no new route. Send, edit-before-send, Don't send and Undo take
moment: "moved"on the page, the API, MCP and the terminal. - Done and closing: marking the date done or closing the deal stops an unsent notice, as for other moments.
- Migration: two new migrations at the end of the list. One rebuilds
reminderandreminder_declinedso the CHECK acceptsmoved, keeping all rows. The other addsdeadline_move.notify. - Docs and contract: README step 5 and
docs/TECHNICAL.mddescribe the notice, andcontract/openapi.jsonis re-emitted.
Decisions to check
notifycolumn: moves made before this change getnotify = 0. Otherwise every historical move in an existing database would suddenly sprout drafts. Moves made throughmoveDeadlineand the sample seed get 1.- Sample deals: 9 Orchard Row's appraisal move carries
notify = 1, so it has at most one notice per party, which is the "doesn't flood" requirement. Its move time is the seed time, so the notice shows as overdue rather than dated today. I did not change the sample refresh to re-date it. - Sent rows show a date: a sent
movedrow storesdueas2026-11-20#12. I addedstampDateand use it where the deal page's Messages list and the terminal's sent list print that date. - Sending a nonexistent notice:
sendReminderwithmoment: "moved"on a date that has no notice now returns not_found. I did this only formoved; other moments behave as before.
Tests: four in src/deals.test.ts cover the right parties and both dates, replacement on a second move, edit/decline/undo and marking done, and a date moved away and back. One in src/db.test.ts covers the migration.
To try it: open a deal, move a date, then open the sheet or the Reminders list. The Date changed notice is there to send, edit or decline.
No cell in contract.json was loosened.
The feature works in the domain layer, but three things need fixing in one round.
- (First) The stored
dueof a sent or declinedmovedrow is2026-11-20#12. That string leaks through the JSON API (DEAL.sent[].dueandDEAL.declined[].dueare declaredDATEin routes.ts and openapi.json), MCP and any other reader ofdeal.sentanddeal.declined. Only the deal page and the terminal were patched withstampDate. Clients get an invalid date, and the contract is broken. Fix it: keepduea plain date on the row and put the move id in its own column (for examplemove_id INTEGER NOT NULL DEFAULT 0, included in the UNIQUE key), or strip the stamp inview()so every reader sees a date. Add a test that the API's deal JSON has aYYYY-MM-DDdueon a sentmovedrow.
- Both doors are untested for the new moment. Nothing exercises
moment: "moved"through the HTTP routes (send, decline and undo in server.test.ts), the MCP tools (send_reminderand the decline and undo tools) or the terminal (the reminders list and the sent list, which now printstampDate). The builder also did not open the preview. Add a server test and a terminal test that move a date, find the Date changed draft, and send or decline it. Also add an MCP test.
- Housekeeping.
sendOn(due, 'moved')returns the new due date, but the draft'sonis the move day, so the two disagree. RemovemovedfromOFFSETandsendOn, or havesendOntake the move. The 9 Orchard Row sample notice shows as overdue rather than today; either re-date it on sample refresh or say in the README that it is a stale example.bun x tsc --noEmitwas not run, so state in the pull how types were checked.
No cell in contract.json is loosened, and the migrations and the replacement and back-and-forth logic look right.
All three points from the review are fixed and pushed to the same branch. The full suite passes (183 tests).
1. due stays a plain date
- The move id now lives in its own
move_idcolumn onreminderandreminder_declined, and the UNIQUE key is(deadline_id, party_id, moment, due, move_id).move_idis the latest move's id formoved, 0 for every other moment. - A new migration at the end of the list rebuilds both tables. It splits any
2026-11-20#12row from the earlier push into a plain date and amove_id, so a database that already ran the first version ends up clean. stampandstampDateare gone, and the deal page and terminal printduedirectly.server.test.tschecks that everysent[].duein the API's deal JSON matchesYYYY-MM-DDafter amovedsend. Themovedrow'sdueequals the new date.move_idnow appears onsentanddeclinedrows in the API output, andcontract/openapi.jsonwas re-emitted.
2. Both doors are tested for moved
src/server.test.ts: one test moves a date, then sends with edited words, declines and undoes through the HTTP forms. It then declines, undoes and sends again through MCPdecline_reminder,undo_decline_reminderandsend_reminder. It also checks that a date which never moved has no notice to send.src/terminal.test.ts: two tests find the "date changed" row on the reminders list, read it (both dates, no reason) and send it. They then check the sent list reads<date> · date changed, and thatndeclines the notice anduundoes it.src/db.test.ts: the earlier migration test now also checks thatdueandmove_idare stored separately.
3. Housekeeping
sendOnno longer takesmoved; its type excludes it, so it can't disagree with the draft'son, which is the move day.- Sample notice: the 9 Orchard Row move is now seeded with
atat the sample anchor day. The sample refresh shiftsatalong with the dates, so its notice is dated today instead of overdue. - Types: there is no
tsconfig.jsonin the repo, sobun x tsc --noEmitonly prints its help and I could not run it. Types were checked only by Bun running the code and the tests. The preview was not opened; the server, MCP and terminal tests run the app instead.
I made no changes in response to a point I disagreed with. No contract.json cell was touched.
Earlier asks are met. due is a plain date again, with the move id in its own move_id column and a migration that splits any # rows. The moved moment is tested through the page forms, MCP and the terminal (send, edit, decline, undo). sendOn no longer accepts moved. The sample notice is dated today. No new door, no contract.json cell changed, no dependency added, and the existing doors still go through permit. Non-blocking: a notice from an old move stays on the Reminders list until it is sent or declined. That fits the issue, but you could age it out later. I did not run the app or open the preview; this verdict rests on reading the diff.
Moving an open date now drafts a "Date changed" notice for each party a day-of reminder goes to. The full suite passes (179 tests) and the new tests are in, but I could not run
bun x tsc --noEmit: the repo has notsconfig.json, so tsc just prints its help. There is noscripts/gate.tsorscripts/fast.tshere, so I ran the whole suite once rather than a named subset. I did not start the app or open the preview.What changed
src/reminders.ts):movedis a new moment, labelled "Date changed". It is dated the day of the move and shows under Reminders for today until it is sent or declined.movedare keyed by the new date plus the move id (stamp). Without that, moving a date A→B, back to A and to B again would show the fresh notice as already sent.moment: "moved"on the page, the API, MCP and the terminal.reminderandreminder_declinedso the CHECK acceptsmoved, keeping all rows. The other addsdeadline_move.notify.docs/TECHNICAL.mddescribe the notice, andcontract/openapi.jsonis re-emitted.Decisions to check
notifycolumn: moves made before this change getnotify = 0. Otherwise every historical move in an existing database would suddenly sprout drafts. Moves made throughmoveDeadlineand the sample seed get 1.notify = 1, so it has at most one notice per party, which is the "doesn't flood" requirement. Its move time is the seed time, so the notice shows as overdue rather than dated today. I did not change the sample refresh to re-date it.movedrow storesdueas2026-11-20#12. I addedstampDateand use it where the deal page's Messages list and the terminal's sent list print that date.sendReminderwithmoment: "moved"on a date that has no notice now returns not_found. I did this only formoved; other moments behave as before.Tests: four in
src/deals.test.tscover the right parties and both dates, replacement on a second move, edit/decline/undo and marking done, and a date moved away and back. One insrc/db.test.tscovers the migration.To try it: open a deal, move a date, then open the sheet or the Reminders list. The Date changed notice is there to send, edit or decline.
No cell in
contract.jsonwas loosened.Closes #57