Public: anyone can read this; the crew can change it.
Each deal shows a Messages record: every reminder sent for it, newest first, with who, when and the exact words approved #26
Merged 31d 4h ago, live in production
/deals/:id now has a Messages section below Parties. It lists every sent reminder for the deal, newest first, with the words that were approved. bun test passes (99 tests) and bun run lint:design is clean.
-
Reviews
Changes requested — before the latest pushThe page, API and migration are sound, but one item on the list is missed: the terminal door. Fix first: add the Messages record to src/terminal.ts, with a test.
- Both doors. A person can read the Messages record on the page, but src/terminal.ts and src/tty.ts show no sent record for a deal: grep finds no sent-record view there. Add a view of a deal's sent reminders, newest first, with who, when and the exact words. It should read through the same
permitdeal-read gate as the page. Add a terminal test that fails without it. The README should then say how to reach it in the terminal. - docs/TECHNICAL.md now says the record is shown 'in the terminal'. That is untrue until item 1 lands.
- src/sample.ts: the 'untouched' check treats any reminder with by_name = 'Sample data' as the sample's own. by_name comes from the signer's name, so a real user named 'Sample data' could send a reminder that never marks the deal as changed, and the refresh would then shift its dates. Mark the sample's reminder by something a user cannot set, for example a column, or compare against the exact seeded rows. The tests that filter on by_name <> 'Sample data' (db.test.ts, terminal.test.ts) should follow.
- Minor: src/deals.test.ts has a stray
"Edited" , bodyformat. Also run a type check; the pull says none ran.
ApprovedEarlier asks are met. (1/2) The terminal now has the Messages record: s on an open deal, newest first, enter opens the words, b goes back, and it reads through getDeal so a guest sees nothing. It is tested and in the README. (3) The sample marker is a seed-only
samplecolumn, not a comparison on by_name, and a test covers the spoofed name. (4) The stray formatting is fixed. I found no new security, contract or cleanliness problems in the changed lines. contract.json is untouched, so no cell is loosened. Non-blocking: the terminal prints stored subject and body verbatim, so control characters in them reach the screen. Stripping them on render would be a cheap hardening step. - Both doors. A person can read the Messages record on the page, but src/terminal.ts and src/tty.ts show no sent record for a deal: grep finds no sent-record view there. Add a view of a deal's sent reminders, newest first, with who, when and the exact words. It should read through the same
-
Checks
shipped production is serving it deploy d2eada7
-
History
- The terminal shows a deal's Messages (s on an open deal); the sample's own sent reminder is marked by a column a signer cannot set (#23) 9dbdb77
- Each deal shows a Messages record of every reminder sent, newest first, with the words approved; the sample carries one (#23) 1cc4755
- 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) ec4452c
- An agent over MCP can correct or remove a party, remove a dropped date and remove a deal, as the page and the terminal can (#19) 6354d9b
- New deal shows every computed date before it is opened, and a refused form keeps what was typed (#22) 6c86e19
- A realtor reads the README in one go: what it does, a five-minute walk through the sample deals, and what is not real yet, with the technical part kept separate (#18) eec530a
- The agent can correct a party's name or contact, remove a party, and remove a date the contract dropped (#16) f62bfce
- The agent can edit a reminder's words before sending, and the sent record keeps exactly what was approved (#10) fa34ea2
- An agent can open a deal, add a date, add a party and reopen a date over MCP, like on the page (#14) d8f7cb2
- Sample deals look like today on every boot, not like the day the database was made (#11) 7eadc93
- The template's notes scaffold is gone, so every door is about deals (#8) ab2ee77
- Build deal-clock (#2) 8969e75
- Start deal-clock 767a5e7
/deals/:id now has a Messages section below Parties. It lists every sent reminder for the deal, newest first, with the words that were approved.
bun test passes (99 tests) and bun run lint:design is clean. bun x tsc --noEmit only printed its help text, because the repo has no tsconfig.json, so there was no type check. There is no scripts/gate.ts or scripts/fast.ts. I did not open the running page, so I haven't seen how the section looks.
What changed
- Page: each entry shows the party's name and role, the date's label, its due day, "3 days before" or "Morning of", and the day it was sent. The subject is the visible line, and the approved body opens in a
<details>with no JavaScript. The words come from the stored sent record, so an edited reminder reads back as edited. When nothing is sent, it shows one muted line: "Nothing sent yet". It reuses the existing.draftsand.draftstyles, so there is no new component class. - Removed dates: the sent record already kept the date's label and the party's name, but not the party's role. I added a migration for a
party_rolecolumn onreminder, filled in for existing rows where the party still exists.sendRemindernow stores the role at send time. A reminder sent before this, whose party was already removed, shows without a role and says "The words were not kept for this one" if its subject was empty. A reminder for a removed date shows "(date removed)" after its label. - API and MCP: the deal view's
sentlist is now ordered newest first.GET /api/deals/:idand the MCPget_dealalready returnedsent, so both pick up the new order andparty_rolewith no further change. The openapi description forsentis updated, withlabel,party_nameandparty_roleadded, andcontract/openapi.jsonis regenerated. - Permissions: the page and API read through the existing
dealread permission.contract.jsonis untouched, so no cell is loosened. - Sample data: 1418 Alder Lane now carries one sent reminder, in edited words, to the buyer about the inspection date. The README walk has a sentence pointing to it, and
docs/TECHNICAL.mddescribes the section. The sample refresh now treats a reminder the sample itself sent as untouched and moves it along with its date. Any reminder a person sends still makes that sample deal "changed", as before. - Tests:
src/server.test.ts: the page lists the edited words, escaped; a deal with nothing sent shows the empty line; the Alder Lane sample reads back; a guest gets 401; the API includessent.src/deals.test.ts: the role and label survive both being removed, with the newest entry first.src/terminal.test.tsandsrc/db.test.ts: two assertions now ignore the sample's own sent reminder.
What I chose not to do
- I did not add a "removed" label for a removed party. Their name and role stay as sent, which already says who it went to.
- I placed the sample reminder on a done date (inspection) rather than an open one. An open date would have added a row to today's reminder list and shifted what the terminal tests step through.
- I did not time the page. It does one extra indexed read on the deal view, which the sample data should not slow.
To try it: open 1418 Alder Lane from the clock, then open any entry under Messages to read the words.
🤖 Generated with Claude Code
I've addressed all four points and pushed to the same branch. bun test passes (101 tests), bun run lint:design is clean, and a type check with strict settings reports no errors.
What changed
- Terminal Messages (items 1 and 2): press
son an open deal (oopens it) to see its sent reminders, newest first.- Each row shows the party and role, the date's label and due day, the moment, and the day it was sent.
- Enter opens the exact approved words and
bgoes back to the deal. - It reads through
getDeal, the samepermitdeal-read path as the page, so a guest sees nothing. - The README walk now says "In the terminal: open the deal with o, then press s", and
docs/TECHNICAL.mdsays the same, so its "in the terminal" claim is now true. - The new test in
src/terminal.test.tssends two reminders, then checks the newest-first order, that the words open on enter, thatbreturns to the deal, and that a guest sees nothing.
- Sample marker (item 3): I'm not comparing
by_nameanymore. A new migration addsreminder.sample, which only the seed sets. The migration also marks the existing sample rows in databases already seeded.- The untouched check and the date shift now use
sample. - The
db.test.tsandterminal.test.tsfilters usesample = 0. - A new
db.test.tstest sends a reminder as "Sample data" on a sample deal. It fails with the old by-name check, because the refresh would shift that deal's dates, and passes now. - I added a new migration instead of editing the earlier one, since the earlier one has already run on previews.
- The untouched check and the date shift now use
- Format and type check (item 4): the stray format in
src/deals.test.tsis fixed. The repo has notsconfig.jsonor@types/bun, so I installedtypescriptand@types/bunin$TMPDIRand rantsc --strict --noUncheckedIndexedAccessover the app,src/terminal.test.ts,src/db.test.ts,src/server.test.ts,src/deals.test.tsandsrc/sample.ts. Nothing is added to the repo.
What I did not do
- With
exactOptionalPropertyTypesalso on,tscreports errors insrc/deals.ts(the decline and undo helpers) andsrc/server.test.ts. That flag is stricter than the repo's own settings (there is notsconfig.json), and those lines aren't part of this change, so I left them. - I did not add a separate terminal route for the record, such as its own top-level key. It lives under the open deal, matching where the page puts it.
/deals/:idnow has a Messages section below Parties. It lists every sent reminder for the deal, newest first, with the words that were approved.bun testpasses (99 tests) andbun run lint:designis clean.bun x tsc --noEmitonly printed its help text, because the repo has notsconfig.json, so there was no type check. There is noscripts/gate.tsorscripts/fast.ts. I did not open the running page, so I haven't seen how the section looks.What changed
<details>with no JavaScript. The words come from the stored sent record, so an edited reminder reads back as edited. When nothing is sent, it shows one muted line: "Nothing sent yet". It reuses the existing.draftsand.draftstyles, so there is no new component class.party_rolecolumn onreminder, filled in for existing rows where the party still exists.sendRemindernow stores the role at send time. A reminder sent before this, whose party was already removed, shows without a role and says "The words were not kept for this one" if its subject was empty. A reminder for a removed date shows "(date removed)" after its label.sentlist is now ordered newest first.GET /api/deals/:idand the MCPget_dealalready returnedsent, so both pick up the new order andparty_rolewith no further change. The openapi description forsentis updated, withlabel,party_nameandparty_roleadded, andcontract/openapi.jsonis regenerated.dealread permission.contract.jsonis untouched, so no cell is loosened.docs/TECHNICAL.mddescribes the section. The sample refresh now treats a reminder the sample itself sent as untouched and moves it along with its date. Any reminder a person sends still makes that sample deal "changed", as before.src/server.test.ts: the page lists the edited words, escaped; a deal with nothing sent shows the empty line; the Alder Lane sample reads back; a guest gets 401; the API includessent.src/deals.test.ts: the role and label survive both being removed, with the newest entry first.src/terminal.test.tsandsrc/db.test.ts: two assertions now ignore the sample's own sent reminder.What I chose not to do
To try it: open 1418 Alder Lane from the clock, then open any entry under Messages to read the words.
🤖 Generated with Claude Code
Closes #23