Public: anyone can read this; the crew can change it.
An addendum moves several of a deal's dates at once with one reason, and each party gets one "dates changed" notice listing every change #71
Check · Review · Land · Live done — Landed and live in production.
The deal page now has an Amend the contract form: an addendum moves several dates at once with one reason, and each party gets one "dates changed" notice listing every change. bun test passes (217 tests plus the new terminal test), as does bun run lint:design.
shipped production is serving it deploy d2eada7
The deal page now has an Amend the contract form: an addendum moves several dates at once with one reason, and each party gets one "dates changed" notice listing every change. bun test passes (217 tests plus the new terminal test), as does bun run lint:design. I couldn't run bun x tsc --noEmit because the repo has no tsconfig.json and tsc just prints its help.
What changed
- Form (
src/pages/amend.ts). One date input per open date, prefilled with its due date, plus one required reason of 1–200 characters. It works without JavaScript, and a refused form comes back 422 with what was typed and the offending field marked.src/pages/deal.tsonly includes it, so #62 and #64 can still edit that file. - Action (
amendDealinsrc/deals.ts). It checks every date before moving any, so one bad date refuses the whole amendment. A date left at its current due is skipped, and if none changed it answers "Nothing changed". It writes one move per changed date in a single transaction, with the same reason and author. It uses the samepermit(deal, update)check as a move, andcontract.jsonis untouched. - Notices. Moves from one amendment share a new
amendmentnumber (migration appended tosrc/db.ts). Each party gets one notice listing every changed date they are told about (old → new). It sits on one of the amendment's dates and is remembered by the first move it told that party about, so a notice already sent or declined is not re-drafted if one of its dates is moved again. Single-date moves keep today's notice. Send, edit, decline and undo work on it unchanged, becauseDraftnow carriesmove_idinstead ofmoveKey. - Doors.
- API: POST /api/deals/:id/amend, with contract/openapi.json regenerated.
- MCP: amend_deal with {deal, dates, reason}.
- Terminal: M in the deal view, where a blank answer keeps a date.
- All of them show the #61 closing-order conflicts after the amendment.
- Docs. README step 5 has the one sentence you asked for, and
docs/TECHNICAL.mdnamesamend_deal.
Changes outside the listed files
doorOfinsrc/security.tsnow treatsPOST <api>/:id/amendas an update of the deal. Without that the API route had no contract cell andsrc/openapi.test.tsfailed. This does not loosen any cell.- The event-stream test in
src/server.test.tsassumed the first replayeddeal.changedwas its own. With more tests emitting events, that event dropped out of the 100-event replay buffer and the test failed. It now opens the stream past every earlier event. That test was wrong, not the code. src/server.test.tsalso listsamend_dealamong the MCP tools.
What I chose not to do
- If an amendment's notice is already sent or declined and a later move also touches that notice's date, the later move gets its own notice; the amendment's stays as it was.
- A notice for an amendment that tells a party about only one date uses the ordinary single-date wording.
- The notice does not state the reason, matching today's moved notice.
Try it: open any deal, change two dates under Amend the contract, give a reason, and save. Under Messages or the Reminders view, each party has one "dates changed" notice naming both. Submitting with no change, or with a blank reason, brings the form back with the field marked.
🤖 Generated with Claude Code
I merged main into this branch and pushed it. The full suite passes locally (219 tests, 0 failures).
What changed: the only conflict was in src/pages/deal.ts, where both sides had added an import on the same line. main added confirmRemove from ./confirm.ts and this branch added amendForm from ./amend.ts. Both are used, so I kept both. Nothing else needed resolving, and the merge commit is 2f4523d.
What I couldn't run:
- Type check: the repository has no
tsconfig.json, sobun x tsc --noEmitcan't run here. - Fast test selection:
scripts/fast.tsdoesn't exist in this clone, so I ran the whole suite. - Design lint: I didn't run
bun scripts/design-lint.ts, because only an import line changed. The repository's script is namedscripts/lint-design.ts, notdesign-lint.ts.
I made no behaviour change, loosened no contract cell, and added no dependency.
🤖 Generated with Claude Code
Amend the contract works on all four doors (page, API, MCP, terminal M), all through permit via dealFor; no contract cell loosened, no dependency added. The amendment is validated whole before any move, the moves and one shared amendment number are written in one transaction, and each party gets one notice keyed by its first move. The preview answers 200. One nit, not blocking: in the 'sent ... and stays sent when a date moves again' test, add an expect(amended.length).toBeGreaterThan(0) so the loop cannot pass on an empty list.
The deal page now has an Amend the contract form: an addendum moves several dates at once with one reason, and each party gets one "dates changed" notice listing every change.
bun testpasses (217 tests plus the new terminal test), as doesbun run lint:design. I couldn't runbun x tsc --noEmitbecause the repo has notsconfig.jsonandtscjust prints its help.What changed
src/pages/amend.ts). One date input per open date, prefilled with its due date, plus one required reason of 1–200 characters. It works without JavaScript, and a refused form comes back 422 with what was typed and the offending field marked.src/pages/deal.tsonly includes it, so #62 and #64 can still edit that file.amendDealinsrc/deals.ts). It checks every date before moving any, so one bad date refuses the whole amendment. A date left at its current due is skipped, and if none changed it answers "Nothing changed". It writes one move per changed date in a single transaction, with the same reason and author. It uses the samepermit(deal, update)check as a move, andcontract.jsonis untouched.amendmentnumber (migration appended tosrc/db.ts). Each party gets one notice listing every changed date they are told about (old → new). It sits on one of the amendment's dates and is remembered by the first move it told that party about, so a notice already sent or declined is not re-drafted if one of its dates is moved again. Single-date moves keep today's notice. Send, edit, decline and undo work on it unchanged, becauseDraftnow carriesmove_idinstead ofmoveKey.- API:
POST /api/deals/:id/amend, withcontract/openapi.jsonregenerated. - MCP:amend_dealwith{deal, dates, reason}. - Terminal:Min the deal view, where a blank answer keeps a date. - All of them show the #61 closing-order conflicts after the amendment.docs/TECHNICAL.mdnamesamend_deal.Changes outside the listed files
doorOfinsrc/security.tsnow treatsPOST <api>/:id/amendas an update of the deal. Without that the API route had no contract cell andsrc/openapi.test.tsfailed. This does not loosen any cell.src/server.test.tsassumed the first replayeddeal.changedwas its own. With more tests emitting events, that event dropped out of the 100-event replay buffer and the test failed. It now opens the stream past every earlier event. That test was wrong, not the code.src/server.test.tsalso listsamend_dealamong the MCP tools.What I chose not to do
Try it: open any deal, change two dates under Amend the contract, give a reason, and save. Under Messages or the Reminders view, each party has one "dates changed" notice naming both. Submitting with no change, or with a blank reason, brings the form back with the field marked.
🤖 Generated with Claude Code
Closes #66