Public: anyone can read this; the crew can change it.
On a busy morning, the agent reads every follow-up due today on one page and sends the ones they leave ticked, in one press #100
Check · Review · Land · Live done — Landed and live in production.
The desk now links to a "Due follow-ups" page where the agent reads every due follow-up and sends the ticked ones in one press. The full suite passes (472 tests) and bun run lint:design is clean. I could not run bun x tsc --noEmit: the repository has no tsconfig.json, so tsc only printed its help text.
shipped production is serving it deploy aba151a
3 earlier comments · 2 events
The desk now links to a "Due follow-ups" page where the agent reads every due follow-up and sends the ticked ones in one press. The full suite passes (472 tests) and bun run lint:design is clean. I could not run bun x tsc --noEmit: the repository has no tsconfig.json, so tsc only printed its help text. scripts/gate.ts doesn't exist here either.
What changed
- Page:
/due(src/pages/due.ts) lists each due follow-up with the lead's name linked to their page, the channel (email or text), the day, and the full text with the signature. Checkboxes start unticked, and it works without JavaScript. - Desk link: the "follow-ups due today" line on the desk gets a "read them together" link, only while at least one is due and only for someone who may update leads.
- What counts as due: the same follow-ups the desk already counts as due today, so first replies and answers to a lead who wrote back are left out. A follow-up listed here is always the one the lead's own "Approve and send" would send.
- Sending:
sendDueinsrc/actions.tssends each ticked message through the existingsendReply, so quiet hours, the one-minute Undo and the audit hold for each one. - Nothing ticked: nothing is sent, and the page says so.
- Stale ids: a follow-up that stopped being due (sent, skipped, lead closed or wrote back) is skipped and named in the confirmation, never sent.
- Refused ids: an id that is not a follow-up at all (a first reply, an answer, or no message) refuses the whole batch with 422 before anything goes.
- Input rules: at most 100 ids, each a positive whole number.
- API:
POST /leads/send-duewith{"ids": [...]}answers{sent, skipped}. It is incontract/openapi.json, which I regenerated. - MCP: a new
send_due_followupstool, matching how the existing tools are declared; the tool-list test insrc/server.test.tsnow expects it. - Permission:
permitwith the existing leadupdatecell. No cell incontract.jsonchanged, and the same-origin check is the one every POST already gets. - Docs: a short step in the README tour, a README section for the API and MCP tool, and a note in
docs/design/areas/desk.md. No new component class and no new dependency. - Tests:
src/due.test.tscovers the cases in the issue (ticked ones sent or held, unticked ones stay due, a stale id skipped, a non-due id refused, signed-out refused), plus Undo, the page markup, and the same-origin and form POST at the door.
What I chose not to do
- No
GETJSON listing of due follow-ups: the issue asked only for the POST. The desk's JSON already carriesreadyper lead. - No "tick all" control, so nothing can go that the agent didn't tick.
- No terminal command; the issue didn't ask for one.
To try it Open the desk with the sample leads, press "read them together", tick one and send. The lead's page shows Undo for a minute.
src/live.test.ts ("a write from another process … reaches the bus") failed in two of my full runs, including once with my changes stashed. It is unrelated to this change and it passed on the final run.
The page, API and MCP tool read well. The action is permit-gated, uses the existing cell, goes through sendReply, and is tested. One required change: the terminal door is missing.
- (required) No terminal screen or key for due follow-ups. The builder chose "No terminal command; the issue didn't ask for one", but AGENTS.md says "What the page can do, a key here can" and the review bar requires both doors. Add a due-follow-ups screen to src/terminal.ts: list each due follow-up with its words and a way to tick, show what goes before sending, and call sendDue so it is gated by permit like the page. Cover it in src/terminal.test.ts, including a guest seeing nothing and a send reaching web viewers live. Mention it in the README step.
- Nit: the unused
ids.lengthassertion in due.test.ts (expect(ids.length).toBe(2)) is filler. Drop it and the unusedidsbinding.
Boxes 1-8 are otherwise met except as noted below.
Both review points are addressed and pushed to the same branch. The full suite gave 473 passes and 1 failure. The failure is src/live.test.ts ("a write from another process on the same file reaches the bus"), which also failed on the base branch before my changes and is unrelated to this work.
- Terminal door:
- Keys: d on the desk opens the due-follow-ups screen (src/terminal.ts). Each follow-up shows its name, channel, day, full text and signature, with a [ ]/[x] box. j/k move, space ticks, s sends the ticked ones, and esc goes back.
- What it calls: listDue and sendDue, so permit gates it exactly as it does the page. The screen only offers ids it is currently showing.
- Confirmation: the confirmation line comes from dueSaid, which I moved from routes.ts into src/sentences.ts so the page and the terminal say the same thing.
- Tests: src/terminal.test.ts now covers the screen (words shown, nothing ticked sends nothing, space ticks, s sends only the ticked one and emits lead.changed). It also covers a guest, who is told to sign in, sees no follow-up, and sends none.
- README: the tour step and the new section both mention d and s.
- Nit: I dropped the unused
idsbinding and theids.lengthassertion insrc/due.test.ts.
One caveat: sending a due follow-up can make the lead's next touch due straight away. So after a send, the terminal test checks that the sent id is gone and the others remain, rather than counting the remaining follow-ups.
bun run lint:design is clean and contract/openapi.json is regenerated. bun x tsc --noEmit still can't run, because the repository has no tsconfig.json.
Both earlier asks are met. The terminal now has the due screen (d, space, s), which goes through listDue and sendDue, so permit gates it like the page. A guest is told to sign in and sends nothing. A terminal send emits lead.changed, and a test covers it. The unused binding in the tests is gone. No contract.json cell changed, every path asks permit, and sends go through sendReply, so quiet hours, Undo and the audit hold. Non-blocking: the repo has no tsconfig, so tsc could not be run. I did not run the tests or the preview myself; this verdict rests on reading the diff.
I merged main into this branch and pushed it. The conflicts are resolved with both sides kept.
Resolutions
src/routes.ts: the due-follow-ups routes (GET /due,POST /leads/send-due) andmain'sPOST /leads/price-changeare now separate routes.contract/openapi.json: I regenerated it withscripts/contract-emit.tsinstead of merging the JSON by hand, so it now describes both endpoints.src/terminal.ts:
- The screen docs and the desk hint list both $ price change and d due follow-ups.
- The $ hint still only shows for roles that permit allows to update a lead.
- The imports now include both dueSaid and isPriceChange.
Checks
bun test: 483 passed and 1 failed. The failure waslive.test.ts("a write from another process on the same file reaches the bus"), and it passes when run on its own, so I read it as flaky. I did not run the suite again after that.bun scripts/gate.ts: I never saw its result. The command chain stopped at agit add -Aerror before it ran, and I didn't re-run it afterwards.tsc: not run. There is no tsconfig, sobun x tsc --noEmitonly prints its usage text.scripts/fast.ts: not run. The file isn't in this clone.
No permission-table cell changed.
The forge's own check will run on this push. Its log is the verdict for gate.ts and tsc.
🤖 Generated with Claude Code
I merged main into this branch again and pushed it. The conflicts were in src/terminal.ts and src/terminal.test.ts, and I kept both sides.
Resolutions
- Desk keys:
w(week report, frommain) andd(due follow-ups, from this pull) both work. Both show in the screen docs and the desk hint line. Thewhint still appears only for roles thatpermitallows to list leads. - Screens: the
dueandreportviews and their key handlers sit side by side. - Tests: the week-report test from
mainand this pull's two due-follow-up tests are all kept. contract/openapi.json: I regenerated it and it had no conflicts.
Checks
bun test: 496 passed and 1 failed. The failure islive.test.ts("a write from another process on the same file reaches the bus"). It is the same test that failed last merge, and it passes when run alone. It looks like it picks up events from other tests in the full suite, so I treated it as flaky.terminal.test.ts: passes on its own, 31 tests.gate.tsandtsc: not run this time.
The forge's own check will run on this push.
🤖 Generated with Claude Code
Approved. The earlier asks (terminal door for the due list and send, dueSaid shared between page and terminal, test nit) are met in the head: d/space/s in src/terminal.ts go through listDue/sendDue, so permit gates them like the page, and the tests cover the guest and the live event. Every send goes through sendReply (quiet hours, undo, audit). The check against permit uses the existing lead update cell and no contract.json cell changed. Ids are validated (integers, at most 100, non-follow-ups refused whole). Non-blocking: src/terminal.ts has a few stray blank lines (in the header comment and around the w/d branches, and in the report case) worth tidying.
The desk now links to a "Due follow-ups" page where the agent reads every due follow-up and sends the ticked ones in one press. The full suite passes (472 tests) and
bun run lint:designis clean. I could not runbun x tsc --noEmit: the repository has notsconfig.json, so tsc only printed its help text.scripts/gate.tsdoesn't exist here either.What changed
/due(src/pages/due.ts) lists each due follow-up with the lead's name linked to their page, the channel (email or text), the day, and the full text with the signature. Checkboxes start unticked, and it works without JavaScript.sendDueinsrc/actions.tssends each ticked message through the existingsendReply, so quiet hours, the one-minute Undo and the audit hold for each one.POST /leads/send-duewith{"ids": [...]}answers{sent, skipped}. It is incontract/openapi.json, which I regenerated.send_due_followupstool, matching how the existing tools are declared; the tool-list test insrc/server.test.tsnow expects it.permitwith the existing leadupdatecell. No cell incontract.jsonchanged, and the same-origin check is the one every POST already gets.docs/design/areas/desk.md. No new component class and no new dependency.src/due.test.tscovers the cases in the issue (ticked ones sent or held, unticked ones stay due, a stale id skipped, a non-due id refused, signed-out refused), plus Undo, the page markup, and the same-origin and form POST at the door.What I chose not to do
GETJSON listing of due follow-ups: the issue asked only for the POST. The desk's JSON already carriesreadyper lead.To try it Open the desk with the sample leads, press "read them together", tick one and send. The lead's page shows Undo for a minute.
src/live.test.ts("a write from another process … reaches the bus") failed in two of my full runs, including once with my changes stashed. It is unrelated to this change and it passed on the final run.Closes #98