Repository navigation
fix(serving): members get the switcher on their company's public patches - #1339
Conversation
A public patch's current version was served as the public shell to everyone, signed in or not, so a member who opened their own company's public patch could not open the switcher there, or leave it with the key. Its address is now the company page for its own signed-in members: private, no-store, with their switcher and session, recording the open. Everyone else keeps the public page. The address follows a handshake Clerk starts for a session the browser holds, so a member whose token lapsed comes back recognised, but never a development instance's set-up of a new browser, and a content URL never starts one. A public page now carries Clerk's cookies, which keeps it private, and varies by Cookie while cacheable. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sol review (round 1)CHANGES REQUESTED
Validation: all 88 tests in the four requested Vitest files passed. The switcher browser case and existing real-session case passed. Two separate browser reproductions failed the expected preservation assertions above. Browser runs used the requested shared lock. No repository files were edited. Reviewed by GPT 6.1 Sol (xhigh) in Codex, orchestrated from T3 Code. |
… on top The first round served a public patch's own members a company shell over the public version. Its stream stopped the publicly readable page when their session ended, and its pinned principal was overwritten by the public version's null `me()`, so sharing back to company made the next call `principal_changed`. The member now gets the same public shell everyone reads, unpinned and with no stream, with their switcher and the session's scripts on top, private and no-store, still recording the open. The shell says `data-switcher` on its frame when it loads one, and the broker opens the switcher on that; the switcher takes the shell's frame wherever it loads. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks. Both findings came from one choice in round 1: a public patch's own member got a company shell over the public version. I changed that shape instead of patching the two sites (head A member now gets the same public shell every reader gets:
Kept from round 1: the handshake kinds (follow
Built by Claude Opus 5.5 (xhigh) in Claude Code, orchestrated from T3 Code. |
Sol review (round 2)CHANGES REQUESTED Round-1 findings:
New finding:
Validation: 271 targeted Vitest tests and all 60 tests in Reviewed by GPT 6.1 Sol (xhigh) in Codex, orchestrated from T3 Code. |
Every handshake reason but `dev-browser-missing` counted as `session`, so a public address followed Clerk's development-only, cookie-free hops: a `__clerk_db_jwt` link bounced an anonymous reader through Clerk, and a `__clerk_redirect_url` link sent them to whatever site it named. A handshake is now `session` only when the request carries Clerk's evidence of a session, a session token or a signed-in client, and Clerk isn't setting up or syncing the browser itself. Everything else that isn't a verified return is `browser`, which public pages ignore. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks. Fixed in [P2] Do not classify anonymous browser-sync hops as session handshakes: resolved.
Everything else that isn't a verified return is Tests:
Ran on a loaded machine, targeted as asked:
ADR-0006's handshake line now says the same. Built by Claude Opus 5.5 (xhigh) in Claude Code, orchestrated from T3 Code. |
Sol review (round 3)APPROVE Round-2 finding: resolved. Both cookie-free reproductions now return the cacheable public 200: New findings: none. The evidence check reads both cookie families, rather than duplicating Clerk 3.23's selection rules. It therefore includes the evidence from whichever family Clerk selected. When Clerk selects a signed-out family, its signed-out result prevents stale evidence in the unused family from creating a session redirect. Checked plain and suffixed lapsed tokens, active clients without tokens, newer-token precedence, explicit sign-out and foreign-instance cookies, with both development and production-key offline fixtures. No session-recovery misclassification reproduced. Company pages still follow every handshake. An additional in-memory check covered browser setup, both development sync hops with and without signed-in cookies, and an expired session; redirects and cookie directives were preserved. ADR-0006's handshake wording matches the implementation. Validation: all 105 tests in Reviewed by GPT 6.1 Sol (xhigh) in Codex, orchestrated from T3 Code. |
Acceptance: PASS with notesChecked Setup: a Done means
Transcript excerpts, base → head (
|
…ing onto #1339 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ing onto #1339 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ly again (#1375) ## What changed Someone made a tier 1 patch public, switched it back to company 23 seconds later, and reopened it. Every save then failed with "Runtime request refused: principal_changed." Production served a public page as `public, max-age=60` to members too, so for a minute their browser started its kept copy of the public page. The kept copy's `me` named them, because the patch was company again, so the page enabled its buttons. But a public shell binds no principal, so every data call was refused. On a public frame that refusal shows no notice, so the page simply looked broken. #1339, merged and not yet released, stops caching a member's public page, which closes the path production took. This PR is the backstop for any other copy a browser keeps, such as a page restored by a proxy or an older cached response. A public shell never hands its patch a viewer. If its first `me` names someone, the patch is no longer public, so the shell reloads the address and the person gets the company page. Refs #1373 (refused calls count against no limit, which let that tab send about 60,000 of them in under an hour). ## Look at **`identify()` in `packages/serving/src/broker.ts`.** A company shell pins the viewer from `me`, as before. A public shell now treats a non-null `me` as a sign that it's stale: it releases the reply's bytes, stops the broker, removes the frame and reloads, and the patch's call fails as a lost request rather than resolving. Runtime answers a public version's `me` with null and the broker caches `me` per document, so only a document that starts after the sharing change reaches this branch. **What it leaves alone.** A public tab that is already open when the patch goes back to company keeps #1339's contract. It keeps its page and draft, and the patch sees `principal_changed`, as `stream.spec.ts` "a member's public patch that goes back to company refuses the patch, not the page…" still checks. I tried reloading on that refusal too and backed it out, because it would throw away a draft that #1339 keeps on purpose. ## How it was verified - New browser case in `tier1.spec.ts`, "a kept public copy that starts after its patch went back to the company reloads as the company page". It serves a page the test kept from when the patch was public, after sharing goes back to company. On main's broker it fails: the page stays the public shell, and while diagnosing I saw the patch get the viewer from `me` and its table calls refused `principal_changed`. With this change it passes: the page reloads as the company shell, `me` names the viewer and a table call lists. ``` Error: expect(locator).toHaveAttribute(expected) failed Expected: "company" Received: "public" 1 failed ``` - The tier 1, stream, pinned-viewer, switcher and switcher-relay browser specs pass on the rebased head: 83 passed. - `bun fmt --check`, oxlint, `pnpm typecheck:tests` and the serving package's `effect-tsgo tsc` pass. - The ADR-0010 public-shell paragraph says the shell never gives its patch a viewer. ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — shell script change; the server and wire are unchanged - **What does a revert leave behind?** Nothing. Shells rendered by this release carry the new broker; after a revert, pages render the old one. - **Does the release before it still work with that?** Yes. Written by Claude Opus 5.5 in Claude Code, running in T3 Code. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…d once (#1376) ## What changed This adds release 41's What's new entry, written from `a25a9c5`. It covers everything merged since release 40's `through` (`08e1fd9`), and sets the `patchy` release to `0.41.0` in `packages/patchy/package.json` and `CURRENT_RELEASE`. It ships the UI overhaul together with #1204, the terms prompt, as one release, at Allison's word. | Change | PRs | | --- | --- | | Improved: Patchy has a new look | #1332, #1336, #1338, #1343, #1353, #1354, #1369, #1372 | | New: Accept updated terms once | #1204 | | Improved: Settings holds People, Integrations and Agent access | #1334, #1341 | | Improved: Home starts with what needs you | #1344, #1353 | | New: A blue dot marks patches you haven't opened | #1370 | | Improved: A patch's page has one header and tabs | #1345 | | Improved: Search lands on All patches | #1346, #1353 | | Improved: Inviting and deactivating people is clearer | #1349 | | Improved: Your agents shows what's connected | #1352 | | Improved: Integrations use plain words | #1347, #1351 | | Improved: Agents and integrations show their own logos | #1371 | | Improved: What's new goes by month | #1350 | | Fixed: ⌘⇧K works on your company's public patches | #1339 | | Fixed: Saving works after a patch stops being public | #1339, #1375 | | Behind the scenes: every page built from one set of parts, with a check | #1338, #1354 | | Behind the scenes: agents know a once-public page's refusals mean reload, and retries wait and stop | #1374 | | Patch changes: a kept public page reloads into the company page; check retries wait and stop | #1375, #1374 | #1337 is release 40's own entry. #1340 (routes split, plus the call summary Home and All patches show) and #1342 (the `dense` dev scenario) need no line of their own: the call summary is part of the Home and All patches changes, and the scenario is tooling. The overhaul makes no patch changes. Running patches keep their own styles, which #1332 pins, and the only SDK change is the wording of two error messages' admin addresses. ## Look at - **The entry**, at the top of `releases` in `packages/core/src/whatsNew.ts`. - **Rollback safety, from the live commit `d3d32da` (release 40) to this PR's merge:** - **#1334 is `one-way`.** Your agents and Settings moved to `/agents` and `/settings/…`. Old addresses redirect forward, but release 40 serves none of the new ones. This release's CLI hints, the `patchy` skill on `main`, and the API, MCP and publish hints all name the new addresses, so on release 40 they'd answer 404. - **#1372 needs the private font bucket**, and that's done. Its deploy step fetches the pinned Cabinet Grotesk file and checks it before recording anything. The bucket was created on 2026-11-10 and holds the pinned bytes. A rollback to a commit from before #1372 pins no font and builds as before. - **#1204** adds migration `0036_terms_acceptances`, an additive table that release 40 never reads. Release 40 doesn't prompt, and coming forward again asks only people who hadn't accepted. Not `one-way`. - **#1375** changes only the public shell's script, and #1374 is skill text. Release 40 renders its own shell and serves its own skills. - **#1370 and #1339** add rows to the existing `patch_opens` table (a guest's opens, and members' opens of public patches). Release 40 reads them like any other open. - **Everything else** is pages, styles, copy and docs: no migrations, and no API, `--json` or configuration changes. - **patchy-web #53**, the website line #1371's logos needed, is merged (771e6d9). **Rollback line:** Rolling back past #1334 would break every `/agents` and `/settings/…` link that this release's CLI, skill and hints hand out, because release 40 answers them with 404. Fix forward instead. ## How it was verified - **Tests:** the `packages/core` What's new test passes (5), the `packages/api` suites pass (64), and the three files are formatted. - **The range.** Each of the 22 overhaul PRs was: - reviewed by GPT 6.1 Sol at xhigh, with every finding fixed or declined in writing on the PR; - accepted on its final head by an agent that didn't write it; - merged green, by a merge train that rebuilt each PR's accepted tree on main's tip and checked that main's tree matched it after every merge. - **#1339, #1375, #1374 and #1204** were each Sol-reviewed and accepted, and merged on their own: #1339 before the train, the other three after it. #1204's acceptance was rerun on the new sign-in pages. ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required The changelog entry and the release version only. - **What does a revert leave behind?** Nothing. CLIs installed from this release report `0.41.0` and are told to match the server, as at every release. - **Does the release before it still work with that?** Yes. Changes made by Claude Opus 5.5 in Claude Code, running in T3 Code. Co-authored-by: Claude Opus 5.5 <[email protected]>
…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]>

What changed
A signed-in member who opened their own company's public patch got nothing from ⌘⇧K. A public patch's current version was served as the public shell to everyone, signed in or not, and the public shell has no switcher. So the patch was in their menu but they couldn't leave it with the key. A member of the patch's own company now gets the same public page as everyone, with their switcher and session on top. It is private and no-store, and their open counts on Home. The page underneath is the one every reader gets: it pins no viewer and opens no stream, so a session that ends or a sharing change never stops it. Everyone else still gets the bare public page: signed-out readers, link unfurlers, people at other companies, the patch's guests, people with no company and deactivated accounts. Another company's public patch still never enters anyone's list, and
/switcher.jsonis unchanged.Part of #1091
Look at
The key on a member's public patch. Allison makes Brightline's kickoff brief public, opens Kudos and then the brief, and presses ⌘⇧K. Before, nothing opens. After, Go to… opens with Kudos lit and This patch below it, and ↵ goes back to Kudos.
Flow
public-patch-switcher, as Allison Mahmood (admin)Before is
d3d32da(where this branch left main) and after isf0edc3c(fix/switcher-public-patches), both on thebrightlinescenario, frompnpm dev film.waitFor: Timeout 5000ms exceeded.Before is on the left, after on the right.
side-by-side.mp4
Switcher on top, public page underneath. In
Pages.servePatch,viewernow says whom a page is rendered for: a company page's admitted viewer, or a public patch's own member at its address. The member's shell keepsscope: "public", so the broker,me(), principal and stream behave exactly as for any public reader.vieweradds the switcher (their user and company), the session's scripts and the CSP that admits Clerk, takes the page off the public cache, and records the open. The shell marks its framedata-switcherwhen it loads one, and the broker's frameopenuses that mark. Company scope still counts too, so a company shell rendered by the release before keeps working during a deploy. The switcher takes the shell's frame wherever it loads. A public shell rendered for no one is unchanged.Handshakes on a public address. Clerk's session tokens last a minute, so a member arriving from a link in Slack or mail usually has a lapsed token, and a public address never started a handshake. The address now follows one when Clerk starts it for a session the browser already holds (
Session.Handshake"session"), so the member comes back recognised. "Holds" means Clerk's own evidence: a session token or a signed-in__client_uat. Everything else that isn't a verified return is"browser", which public pages ignore. That covers a handshake for a browser without a session and Clerk's work on the browser itself: setting up a development browser (dev-browser-missing,dev-browser-sync) and syncing it (primary-responds-to-syncing,satellite-needs-syncing). In dev, a link alone can ask for any of those, and the sync hop redirects off-site. A content URL never starts one. Every other outcome ends on the public page: a failed sign-in, another company, a guest, no membership or a deactivated account. Clerk stops after three handshakes in two seconds, so this can't loop.Cookies and caching. In production, Clerk verifies a handshake return without a cleanup hop: the return is a plain sign-in carrying the cookies that finish it. The public page used to drop those cookies, so a non-member's session never settled. It now carries Clerk's cookies, except a handshake's own when it didn't follow that handshake. A public page that sets a cookie is
private, no-store. While cacheable, the public address sendsVary: Cookie, so a browser or proxy never hands a member the copy it kept from when they were signed out.How it was verified
Serving cases (
Pages.test.ts):data-scope="public", nodata-viewer-id,data-switcher). It carries their switcher and the session's scripts, isprivate, no-storeunder the CSP that admits Clerk, and records the open. The content URL stayspublic, max-age=60.public, max-age=60withVary: Cookieand noSet-Cookie, goes to everyone else: signed out (with and without Clerk's dev browser), another company, no company, deactivated, and the patch's guest.__patchy_shell_reloadmakes it private./~v/2(current) is public./~v/1(older) is unchanged: 401 signed out, 404 for an outsider, the company shell for a member.?__clerk_db_jwt=…or?__clerk_redirect_url=https%3A%2F%2Fexample.com%2Fget the cacheable public 200: no redirect, noSet-Cookie.Session.test.tsclassifies Clerk's real reasons, read off its redirects:browser:dev-browser-missing,dev-browser-syncand the sync hop, cookie-free and with a fresh session alike.session: an expired token,client-uat-but-no-session-token,session-token-iat-before-client-uatandprimary-domain-cross-origin-sync.render.test.tscovers the shell's three cases: a member's public shell, a company shell and an anonymous one. Mutation-checked: dropping the address's handshake, following dev-browser handshakes, letting content start one, keeping an unfollowed handshake's cookies, dropping cookies on the public page and droppingVaryeach fail a case.Sol's two findings, as browser cases in
stream.spec.ts. Both fail on the first round's head and pass now.principal_changed, as a signed-in public reader's tab does on main, with no notice and the draft kept. The first round gave the SDKunknown_outcomebehind a "Your account changed" notice.Switcher (
switcher.spec.ts): a member flips back from their company's public patch with ⌘⇧K ↵, This patch included. Signed out, and as the patch's guest, the shell loads no switcher and the patch keeps every key.Round 3 (
4178f9f7, on a loaded machine, so targeted runs as asked):pnpm check: format, lint, typecheck and synth pass.scripts/devplan.test, which trips on a stray empty/tmp/.giton this machine and is untouched here.stream.spec.ts,switcher.spec.tsandswitcher-relay.spec.tspass 60/60 under the shared lock.Round 2 (
f0edc3c), the full runs below.pnpm verify(under the shared lock): format, lint, typecheck, synth, postgres-concurrency, cli-smoke, install and tier2-smoke pass.GET /to its foreign stub. Rerun,pnpm test:browserpassed 116/116.testandtest (bun)failed on a heavily loaded machine. Every file outside the CLI stub-server suites passed when rerun; those suites get a strayGET /from local port probing. CI is the arbiter.Not checked: a production Clerk instance end to end. Its verified return is a sign-in carrying cookies, the same shape the renewed-session cases exercise.
Hit every surface:
docs/product.md; the portal, patches and serving glossaries; ADR-0006; ADR-0010; theserving-headers.tsheader; DEVELOPMENT's serving check.ui-consistencyspec.Release impact
Tick exactly one.
Serving only: what a public patch's own members get on top of its page, which handshakes its address follows, and its cache headers. No schema, configuration, CLI or API changes.
patch_opensrows for public patches that members opened while it was live, and thepatch.first_openedevents already reported for them. Nothing else: no new cookies, columns or contracts.Built by Claude Opus 5.5 (xhigh) in Claude Code, orchestrated from T3 Code.