Repository navigation
feat(portal): switcher.json lists the patches a person can open - #1294
Conversation
Sol review (round 1)CHANGES REQUESTED
Validation: 157 tests passed across the six targeted test files. No code changed. Reviewed by GPT 6.1 Sol (xhigh) in Codex, orchestrated from T3 Code. |
GET /switcher.json answers a signed-in person's browser with their company's live patches, their own open times, and the patches shared with them that they can open now and that aren't public. Requests without same-origin fetch metadata, or with a bearer token, are refused before authentication, and every refusal is JSON with private, no-store. GuestGrants.sharedWith gains each patch's scope so the list can leave out a shared patch while it is public. The stream's refresh rule moves to Session.refreshable so both routes share it. Core exports the monogram's tint picker for the switcher's client. Co-Authored-By: Claude Opus 5.5 <[email protected]>
An expired session cookie with Clerk's suffixed refresh cookie makes Clerk refresh the session server-side and answer signed in with new cookie directives. The route answered 200 without them, so the browser kept its expired session and old refresh cookie. Every answer after Clerk reads the session now carries its cookies, as pages do; a handshake still answers session_refresh_required without them. The portal suite's sessions now use a stub Clerk backend, so a case can drive the refresh. Co-Authored-By: Claude Opus 5.5 <[email protected]>
285d4a8 to
3e778e0
Compare
|
Re the Sol review P2: fixed in 3e778e0. Once |
Sol review (round 2)APPROVE No findings. The round-1 P2 is fixed: refreshed cookies reach the 200; post-authentication refusals and handled 503s retain Clerk's directives, including signed-out clearing cookies. Handshakes and pre-authentication refusals stay cookie-free. The stub preserves real session verification and the offline network guard. Tracing the complete portal suite found only the new test's expected refresh request; existing tests made no backend calls. Validation: 174 tests across nine affected files, eight refusal/cookie probes, and test typechecking passed. The new regression test passes at head and fails against the old route with 200 and both cookies missing. No other regressions found; no code changed. Reviewed by GPT 6.1 Sol (xhigh) in Codex, orchestrated from T3 Code. |
Acceptance: PASS with notesChecked Done means
The lists as Ada changes sharing (names only)Golden journeys
Portal markup, base vs headTests: all 24 CI checks pass on this head; Rollback answers: they match the diff. There is no migration, and nothing changes in Not run
Notes
|
## What changed
Moving between patches meant the back button, the address bar or a trip
through Home, and inside a patch Patchy showed nothing at all. Now
Mod+Shift+K (⌘⇧K on a Mac) opens Patchy's **Go to…** menu over any
company patch a person can open, a guest's view of a shared patch
included, and over every signed-in portal page. With nothing typed, the
patch they were last in comes first and lit, so ⌘⇧K then ↵ flips back to
it. Escape or the key again closes it and puts the cursor back where it
was, inside the patch's own field too. The look is mock direction 2,
"Quiet list".
How:
- **`/~shell/switcher.js`** is core's second generated script
(`scripts/build-core-scripts.mjs`), plain DOM code with no Preact,
Effect or schema library. The generator now refuses any bundled input
from outside core. Every host serves it like the broker, immutable under
its digest. App pages load it from `htmlPage` when they pass `app`, and
company shells from `renderPatchWrapper`, ahead of Clerk's and the
session's scripts. The tag names the viewer and company the page was
rendered for. Doors, public shells and `patchy dev` don't load it, so
they only claim the key. The script is 14.9 KB raw and 5.6 KB brotli.
- **The menu** is a command list in a modal `<dialog>` with the starting
cover's flat `shell-scrim`, and no animation or blur. It installs `{
open, toggle }` as `window.patchySwitcher`, the contract from #1298, and
opens at once if a press came before it loaded.
- **Nothing typed:** the flip target, then the next five by last open,
then **This patch**, then **Patchy**. Patch slots that opens leave fill
with patches the viewer has never opened, the company's live ones before
those shared with them, each by title, then id, six patch rows in all
(decided by Allison on 2026-11-08). So a new member or a guest sees
patches straight away. With nothing to flip back to, no patch is lit:
the first row after them is, so ⌘⇧K ↵ never opens a patch the person
hasn't been to. An unopened company patch shows no detail; a shared one
shows its company's name. This patch is the card's Overview and
Versions, plus Log and Settings for the owner and admins, shown only
once the list confirms membership. Patchy is the places, minus the
page's own, plus What's new with its dot.
- **Typing** goes through a pure ranking module (`switcher/rank.ts`):
word starts in any order, then initials, then a match inside a word from
three letters. Ties go by open score, then title, then id.
- **The list in the browser** (`switcher/client.ts` over
`switcher/cache.ts`) is one versioned sessionStorage entry keyed to the
page's viewer and company. It holds row metadata and the tab's `{
current, previous }` patch ids.
- It fetches `/switcher.json` on load, and again on open once the copy
is a minute old.
- A stale session is refreshed once through `window.patchySession`, then
the list is fetched once more.
- Signed out, a refusal, someone else's list or a non-list response
clears everything. So does signing out on the page: posting the form to
`/logout` forgets the list and pointers before the browser leaves for
the door, which has no switcher, and an answer still on its way is
dropped (`forgetOnSignOut`).
- A stored entry that is someone else's, an older version's, or doesn't
read back whole is removed, pointers and all. Pointers alone, as before
a first list lands, still read back.
- A list that lands after the menu opened, before the person typed,
moved the selection or pointed at any row (the lit one included), is
drawn as if it had been there at open: the flip first and lit. After any
of those, and on later refreshes, the rows already shown keep their
order and the selection stays put.
- It takes its inputs as options, so #1271's notices can reuse it.
- **Keys around the chord.** A company shell's switcher tells the
patch's relay it is there with a new shell message, `available`. It
answers each validated `hello` from its frame itself, so this never
depends on the broker's release; it runs before the broker gives the
frame its address, so it hears every `hello`. From then on, an
activating press makes the relay hold every keydown, keypress and keyup
in the frame. The hold lasts until the browser blurs the frame and it
has really lost focus to the menu, `closed` arrives, or a second passes;
a blur the page dispatches itself ends nothing. So the patch never hears
a key meant for the menu. An Enter pressed in the few milliseconds
before the menu has focus is dropped, not flipped; a person's ⌘⇧K ↵ is
slower than that. Without `available` (a public shell, `patchy dev`, an
older shell) nothing is held, and typing goes on as before. The relay
accepts `available` and `closed` only as trusted messages from its real
parent. Nothing is replayed, and the frame never gives up focus. The
menu takes focus before it draws its rows.
- **The field keeps focus.** It is a `<label>`, and a press anywhere in
the dialog but its text, the glyph and panel included, leaves focus in
it.
- **Closing** puts focus back where the menu opened from. Over a patch
that is the frame, then `closed` so the relay restores the field and
selection, once the frame has focus again (Firefox returns it only after
the key event that closed the menu). Focus leaving the open menu, to the
patch, another window or the browser, closes it the same way, so Go to
never shows while typing goes elsewhere. It can also be the shell
control or the starting cover. On app pages it is the element that held
focus. The cover waits while the menu is open, and clearing it never
takes the menu's focus (`stream-status.ts`).
- **Components:** core gains `kbd` and the command-list contract
(`command-list.ts`: field, listbox, lit row, group label, empty line),
with its own scoped reset. `mono`, `page-mark`, `mark`, `tag`,
`shelf-label`, the What's new dot and the `field`/`field-group` rules
moved into `shellStyles`, so a served shell draws them as an app page
does. Escaping, patch marks and the sidebar's places moved into
dependency-free modules (`escape.ts`, `patch-marks.ts`, `places.ts`)
that the browser bundle can carry. Their old exports are unchanged.
- **Smaller changes:** the switcher list's type moved from Portal into
`@patchy/core/switcher`, as #1294 suggested. The shell's console line on
`open` is gone at company scope; `patchy dev` keeps it.
Closes #1270
**This PR changes code from #1298.** The commit `fix(core): the relay
holds the keys after the chord only where a switcher will take them`
changes `packages/core/src/switcher/relay.ts` and `messages.ts`, with
their cases in `switcher-relay.spec.ts` and ADR-0010. Of #1298's
`broker.ts`, this PR changes only the console line on `open`. Without
it, a fast ⌘⇧K ↵ from a patch's field sent the Enter into the patch,
since the browser delivered it inside the frame before the shell had
handled the relay's `open`. The fix needs the shell's switcher to say a
menu exists (`available`), and the relay to hold keys only then and to
accept only its real parent's messages and the browser's own focus and
blur. That only matters once there is a menu, so it lands here rather
than in #1298.
## Look at
**The flip**, filmed on `brightline` as Allison: Spend Requests, then
New Business, then ⌘⇧K ↵ back to Spend Requests, typing to filter, and
the menu on Home.
https://github.com/user-attachments/assets/117eb293-cae5-4fe6-931c-0c391df522cc
**Over a patch**, nothing typed. Spend Requests is lit as the flip
target, and New Business, the patch on screen, isn't a row:

**A new member** (Jordan on `brightline`, who hasn't opened anything)
with nothing typed: the company's patches by title, none lit, and the
first place lit:

**Typed** ("ku" over Spend Requests), and **on Home**, where Home isn't
offered:
| Typed | On Home |
| --- | --- |
| 
| 
|
**Pages with the menu closed don't change.** `pnpm dev compare` as
Allison on `brightline`, before at `66997dd` (#1298's head) and after at
`ab55b42`:
| Page | 1280px | 390px |
| --- | --- | --- |
| `/` | No visible change | No visible change |
| `/brightline/new-business` | No visible change | No visible change |
<details><summary>After, 1280px</summary>


</details>
**The spec caught a real race.** `dialog.close()` queues its `close`
event, and Chrome can handle a fast key press first. Without a guard,
the stale event from an Escape closed a menu reopened straight
afterwards. The menu now acts on its dialog's `close` event only while
the dialog is actually closed. The cover spec reopens it immediately
after Escape to hold that.
## How it was verified
- **`test/browser-tier1/switcher.spec.ts`**, 16 cases, all pass twice
over with `--repeat-each=2` in Chromium, and once more after the rebase
onto `main`. The 14 that aren't Chromium-only (all but the starting
cover's two) also pass twice over in Firefox.
- Someone who has opened nothing: a new colleague's menu on All patches
lists the company's patches by title with Home lit; a guest's lists the
patch shared with them, named with its company's name, with Home lit.
- ⌘⇧K, then ↵ once the menu has focus, three flips in a row from the
patch's field: each lands. Then ⌘⇧K ↵ with no pause: the patch's own
listeners and its form never hear the Enter.
- A menu slow to open (600 ms after the relay asks, the shell otherwise
free) over a patch that forges blur events every 20 ms: the Enter
pressed straight after the chord never reaches the patch, and nothing
flips. The broker never answers `hello`, as #1298's doesn't, so
readiness comes from the switcher alone. With the switcher's answer
disabled, the patch hears the Enter: the case bites.
- A patch that grabs focus back 400 ms after losing it, never leaves Go
to up while typing goes to the patch. In Chromium the menu closes and
"private" lands in the patch. In Firefox the inert frame can't take
focus, and the keys stay in the menu.
- A fresh tab whose list is held back: the menu opens on the places with
Home lit; once the list lands the flip is first and lit. Pressing ↓
first keeps All patches lit instead, and so does pointing at Home, the
lit row.
- A click on a group label, then on the glyph: the field keeps focus,
typing filters and ↵ opens.
- Sign out from the account menu: the tab's entry is gone on the page
the form leads to.
- Over a patch with the cursor in a field: the flip is lit, typing
filters, no match offers All patches, Escape restores the field's
selection (typing replaces it), ⌘⇧K ↵ flips both ways, the arrows wrap,
the key again closes, hover lights a row, the scrim closes and a click
opens.
- On All patches and Home: the flip to the patch the tab left, no own
place, no This patch, and focus back in the sidebar search.
- A guest: shared rows named with their company's name and no This
patch. Revoking the grant drops the row when the held `/switcher.json`
lands, while the menu stays open.
- Another viewer's planted entry is ignored and removed, while the same
entry as the viewer paints from cache. Denied `sessionStorage` still
lists.
- Sessions: stale gets the list back (401, refresh, 200), an exhausted
retry keeps the copy (401, 401), and signed out clears the list and the
entry.
- A host with no `switcher.js`: the key is claimed and `patchySwitcher`
stays `true`. With `/switcher.json` answering a 404 page: places only.
- A public shell loads neither file, and a key typed straight after the
chord lands in the patch's field.
- Over the starting cover: the menu opens over it, Escape returns focus
to the cover, and a cover clearing behind the reopened menu leaves focus
in it. A cover due while the menu is open waits, then takes focus once
it closes.
- **`switcher-relay.spec.ts`** now runs the relay alone on a host
without `switcher.js`, since a loaded menu answers its pending requests.
A new case shows that a page dispatching `available` itself is ignored
and the key after the chord stays the page's. The shell's own
`available` holds the next key, a blur the page forges releases nothing,
and `closed` ends the hold. All 11 pass, as do the 4 `focus.spec.ts` and
7 `starting.spec.ts` cases, twice over in Chromium.
- **Unit tests:**
- `rank.test.ts`: the mock's "sa" order, any-order words, initials,
inside-a-word from three letters, no typos, deterministic ties.
- `cache.test.ts`: round trip, metadata only, removal of another
viewer's or company's entry, of a bad list, bad pointers or an old
version, pointers on their own kept, full or denied storage, pointer
moves.
- `rows.test.ts`: every nothing-typed and typed case above, member vs
admin cards, the hold on refresh, the "4 min" … "Oct 2, 2025" labels.
Never-opened patches: a new member's six of eight by title and none lit,
a guest's shared patches named with their company, the mix (the flip,
then opened, then the company's unopened, then shared, capped at six),
and the patch on screen left out.
- `client.test.ts`: adopt, freshness, refresh once, keep, forget,
pointers, and sign-out forgetting for good with an answer still on its
way.
- `command-list.test.ts`: structure, escaping and the CSS in
`shellStyles`.
- `html.test.ts` and `render.test.ts`: the tag on app pages and company
shells only, ahead of Clerk, with escaped ids.
- `Pages.test.ts`: `switcher.js` is immutable only under its digest.
- **`pnpm check`** (rerun after the round-three fixes): format, lint,
typecheck and synth pass. Its tests fail only in this machine's known
places, which fail the same on `origin/main` here: a stray `GET /`
reaching CLI stub servers (cli, cliPublish, cliLifecycle, cliLook,
cliRepoRecovery) and npm missing beside `/usr/bin/node` (install).
- **`pnpm verify`** under the shared lock, run before the round-one
fixes, with mise's Node 24 first on PATH: format, lint, typecheck,
synth, postgres-concurrency, cli-smoke, install and tier2-smoke pass.
test and test (bun) fail only on the same stray `GET /` and on load.
RequestEvents, Engine and Supervisor pass alone; Supervisor's case had
hit its 20 s timeout at a load average of 15. The browser job stopped at
its first failure, so I reran the whole tier 1 suite: 103 of 104 pass.
The one failure is `tier1.spec.ts` "hostile navigation", whose
foreign-origin stub heard a bare `GET /` from the local port probe.
#1294 documented it failing the same way on `origin/main`.
- **Not checked:** the hand test on a Mac in Safari, Chrome, Firefox and
Zen. That covers focus and cursor restore, the first moments after a
patch opens, and whether initials matches read clearly without
highlighting. WebKit isn't runnable here, so Safari is unverified. CI
runs Chromium only; the Firefox run was local.
Hit every surface:
- **Served pages:** the `ui-consistency` spec now covers the switcher as
the one shell UI a person opens over a running patch, the command list
and `kbd`, the components `shellStyles` now shares, the switcher script
on app and company shells, and how the starting cover yields to it.
- **Vocabulary and product shape:** Portal's glossary gains
**Switcher**, Serving's **Switcher relay** says what the menu does with
its messages, `docs/product.md` describes the switcher, and GLOSSARY-MAP
and the README layout mention it. ADR-0010 already states the final `{
open, toggle }` contract from #1298.
- **Dev loop:** `pnpm dev` already runs core's generator, which now
emits two scripts. No runner change.
- **Not touched:** the wire contract (`/switcher.json` is Portal's,
browser-only), the CLI (no command, flag or exit code; `patchy dev`
stays claim-only), migrations, company resources, reverse states
(opening and closing are the pair) and the repo layout.
Where this departs from the issue, each a gap the issue left open:
- A shared patch's detail is its company's name: guests record no opens,
so there is no time to show.
- Typed results are one ranked list without group labels, as the mock's
typed state is. Card and place rows keep their icons.
- The place a page belongs to isn't offered, as on the mock's Home.
## Release impact
- [ ] **Breaking** — requires action from anyone already running this
- [x] **Not breaking** — no action required
A new browser script and its route; no API, CLI, schema or configuration
change. #1267 (reopens within 10 minutes count once, PR #1295, now on
main) ships in the same release, so flips don't inflate Your usual.
- **What does a revert leave behind?** A `patchy.switcher` entry in
`sessionStorage` in tabs that loaded the menu. It holds row metadata
only and lasts until the tab closes. Pages already open keep the script
they loaded.
- **Does the release before it still work with that?** Yes. It never
reads the entry. A page from this release asking an older host for
`switcher.js` gets nothing, so the relay claims the key and nothing
opens. An older host without `/switcher.json` gives the menu places
only.
Built by Claude Opus 5.5 (xhigh) in Claude Code, orchestrated from T3
Code.
---------
Co-authored-by: Claude Opus 5.5 <[email protected]>
## What changed This adds release 40's What's new entry, written from `08e1fd9`. It covers everything merged since release 39's `through` (`17b1ad8`), and sets the `patchy` release to `0.40.0` in `packages/patchy/package.json` and `CURRENT_RELEASE`. | Change | PRs | | --- | --- | | New: Jump anywhere with ⌘⇧K | #1294, #1298, #1304, #1307 | | Improved: Your usual stays yours | #1295 | | Patch changes: Mod+Shift+K no longer reaches patch code; Patchy serves one script first in every patch document | #1298 | #1293 is release 39's own entry. The range is exactly the switcher stack (#1091), which ships as one release. #1295 had to ship no later than the menu, and it does. ## Look at - **The entry**, at the top of `releases` in `packages/core/src/whatsNew.ts`. - **Rollback safety, from the live commit `64ce907` (release 39) to this PR's merge:** - **No PR in the range is `one-way`.** There are no migrations, no API or CLI contract changes, and no infrastructure changes. - **#1295** changes only how new opens add to a person's score. Scores written under the new rule stay valid for release 39, which keeps counting every open. - **#1298** inserts the relay into served patch bytes at serve time. Stored files and digests are unchanged, so release 39 serves them as before. - **#1304 and #1307** add a `sessionStorage` entry that release 39 never reads. #1307's new `claims` field on a completed Clerk handshake exists only in memory. **Rollback line:** If this release misbehaves, roll back to `64ce90784350341fc2f60fe4f4161a78444f243e` (release 39). ## 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 #1294, #1298, #1295, #1304 and #1307 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 on a branch up to date with main. ## 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.40.0` and are told to match the server, as at every release. - **Does the release before it still work with that?** Yes. Written by Claude Opus 5.5 in Claude Code, orchestrated from T3 Code. Co-authored-by: Claude Opus 5.5 <[email protected]>
Stacked in the UI overhaul (#1315) after F2; merge the stack together, not alone. ## What changed Your agents lived at `/machines` and company management at `/company/…`. They now have the addresses the new sidebar names: Your agents at `/agents`, with Connect an app at `/agents/connect?app=<app>` and Add a computer at `/agents/computer` as pages of their own, and People, Integrations and Agent access at `/settings/people`, `/settings/integrations` and `/settings/agent-access` (`/settings` opens People). Released skills, CLIs and bookmarks carry the old addresses, so every one of them keeps working. No page is restyled; later lanes rebuild them. Closes #1318 ## Look at **1. One map, by method and path: `apps/server/src/Moved.ts`.** Each entry is an old route exactly as the last release registered it, found with Effect's own `FindMyWay` under the router's default rules, so any letter case, trailing slash, repeated slash or percent-encoding the router accepted before still works. A GET answers 308 to the new URL with the query as sent; a browser carries the fragment across on its own. A POST, from a form left open across the move, is handed to the router under its new URL before routing, so the new route answers it with every check it makes (same-origin, admin-only, ownership). That is the pattern `servingHeaders` already uses for HEAD. Anything else under the old prefixes stays a 404. | Old | New | |---|---| | `GET /machines` | `/agents` | | `GET /machines?agent=<app>` | `/agents/connect?app=<app>` (other parameters kept) | | `GET+POST /machines/revoke-all` | `/agents/disconnect-all` | | `POST /machines/:id/revoke` | `/agents/computers/:id/disconnect` | | `POST /machines/agents/:id/disconnect` | `/agents/apps/:id/disconnect` | | `GET /company`, `GET /settings` | `/settings/people` | | `POST /company/invites[/:id/{revoke,resend}]`, `POST /company/users/:id/role` | `/settings/people/invites…`, `/settings/people/users/:id/role` | | `GET+POST /company/users/:id/{deactivate,reactivate}`, `/company/guests/:id/remove` | `/settings/people/users/…`, `/settings/people/guests/…` | | `GET+POST /company/agent-access` | `/settings/agent-access` | | `/company/connections…`: index, catalogue, connect pages and posts, Pidgeon's Find addresses, a connection, its five acts and six confirmations | `/settings/integrations…`, same shape | `apps/server/src/Moved.test.ts` boots the whole server and walks the map: every old GET (signed in and out) answers 308 with `?show=a%20b&q=x+y&empty` kept byte for byte and no fragment, and its target is a real route. For every old POST, another site's form gets the same 403 as at the new address, and a member's request for what isn't theirs gets the identical status, location and page. Two old forms change what the new routes change: revoking a computer and turning agent access on. Spellings the router accepted (`/company/`, `/COMPANY?…`, `/%63ompany`, `//machines//revoke-all`) redirect or post as before; `?%61gent=codex` and `?app=claude&agent=codex` land on Codex's steps, as the old page showed. Unknown URLs under the old prefixes still 404. With the rewrite taken out, the POST tests fail. **2. Your agents' "add" disclosures became links to their own pages,** because the old `?agent=` link now needs a destination of its own. The links keep the ids old `/machines#add-a-computer` and `#connect-an-agent` links name; `test/browser-tier1/moved.spec.ts` follows both old links in a browser. Screenshots below come from `pnpm dev compare` on throwaway `brightline` instances. *Before* opens the old address on the base; *after* opens the same old address on this head, which follows the redirect. ## How it was verified - `pnpm check`: format, lint, typecheck and synth pass. In the offline tests, the only failures were the CLI stub tests that a local tool's stray `GET /` breaks on this machine (a different handful each run, none touching these paths) and load-sensitive execution tests. Each passes alone; CI runs the full suite. - After rebasing on #1294/#1298: auth, companies, core, integrations, portal, MCP and the server wiring suites, 1,176 tests, pass. - `pnpm dev up imap`: the dev runner connected `imap/invoices` through the moved connect page and its new URL wait, then published. - Enrollment refuses the `agents` handle (`Companies.test.ts`, and `/join` in `AuthPages.test.ts`). `settings` was reserved already. - **Not run locally:** the browser suites (CI runs `moved.spec.ts`) and live Clerk (`login-door`, `patchy-login` now open `/settings/people` and `/agents`). - **Not checked:** whether a production company already holds the `agents` handle. That's left to the orchestrator before release. Surfaces it follows through to: every href, form action, receipt redirect and refusal link; the dev personas hint; device-login and consent links (their routes don't move); hints agents read from the API, MCP door, publish warnings, SDK generation and the CLI; the global `patchy` skill (`skills-lock.json` refreshed) and its onboarding reference; the project skills under `packages/sdk/skills`; `docs/API.md` (regenerated), `docs/product.md`, ADR-0004, README, DEVELOPMENT, OPERATIONS, the auth glossary and the acceptance skill; the dev runner's connect URLs and URL waits. The rollback rehearsal drives the live release as well as this head, so it opens People and Disconnect everything at the old addresses (both releases answer them) and accepts either form address. Past What's new entries hold no old paths. Seeds and scenarios don't change. Left for later lanes: copy that names the old Company group ("Back to Company", "Turn it on at Company", the sidebar's group label) goes to N and the page lanes, and Revoke → Disconnect to P4. No core additions. Core's sidebar place list changes only its hrefs. ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required Every old address keeps answering: GETs redirect permanently, POSTs are served where they were. No schema, API shape or configuration changes; hint strings name the new addresses. - **What does a revert leave behind?** No schema or rows. It does leave the new addresses that people's agents and clients now rely on: the global `patchy` skill on `main` sends people to `/agents`, this release's CLI hints name `/settings/integrations`, `/settings/people` and `/settings/agent-access`, and the API, MCP and publish hints it served say the same, as do bookmarks people make. - **Does the release before it still work with that?** No. It serves none of `/agents…` or `/settings/…`, so every one of those links and hints answers 404 until production rolls forward again. Nothing else breaks: no data or schema changes. Labelled `one-way`. Built by Claude Opus 5.5 (xhigh) in Claude Code, orchestrated by Fermy. <!-- patchy-dev:compare:allison --> #### Before and after, as Allison Mahmood (admin) Before is `0a78106` (where this branch left main) and after is `529f6be` (ui/u-addresses), both on the `brightline` scenario, from `pnpm dev compare`. ##### `/machines` **1280px, after**  <details><summary>1280px, before</summary>  </details> | Width | Before | After | | --- | --- | --- | | 390px |  |  | ##### `/machines?agent=codex` **1280px, after**  <details><summary>1280px, before</summary>  </details> | Width | Before | After | | --- | --- | --- | | 390px |  |  | ##### `/agents/computer` **1280px, after**  <details><summary>1280px, before</summary>  </details> | Width | Before | After | | --- | --- | --- | | 390px |  |  | - Before at 1280px answered 404; 1 browser error(s): `Failed to load resource: the server responded with a status of 404 (Not Found)`. - Before at 390px answered 404; 1 browser error(s): `Failed to load resource: the server responded with a status of 404 (Not Found)`. ##### `/company` **1280px, after**  No visible change at 1280px. | Width | Before | After | | --- | --- | --- | | 390px | No visible change |  | <!-- /patchy-dev:compare:allison --> Co-authored-by: Claude Opus 5.5 <[email protected]>

What changed
The switcher (#1091) needs to know which patches a person can jump to, and nothing could tell a browser that yet.
GET /switcher.jsonnow answers a signed-in person's browser with their company's live patches, with their own open times, and the patches other companies shared with them that they can open now. Another company's public patch never appears, including a shared one while it is public. Nothing calls the route until #1270.Closes #1269
Look at
The public filter. A guest grant outlives its patch going public and back (
Guests.test.ts), soGuestGrants.sharedWithnow carries each patch's currentscope, and the list leaves out shared rows that are public or that the guest can't open now. Home's use ofsharedWithis unchanged. Here it is on a localguestsenvironment: Jo works at Pine Studio and has both Harbor Works patches shared with them. Ben is a Harbor Works member. Ada flips Site notes public and back with the CLI:Who gets an answer. Any request whose
Sec-Fetch-Siteisn'tsame-origin, and any request with anAuthorizationheader, is refused before authentication, so it can't start a Clerk handshake. Every refusal is JSON withprivate, no-store, never the sign-in page or a redirect. Once Clerk has read the session, every answer carries the cookies Clerk set, as a page's does. That way a session Clerk refreshed server-side, from an expired session cookie plus its refresh cookie, stays refreshed in the browser. A handshake still answerssession_refresh_requiredwithout the handshake's cookies, because a script can't follow that redirect. Same environment:That machine token gets
200from/api/me.The final shape, for #1270. Close to the issue's sketch:
The session codes are the runtime stream's own, so the script can follow
stream.ts's refresh pattern.titleis as published and may be blank, so the client falls back with core'spatchTitle. The payload type isSwitcherList.SwitcherListin@patchy/portal. If #1270's browser script wants the type, lift it into core there. Core now exportsmonogramTint, the mark's tint picker, so the menu's marks match the portal's.monogramrenders the same markup as before.How it was verified
PortalPages.test.ts› "the switcher's list", four cases:mineset, and only the member's own open. A retired patch, a disabled patch and another company's company-scope and public patches are all absent.noneand missingSec-Fetch-Site, with a valid, a stale and no session, all403before authentication. A live machine token, with and without a session, gets403. A stale session gets401 session_refresh_required, signed out401 session_expired, no membership and deactivated403. All are JSON withprivate, no-store.200with the refreshed__sessionand refresh cookies. The portal suite's sessions now use a stub Clerk backend for this. Over the first commit's route, the same request got200without the cookies, which was Sol's finding.The tests bite. Dropping the public filter fails the guest case, and dropping the
Sec-Fetch-Sitecheck fails the refusal case (expected 200 to equal 403).The stream's refresh rule moved into
Session.refreshableso both routes share it.RuntimeStreamApi.test.tsand the browser suite's stream refresh tests still pass.pnpm check: format, lint, typecheck and synth pass.pnpm verify(under the shared lock): postgres-concurrency and tier2-smoke pass.test,test (bun),cli-smoke,installandbrowserfailed only for two local machine reasons:GET /reaches the tests' stub servers on local ports. That broke the CLI stub-log tests andLocalTaskProviderintest, and onetier1.spec.tscase whose "foreign origin" stub saw"/". Intest (bun)every file passed (256/256) and the probe only threw uncaught JSON parse errors indevExecution.test.ts's stubs./usr/bin/nodehas nonpmbeside it. That brokeinstall.test.ts,installandcli-smoke's install line.Both reasons fail the same way on
origin/main. The same four files there fail 12 tests, with the same stray"/"andnpm is not on PATH. Rerun alone, the full tier 1 browser suite passed (85/85). After rebasing onto feat(integrations): patches save IMAP attachments into their files #1264: typecheck passes, andPortalPages,RuntimeStreamApi,GuestGrants,Guestsandcore/htmlpass (129 tests).After the cookie fix:
pnpm checkpasses format, lint, typecheck and synth. Its tests failed only for the strayGET /,npm is not on PATH, and timeouts under a load average of 43. The nine suites that timed out or that this touches pass when run alone:McpDoor,Tables,SdkApi,QuerySnapshot,InvocationLocal,RequestEvents,RuntimeStreamApi,GuestsandSession(110 tests). The whole portal suite passed in that run. I didn't rerunpnpm verify: the fix touches only this JSON route and its test, which none of verify's acceptance suites exercise.Not checked: CI on Linux, which doesn't have either machine issue.
Hit every surface:
packages/api, so there's no CLI command and nodocs/API.mdchange.GLOSSARY.mdgains Switcher list.docs/product.mdwaits for feat(core): Mod+Shift+K opens Patchy's switcher #1270, when people can see something.Release impact
Tick exactly one.
A new browser-only route that nothing calls yet. No migration, no CLI or API change.
/switcher.jsonbefore feat(core): Mod+Shift+K opens Patchy's switcher #1270.Built by Claude Opus 5.5 (xhigh) in Claude Code, orchestrated from T3 Code.