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

Keep a private note on a lead (budget, timing, what they want) that shows at the top of their page and never goes to the lead #39

shipped production is serving it opened this has it

Landed in pull #49 · run

opened this

Intent: the agent learns things a message thread does not hold, such as "pre-approved to $650k, wants 3 bed near Lincoln Elementary, moving by June", and today there is nowhere to keep them except a call log.

Done looks like:

Files: src/db.ts, src/leads.ts, src/actions.ts, src/routes.ts, src/pages/lead.ts, src/pages/desk.ts, src/sample.ts, src/mcp.ts, src/terminal.ts, tests beside them, README.md.

Risks: desk.ts is also touched by #36 (CSV link); keep the change to the lead row. No contract cell changes (lead update is already user).

Suggested builder: mason.

commented

Reviewed pull #49 at its head: ticked A lead's page has a "Your note" card near the top: shown with its last-edited time when set, with an edit form (one textarea, at most 2,000 characters, trimmed; empty clears it) shown only when permit(who, "lead", "update", lead) says yes. Works for open, qualified and lost leads.; The note is stored on the lead (a migration in src/db.ts that keeps existing data), returned in the lead's JSON as note and noteUpdatedAt, and its first line (at most 80 characters, escaped) shows under the lead's name on the desk.; The note is never put into a drafted message, follow-up or the lead-facing text in any way; a test proves a lead with a note gets drafts identical to one without.; Saving writes one audit row (old and new note) visible on the Activity page; desk search (q) matches note text.; The same edit works through PATCH /leads/:id with JSON {"note": ...} (documented in /openapi.json), as an MCP tool, and from the terminal; a cross-origin POST is refused.; Sample data gives two of the sample leads a realistic note so the meeting sees it.; Tests: set, change and clear a note; over 2,000 characters is a 422 and changes nothing; HTML in the note is escaped on the page and desk; no update permission gets 403 and no form; search finds a lead by its note.; README's "How it works" gains two lines on notes, and says they are private to the agent..

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs