Repository navigation
feat(serving): notices carry the switcher - #1307
Conversation
Sol review (round 1)CHANGES REQUESTED
Validation: all 60 focused serving tests and the new Chromium notice case passed under the shared lock. The scenarios above were checked separately on a throwaway offline instance. No repository code was changed. Reviewed by GPT 6.1 Sol (xhigh) in Codex, orchestrated from T3 Code. |
13c228f to
f2decd4
Compare
|
1. Needs-rebuild takes the handshake path: declined. That 307 comes from the patch address's own admission, which this PR doesn't change. A company address has to know who's asking before it says anything about the patch, a notice included, and on a top-level load that has always meant Clerk's handshake. Clerk returns to the same address, and the needs-rebuild notice then renders with the fresh session and the switcher. The notice adds no redirect of its own, and a visitor who can't be verified still gets the ordinary door. 2. The flip returned to the same notice: fixed in f2decd4. A needs-rebuild notice's switcher tag now names its patch ( 3. Verified handshake cookies were dropped: fixed in f2decd4. |
Sol review (round 2)APPROVE No findings in this PR's own diff against
Validation: 409 focused tests, 25 Chromium tests and 20 additional offline adversarial checks passed. No code changed. Reviewed by GPT 6.1 Sol (xhigh) in Codex, orchestrated from T3 Code. |
ff12df6 to
0e598f2
Compare
f2decd4 to
d18e9c3
Compare
0e598f2 to
e72f3d4
Compare
d18e9c3 to
a042c5c
Compare
Acceptance: PASS with notesChecked I drove both notice kinds as each kind of person with Playwright, in Chromium and Firefox, on fresh Done means
The rest of the brief
Golden journeys
Rollback answers: they match the diff. Nothing is stored. There's no migration, and no change to Not run
Notes
|
b785ac4 to
2a2935d
Compare
A person stopped on a Patchy notice, such as a revoked version or a replaced document, had no way out but the address bar: notices ran no script but the relay, so Mod+Shift+K was claimed and nothing opened. Top-level notices now read the session without ever answering for the page. An active signed-in viewer gets their switcher and the session's scripts, under a notice CSP extended by exactly those sources. Signed out, a handshake Clerk wants, no membership or a deactivated account all get the notice as before; it never redirects. The needs-rebuild notice at a company address uses the viewer admission already found. Public pages and framed notices keep the relay alone. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t can't open Two gaps Sol's review found in notices carrying the switcher. A handshake Clerk verified, returning to a notice, became a plain notice that dropped the cookies completing it. Session now returns a verified return's claims, and a notice admits them at once with those cookies, still without Clerk's cleanup hop. A handshake Clerk wants to start is still no one, and its cookies are still dropped. On a patch's needs-rebuild notice, the menu lit that same patch, so Enter went straight back to the notice. The notice's switcher tag now names the patch, which the menu treats as the one on screen, as a company shell's frame does: never a row, the flip goes to the patch before it, and This patch is offered by the same rule. Co-Authored-By: Claude Opus 5.5 <[email protected]>
a042c5c to
cfe2b53
Compare
## 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]>


What changed
When Patchy stops a patch, it shows a notice: a revoked version, a document another tab replaced, a patch that needs a rebuild. A person stopped there had no way out but the address bar. Notices ran no script but the switcher relay, so Mod+Shift+K was claimed and nothing opened. Now a signed-in person opens Go to… on any notice and leaves. A signed-out person sees the notice as before.
How:
Door.noticeViewer):/~shell/notice/:codereads the session but never answers for the page. An active member or guest gets the notice with their switcher tag, then the session's scripts, so Clerk keeps the cookie fresh, plus any cookies Clerk set on the way. A handshake Clerk verified on the way back is admitted the same way, with the cookies that complete it, and without Clerk's cleanup hop;Sessionnow returns a verified return's claims. Everyone else gets the notice with no viewer: signed out, a stale session Clerk would want to start a handshake for, signed in without a membership, deactivated, or the sign-in service down. The notice never redirects. The cookies of a handshake Clerk wants to start belong to its redirect, so they're dropped.data-patch), which the menu treats as the one on screen, as over a company shell: never a row, the flip goes to the patch before it, and This patch is offered by the same rule. A public patch's notice stays viewer-free, and so does a framed notice (needs-rebuild at a content URL), which keeps the relay alone.noticeContentSecurityPolicy) is the notice's own policy plus'self'script and connect, Clerk's Frontend API host for both, andworker-src blob:. Only a viewer's notice gets it; everyone else's keeps the relay-only policy.private, no-store, so one viewer's notice never reaches anyone else.Closes #1271
Look at
A notice as a signed-in person, on
brightlineas Allison. She was in Spend Requests, then a notice says another connection replaced New Business's document. On #1304's head (ab55b42), ⌘⇧K is claimed and nothing opens. Now Go to… opens over the notice with Spend Requests lit and every place listed. There's no This patch, since no patch is on screen, and ↵ goes back.Before: the same notice after ⌘⇧K
The flow on both sides, before on the left. Before stops where the menu should open:
side-by-side.mp4
How it was verified
Pages.test.ts, two new cases. "As anyone" means byte-for-byte the notice rendered with no viewer, under the relay-only CSP./~shell/notice/:code:Locationand no cookies. A mutant that passes the handshake's cookies through fails this.principal_changedkeeps its Sign in link for a viewer.shell-headers.test.ts: the viewer's notice CSP admits'self', Clerk and the relay. Apart from script, connect and worker, it is exactly the notice policy.render.test.ts: the switcher tag comes before the session's scripts, with no new inline script.test/browser-tier1/switcher.spec.ts, two new cases, and all 11 pass:switcher.jsnor/switcher.json.docs/product.mdand the Portal glossary needed merging by hand; CI is the check on the rebased head). Earlier, on the head rebased onto feat(core): Mod+Shift+K opens Patchy's switcher #1304'se72f3d40:switcherandswitcher-relaybrowser specs pass under the shared lock, 28 of 28, both notice cases included.pnpm verifyunder the shared lock, with mise's Node 24 first on PATH: format, lint, typecheck, synth, postgres-concurrency, cli-smoke, install, tier2-smoke and browser pass. Browser is the whole tier 1 suite, 113 of 113.LocalTaskProvider's, heard a strayGET /from a local port probe.Supervisor's "does not reap active calls" times out at 20 s. That case answers the last request its local listener heard, so a stray request leaves the real call waiting. Alternating three runs alone on feat(core): Mod+Shift+K opens Patchy's switcher #1304's tip and on this head, it failed the same on both, 3 of 3, at a load average near 1.Hit every surface:
ui-consistencyspec says which notices load the switcher and the session's scripts, and what their CSP admits.docs/product.mdinclude notices. ADR-0006 says a notice reads the session but never redirects: it never starts a handshake, and takes a verified return without the cleanup hop.Release impact
Notices gain scripts and a wider CSP for a signed-in viewer only. No API, CLI, schema or configuration change.
patchy.switcherentry a notice wrote tosessionStorageis the one feat(core): Mod+Shift+K opens Patchy's switcher #1304's pages already write.Built by Claude Opus 5.5 (xhigh) in Claude Code, orchestrated from T3 Code.