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

The morning after a showing, a "how did you like it?" follow-up naming the address waits on the desk for the agent to approve #71

Merged opened this

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

Merged

Booking a showing now drafts a "how did you like it?" note for the lead, due at 8:00 the next morning in the agent's time zone. The full bun test suite passes (334 tests, including 10 new ones in src/after-showing.test.ts), and bun scripts/lint-design.ts is clean.

Notes

shipped production is serving it deploy aba151a

opened this

Booking a showing now drafts a "how did you like it?" note for the lead, due at 8:00 the next morning in the agent's time zone. The full bun test suite passes (334 tests, including 10 new ones in src/after-showing.test.ts), and bun scripts/lint-design.ts is clean. bun x tsc --noEmit could not run in this sandbox because the repo has no tsconfig.json and no TypeScript dependency. No contract.json cell changed.

What changed

  • The note. It asks how the home was, names the address (or says "the home" when there is none), and offers another showing or talking numbers. It goes by channelFor and carries the agent's signature. It stays a draft until approved, and the agent can edit it when sending.
  • Numbering. The note is message day AFTER_SHOWING_DAY (500) + n, one per showing. That range sits between the cadence days and ANSWER_DAY, and (lead_id, day) stays unique. The change is src/drafts.ts, src/showings.ts (morningAfter, wallAt) and src/leads.ts.
  • Timing. advance leaves this note out of the showing hold, so it comes due at 8:00 while the other cadence days stay held until the day after the showing.
  • Rebooking and cancelling. Rebooking before the note is sent moves the same note. Booking again after it went gets a new one, so each showing has exactly one. Cancelling deletes an unsent note.
  • Closed or unreachable leads. Qualified or lost leads get it skipped, and reopen restores it. A lead with no way to be reached (no email and no text consent) gets none.
  • Redrafting. STOP and profile changes redraft the note from the current showing's address.
  • Skipping. The generic skip and restore work on it, so the agent can set it aside by hand.
  • Text length. An address too long to fit MAX_BODY.text is dropped from the text version.
  • Escaping. The body is stored raw and escaped wherever it is shown. A test covers a script-laden address on the lead page.
  • Display. The lead page plan, the desk status and the terminal show "After the showing" through dayLabel.
  • Sample data. Rosa Alvarez had a showing yesterday at 418 Juniper Ln at 10:00, so her note is on a fresh desk. If a restart lands before 8:00, the showing moves back a day so the note is still due. README step 7 and the AGENTS.md showing bullet describe this.

Chosen not to do

  • Ordering. The ready-message order is still by day, so when a note and a later cadence follow-up are both due, the follow-up shows first. Changing it would touch four queries.
  • "Opted out of everything." I read this as "cannot be texted and has no email", since the app has no separate opt-out from email.

To try it

  • Open Rosa Alvarez on a fresh desk and the note is ready to approve.
  • Or book a showing on any contacted lead and look at "After the showing" in the plan.

🤖 Generated with Claude Code

Closes #68

2 earlier comments · 2 events
commented

Booking a showing now drafts a "how did you like it?" note for the lead, due at 8:00 the next morning in the agent's time zone. The full bun test suite passes (334 tests, including 10 new ones in src/after-showing.test.ts), and bun scripts/lint-design.ts is clean. bun x tsc --noEmit could not run in this sandbox because the repo has no tsconfig.json and no TypeScript dependency. No contract.json cell changed.

What changed

  • The note. It asks how the home was, names the address (or says "the home" when there is none), and offers another showing or talking numbers. It goes by channelFor and carries the agent's signature. It stays a draft until approved, and the agent can edit it when sending.
  • Numbering. The note is message day AFTER_SHOWING_DAY (500) + n, one per showing. That range sits between the cadence days and ANSWER_DAY, and (lead_id, day) stays unique. The change is src/drafts.ts, src/showings.ts (morningAfter, wallAt) and src/leads.ts.
  • Timing. advance leaves this note out of the showing hold, so it comes due at 8:00 while the other cadence days stay held until the day after the showing.
  • Rebooking and cancelling. Rebooking before the note is sent moves the same note. Booking again after it went gets a new one, so each showing has exactly one. Cancelling deletes an unsent note.
  • Closed or unreachable leads. Qualified or lost leads get it skipped, and reopen restores it. A lead with no way to be reached (no email and no text consent) gets none.
  • Redrafting. STOP and profile changes redraft the note from the current showing's address.
  • Skipping. The generic skip and restore work on it, so the agent can set it aside by hand.
  • Text length. An address too long to fit MAX_BODY.text is dropped from the text version.
  • Escaping. The body is stored raw and escaped wherever it is shown. A test covers a script-laden address on the lead page.
  • Display. The lead page plan, the desk status and the terminal show "After the showing" through dayLabel.
  • Sample data. Rosa Alvarez had a showing yesterday at 418 Juniper Ln at 10:00, so her note is on a fresh desk. If a restart lands before 8:00, the showing moves back a day so the note is still due. README step 7 and the AGENTS.md showing bullet describe this.

Chosen not to do

  • Ordering. The ready-message order is still by day, so when a note and a later cadence follow-up are both due, the follow-up shows first. Changing it would touch four queries.
  • "Opted out of everything." I read this as "cannot be texted and has no email", since the app has no separate opt-out from email.

To try it

  • Open Rosa Alvarez on a fresh desk and the note is ready to approve.
  • Or book a showing on any contacted lead and look at "After the showing" in the plan.

🤖 Generated with Claude Code

Changes requested — before the latest push

Mostly sound, but one correctness gap and one cleanliness miss. 1) Fix first: noteAfterShowing treats only draft/scheduled/due/skipped as unsent. If the note is approved and held (status held, e.g. quiet hours) and the showing is rebooked, a second note is inserted for the same showing, which breaks one per showing and sends two notes. Handle held (move it, or leave it and do not insert) and add a test. 2) The unsent status list is written twice (UNSENT and an inline array); use one definition. Also the fetch of / on the preview did not show an After the showing line for me, so please confirm Rosa Alvarez is ready on a fresh preview desk. No contract cell changed; tsc could not run as there is no tsconfig.

commented

A rebooked showing no longer gets a second note when the first is held, and the unsent statuses now come from one list. Both fixes are in src/leads.ts on this branch. The full suite passes (335 tests), including a new one for the held case. tsc still cannot run here because the repo has no tsconfig.

  • Held note: in noteAfterShowing, an approved note held for quiet hours is now left alone. Rebooking neither moves it nor adds a second, and cancelling keeps it, since the agent already approved it. A sent note still lets a later showing get its own. The new test turns quiet hours on, because the suite turns them off by default.
  • One list: UNSENT is now a single array, and the SQL form UNSENT_SQL is derived from it. The inline copy is gone.
  • Rosa Alvarez: I booted the branch on an empty data directory. Her "After the showing" note is in the database as due, so it is ready on a fresh desk. I could not see it on the page, because the app shows leads only to a signed-in person. The preview you fetched may have been seeded before this change, since the samples are laid out once on first boot, so an admin restart of the samples (resetSample) would show it.
Approved

Held-note fix and the single UNSENT list are in the diff and read correctly: a note approved and held for quiet hours is left alone on rebook and cancel, and a sent note lets the next showing get its own. A test covers it. No contract cell changed, escaping is covered by a test, and the terminal shows the same labels as the page through dayLabel. Non-blocking: ready messages still order by day, so a later cadence follow-up can show before the note. Non-blocking: the clone does not have commit 19136da78982, so I read the whole change rather than the increment.

commented

Left #68 open: 1 unticked item remain (When a booked showing that was not cancelled has passed, a draft appears for that lead on the desk from the next morning at 8:00 in the agent's profile time zone. It asks how the home was, names the showing's address when there is one, and offers a next step (another showing or talking numbers). It goes by the lead's channel (channelFor, so it respects STOP and "Email only") and is signed with the agent's profile.).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs