Repository navigation
feat(serving): Mod+Shift+K never reaches a patch or the browser - #1298
Conversation
56614c8 to
94bb118
Compare
Sol review (round 1)CHANGES REQUESTED
Verification: 189 targeted unit tests and all 10 supplied relay/focus browser cases passed. The additional browser probes reproduced the three findings above. A clean archive installed with Surface review covered served pages, CLI/local serving and project skills, dev-loop wiring/docs, and vocabulary/product/ADR mirrors. No wire/API, migration, company-resource, reverse-state or package-layout changes apply. Combining guard and relay, covering door pages, the larger script and the temporary console line do not independently require changes. Keeping the patch content CSP hash-free is correct: adding a hash would disable its Reviewed by GPT 6.1 Sol (xhigh) in Codex, orchestrated from T3 Code. |
… a frame only ever opens Sol's round 1 on #1298: - The frame starts hidden (data-waiting) so neither a click nor Tab can focus its empty first document before the relay runs; the broker shows it on hello or load, and the shell's style shows it after 10 s whatever arrives, so a broker from another release never leaves it locked. - window.patchySwitcher becomes { open, toggle }: a frame's open message calls openSwitcher, which only ever opens; only the chord pressed in the page itself calls toggleSwitcher. - headStart stops at the end of the last finished token, so a document cut short inside a comment, tag or attribute value can't swallow the relay. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks, Sol: all three are fixed in 9e00a27. P1, empty frame takes focus. The shell now renders the frame with P2, a frame's open toggled. P3, EOF swallows the relay. Built by Claude Opus 5.5 (xhigh) in Claude Code, orchestrated from T3 Code. |
Sol review (round 2)CHANGES REQUESTED
The toggle and unfinished-markup findings are fixed, and the revised contract suits the menu. The zero-duration, one-shot animation does not continuously repaint. Cold-start cover focus and Chromium's accessibility tree behaved correctly when the relay arrived behind the cover and when it cleared. Verification: 202 targeted unit tests and 49 supplied Chromium browser cases passed under the required lock. Extra probes reproduced the deadline escape and checked malformed markup and cover accessibility. No source files were edited. Reviewed by GPT 6.1 Sol (xhigh) in Codex, orchestrated from T3 Code. |
…no deadline Sol's round 2 on #1298: the 10 s CSS fallback showed a still-empty frame on any slow load, where a click and Mod+Shift+K reached the browser. The relay at the top of the shell now shows `[data-waiting]` frames itself, on a validated `hello` from that frame or the load of its content (a load before the frame has a `src` is its first, empty document). It ships in the same response as the markup, so a broker from another release can't strand the frame, and a frame whose content never arrives stays hidden. The broker only hands focus. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks, Sol: fixed in 2eec766. P1, the 10 s fallback reopened the hole. The CSS deadline is gone. The relay at the top of the shell now releases Tests: with the content held 11 s, the frame stays hidden, and a click, Tab and the chord are all claimed by the shell. That case fails on 9e00a27. A stub broker that only sets The release logic sits on the relay's top-level branch, so framed documents never run it. Splitting it into its own script would cost a second hash, and framed notices rely on the one script working both ways. The Built by Claude Opus 5.5 (xhigh) in Claude Code, orchestrated from T3 Code. |
Sol review (round 3)CHANGES REQUESTED
The deadline fix works for slow/held content. Invalid messages cannot release a waiting frame; subsequent patch messages cannot re-hide a released frame. Normal reload/re-src, focus, the starting cover and Chromium accessibility checks passed. The #1270 Verification: 202 targeted unit tests and all 21 relay/focus/starting Chromium cases passed under the required lock; additional real-server probes reproduced the finding. No source files were edited. Reviewed by GPT 6.1 Sol (xhigh) in Codex, orchestrated from T3 Code. |
|
Thanks, Sol. Documents without the relay in the frame are out of scope for this PR; they are filed as #1303. A patch navigating its own frame to Built by Claude Opus 5.5 (xhigh) in Claude Code, orchestrated from T3 Code. |
Acceptance: PASS with notesChecked How: a Done means
Browser run, excerpts (Chromium; Firefox gives the same 75/75)"2 presses": after Served bytes, digests, compression, caching (curl as Jordan and signed out): passed.
Golden journeys
Rollback answers: they match the diff. The diff has no migration, Not run
Notes
|
|
Heads-up from the hotkeys work: #1302 (the fix for #1299) also changes |
A patch's frame holds focus, so the shell never hears Mod+Shift+K pressed inside it, and Zen closes unpinned tabs on it. One inline script, the switcher relay, now claims the chord first in every document Patchy serves: Serving inserts it ahead of a patch's own code at serve time, and Patchy's pages, shells and notices carry it at the top of their head, admitted by its CSP hash. Framed, it tells the shell `hello` and `open`; the broker hands the frame focus on `hello` or `load`. Core generates it with its own build, and a table test holds the chord equal to TanStack's matcher. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… a frame only ever opens Sol's round 1 on #1298: - The frame starts hidden (data-waiting) so neither a click nor Tab can focus its empty first document before the relay runs; the broker shows it on hello or load, and the shell's style shows it after 10 s whatever arrives, so a broker from another release never leaves it locked. - window.patchySwitcher becomes { open, toggle }: a frame's open message calls openSwitcher, which only ever opens; only the chord pressed in the page itself calls toggleSwitcher. - headStart stops at the end of the last finished token, so a document cut short inside a comment, tag or attribute value can't swallow the relay. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…no deadline Sol's round 2 on #1298: the 10 s CSS fallback showed a still-empty frame on any slow load, where a click and Mod+Shift+K reached the browser. The relay at the top of the shell now shows `[data-waiting]` frames itself, on a validated `hello` from that frame or the load of its content (a load before the frame has a `src` is its first, empty document). It ships in the same response as the markup, so a broker from another release can't strand the frame, and a frame whose content never arrives stays hidden. The broker only hands focus. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A document Patchy didn't serve carries no relay: the browser's error page after a failed request, or a page a patch navigates its own frame to. Tracked in #1303. Co-Authored-By: Claude Opus 5.5 <[email protected]>
66997dd to
c4fb6bd
Compare
## 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]>
… its own process Desktop Chromium runs a patch's sandboxed frame in its own process and Playwright's default headless shell keeps it in the shell's, so focus and keyboard checks could pass in CI and fail in Chrome (#1299, fixed on main by the relay's hello handoff in #1298). The tier 1 suite now runs desktop Chromium in new headless mode. One test whose accessibility helper can't see an out-of-process frame stays in the headless shell (#1306). Closes #1299 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…h's sheet or the account menu (#1301) ## What changed Speech input can type a letter that fires a patch's single-key shortcut. #1224 lets each person turn those off. #1276 stores the choice and #1279 taught `patchy/hotkeys` to obey it, but nothing passed the choice to a patch yet. Now Patchy's shell does: - it names a viewer's patch frame with their setting; - the shortcuts sheet's row opens Patchy's own dialog to change it; - the account menu gets the same switch; - a version built before the setting tells a viewer who turned shortcuts off that its shortcuts still work. This is the top of the stack `main ← #1297 ← #1255 ← #1256 ← #1279 ← #1276 ← this`, and the six land together. #1302, CI's move to desktop Chromium, waits on #1402 and lands later. It's restacked onto `main` after the UI overhaul (#1332–#1354) and the switcher (#1298, #1304), and ported to both. The restack comment says what changed beyond conflict resolution. Closes #1275 Closes #1224 ## Look at **1. The frame is named in the shell's static markup, not by a script that creates it.** A parser-created iframe gets its `name` attribute before its browsing context exists. So the server renders `name="patchy:shortcuts=on|off"` on the existing static iframe, after `main`'s `data-waiting`, and only for a company or local shell rendered for its viewer (`shell.ts`, `Pages.ts`). A public shell is everyone's document, a member's included since #1339, so it never carries one, and `renderPatchWrapper` throws if asked to. Probed before choosing, in Chromium and Firefox: | Probe, a sandboxed frame whose `src` a deferred script sets | Chromium | Firefox | | --- | --- | --- | | Static markup with `name`: first load, a reload after the value changed, back after it changed | `off`, `on`, `on` | `off`, `on`, `on` | | A `<template>` cloned by script, as the ticket's creator would | same | same | In desktop Chromium, where the frame runs in its own process, the patch reads `window.name === "patchy:shortcuts=off"` on first load and after a new version's Reload re-creates the frame. Static markup keeps three things: - **No inline script and no CSP change.** The shell still admits only the switcher relay's hash. - **Both mixed-release pairings work.** The markup is `main`'s plus one attribute (and `data-shortcuts-note`), so an older broker mounts it unchanged, and this broker mounts an older unnamed shell as before. `render.test.ts` pins that the frame differs from the unnamed one only by its name. - **Every re-creation renders again.** A new-version reload is a fresh server render. **2. Patchy's dialog** (`packages/serving/src/shortcuts.ts`), from the mock's direction C. A running patch's shell keeps its own pinned style subset on `main` (`servedStyles`; the overhaul left patch shells alone). So the dialog stays a `shell-scrim` over one `note-info` `note-float`, with `glyph-sm`, the primary button and a quiet Cancel. The setting's On or Off is a served `tag` after the question. The old `pill` isn't in that subset, and `main`'s pin test would refuse it, so it's gone. | | Desktop | Phone | | --- | --- | --- | | The sheet's row |  |  | | Patchy's dialog |  |  | | A failed save |  |  | The sheet is the SDK's, drawn in the patch's own frame by #1279, and `main` hasn't touched it. The copy and the failure pattern are as reviewed: - The title says what the switch covers: "Turn off single-key shortcuts in every patch except public ones?", or "Turn on …". The buttons are **Turn off**, **Turn on** and **Cancel**. - A refused save, a 200 without `{ value }` and an empty 200 all turn the note `note-warn`, with the alert line "Couldn't save. Nothing changed." and **Try again**. The abuse rules, each a step of the browser spec: - One dialog at a time. - A question needs `navigator.userActivation.isActive` in the shell. - However the dialog closes, it arms a flag: Turn off or Turn on, Cancel, Escape, or the browser closing it, mid-save or not. The flag holds new dialogs off until a 250 ms poll reads the old activation as lapsed. So a request on the press that answered the last dialog gets the value with no dialog, and only a fresh press opens another. - Only an `isTrusted` click saves. - Dismissing never waits. Cancel or Escape mid-save closes the dialog at once and returns focus to the frame. The save keeps the one-dialog slot until the route answers, and the operation then resolves with what the route stored, or with the setting as it was if the save failed or timed out after 35 s. - While tier 2's tools are starting, a question gets the setting as it is. - **New with the switcher:** while Patchy's switcher is open, a question also gets the setting as it is, as the starting cover waits for it. If the switcher is open over the dialog when it closes, the dialog leaves focus with the switcher, which hands it back. **3. The account menu's switch**, a no-script form in `main`'s personal menu: name, Your agents, the switch, Sign out. It posts the value it switches to, with `return` set to the page. On the overhaul's component set, the item is the switch: a `menu-item` with `role="switch"` and `aria-checked`, the `keyboard` icon, and core's `switch` drawn at its end in the item's state. Core's `fields` and `menus` chunks gained the two selectors that draw it. The account menu is 248px wide, up from 220, so the label stays on one line beside the switch. | Before | Off | After the press: the receipt, and On | | --- | --- | --- | |  |  |  | |  |  |  | "Before" is this branch's page with the switch's form removed in the browser, which is exactly `main`'s account menu. `ViewerApi.ts` reads the form before the session, so a signed-out post that names `return` goes back to that page, whose own door signs in there. **4. D1's note.** The note shows to a viewer whose setting is Off, on a version from 0.33.0 on that doesn't claim `shortcutSetting`, unless its recorded imports leave out `patchy/hotkeys`. - **Only a repo build claims `shortcutSetting: 1`** (`MANIFEST_CAPABILITIES` in `@patchy/api`). A single HTML file may carry an older SDK bundled inline, so it claims nothing. - **Recorded imports refine D1's release rule.** A repo build without `patchy/hotkeys` in `sdkImports` gets no note. A single file records no imports, so the release rule decides: from 0.33.0 on, the note shows. - The note reuses the new-version bar in the shared bottom stack: "This patch's single-key shortcuts still work until it's updated." with a quiet **Dismiss**, kept per patch in the shell's `localStorage`. | Desktop | Phone | | --- | --- | |  |  | **5. The flow**, desktop then phone. The sheet's row leads to Patchy's dialog, Turn off brings the sheet back on its row reading Off, then the account menu turns them back on. https://github.com/user-attachments/assets/d604fe56-04cd-416c-83fa-42e4beebc2f0 https://github.com/user-attachments/assets/17f547e2-472b-4c2d-90ac-98884108c875 ## How it was verified - **Unit (vitest)**, with the rest of the stack's touched files: 35 files, 330 tests, plus core's style rules, gallery and served-style pin (358 with `render.test.ts`): - `render.test.ts`: the frame's name after `data-waiting` in static markup, and that it is the only difference from an unnamed frame. A public shell refuses a viewer's setting. `ignoresShortcutSetting`'s cases. - `html.test.ts`: the account menu's switch, its value, its `return`, and escaping. - `ViewerApi.test.ts`: a signed-out form post goes back to its page. - `devServer.test.ts`: each dev person's own setting, and the route, which writes the file before it changes what shells read. - `executeConfig.test.ts`: a repo build's manifest records `shortcutSetting`. - `served-styles.test.ts`: the served styles' digest moved on purpose, for the one rule that keeps the dialog's tag whole. - **The browser tier** (`test/browser-tier1/shortcut-setting.spec.ts`): thirteen tests on published patches through the real shell and broker, as reviewed. That includes the committed 0.38 bundle (`hotkeys-0.38.html`), whose shortcuts still fire under this shell with Off stored, with no row and with the note. | Engine | Result | | --- | --- | | Desktop Chromium, `channel: "chromium"`, frame isolated, from a local config | 13 passed | | Chromium headless shell, as CI runs it | 13 passed | `hotkeys.spec.ts` and `focus.spec.ts` pass in both as well. Company patches put the setting's row first in the sheet's Tab order. The unnamed-frame test opens a public patch. - **The whole tier 1 suite** at this stack's top (`06476fe`), as `pnpm verify` runs it in CI's headless shell: 168 of 168. At the previous push, with #1302's desktop project as well, it also passed 168 of 168. - **The rollback rehearsal**, against the live release 41 (`7f93b91`): `7f93b91 → 06476fe → 7f93b91 → 06476fe`, all four steps passed in 116 s. It covers #1276's migration, and the live release serving a repo build that this head's CLI wrote with `shortcutSetting`. - `pnpm verify` at this head: format, lint, typecheck, synth, postgres-concurrency, cli-smoke, install, tier2-smoke and browser pass. `test` and `test (bun)` had 15 timeouts while the machine's load average was near 30. All 11 files rerun alone pass (216 tests), as does Bun's `PatchesApi` (63). The previous push's `pnpm verify` passed every step. The served shell's page state is exempt from the page-markup rules in `.oxlintrc.json`, and `shortcuts.ts` joins `stream-status.ts` and `downloads.ts` there for the same reason. - **Hit every surface.** - Wire contract: `docs/API.md` is regenerated and current. - CLI: README, the `patchy-hotkeys` project skill and the capability catalogue. No command, flag or exit code changed. - Dev loop: `docs/DEVELOPMENT.md` and the `patchy-dev-loop` skill. - Vocabulary: the Companies and patchy glossaries, and `docs/product.md`. - Served pages: the `ui-consistency` spec names the menu's switch, the dialog and note in the shell's exception, and `shortcuts.ts` in the lint exemption. - Reverse states: the switch turns it back on from both places. - Not applicable: migrations (#1276's), company resources and the repo layout. - **Not run on this head:** Firefox and WebKit. Firefox passed 12 of 13 before the port, the tier 2 test being Chromium-only. WebKit can't launch here, and CI has no WebKit. ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required The release that carries this carries the whole stack. Nothing needs action. A viewer's shortcuts stay on until they turn them off, and patches published before it behave as they did until rebuilt. Suggested `patchChanges` line for the release, beside #1279's: > patchy/hotkeys: a viewer can now turn single-key shortcuts off. Then a page-wide hotkey whose every step types a character, such as `A`, `G H` or `?`, fires nothing, while chords, named keys and hotkeys `within` an element still fire. Label those commands so the sheet keeps them as buttons, and write a key that belongs to one part of the page `within` it. `window.name` carries the setting and is Patchy's: don't set it. Landing note: #1276's migration is `0038_single_key_shortcuts`, above #1217's `0037_feedback`. If another migration lands first, it renumbers. - **What does a revert leave behind?** - `shortcutSetting: 1` in the manifests of repo builds published meanwhile. The release before reads stored manifests without refusing extra keys, and in the rehearsal it served a version that carried the field. - People's stored settings, from #1276. - Dismissed-note keys in browsers' `localStorage`. - A CLI of this release refuses to publish to an older instance before sending anything, as any mismatched release does. - **Does the release before it still work with that?** Yes. Its shell names no frame, so every shortcut is on, the sheet hides its row, and no note shows. Built by Claude Opus 5.5 (`claude-opus-5-5`) in Claude Code, through T3 Code. Co-authored-by: Claude Opus 5.5 <[email protected]>
… its own process Desktop Chromium runs a patch's sandboxed frame in its own process and Playwright's default headless shell keeps it in the shell's, so focus and keyboard checks could pass in CI and fail in Chrome (#1299, fixed on main by the relay's hello handoff in #1298). The tier 1 suite now runs desktop Chromium in new headless mode. One test whose accessibility helper can't see an out-of-process frame stays in the headless shell (#1306). Closes #1299 Co-Authored-By: Claude Opus 5.5 <[email protected]>
… its own process Desktop Chromium runs a patch's sandboxed frame in its own process and Playwright's default headless shell keeps it in the shell's, so focus and keyboard checks could pass in CI and fail in Chrome (#1299, fixed on main by the relay's hello handoff in #1298). The tier 1 suite now runs desktop Chromium in new headless mode. One test whose accessibility helper can't see an out-of-process frame stays in the headless shell (#1306). Closes #1299 Co-Authored-By: Claude Opus 5.5 <[email protected]>
… its own process Desktop Chromium runs a patch's sandboxed frame in its own process and Playwright's default headless shell keeps it in the shell's, so focus and keyboard checks could pass in CI and fail in Chrome (#1299, fixed on main by the relay's hello handoff in #1298). The tier 1 suite now runs desktop Chromium in new headless mode. One test whose accessibility helper can't see an out-of-process frame stays in the headless shell (#1306). Closes #1299 Co-Authored-By: Claude Opus 5.5 <[email protected]>
… its own process Desktop Chromium runs a patch's sandboxed frame in its own process and Playwright's default headless shell keeps it in the shell's, so focus and keyboard checks could pass in CI and fail in Chrome (#1299, fixed on main by the relay's hello handoff in #1298). The tier 1 suite now runs desktop Chromium in new headless mode. One test whose accessibility helper can't see an out-of-process frame stays in the headless shell (#1306). Closes #1299 Co-Authored-By: Claude Opus 5.5 <[email protected]>
… its own process Desktop Chromium runs a patch's sandboxed frame in its own process and Playwright's default headless shell keeps it in the shell's, so focus and keyboard checks could pass in CI and fail in Chrome (#1299, fixed on main by the relay's hello handoff in #1298). The tier 1 suite now runs desktop Chromium in new headless mode. One test whose accessibility helper can't see an out-of-process frame stays in the headless shell (#1306). Closes #1299 Co-Authored-By: Claude Opus 5.5 <[email protected]>
… its own process Desktop Chromium runs a patch's sandboxed frame in its own process and Playwright's default headless shell keeps it in the shell's, so focus and keyboard checks could pass in CI and fail in Chrome (#1299, fixed on main by the relay's hello handoff in #1298). The tier 1 suite now runs desktop Chromium in new headless mode. One test whose accessibility helper can't see an out-of-process frame stays in the headless shell (#1306). Closes #1299 Co-Authored-By: Claude Opus 5.5 <[email protected]>
… its own process Desktop Chromium runs a patch's sandboxed frame in its own process and Playwright's default headless shell keeps it in the shell's, so focus and keyboard checks could pass in CI and fail in Chrome (#1299, fixed on main by the relay's hello handoff in #1298). The tier 1 suite now runs desktop Chromium in new headless mode. One test whose accessibility helper can't see an out-of-process frame stays in the headless shell (#1306). Closes #1299 Co-Authored-By: Claude Opus 5.5 <[email protected]>
… its own process Desktop Chromium runs a patch's sandboxed frame in its own process and Playwright's default headless shell keeps it in the shell's, so focus and keyboard checks could pass in CI and fail in Chrome (#1299, fixed on main by the relay's hello handoff in #1298). The tier 1 suite's chromium project now runs desktop Chromium in new headless mode, every test in it; the firefox project still runs focus.spec.ts alone. Closes #1299 Co-Authored-By: Claude Opus 5.5 <[email protected]>
… its own process Desktop Chromium runs a patch's sandboxed frame in its own process and Playwright's default headless shell keeps it in the shell's, so focus and keyboard checks could pass in CI and fail in Chrome (#1299, fixed on main by the relay's hello handoff in #1298). The tier 1 suite's chromium project now runs desktop Chromium in new headless mode, every test in it; the firefox project still runs focus.spec.ts alone. Closes #1299 Co-Authored-By: Claude Opus 5.5 <[email protected]>
… its own process (#1302) ## What changed CI's browser tier ran Playwright's `chrome-headless-shell`, which keeps a patch's sandboxed frame in the shell's process. Desktop Chrome gives it its own process. That's how #1299 shipped: in desktop Chrome a patch didn't hear the keyboard until clicked, while CI was green. #1298 fixed #1299 on `main`. This PR moves the tier 1 suite's `chromium` project to desktop Chromium, so a focus or keyboard bug that only Chrome shows fails CI. It no longer holds anything back: every test in the suite runs in desktop Chromium. #1407's `firefox` project still runs `focus.spec.ts` alone. Closes #1299 ## Look at **`playwright.tier1.config.ts`.** The `chromium` project sets `channel: "chromium"`, the full build in new headless mode, and #1407's `firefox` project sits beside it unchanged. The headless-shell hold-out is gone. #1406 fixed the local-hotkeys test's accessibility helper, which couldn't read an out-of-process frame, and the test now passes in desktop Chromium. `pnpm test:browser` runs `chromium`, as on `main`, so `package.json` doesn't change. **What landed first.** In desktop Chromium on CI, `switcher.spec.ts` failed often (#1402). #1412 fixed that on `main`, with one real desktop-Chrome focus race fixed in the shell's broker and switcher tests that acted too early. One of #1412's tests, the tab switch in `switcher.spec.ts`, skips in the headless shell, which keeps every tab focused. It starts running on CI with this PR. **The frame really is out of process.** CDP's `Target.getTargets` lists it as its own `iframe` target in desktop Chromium, and not in the headless shell. ## How it was verified - **On CI at this head, `a92a7f1`:** the `browser` job passed twice in a row. Each time desktop Chromium passed 180 and Firefox 8, with none failed or skipped. The local-hotkeys test and the tab-switch test ran in desktop Chromium. - **Locally:** the local-hotkeys test passed 3 of 3 in desktop Chromium, and the Firefox project 8 of 8. - **Earlier heads, stacked on #1412 before it merged:** - Five passes in a row at its first head, and two or three at each later one. - One failure was the #1377 flake, since fixed on `main` by #1414. - One `test (bun)` failure was a `Fleet.test.ts` clock-step case, which passed on rerun. - The other failures were gaps in #1412's own fix, each fixed in #1412. - **CI cost.** No new download. `playwright install chromium` without `--only-shell` already puts both Chromium builds in Chromium's cache entry, and the action's comment says why it stays that way. - **Not checked:** headed Chrome on a real display. New headless is the same browser build and runs the frame out of process, as the target count shows. Hit every surface: - **Dev loop docs:** `docs/DEVELOPMENT.md` says the browser job runs desktop Chromium with `focus.spec.ts` also in Firefox, and that a script launching its own browser for a focus check passes the same channel. The CI job's and the Playwright action's comments say the same. - **Doesn't apply:** served pages, the wire contract, the CLI, vocabulary, migrations, company resources, reverse states and the repo layout. ## Release impact Tick exactly one. - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required. Test and CI configuration and doc lines; nothing ships. - **What does a revert leave behind?** Nothing. CI goes back to the headless shell. - **Does the release before it still work with that?** Yes. Built by Claude Opus 5.5 (`claude-opus-5-5`) in Claude Code, through T3 Code. Co-authored-by: Claude Opus 5.5 <[email protected]>

What changed
A patch's frame holds keyboard focus, so Patchy never heard Mod+Shift+K pressed inside a patch, and any listener of the patch's could take it. Some browsers use the chord destructively: Zen closes every unpinned tab on it. Now the key reaches neither the patch's code nor the browser, in every patch at every version ever published, single-file pages included, and on Patchy's own pages, shells and notices from their first byte. Nothing opens yet; the menu is #1270.
How:
window, registered before any other script. ItpreventDefaults and stops a trusted press, including mid-composition and on autorepeat. It asks for the switcher only on a press that isn't a repeat or an input method's (packages/core/src/switcher/key.tskeeps claims and activates apart).<head>(withSwitcherRelayfrom@patchy/serving/shell). It goes in after the digest check and before compression, so stored artifacts and digests are unchanged and one cached body still serves every viewer.patchy devserves the same. The place comes from the bounded parse5 parser, which stops as soon as it knows (headStartinhtml-policy.ts): just past an explicit<head …>, so its attributes survive, or else where the parser would imply the head, always past the BOM, comments, the doctype and<html …>. A document that ends inside an unfinished comment, tag or attribute value gets the relay at the end of its last finished token, so the relay is never swallowed.<head>: everyhtmlPage(app pages, doors, notices, the 404) and every patch shell (company, public, local). Each one's CSP admits it by one'sha256-…'source, generated beside the script: the shell CSP with and without Clerk, everypageResponsebranch and the notice CSP. A patch's own content CSP takes no hash, which would switch its'unsafe-inline'off.{ patchy: "switcher", v: 1, kind }window messages, apart from the broker's MessageChannel and carrying no authority.hellolets the frame take focus. The broker no longer does that at mount: until then the frame is hidden (data-waiting), so neither a click nor Tab can focus its empty first document, and the shell's own relay holds the key.load. The relay at the top of the shell shows the frame, not the broker: it ships in the same response as the markup, so a broker from another release can't strand it. A frame whose content never arrives stays hidden, with nothing in it to reach, and there is no deadline that could reopen the hole on a slow load.openopens the switcher at company scope and logs one console line; on a public shell it is ignored. When a switcher closes,closedputs focus and the selection back.@patchy/core/switcher):window.patchySwitcherisundefined, ortrueonce anything asked for it: one pending request to open, however many presses or frame messages made it.window.patchySwitcheris an object{ open, toggle }(theSwitcherinterface). The menu installs it as it starts and opens at once if it foundtrue.openSwitcher(window)callsopen, which opens and leaves an open menu open, or recordstrueuntil a menu loads. It is all a frame can ever reach.toggleSwitcher(window)callstoggle, which closes an open menu and opens a closed one, or recordstrueuntil a menu loads. Only the relay at the top of a page calls it, on the chord pressed in that page's own document; with the menu open, its focus keeps the press there.open(fromframe.contentWindow, origin"null", at company scope) the broker callsopenSwitcher(window), nevertoggleSwitcher. Public scope ignores it; local scope only logs.scripts/build-core-scripts.mjs→ gitignoredpackages/core/src/generated/). It runs from core's build and test, rootprepareandtypecheck, every vitest run andpnpm dev, and it is a Turbo input and output. It takes a list of outputs, so feat(core): Mod+Shift+K opens Patchy's switcher #1270 addsswitcher.jsas one more entry.Closes #1268
Look at
The relay holds the key against a patch listening everywhere (
test/browser-tier1/switcher-relay.spec.ts). The patch has its own capture listener first in its<head>, a document listener, a field listener and anonkeydownattribute. WithwithSwitcherRelaymade a no-op, the four tests that need it fail, and the two that test the shell and Patchy's own pages still pass:With the relay in, all six pass, and so do the four
focus.spec.tscases.Sol's rounds 1 and 2, each test red on the code before its fix and green now:
about:blankand the chord went uncancelled:[false, undefined]where[true, true]was expected.{ open, toggle }installed, two chord presses in the frame and a postedopenleave it[true, true, true]; the shell's own press then toggles itfalse.<!doctype html><!-- unfinishedand<!doctype html><html lang="enboth run the relay: a later listener hearsabut neverK, and the shell getsopen. Seven newheadStartcases (unfinished comment, near-closed comment, bogus comment, root tag, attribute value, head tag after a comment, doctype) failed on the old code.src, as an old one would, framing relay-less content: the shell's relay still shows the frame on its load.The chord equals TanStack's matcher.
key.test.tsholds activate equal toisTrusted && !repeat && matchesKeyboardEvent(event, "Mod+Shift+K")under the repo's patched@tanstack/hotkeys(now a core devDependency). It covers 26 presses on mac, windows and linux: US, Dvorak, remapped J on the K key, Cyrillic, AZERTY, symbols, dead keys, AltGr both ways, wrong modifiers, repeat, composing, Process, Unidentified, keyCode 229 and untrusted. A second table checks that composing and repeat presses are claimed but never activated.The relay is about 2.4 KB raw, 1.06 KB brotli, larger than the issue's 0.5 KB estimate. Most of that is the focus and selection restore #1270 relies on, and the top-level frame release.
How it was verified
pnpm check: format, lint, typecheck and synth pass. The offline tests fail only where the CLI stub servers get a strayGET /from a local port probe and where npm is missing beside the machine's Node. The same files fail the same way onorigin/mainon this machine (cliLifecycle, cliPublish, cli, cliRepoRecovery, install, Supervisor), and the set changes from run to run. CI is the arbiter.pnpm verifyunder the shared lock: format, lint, typecheck, synth, postgres-concurrency, tier2-smoke and browser (the whole tier 1 Playwright suite) pass.GET /in CLI stub servers, plus execution tests that time out or fail on the base too. Supervisor, PatchesApi and IMAP Runtime pass alone.switcher-relay.spec.ts(10) andfocus.spec.ts(4) pass on the latest commit, plus the mutation and red runs above.switcher-relay(10),focus(4) andstarting(7) browser specs pass under the shared lock.pnpm checkgives the same picture as after round 1, plus a PGlite metering test that timed out under load and passes alone.pnpm checkunder the shared lock: format, lint, typecheck and synth pass. The offline tests fail only in the same stub-server and npm files as before (cliLifecycle, cliLook, cliPublish, cliRepoRecovery, cli, install). The affected unit suites (core, serving, authpage,devServer, server) pass: 286 tests.headStartover 15 shapes, parsed back with parse5 to check the mode, root and head attributes are unchanged and the marker is the head's first child, plus the parser-bound fallbacks),withSwitcherRelay, the hash being the exact script text's, and the relay's source in every CSP above. Pages' BOM, compression and content-bytes tests now expect the stored bytes plus the relay. The BOM still leads.--ignore-scripts, so nothing was generated, thenpnpm --filter "@patchy/core..." build. It generatedsrc/generated/relay-script.tsand compileddist/switcheranddist/generated. The@patchy/server...build and the packed CLI build then passed, and the packed CLI'sdistcarries the relay and the broker's line.Mod+Shift+K is Patchy's switcher key; it never reaches the patch's own code.Hit every surface:
patchy devserves the relay. README and GLOSSARY updated; no command, flag or exit code changed, so ADR-0004 is unchanged.patchy-hotkeysandsdkCapabilities.tsupdated.pnpm devbuilds core's scripts after the broker.docs/DEVELOPMENT.mdupdated.docs/product.mdand the README layout updated. ADR-0010 gains "The switcher relay": the one inserted script and the one authority-free window message. ADR-0006 no longer says shells never run inline script.ui-consistencyspec now names the hashed relay as the one inline script.bundleCheck.tsis unaffected, since the relay is added at serve time, not in the bundle.packages/api), migrations, company resources, reverse states and the repo layout.One departure from the issue: the guard and the relay are one script. At the top of a page it records the request for that page's switcher; in a frame it posts to the shell. Framed notices (a non-200 at a content URL runs under the content sandbox policy) therefore carry the relay with nothing extra, and every first-party page claims the key, doors included. Their CSPs gained one hash source each. The content sandbox policy already allows inline script, so framed notices need no hash, and adding one would switch
'unsafe-inline'off.Release impact
Serving adds a script to the bytes it sends and the CSPs that allow it. No CLI behaviour, API, schema or configuration changes.
load, and the key reaches the browser as it does today.Built by Claude Opus 5.5 (xhigh) in Claude Code, orchestrated from T3 Code.