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

The People page says when each person last got a message from the agent and about what, so "did I tell the lender?" is answered in one look #129

Merged opened this

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

Merged

Each person on the People page now shows their most recent sent reminder or notice, for example "Last heard Nov 6 · Financing, 12 Oak Lane". The label links to that deal. A person with nothing sent shows "Nothing sent yet".

Notes

shipped production is serving it deploy d2eada7

opened this

Each person on the People page now shows their most recent sent reminder or notice, for example "Last heard Nov 6 · Financing, 12 Oak Lane". The label links to that deal. A person with nothing sent shows "Nothing sent yet".

What changed

  • src/people.ts: Person gains last_sent ({ sent_on, deal_id, address, label } or null).

- It is read from the sent messages already loaded with each deal, so there is no extra query and nothing per person. - A message belongs to the party it was sent to. Parties merge by personKeys as before, and the newest message across the merged parties wins. - A sent message whose party was later removed has no person to show under, so it is not counted. Matching by name would risk showing one person's history under another with the same name. - Only sent messages count. Declined and held drafts are stored separately and are never read.

  • src/pages/people.ts: renders the "Last heard …" line or "Nothing sent yet".
  • src/routes.ts documents last_sent in the shared person schema, and contract/openapi.json is regenerated. GET /api/people and list_people use the same data, so they carry the field without further change.
  • README: one sentence in the People section.

Tests

  • src/lastsent.test.ts runs against a real database. A person starts with no message, a declined draft changes nothing, and after a send the message shows on the page.
  • src/people.test.ts covers a person on two deals showing the newer message, and a same-name person with a different contact not inheriting it.
  • The people, openapi, contract, a11y, speed, owes, fell and terminal tests pass.

Not run

  • bun x tsc --noEmit has no tsconfig.json in the repo and only prints its help, so I could not type-check.
  • scripts/gate.ts, scripts/fast.ts and scripts/design-lint.ts don't exist here, so I picked the tests above by hand.

I did not loosen any contract cell, and I added no dependencies.

🤖 Generated with Claude Code

Closes #125

2 earlier comments · 1 event
commented

Each person on the People page now shows their most recent sent reminder or notice, for example "Last heard Nov 6 · Financing, 12 Oak Lane". The label links to that deal. A person with nothing sent shows "Nothing sent yet".

What changed

  • src/people.ts: Person gains last_sent ({ sent_on, deal_id, address, label } or null).

- It is read from the sent messages already loaded with each deal, so there is no extra query and nothing per person. - A message belongs to the party it was sent to. Parties merge by personKeys as before, and the newest message across the merged parties wins. - A sent message whose party was later removed has no person to show under, so it is not counted. Matching by name would risk showing one person's history under another with the same name. - Only sent messages count. Declined and held drafts are stored separately and are never read.

  • src/pages/people.ts: renders the "Last heard …" line or "Nothing sent yet".
  • src/routes.ts documents last_sent in the shared person schema, and contract/openapi.json is regenerated. GET /api/people and list_people use the same data, so they carry the field without further change.
  • README: one sentence in the People section.

Tests

  • src/lastsent.test.ts runs against a real database. A person starts with no message, a declined draft changes nothing, and after a send the message shows on the page.
  • src/people.test.ts covers a person on two deals showing the newer message, and a same-name person with a different contact not inheriting it.
  • The people, openapi, contract, a11y, speed, owes, fell and terminal tests pass.

Not run

  • bun x tsc --noEmit has no tsconfig.json in the repo and only prints its help, so I could not type-check.
  • scripts/gate.ts, scripts/fast.ts and scripts/design-lint.ts don't exist here, so I picked the tests above by hand.

I did not loosen any contract cell, and I added no dependencies.

🤖 Generated with Claude Code

commented

I merged main into this branch and pushed it. The only conflict was in README.md, and bun test passes (562 tests, 0 failures).

  • Conflict: main had turned the README's People section into a numbered walkthrough, and my branch had edited the old paragraph. I kept main's walkthrough and moved my text into its item 9. It now says each person shows when they last got a sent reminder or notice and about what, or "Nothing sent yet". Declined and held drafts don't count. It also names the P key in the terminal and list_people over MCP.
  • Other files: contract/openapi.json, src/people.ts and src/routes.ts merged automatically, and the tests cover them.
  • Not run: bun x tsc --noEmit printed only the compiler's help text, because the repo has no tsconfig.json, so no type check ran. The repo also has no scripts/gate.ts, so I did not run the gate. scripts/lint-design.ts was also not run, since the merge changed no src/web/ files on my side.
Changes requested — before the latest push

Page, API, MCP and openapi are right, and the security surface is clean (output escaped, no new write, no contract cell touched). One miss: the terminal door does not show last_sent. Fix first: in src/terminal.ts, the people view (around line 743-753) should print, under each person, Last heard <spoken date> · <label>, <address> or Nothing sent yet, from p.last_sent, and add a terminal test for it (the terminal test suite already drives the P view). The README now tells people to press P for this, so it must be true. The preview /people answered 401 to my token, so I could not view the page there; I judged the page from the code and tests.

commented

The terminal People view (P) now shows the last-sent line, so it matches the README and the page.

  • Terminal: src/terminal.ts prints a dimmed line under each person's name. It reads Last heard <spoken date> · <label>, <address> or Nothing sent yet, taken from p.last_sent.
  • Tests: the existing P test in src/terminal.test.ts now also expects "Nothing sent yet". A new test sends a reminder to a buyer and checks that the P screen shows Last heard <today> · <label>, 9 Heard Way, while the seller still shows "Nothing sent yet". The two test files I ran, src/terminal.test.ts and src/lastsent.test.ts, pass (43 tests). I did not re-run the full suite, and I did not run bun x tsc --noEmit this time either, because the repo has no tsconfig.json.
  • Preview 401: I didn't look into the 401 on /people you saw with your token.
Approved

The terminal P view now prints the same last_sent line from the same people() data as the page, so it is gated the same way, and it has a test. That meets my earlier ask for a terminal door. No contract cell is loosened, there is no new query, and output is escaped on the page. I could not diff against cc244e71cbe2 because that commit is not in the clone, so I read the terminal change in the diff above. On the preview, /people and /api/people return 401 signin_required to my token. That is the sign-in gate, not a defect in this change, so I could not see the page rendered there. Non-blocking: tsc was not run because the repo has no tsconfig.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs