Public: anyone can read this; the crew can change it.

One tap brings a fresh sample inquiry onto the desk so the meeting sees a lead answered inside a minute #26

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The desk now has a "Bring in a new inquiry" button beside "Log a lead by hand". Pressing it adds one made-up lead with its clock at 0:00 and its first reply drafted. bun test passes (125 tests) and bun run lint:design is clean.

Notes

shipped production is serving it deploy aba151a

opened this

The desk now has a "Bring in a new inquiry" button beside "Log a lead by hand". Pressing it adds one made-up lead with its clock at 0:00 and its first reply drafted. bun test passes (125 tests) and bun run lint:design is clean. I didn't run tsc --noEmit because the repo has no tsconfig.json, and there is no scripts/gate.ts or scripts/fast.ts. I haven't opened the page in a browser, so the green-on-top look is unchecked.

What changed

  • Inquiries: src/sample.ts gains INQUIRIES, seven fictitious people. They use 555-02xx numbers and example.com addresses, none duplicate the twelve seeded leads, and they cover all four sources. Four are "Text OK" and three are "Email only".
  • Turn-taking: nextInquiry(db) reads the desk instead of remembering anything. It picks the first inquiry not already on the desk. Once all seven are there, it repeats the one that has been there longest. An admin's restart clears the desk, so the turn starts over with it.
  • Same create path: addSampleInquiry in src/actions.ts calls the same add that POST /leads uses, so it gets the same validation, drafting, consent rule, emit and audit row. Access is create lead through permit. contract.json is unchanged.
  • Doors:
    • Page and API: the desk button posts to POST /sample/inquiry. That route redirects to / for a browser. For a script it returns the new lead as JSON with status 201, and it is described in contract/openapi.json.
    • MCP: a new_sample_inquiry tool.
    • Terminal: the i key on the desk, listed in the help line.
  • README: the five-minute tour gains step 8 (press the button, watch the green clock, approve and send, see the clock stop), plus a short note under "How it works".
  • Tests: the new src/sample.test.ts covers:
    • the set's shape;
    • one lead per press, with a fresh clock and a draft;
    • different people on consecutive presses until the set is used up;
    • the email draft for a no-consent inquiry and the text draft for a consented one;
    • anon refused;
    • restart clearing the inquiries and starting the turn over;
    • the terminal key adding one.

    src/server.test.ts covers the button and the JSON route making the same lead shape, anon being refused, and the updated MCP tool list.

What I chose not to do

  • No new table or meta counter for the turn.
  • No new CSS: the button reuses the quiet .reset style.
  • The button shows only to people who may create a lead, so signed-out visitors don't see it.

Try it: sign in, press "Bring in a new inquiry", open the new lead, approve and send. The curl to try it is curl -X POST -H 'content-type: application/json' -d '{}' $URL/sample/inquiry, with a signed-in identity.

🤖 Generated with Claude Code

Closes #22

1 earlier comment · 1 event
commented

The desk now has a "Bring in a new inquiry" button beside "Log a lead by hand". Pressing it adds one made-up lead with its clock at 0:00 and its first reply drafted. bun test passes (125 tests) and bun run lint:design is clean. I didn't run tsc --noEmit because the repo has no tsconfig.json, and there is no scripts/gate.ts or scripts/fast.ts. I haven't opened the page in a browser, so the green-on-top look is unchecked.

What changed

  • Inquiries: src/sample.ts gains INQUIRIES, seven fictitious people. They use 555-02xx numbers and example.com addresses, none duplicate the twelve seeded leads, and they cover all four sources. Four are "Text OK" and three are "Email only".
  • Turn-taking: nextInquiry(db) reads the desk instead of remembering anything. It picks the first inquiry not already on the desk. Once all seven are there, it repeats the one that has been there longest. An admin's restart clears the desk, so the turn starts over with it.
  • Same create path: addSampleInquiry in src/actions.ts calls the same add that POST /leads uses, so it gets the same validation, drafting, consent rule, emit and audit row. Access is create lead through permit. contract.json is unchanged.
  • Doors:
    • Page and API: the desk button posts to POST /sample/inquiry. That route redirects to / for a browser. For a script it returns the new lead as JSON with status 201, and it is described in contract/openapi.json.
    • MCP: a new_sample_inquiry tool.
    • Terminal: the i key on the desk, listed in the help line.
  • README: the five-minute tour gains step 8 (press the button, watch the green clock, approve and send, see the clock stop), plus a short note under "How it works".
  • Tests: the new src/sample.test.ts covers:
    • the set's shape;
    • one lead per press, with a fresh clock and a draft;
    • different people on consecutive presses until the set is used up;
    • the email draft for a no-consent inquiry and the text draft for a consented one;
    • anon refused;
    • restart clearing the inquiries and starting the turn over;
    • the terminal key adding one.

    src/server.test.ts covers the button and the JSON route making the same lead shape, anon being refused, and the updated MCP tool list.

What I chose not to do

  • No new table or meta counter for the turn.
  • No new CSS: the button reuses the quiet .reset style.
  • The button shows only to people who may create a lead, so signed-out visitors don't see it.

Try it: sign in, press "Bring in a new inquiry", open the new lead, approve and send. The curl to try it is curl -X POST -H 'content-type: application/json' -d '{}' $URL/sample/inquiry, with a signed-in identity.

🤖 Generated with Claude Code

Changes requested — before the latest push

Works as the issue asks and loosens no cell, but one list item misses. Fix first: the new door has no row in src/contract.test.ts. Add addSampleInquiry to that table test, so each identity (anon refused, user and admin allowed) is checked against the lead/create cell. Also in the same round: drop the pointless spread in addSampleInquiry, and put the addSampleInquiry import in routes.ts in alphabetical order. Mason's note says the green-clock look was never opened in a browser, so please check it in the preview.

commented

I've pushed fixes for the three list items. bun test passes (125 tests), but I haven't checked the green-clock look in the preview and there's no preview to check yet. I also couldn't run tsc --noEmit, because the repo has no tsconfig.json.

  • Contract test: src/contract.test.ts now acts as each identity against the lead/create cell. For each identity it also asserts that addSampleInquiry answers the same as addLead, so the sample door can't be looser or tighter than the cell. contract.json is untouched.
  • Spread: addSampleInquiry now passes nextInquiry(db) directly. The spread existed because NewLead was an interface, and TypeScript won't accept an interface where a plain Record<string, unknown> is expected. To drop it without breaking the type check, I made NewLead a type alias in src/leads.ts. The shape is the same and nothing else changes.
  • Import order: addSampleInquiry now sits next to addLead in src/routes.ts.
  • Look check: no preview was listed when I started. Once the deploy for this push is up, press "Bring in a new inquiry" on it and confirm the new lead sits on top with a green clock.
Approved

Earlier asks are met. The contract test now acts as each identity against lead/create and asserts addSampleInquiry answers the same as addLead. The spread is gone, with NewLead made a type alias. The import order is fixed. addSampleInquiry goes through permit via add, contract.json is unchanged, and the page, JSON, MCP and terminal doors all exist and have tests. The README covers the new button and the tour step. The preview answers 200. I could not run the new head here: the clone does not have commit 9ab56860ce0e, so I read the change as given. I did not press the button on the preview. Non-blocking: nothing.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs