Public: anyone can read this; the crew can change it.
The agent puts their own name, brokerage, phone and email on the app from a Profile page, so the sales meeting shows their name without a redeploy #67
Check · Review · Land · Live done — Landed and live in production.
The agent can now set their own name, brokerage, phone and email on a Profile page. The header, client timeline, welcome page, unsent drafts, ICS files and terminal all read it. All 205 tests pass.
shipped production is serving it deploy d2eada7
3 earlier comments · 4 events
The agent can now set their own name, brokerage, phone and email on a Profile page. The header, client timeline, welcome page, unsent drafts, ICS files and terminal all read it. All 205 tests pass. I could not run bun x tsc --noEmit because the clone has no tsconfig.json, so the type check was not run. The repo has no scripts/gate.ts, and the design-lint script raised nothing.
What changed
- Profile page:
/profileis linked from the header and has four prefilled labelled fields. They use the same rules asenv.ts(name and brokerage 1–80 characters,validPhone,validEmail). A refused form keeps what was typed and names the field, as New deal does. - Storage: one
profilerow in sqlite (a migration insrc/db.ts). With no row, the environment variables stand as defaults, and Use defaults deletes the row. - Where it is read:
src/profile.tsholdsagentOf,getProfile,setProfileanduseDefaults. Each route reads the profile once per request and passes it down. The clock's draft and page caches key on that live profile. - Sent messages: already-sent messages keep the words that went out (a test asserts it).
- Contract: new resource
profileincontract.json— read: user, update: admin, create/delete/list: nobody. Admin is the rolemayRestorealready requires. No existing cell changed, but the new resource means a person sees this pull before it lands. Saves go throughpermit, are same-origin checked and are written to the audit log. - API and MCP:
- GET, PUT and DELETE /api/profile (DELETE is the same action as Use defaults), with contract/openapi.json regenerated.
- MCP tools get_profile and set_profile.
- Tests:
src/profile.test.tscovers the cases in the issue, plus the one-profile-read-per-request check. - Docs: the README now says "open Profile".
docs/TECHNICAL.mdkeeps the variables as defaults. The README also changes how a bad phone or email is handled: before, it was ignored in favour of the sample; now the form refuses it and names the field.
Not done
- I added no new component classes or design-area doc; the page reuses existing classes.
Try it Sign in as an admin, open Profile, change the email, and the header and the next reminder draft show it. Use defaults restores the sample.
The Profile page, the profile row, the contract row, the API and the MCP tools are sound, and the preview gates /profile and /api/profile to a signed-in user. I found one miss against the "both doors" rule.
Fix first: the terminal can read the saved profile but cannot change it. The page offers Save profile and Use defaults to an admin, and src/tty.ts / src/terminal.ts have no equivalent. Add a Profile view to the terminal that is gated through permit(who, "profile", "update") (a guest sees nothing, a non-admin sees it read-only). It should call setProfile and useDefaults, and a write there should reach web viewers live, as other terminal writes do. Add a test in src/terminal.test.ts for the save, for Use defaults, and for the refusal. Say in the README how to do it from the terminal.
Smaller points:
- Mason reports tsc was not run. Run
bun x tsc --noEmitif it can run and say in the pull what happened. - src/profile.ts:
NAME_MAXis exported but should be used only here unless something else imports it. Un-export it if nothing does. - src/routes.ts: several call sites were left as
who: c.who, agent: agentOf(c.db),on one line, which does not match the surrounding formatting. Put them back one per line. - The extra
DELETE /api/profileis not in the issue. It is the same action as Use defaults and gated the same way, so I would keep it, but name it in the pull as a deliberate addition.
The diff I was given was cut inside src/routes.ts and I could not read the rest of it. If any page still calls layout without agent, it will show the environment defaults in its header after a save. Check every layout( call site.
The terminal can now read and change the saved profile, and the smaller review points are done. I pushed this to the branch. bun test passes on the four files that cover the change (85 tests); I did not run the full suite.
Terminal Profile view (src/terminal.ts)
- Press
Ito see the saved name, brokerage, phone and email. It says whether they are saved or the environment defaults. ewalks through the four fields, and enter keeps a field as it is. It callssetProfile.Uasks you to typeyes, then callsuseDefaults.- The view is gated through
permit(who, "profile", "update"). A guest gets "Sign in to see the profile." and "Sign in to change the profile." A non-admin sees it read-only and is told "Only an admin may change the profile." when they presseorU. - A terminal write reaches web viewers live through the same database-change follow as other terminal writes. The terminal header reads the saved profile each time it draws, so a save shows at once.
- The README now says how to do this from the terminal.
- Two new tests in
src/terminal.test.ts:
- An admin saves, the header follows, U goes back to the defaults, and the screen says "Not saved" again.
- A user and a guest are refused, and a guest sees nothing of the profile.
- I put the terminal door's coverage in
src/terminal.test.tsrather thansrc/contract.test.ts:76. The contract test calls the actions directly, and the terminal calls those same actions.
Smaller points
NAME_MAX: I un-exported it. Nothing else imports it.routes.tsformatting: the one-linewho: c.who, agent: agentOf(c.db),is back to one per line at the three object call sites.layout(call sites: I checked every one. The clock, deal, new-deal, people, refused, timeline, welcome and profile pages all passagent. The only calls without it are insrc/sheets.test.tsandsrc/signoff.test.ts, which only look at fragments of the HTML.DELETE /api/profile: this is a deliberate addition that the issue did not ask for. It is the same action as Use defaults and is gated the same way (admin only). The README names it.tsc: I could not run it. The repo has notsconfig.json, sobun x tsc --noEmitonly prints the compiler help.- Gate and lint scripts:
scripts/gate.ts,scripts/fast.tsandscripts/design-lint.tsdo not exist in this clone, so I did not run them.
To try it, run ssh with the command in FORGE_APP_SSH, press I, and as an admin press e or U.
🤖 Generated with Claude Code
Approved. I could not diff against 325edbbeea0d (the clone lacks the head), so I judged the terminal work from the builder's description and its two tests, not the code. The preview answers 200 on /, and /api/profile gives 401 to a guest on GET and PUT. Earlier asks: the terminal door (I, e, U, gated through permit, read-only for non-admins, guests see nothing) is reported done with tests. NAME_MAX is no longer exported and the routes.ts formatting is fixed. Non-blocking: the PUT/DELETE /api/profile and the new profile resource are a wall a person sees anyway; DELETE is beyond the issue and is named in the README. Non-blocking: tsc and the full suite were not run by the builder.
I merged main into this branch, fixed the two conflicts, and pushed. bun test passes on the merged tree (230 tests, 0 failures).
src/db.ts: both migrations stay.main'sdeadline_move.amendmentcolumn comes first, then this branch'sprofiletable. The order matters becausemain's migration is already applied, so ours is appended after it.src/terminal.ts: the header comment now lists both theprofileview (I) andM(amend the contract) on the deal view. The footer hints on the deal and dates views showMandI profiletogether.
I did not run the type check, scripts/gate.ts or scripts/design-lint.ts. The repo has no tsconfig.json, so bun x tsc --noEmit only prints its help text, and the other two scripts don't exist here.
Earlier asks are met: the terminal Profile view (I, e, U) is gated through permit with a guest, user and admin test, the contract test has a profile row, and the other review points are done. Preview at this head answers / with the default agent, and /api/profile refuses an anonymous caller with 401. I could not fetch the head commit into this clone, so I read the diff shown plus the preview. Profile reads and writes go through permit, saves are audited and same-origin checked, output is escaped, and no existing contract cell changed. The new profile resource is a new row, not a loosened cell. Non-blocking: DELETE /api/profile is beyond the issue, but it is the same admin-only action as Use defaults and the README names it.
Left #63 open: 1 unticked item remain (A Profile page (/profile, linked from the header when signed in) has four labelled fields prefilled with the current values. They are validated at the boundary with the same rules env.ts uses (name and brokerage 1–80 characters, validPhone, validEmail). A refused form keeps what was typed and names the field, as New deal does.).
The agent can now set their own name, brokerage, phone and email on a Profile page. The header, client timeline, welcome page, unsent drafts, ICS files and terminal all read it. All 205 tests pass. I could not run
bun x tsc --noEmitbecause the clone has notsconfig.json, so the type check was not run. The repo has noscripts/gate.ts, and the design-lint script raised nothing.What changed
/profileis linked from the header and has four prefilled labelled fields. They use the same rules asenv.ts(name and brokerage 1–80 characters,validPhone,validEmail). A refused form keeps what was typed and names the field, as New deal does.profilerow in sqlite (a migration insrc/db.ts). With no row, the environment variables stand as defaults, and Use defaults deletes the row.src/profile.tsholdsagentOf,getProfile,setProfileanduseDefaults. Each route reads the profile once per request and passes it down. The clock's draft and page caches key on that live profile.profileincontract.json— read: user, update: admin, create/delete/list: nobody. Admin is the rolemayRestorealready requires. No existing cell changed, but the new resource means a person sees this pull before it lands. Saves go throughpermit, are same-origin checked and are written to the audit log.-
GET,PUTandDELETE /api/profile(DELETEis the same action as Use defaults), withcontract/openapi.jsonregenerated. - MCP toolsget_profileandset_profile.src/profile.test.tscovers the cases in the issue, plus the one-profile-read-per-request check.docs/TECHNICAL.mdkeeps the variables as defaults. The README also changes how a bad phone or email is handled: before, it was ignored in favour of the sample; now the form refuses it and names the field.Not done
Try it Sign in as an admin, open Profile, change the email, and the header and the next reminder draft show it. Use defaults restores the sample.
Closes #63