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

The agent adds one line of their own on the Profile page, like "Text me anytime, I answer within the hour", and every new reminder draft carries it above the sign-off #138

Merged opened this

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

Merged

The Profile page now has an optional "A line of your own at the end of every message" field, and every new draft carries it just above the sign-off. The new tests and the profile, sign-off, OpenAPI, terminal, db, status, review and security tests pass.

Notes

shipped production is serving it deploy d2eada7

opened this

The Profile page now has an optional "A line of your own at the end of every message" field, and every new draft carries it just above the sign-off. The new tests and the profile, sign-off, OpenAPI, terminal, db, status, review and security tests pass. I did not run the full suite or bun scripts/gate.ts, and bun x tsc --noEmit could not run (details at the end).

What changed

  • Validation (src/profile.ts): the line is plain text, trimmed, at most 200 characters and one line. Any line break is refused (CR, LF, U+2028/2029). A refused form keeps what was typed and names the field.
  • Drafts (src/reminders.ts): Agent gains an optional line, and signOff puts it on its own line directly above the name and brokerage. Date reminders, late follow-ups, "date changed" notices and status updates all use signOff, so all four carry it. With no line, signOff returns exactly what it did before.
  • Memo and sent drafts: the draft memo keys on JSON.stringify(agent), so changing the line resets it. Sent and held drafts keep their stored words, and nothing rewrites them.
  • Storage (src/db.ts): a migration adds profile.line with a default of '' and a 200-character check. Existing rows and the environment defaults keep working.
  • Permissions: saving goes through the existing permit(profile, update) check. contract.json is unchanged.
  • API and MCP: the profile read and update include line, described in the OpenAPI schema (contract/openapi.json regenerated). MCP set_profile takes it too.
  • Terminal: the terminal's profile edit keeps the saved line instead of wiping it.
  • README: the "Make it yours" section says where to set it, in one sentence.

Tests are in src/line.test.ts:

  • A saved line appears in a reminder draft and a status update.
  • An empty line leaves the body identical to before.
  • 201 characters and a line break are refused, over the API and the form, and the form keeps the typed text.
  • HTML in the line is escaped on the Profile page and returned verbatim by the API.

Choices and gaps

  • A PUT or MCP save that omits line clears it, as it does for the other fields. I did not add a keep-if-absent rule.
  • I did not add a separate test of the draft review page's escaping of the line. That page already escapes draft bodies, and the Profile page escaping is tested.
  • bun x tsc --noEmit could not run: there is no tsconfig.json in the repo, so tsc only prints help. scripts/gate.ts and scripts/fast.ts do not exist here either, and docs/VISION.md was not found.
  • bun run lint:design printed no findings (I read the empty output as clean).

Try it: open Profile as an admin, type a line, save, and open the review page for a deal (or GET /api/profile). The line sits above the sign-off of every unsent draft.

🤖 Generated with Claude Code

Closes #135

1 earlier comment · 1 event
commented

The Profile page now has an optional "A line of your own at the end of every message" field, and every new draft carries it just above the sign-off. The new tests and the profile, sign-off, OpenAPI, terminal, db, status, review and security tests pass. I did not run the full suite or bun scripts/gate.ts, and bun x tsc --noEmit could not run (details at the end).

What changed

  • Validation (src/profile.ts): the line is plain text, trimmed, at most 200 characters and one line. Any line break is refused (CR, LF, U+2028/2029). A refused form keeps what was typed and names the field.
  • Drafts (src/reminders.ts): Agent gains an optional line, and signOff puts it on its own line directly above the name and brokerage. Date reminders, late follow-ups, "date changed" notices and status updates all use signOff, so all four carry it. With no line, signOff returns exactly what it did before.
  • Memo and sent drafts: the draft memo keys on JSON.stringify(agent), so changing the line resets it. Sent and held drafts keep their stored words, and nothing rewrites them.
  • Storage (src/db.ts): a migration adds profile.line with a default of '' and a 200-character check. Existing rows and the environment defaults keep working.
  • Permissions: saving goes through the existing permit(profile, update) check. contract.json is unchanged.
  • API and MCP: the profile read and update include line, described in the OpenAPI schema (contract/openapi.json regenerated). MCP set_profile takes it too.
  • Terminal: the terminal's profile edit keeps the saved line instead of wiping it.
  • README: the "Make it yours" section says where to set it, in one sentence.

Tests are in src/line.test.ts:

  • A saved line appears in a reminder draft and a status update.
  • An empty line leaves the body identical to before.
  • 201 characters and a line break are refused, over the API and the form, and the form keeps the typed text.
  • HTML in the line is escaped on the Profile page and returned verbatim by the API.

Choices and gaps

  • A PUT or MCP save that omits line clears it, as it does for the other fields. I did not add a keep-if-absent rule.
  • I did not add a separate test of the draft review page's escaping of the line. That page already escapes draft bodies, and the Profile page escaping is tested.
  • bun x tsc --noEmit could not run: there is no tsconfig.json in the repo, so tsc only prints help. scripts/gate.ts and scripts/fast.ts do not exist here either, and docs/VISION.md was not found.
  • bun run lint:design printed no findings (I read the empty output as clean).

Try it: open Profile as an admin, type a line, save, and open the review page for a deal (or GET /api/profile). The line sits above the sign-off of every unsent draft.

🤖 Generated with Claude Code

Changes requested — before the latest push

The core works (validation, migration, signOff, permit unchanged, contract.json untouched, OpenAPI), but four things must change in one round:

  1. Both doors: the terminal cannot set the line. src/terminal.ts only carries the saved line through an edit; a person at the terminal cannot type or change it, though the page can. Add a prompt for it in the I > e edit flow (enter keeps it, same as the other fields, with a way to clear it), validated by checkProfile, and show it in the terminal profile view. Add a terminal test, and say in the README sentence that the terminal edit asks for it too.
  2. Tests the issue lists are missing: HTML in the line escaped on the review page (box 6 names that page, not only /profile); a saved line appears in the other draft kinds the issue names (late follow-up and date-changed notice, not only the first reminder and status); a draft already sent or edited-and-held keeps its words after the line changes (box 3 has no test that fails without it).
  3. Validation: only CR/LF/U+2028/2029 are refused. Other control characters (\v, \f, \u0085, NUL, tabs) pass through into SMS/email drafts. Refuse all control characters (e.g. /[\p{Cc}\u2028\u2029]/u) and test one.
  4. A PUT/MCP set_profile that omits line silently erases it, so existing API/MCP clients that predate the field wipe the agent's line. Keep the saved line when the key is absent (clear only on an explicit empty string), and test it; document in openapi description.

Also: split the very long README sentence into two; tsc/gate could not run per the builder, so those are unverified by me.

commented

All four points are addressed and pushed. The line, profile, terminal, sign-off, OpenAPI and hold tests pass, and the design lint prints no findings. I did not run the full suite. bun x tsc --noEmit still can't run because the repo has no tsconfig.json, and there is no scripts/gate.ts here, so those stay unverified.

1. Terminal

  • I, then e, now asks a fifth question: "A line of your own above the sign-off".
  • Enter keeps the saved line and - clears it. Anything else goes through checkProfile like the other fields.
  • The profile view shows an "Own line" row, with "none" when it is empty.
  • A terminal test covers setting, keeping and clearing it.
  • The README sentence says the terminal edit asks for the line too, and - clears it.
  • I split the long README sentence into several shorter ones.

2. Tests added (src/line.test.ts)

  • The line appears in the before, day-of, late and date-changed drafts.
  • A sent draft and an edited-and-held draft keep their words after the line changes. The fresh drafts alongside them take the new line.
  • HTML in the line is escaped on /reminders/today.

3. Validation

  • The check is now /[\p{Cc}\u2028\u2029]/u, so tab, \v, \f, NUL, U+0085 and the line breaks are all refused.
  • The tests cover each of those characters.

4. Omitted line

  • A save through PUT or MCP that leaves line out keeps the saved line. Only an explicit empty string clears it.
  • This is tested.
  • The OpenAPI and MCP descriptions say so, and contract/openapi.json is regenerated.

🤖 Generated with Claude Code

Approved

All four earlier asks are met on this head. (1) The terminal edit asks for the line (enter keeps it, - clears it), shows an Own line row, and has a test. (2) The new tests cover every draft kind, sent and held drafts keeping their words, and escaping on /reminders/today. (3) Validation now refuses every control character and U+2028/2029, with a test for each. (4) A save that leaves line out keeps the saved line, and only an empty string clears it; this is tested and described in OpenAPI and MCP. I read the diff since 565d09bb3177 and found nothing new. contract.json is unchanged and saving still goes through permit. I did not exercise the preview.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs