Repository navigation
feat(auth): one door for sign-in, device login, consent and notices - #1343
Conversation
|
GPT 6.1 Sol (xhigh) reviewed this in two rounds; every finding is fixed, none dismissed.
Still open for the integrator: door states in |
27dd1d1 to
b8b4bf2
Compare
cd4d322 to
982a2bc
Compare
|
Acceptance fixes: a retired address shows its company/name path in the code type instead of the patch monogram square, in 982a2bc. |
Acceptance: PASS with notesChecked Round 2 comparison and fix
Done means
Golden journeys
Evidence Rollback answers: match the diff. First-party rendering and shared helpers only; no migration, persisted-format, infrastructure, wire or CLI change. The address fix changes one class and adds a focused rendering test. Not run
Notes
|
|
oh so now we're doing the phone thing, after you shut me from that stuff ok I see how it is. Everything else lgtm |
043f3d5 to
3ad3666
Compare
Co-Authored-By: Claude Opus 5.5 <[email protected]>
982a2bc to
c6b172b
Compare
…1346) Stacked on #1343; part of #1315. Merge the stack together, not alone. ## What changed All patches had its own search box beside the sidebar's, yellow pill tabs, a "Health" column and rows drawn by page CSS, and the Share dialog its own layout and stylesheet. Now All patches is an Index page: a segmented filter where every choice is a URL, the shared table A–Z with **Failures (24 h)** and **Share** on the rows you own, 50 rows a page. The sidebar's search lands here (`/patches?q=…`) and shows its query as a chip; a search that finds no live patch offers the line Home offered, "Build us a Patchy tool for …" with Copy. The Share dialog is core's dialog: invite a guest, the people with access, general access (going public still asks first; a tool says why it can't), why its guests can't open it, Copy link and Done. Every route, form and POST is the same. Closes #1323 ## Look at <!-- patchy-dev:compare:allison --> #### Before and after, as Allison Mahmood (admin) Before is lane S's tip `4593013` (#1342, the `dense` scenario) and after is this PR's two commits on top of it, both on `dense`, from `pnpm dev compare`. Every page answered 200 with no browser errors. ##### `/patches` **1280px, after**  <details><summary>1280px, before</summary>  </details> | Width | Before | After | | --- | --- | --- | | 390px |  |  | ##### `/patches?share=kudos` **1280px, after**  <details><summary>1280px, before</summary>  </details> | Width | Before | After | | --- | --- | --- | | 390px |  |  | ##### `/patches?share=client-onboarding` **1280px, after**  <details><summary>1280px, before</summary>  </details> | Width | Before | After | | --- | --- | --- | | 390px |  |  | ##### `/patches?show=attention` **1280px, after**  <details><summary>1280px, before</summary>  </details> | Width | Before | After | | --- | --- | --- | | 390px |  |  | ##### `/patches?q=zebra` **1280px, after**  <details><summary>1280px, before</summary>  </details> | Width | Before | After | | --- | --- | --- | | 390px |  |  | <!-- /patchy-dev:compare:allison --> ## How it was verified - `pnpm check`: format, lint, typecheck and synth pass. Offline tests: portal (123) and core (279) pass; the failures in `packages/patchy` CLI suites, `sdk/install` and `LocalTaskProvider` change from run to run and pass in isolation on Node 24 (this machine's local port probe and Node 26 default); CI runs them. - `AllPatchesPages.test.ts`: filters with URLs and A–Z order, the search chip and counts, the sidebar keeping the query, the no-results agent line (with Connect your agent for someone without one), paging at 50 with the filter and search kept, Share only on the viewer's own rows, Company + guests, Failures (24 h) reading None / No calls yet / n failed / —, and every Needs attention and Retired and deleted case that was there. - `SharePages.test.ts`: saving Anyone on the internet lands on the asking dialog at `?share=<name>&confirm=public` and only Make public applies it; a member can't, and a member or a tool asking by address gets nothing to confirm; a stale answer is refused; adding and removing guests, refusals under the field with the email kept, suggestions; a tool offers no public choice and says why; guests blocked by a connection are explained; where focus starts in each state (invite, General access while public or after its refusal, Cancel while asking), never on a guest's Remove, including an invite refused after another manager made the patch public; a refused General access change describes the select it focuses. - Browser (`test/browser-tier1/sharing.spec.ts`, run locally): sharing from the menu end to end, and three new cases: a row opens its patch from anywhere on it while its Share and ⋯ stay pressable; a public page with a guest opens Share with focus on General access; without script, Share is a page whose Copy link stays hidden, and Save → Make public goes through `&confirm=public`. - Looked at as Allison and Priya on `dense`, desktop and phone (above). ### §10 states kept - **5, recovery:** Retired and deleted shows when any exist (or while open), with Restore while recoverable and Recovery ended after. - **9, Share:** guest add and remove, the access list, Copy link and Done, company ↔ public with an explicit Make public at its own address, a tool company-only with its reason beside the choice, why guests are blocked, and that guests keep their grants while it is public. - **19, status honesty:** Failures (24 h): None, No calls yet, or n failed linked to the failed log; never "Healthy". The label matches the call summary's 24-hour window. - Also **2** (every filter, page, dialog and the public confirmation is a URL), **10** (a refused email under its field, kept; a refused General access change above its control; stale and authorization refusals as before), **15** (dialog over the page, focus by state, Escape/Done back, row menus operable), **21** (add-guest and remove are idempotent by state, scope is guarded by `expectedScope`; no dedupe needed). ### Left out on purpose - **Visits, not Opens.** The column is the all-time visit count; an "open" is a member's private record (Patches glossary), so calling visits Opens would overstate it. - The header's "12 patches · 3 pages" and the prototype's Sort chip: the filter carries the counts, and the order is always A–Z. - People with access has no "Everyone at …" row; General access says who. - Remove… for a guest's shared patch stays a confirmation page (now the Flow template) rather than a dialog over Home, which is lane P1's page. - Titles keep a "· Company" suffix where a publisher wrote one; stripping it everywhere is a `patchTitle` decision for the stack, not this page. ### Core additions - None for Copy link: the dialog uses the stack's one `copyButton` (#1344's, hidden by `.copy-button[hidden]` until the copy script reveals it). - `input` takes `list`, the id of a `<datalist>`, for the dialog's suggestions; `select` takes `autofocus`. - `table` columns take `nowrap` and `grow`: the patch column takes the room left with a one-line description. - New chunks, each opt-in by class: `pairs.ts` (`.pair`, a control with what goes beside it), `rows-flush.ts` (rows flush under a label, ends under the name on a phone) and `table-cells.ts` (`nowrap`, `cell-grow`, `show-sm`, and links in a stretched-link row sit above it, so "2 failed" opens the log). - The gallery shows the pair. ### Shared changes - The sidebar's search form posts to `/patches` instead of `/` (`core/html.ts`, and its test; `test/browser-tier1/shell.spec.ts` follows). Lane P1 redirects `/?q=`. - `shared/handlers.ts`: `shareOverlay` passes why the patch's guests can't open it (read only while it has guests); `behind` keeps `page` with `q` and `show`; `asked` reads `&confirm=public` and `pagePath` drops it. - `shareStyles` is gone: Share is core's dialog, and Home and the patch page no longer add it. - `test/fixtures.ts`: `listed` and `dialogAfter` read the new markup, plus `shareDialog`. `apps/server/src/McpDoor.test.ts` reads the new row link. - Docs: `packages/portal/GLOSSARY.md` (All patches, Share dialog) and `docs/product.md`. ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required Pages and docs only: no new route, form field, API, CLI or schema change. Saving Anyone on the internet without its answer now redirects (303) to the asking dialog instead of drawing it in the POST's response. The sidebar's search moves from Home's results to All patches', and `/?q=` keeps working. - **What does a revert leave behind?** Nothing: no data, schema or contract. - **Does the release before it still work with that?** Yes. Built by Claude Opus 5.5 (xhigh) in Claude Code, orchestrated by Fermy. Co-authored-by: Claude Opus 5.5 <[email protected]>
Stacked on #1346; part of #1315. Merge the stack together, not alone. ## What changed People, its invite form, Guests, deactivation and Agent access were each built by hand with their own CSS: an invite panel that pushed the table down, tabs that came and went, deactivation as three competing buttons, and Agent access as a pill and a button. They now sit on the shared templates and carry no page CSS. - **People** is an Index page. **Invite people…** opens a dialog at `?invite=1` over the list it was opened from (emails, Member or Admin, Send invites); a refusal draws it again with what was typed, its problem under the field. A segmented filter (All · Admins · Invited · Guests, and Deactivated while anyone is) and a filter field, both in the URL, narrow the table: avatar, name and email, role, patches, joined, ⋯. Rows menus: Make admin / Make member (never offered for the last active admin), See their patches, Deactivate… / Reactivate…; an invite's: Resend, Revoke. Invites that need an admin lead the invites, marked Expired or Email didn't send. Members read the same table without menus, with the admins named in the header. - **Guests** lists each guest with their company, the patches they can open and who shared each when; **Remove from all patches…** in the row menu confirms in a dialog over Guests, naming every patch. - **Deactivate / Reactivate** are Flow pages: Keep them live (chosen), Retire some, Retire all, over the list of their patches (by title, and name when the title differs) with what reads each; Keep finishes at once, the others go to the existing confirmation, which asks for the acknowledgement when something breaks. A confirmation refused because the selection changed comes back on Retire some with what is still theirs checked, never on Keep. The last-admin refusal and the other refusals render in the same frame. The copy says the credential rule in today's words: deactivation ends their computers and apps, reactivation brings none back. - **Agent access** is one setting row, Agents use patches, with a switch that posts at once and "Turned on by … on …" under it. Members read On or Off and who can change it, with Connect your app while it's on. Closes #1325 ## Look at Before and after on the dense scenario (`pnpm dev compare`), as Allison (admin) and Priya (member), at 1280 and 390. <!-- patchy-dev:compare:allison --> #### Before and after, as Allison Mahmood (admin) Before is `4593013` (where this branch left ui/s-scenario) and after is `95a46a4` (ui/p5-people), both on the `dense` scenario, from `pnpm dev compare`. Every page answered 200 with no browser errors. ##### `/settings/people` **1280px, after**  <details><summary>1280px, before</summary>  </details> | Width | Before | After | | --- | --- | --- | | 390px |  |  | ##### `/settings/people?show=guests` **1280px, after**  <details><summary>1280px, before</summary>  </details> | Width | Before | After | | --- | --- | --- | | 390px |  |  | ##### `/settings/people?invite=1` **1280px, after**  <details><summary>1280px, before</summary>  </details> | Width | Before | After | | --- | --- | --- | | 390px |  |  | ##### `/settings/people/users/usr_env_brightline_marcus/deactivate` **1280px, after**  <details><summary>1280px, before</summary>  </details> | Width | Before | After | | --- | --- | --- | | 390px |  |  | ##### `/settings/agent-access` **1280px, after**  <details><summary>1280px, before</summary>  </details> | Width | Before | After | | --- | --- | --- | | 390px |  |  | <!-- /patchy-dev:compare:allison --> <!-- patchy-dev:compare:priya --> #### Before and after, as Priya Shah (member) Before is `4593013` (where this branch left ui/s-scenario) and after is `95a46a4` (ui/p5-people), both on the `dense` scenario, from `pnpm dev compare`. Every page answered 200 with no browser errors. ##### `/settings/people` **1280px, after**  <details><summary>1280px, before</summary>  </details> | Width | Before | After | | --- | --- | --- | | 390px |  |  | ##### `/settings/agent-access` **1280px, after**  <details><summary>1280px, before</summary>  </details> | Width | Before | After | | --- | --- | --- | | 390px |  |  | <!-- /patchy-dev:compare:priya --> ## How it was verified - `packages/auth/src/CompanyPage.test.ts` rewritten against the new markup: list, filters and counts, invite dialog (open, refused, partial result), the Patches column, Agent access for admin and member, and a new case that a form pressed twice sends one email, for Send invites (concurrent) and Resend. - `packages/companies/src/Invitations.test.ts`: two presses of one Resend form send one email, a fresh form sends again. - `packages/portal/src/UserLifecyclePage.test.ts` (all 17 cases kept), `apps/server/src/Guests.test.ts` (the removal is now a dialog), `Server.test.ts`, `AuthPages.socket.test.ts`. - New browser test `test/browser-tier1/people.spec.ts`: invite dialog focus, refusal and Escape; deactivate and reactivate through the menus; the Agent access switch and the member's read-only view. Run locally alone; the full browser suite is CI's. - `pnpm typecheck`, `pnpm lint`, `pnpm ui:report` (nothing off-system in `CompanyPage.ts` or `UserLifecyclePage.ts`), and the companies, auth, portal, core and server suites. Looked at every page above at 1280 and 390 on `pnpm dev up dense`. ### §10 states kept | Item | State | Where it's checked | |---|---|---| | 3 | Members: read-only list, Guests without Remove, Agent access as text with who can change it; direct admin URLs refused in the frame | `CompanyPage.test.ts`, `Guests.test.ts`, `people.spec.ts` | | 4 | Guests: company, patches they can open, who shared, admin-only Remove with its confirmation | `Guests.test.ts` | | 6 | Make admin / member, See their patches, Deactivate…, Reactivate… (Deactivated filter when any); Resend, Revoke; Expired marked; keep / some / all; last-admin refusal; fresh credentials; second confirmation and acknowledgement | `CompanyPage.test.ts`, `UserLifecyclePage.test.ts` | | 10 | Field errors under their field, which takes the focus; refusals no field owns as a notice above the buttons where focus starts; typed emails and the list behind the invite dialog kept through a refusal | `CompanyPage.test.ts`, `UserLifecyclePage.test.ts`, `checklist.test.ts` | | 21 | Repeat submission: invitations are deduped by the live-invite unique index (a repeat answers "already has an invite", no mail); a Resend form now hands back the expiry it showed, so a second press sends nothing ("A new invite already went to …"). Role, Revoke, Remove guest, Agent access and deactivation are idempotent or refused by state. | `CompanyPage.test.ts`, `Invitations.test.ts` | ### Core additions - `checklist` (`packages/core/src/ui/checklist.ts`, CSS chunk `styles/checklist.ts`, one line each in the two indexes): checkbox rows in a box, each with its name and one line, under a legend with hint and error; refused, its first choosable box takes the focus. Not yet in the `/~ui` gallery (`gallery.ts` is the integrator's); a few lines add it. Used from the stack, not added here: `refusal` (P8, #1343; its focus rule is in `door-parts`) and the `table-cells` chunk (P2, #1346), whose `hide-sm` and `show-sm` put the role under the email on a phone, where the Role column is gone. ### Departures from the prototype - **Guests** have two columns, Guest and Can open, not four: the company sits on the guest's line beside their email, and who shared each patch sits under that patch, since one guest can hold several patches shared by different people, which a single Added by column can't pair up. Folding the company into the line also keeps it on a phone. - **Deactivate's choices** use core's choice cards, side by side on a wide page and stacked on a phone; the prototype stacks them everywhere. A stacked variant is a core change for the integrator. - **Invite and deactivated states** sit on the person's line (an Invited, Expired or Email didn't send badge after the address; "Deactivated 8 Nov" after the email), so Role holds only roles and a phone row keeps them; on a phone the role itself follows the email, as in the prototype. ### Left out - The prototype's "Patches with agent tools" row on Agent access: it needs a Patches read Companies can't make, and the ticket's contract is one setting row. - "See their patches" goes to All patches searched by the person's name (`/patches?q=…`), which also matches titles that contain it; an owner filter belongs to All patches (P2). ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required Pages and forms keep their routes and fields; `Invitations.resend` gains an optional input. No schema change. - **What does a revert leave behind?** Nothing: no rows, schema or contract change. - **Does the release before it still work with that?** Yes. Built by Claude Opus 5.5 (xhigh) in Claude Code, orchestrated by Fermy. Co-authored-by: Claude Opus 5.5 <[email protected]>
Stacked on #1347; part of #1315. Merge the stack together, not alone. ## What changed Each integration looked different while you added it. Postgres, PostHog, Attio and IMAP used a walkthrough that showed its first step already done with a green check, before the admin had done anything, then two or three stacked callouts; Pidgeon had a layout of its own with a side panel, a different width and two primary buttons. Now all five connect through one Flow frame drawn from typed data each integration supplies, so adding an integration means adding data, never a layout. Closes #1329 ## Look at **One frame, five integrations.** In task order: **1 Get it** (where to make the credential, a scope table or a list of requirements; nothing marks it done), **2 Paste it** (fields at answer width, paired fields on one row, secrets masked with Show), Pidgeon's **Choose** sections, **Name it** (the `kind/` prefix fused to the field; the hint names what was typed), **Once connected** (what it can and can't do, at most one caveat), **Test and connect · Cancel**. The access list's platform facts (members, builders' live reads, guests) are written once by the frame from typed flags, so the next platform rule changes all five at once.     <details><summary>Before</summary>     </details> **Pidgeon in the same frame.** Discovery stays: Find addresses (a secondary button, so the page keeps one primary) checks the admin key; Choose an address, Patches may and Name it unlock in place, and lock again if the key changes. Every state survives: no address yet, a new address (address, domain, display name, who it may write to), test mode, a refused key under the key, a refused final submit keeping every choice but the key. Its script now reads the frame's own markup. The side panel's facts moved into Get it, the key's hint and Once connected.   <details><summary>Before</summary>  </details> **Refusals.** A refusal about a field reads under it and takes focus, keeping everything typed except secrets; any other reads right above Test and connect, in focus. A refusal about Pidgeon's address, access or name stays at its field with its association; since a refused submit locks those parts again until the key is checked, a summary above the actions takes focus and says to paste the key again, and the script clears it once the key is in and every other choice is back. Test and connect waits, shut without script, until the form is ready.   **Phones** (Attio, Pidgeon, a refusal):  <details><summary>Before</summary>  </details> ## How it was verified - `ConnectFrame.test.ts`: every integration draws in the same order with nothing marked done, builders' live reads only where the dev binding reads live, Pidgeon's three sections locked until its script runs, field refusals under their field in focus with drafts kept and secrets never echoed, other refusals above the actions in focus, Cancel back to where the integration was chosen. Provider and route tests updated for each integration's connect page and refusals; `packages/integrations` and `packages/core` suites pass, lint and typecheck pass. - Pidgeon's script in a real browser against the dense instance: a refused final submit focuses its summary and keeps the address error; checking the key again clears the summary and restores the new address, its local part and the name; a refused key shows under the key with `aria-invalid` and `aria-describedby`; a dev test key lists its addresses and unlocks the sections; New address shows its fields; choosing Read and send and a name enables Test and connect and fills the review line; changing the key locks the sections again. Nothing was submitted. The no-script notice is in the served HTML (Playwright's script emulation doesn't render `<noscript>`). - The dev runner's Pidgeon connect now presses "Test and connect"; its other selectors (`#pidgeon-key`, `#pidgeon-local`, `#pidgeon-display`, tile and choice cards, `#connection-handle`) are unchanged, as are Attio's and IMAP's field ids. - Not run locally: `pnpm verify` and the browser suites (CI runs them). Pressing Test and connect with invented keys reaches the real provider and is refused, so refusal states come from tests and from refusals Patchy makes before calling out. §10 states kept: one primary per region; no step marked done before Patchy saw it; non-secret drafts survive every refusal, secrets never written back; Pidgeon's no-address, new-address, changed-key and failed-final-submit states and its attempt key; repeat submission stays safe (a second connect with the same name is refused as taken; Pidgeon's attempt key makes a retry one key). Vocabulary and docs: `docs/product.md` describes the one frame and each integration's page in it; the integrations glossary gains **Connect frame**. Rotate, retarget and access dialogs (#1347) already draw their fields from the same field specs the frame uses. **Core additions** (new files only, each chunk one line in the chunk list): `fieldRow` (`ui/field-row.ts`, `styles/field-rows.ts`), fields side by side that wrap on a phone, a field with an answer width keeping it. Scope tables use #1347's compact `expandingTable`. "Once connected" draws P8's `canList` (`ui/door.ts`, from #1343), the same helper with the same classes; this PR's own copy was removed when restacking. **Left for core, deliberately:** the static "Testing…" pending state and a live "Patches use …" preview need the shared enhancer (`/assets/ui.js`, core's file), and `/~ui` doesn't show `fieldRow` yet (`gallery.ts` is core's; it already shows `canList`). The prototype's "Open Attio ↗" style links are out: Patchy has no verified deep links into those products, and the steps name the path. Removed: the legacy connect renderer, walkthrough and per-field callouts in `ConnectionsView.ts`, every provider's hand-written connect fields, and all connect-page CSS (`.connections-subpage`, Pidgeon's and Attio's styles). Integrations pages now pass no `styles` to `pageResponse`. ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required Pages only: the connect routes, form field names, the Find addresses endpoint and its fragment marks are unchanged, so a form posted from an old page still connects. - **What does a revert leave behind?** Nothing: no schema, rows or stored state change. - **Does the release before it still work with that?** Yes. Built by Claude Opus 5.5 (xhigh) in Claude Code, orchestrated by Fermy. Co-authored-by: Claude Opus 5.5 <[email protected]>
## What changed Patchy Cloud only knew that a person ticked Clerk's box at sign-up. It had no record of which terms they accepted, and no way to ask again when the terms change. Now each person's acceptance is recorded by revision. When the terms or privacy notice move, everyone gets one prompt on their next page in a browser: "We've updated our terms", links to the dated pages, Accept, and Sign out. Accept goes on to the page they were opening. Closes #976 (rescoped 2026-11-02: per person, industry standard). ## Look at **The prompt**, as approved in the mock, now drawn with the overhaul's door (P8, #1343): `doorResponse` with Accept as its primary action and the usual "Signed in as … · Sign out" foot, and no styles of its own. `team`'s Cleo hasn't accepted yet, so it stands in for her Home: <!-- patchy-dev:compare:cleo --> #### Before and after, as Cleo Shah (member) Before is `e8851ea` (where this branch left main) and after is `1e926f4` (companies/terms-acceptance), both on the `team` scenario, from `pnpm dev compare`. Every page answered 200 with no browser errors. ##### `/` **1280px, after**  <details><summary>1280px, before</summary>  </details> | Width | Before | After | | --- | --- | --- | | 390px |  |  | <!-- /patchy-dev:compare:cleo --> **Accept goes on to where she was heading**, the query included, and her next page asks nothing: <!-- patchy-dev:film:accept-terms --> #### Flow `accept-terms`, as Cleo Shah (member) After is `1e926f4` (companies/terms-acceptance), on the `team` scenario, from `pnpm dev film`. - After: finished in 6.9s https://github.com/user-attachments/assets/c57c0173-ddb7-4fc7-adf7-a6aad8f14ec8 <!-- /patchy-dev:film:accept-terms --> **Who is asked, and where.** This was the part worth checking: - **Who:** everyone who hasn't accepted the current revisions or later ones. That covers members, admins and guests. A guest is asked about their own record; the host company never matters. - **Where:** only a top-level page load: `GET` with `Sec-Fetch-Mode: navigate` and `Sec-Fetch-Dest: document`. It applies at the two page boundaries, `RequireSession.withViewer` (portal, company, What's new, device-login and consent pages) and Serving's door for company patch addresses. - **Never asked:** - fetches, a patch's `/~content` frame, live streams and runtime calls; - form posts (the page a post redirects to asks); - public patches, the login door, create-or-join and Clerk's handshake; - any client without browser fetch metadata, so agents, machine tokens, MCP and the CLI pass. **The record** is the new `terms_acceptances` table (migration 36). It has one row per person and pair of revisions, holding who, the terms revision, the privacy revision, when, and `via`. `via` is `sign-up` for the row written with each new user at create-or-join, and `prompt` for Accept. Rows are only ever added. There's no foreign key, so a record outlives its account. Accepting again adds nothing. A release on older revisions, such as a rollback, asks nobody again. A form left open across an account switch or a revision change records nothing and asks again with 409, unless whoever is signed in has already accepted. **The revisions** are one line: `current` in `packages/companies/src/Terms.ts`. URLs derive from the ids (`https://patchyhq.com/cloud/terms/<id>`, `…/privacy/<id>`). This head holds **terms `2026-11-10` and privacy `2026-11-10`**, published by patchy-web #52 (merged); both dated pages answer 200. A release never names an id whose dated page doesn't answer. **Ship order:** #52 live (done; both dated pages answer 200) → merge this → release → deploy. The website makes a revision current when it publishes it, so anyone who signs up before the deploy is recorded with the older ids and asked once after it. **Rollout:** - Every existing person is asked once on their next page in a browser. - Nobody is backfilled from Clerk, and Clerk's sign-up time stays as it is. - The new revision says earlier acceptances stay in force until the person accepts it in Patchy Cloud, and this prompt is how each person accepts it. - An account Patchy creates for someone is covered by the new terms' line that they accept the terms when they first use it. If its company is created after this ships, it's recorded at creation and never asked; if it was created before, it's asked once. ## How it was verified - **New tests:** - Users: sign-up rows for created and invited users; later revisions count, older ones don't, and accepting again adds nothing. - AuthPages: the prompt in place of a page; fetch, iframe and metadata-free requests pass; Accept records and returns to the path with its query; a switched account or stale revision gets 409 and records nothing; a foreign return goes to `/`. - Serving: a colleague and a guest are asked at a patch address, never in its frame, on a public patch or without fetch metadata. - `vitest run packages/auth packages/companies packages/serving packages/portal apps/server/src/migrations.test.ts scripts/dev/src/scenario.test.ts`: 38 files, 494 tests pass. `pnpm verify`: see the review comment. - `pnpm dev compare` and `pnpm dev film` above, on throwaway instances at this commit. - **Seeds:** the dev seed, every scenario person and the tier 1 browser instance's people start past the prompt. `team`'s Cleo is `termsPending`. The rollback rehearsal accepts the prompt once when HEAD's revisions are newer than the seed's, which is what every existing person will see. - **Not checked:** the production Clerk sign-up path. Its new user takes the same `create` and `consumeInvite` insert the tests cover. **Follow-up (#1205):** acceptance records are deleted 7 years after the account or company closes. The privacy notice states that retention; nothing deletes records yet, and nothing can close for years. ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — an additive table; no CLI, API or config change. Every existing person sees the prompt once in a browser, by design. - **What does a revert leave behind?** The `terms_acceptances` table and its rows. Nothing else reads them. - **Does the release before it still work with that?** Yes. It never reads the table, and it doesn't prompt. Coming forward again asks only people who hadn't accepted. Built by Claude Opus 5.5 (xhigh) in Claude Code on T3 Code; reviewed and accepted by GPT-6.1-Sol (xhigh). --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…d once (#1376) ## What changed This adds release 41's What's new entry, written from `a25a9c5`. It covers everything merged since release 40's `through` (`08e1fd9`), and sets the `patchy` release to `0.41.0` in `packages/patchy/package.json` and `CURRENT_RELEASE`. It ships the UI overhaul together with #1204, the terms prompt, as one release, at Allison's word. | Change | PRs | | --- | --- | | Improved: Patchy has a new look | #1332, #1336, #1338, #1343, #1353, #1354, #1369, #1372 | | New: Accept updated terms once | #1204 | | Improved: Settings holds People, Integrations and Agent access | #1334, #1341 | | Improved: Home starts with what needs you | #1344, #1353 | | New: A blue dot marks patches you haven't opened | #1370 | | Improved: A patch's page has one header and tabs | #1345 | | Improved: Search lands on All patches | #1346, #1353 | | Improved: Inviting and deactivating people is clearer | #1349 | | Improved: Your agents shows what's connected | #1352 | | Improved: Integrations use plain words | #1347, #1351 | | Improved: Agents and integrations show their own logos | #1371 | | Improved: What's new goes by month | #1350 | | Fixed: ⌘⇧K works on your company's public patches | #1339 | | Fixed: Saving works after a patch stops being public | #1339, #1375 | | Behind the scenes: every page built from one set of parts, with a check | #1338, #1354 | | Behind the scenes: agents know a once-public page's refusals mean reload, and retries wait and stop | #1374 | | Patch changes: a kept public page reloads into the company page; check retries wait and stop | #1375, #1374 | #1337 is release 40's own entry. #1340 (routes split, plus the call summary Home and All patches show) and #1342 (the `dense` dev scenario) need no line of their own: the call summary is part of the Home and All patches changes, and the scenario is tooling. The overhaul makes no patch changes. Running patches keep their own styles, which #1332 pins, and the only SDK change is the wording of two error messages' admin addresses. ## Look at - **The entry**, at the top of `releases` in `packages/core/src/whatsNew.ts`. - **Rollback safety, from the live commit `d3d32da` (release 40) to this PR's merge:** - **#1334 is `one-way`.** Your agents and Settings moved to `/agents` and `/settings/…`. Old addresses redirect forward, but release 40 serves none of the new ones. This release's CLI hints, the `patchy` skill on `main`, and the API, MCP and publish hints all name the new addresses, so on release 40 they'd answer 404. - **#1372 needs the private font bucket**, and that's done. Its deploy step fetches the pinned Cabinet Grotesk file and checks it before recording anything. The bucket was created on 2026-11-10 and holds the pinned bytes. A rollback to a commit from before #1372 pins no font and builds as before. - **#1204** adds migration `0036_terms_acceptances`, an additive table that release 40 never reads. Release 40 doesn't prompt, and coming forward again asks only people who hadn't accepted. Not `one-way`. - **#1375** changes only the public shell's script, and #1374 is skill text. Release 40 renders its own shell and serves its own skills. - **#1370 and #1339** add rows to the existing `patch_opens` table (a guest's opens, and members' opens of public patches). Release 40 reads them like any other open. - **Everything else** is pages, styles, copy and docs: no migrations, and no API, `--json` or configuration changes. - **patchy-web #53**, the website line #1371's logos needed, is merged (771e6d9). **Rollback line:** Rolling back past #1334 would break every `/agents` and `/settings/…` link that this release's CLI, skill and hints hand out, because release 40 answers them with 404. Fix forward instead. ## How it was verified - **Tests:** the `packages/core` What's new test passes (5), the `packages/api` suites pass (64), and the three files are formatted. - **The range.** Each of the 22 overhaul PRs was: - reviewed by GPT 6.1 Sol at xhigh, with every finding fixed or declined in writing on the PR; - accepted on its final head by an agent that didn't write it; - merged green, by a merge train that rebuilt each PR's accepted tree on main's tip and checked that main's tree matched it after every merge. - **#1339, #1375, #1374 and #1204** were each Sol-reviewed and accepted, and merged on their own: #1339 before the train, the other three after it. #1204's acceptance was rerun on the new sign-in pages. ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required The changelog entry and the release version only. - **What does a revert leave behind?** Nothing. CLIs installed from this release report `0.41.0` and are told to match the server, as at every release. - **Does the release before it still work with that?** Yes. Changes made by Claude Opus 5.5 in Claude Code, running in T3 Code. Co-authored-by: Claude Opus 5.5 <[email protected]>
Stacked on #1345; part of #1315. Merge the stack together, not alone.
What changed
Every page Patchy draws outside the app shell was its own card: sign-in, create and join, beta links, device login, consent, errors and Serving's notices each assembled their kicker, heading, buttons and sign-out by hand, with page CSS. They now all render through F2's one Door template, so a door reads the same wherever someone meets it. Device login shows the code to compare in Geist Mono and never says a computer is connected before the CLI collects its key. Consent shows who meets whom and what the app can and can't do. A retired or deleted patch's address stays an app page, apart from the stopping notices.
Closes #1330
Look at
Device login. The code is the thing on the page; who is asking to publish as whom, the computer's name, Confirm and Deny, then when it expires beside who is signed in and Not you?, which signs out and comes back to the same code.
Consent. Who meets whom, each can or can't line saying which in words, Deny and Allow at equal width, where the answer goes, and Use another account.
Sign-in and create. The setup line is a copy line in the sign-in door's foot. Create uses the field helpers: a refusal sits under its field in one line, and the field takes the focus.
Outcomes on the same anatomy: confirmed (go back to your terminal), access off, a local callback warning, a stopping notice, the 404, a denied code.
Phones: sign-in, device login, consent, create.
Before
Every door, on the template
RequireSession.door)/login, private patch address, Clerk waitlist, failed sign-incompanies/Join.ts)data-noticekept), needs rebuildA refusal no field owns (an account or client changed while the page was open, a refreshed sign-in, an invitation that went away, already in a company) is where the page's focus starts; a field's refusal sits under the field, which takes the focus. Consent asked again with a local callback says both in one notice.
The Final step's inline confirmation (
DevicePages.confirmForm) keeps its form, hidden fields,data-inline-confirmand Not me; it moved to the field and button helpers and leaves validation to Patchy (novalidate) instead offormnovalidateon Not me. P1 restyles the guide around it.How it was verified
pnpm check: format, lint, typecheck and synth pass. Offline tests: everything I touched passes (auth, companies, serving, portal, core,apps/server). The failures left locally are the CLI stub-log tests that T3's port probes break on this machine, andfindWorktreeinscripts/dev, which this change doesn't touch; CI is the judge.Is this the code in your terminal?,Name this computer,Go back to your terminal,Address); they run only in CI.Core additions
New files only, plus one export line and one chunk line:
packages/core/src/ui/door.ts:doorCard(the card around adoorPage, whichpageResponseand Serving's notices both draw),verificationCode,meet,canList,answerPair.packages/core/src/ui/refusal.ts:refusal, the focus target for a refusal no field owns (spec §10 Errors), andtypedExactly, which keeps a phone from capitalising or correcting aninputorprefixInputsuch as the company address.packages/core/src/styles/door-parts.ts, registered afterdoors.doorResponse,unavailableDoorandaccountFootinauth/page.ts.signOutFormstays for integrations' pages until P6.Left out
/~uihas no door states yet: the gallery is F2's existing file. G or the integrator can add them from these helpers.Release impact
Copy and markup on first-party doors only. Routes, forms, field names, statuses and headers are unchanged, and so is the running patch wrapper.
Built by Claude Opus 5.5 (xhigh) in Claude Code, orchestrated by Fermy.