Repository navigation
feat(patches): tier 0 is gone; existing pages are tier 1 - #1048
Conversation
d400586 to
6a0d3ec
Compare
1d53fee to
bc2b7d2
Compare
6a0d3ec to
0b16796
Compare
bc2b7d2 to
8309978
Compare
0b16796 to
e4a6ad1
Compare
e4a6ad1 to
f3afd1b
Compare
Stored tier 0 versions, deleted patches' included, become tier 1 in their column, manifest and replayed receipt, and the tier CHECK narrows to 1-3. The manifest's and publish response's tier is 1, 2 or 3. The server drops PATCHY_MAX_HTML_BYTES; every shell frames its version's content URL, so the srcdoc path and the static CSPs go. The CLI refuses a config still at tier 0 with how to move it, and clears a pending tier 0 attempt an older CLI saved, saying to check patchy list. validateHtml and its accept/reject fixtures go; isPage is tier 1. Co-authored-by: Claude Opus 5.5 <[email protected]>
f3afd1b to
b55f247
Compare
Acceptance: PASS with notesChecked The data. Release 23's code (
The same CLI left one tier 0 publish unconfirmed, through a proxy that dropped the POST. That data then ran, with no reseed of patches:
Done means (#986, this PR's part)
Golden journeys
Rollback to R2 and R25: passed. R2 and R25 each started on the migrated data, past ledger id 29. On it, each:
Neither server logged a check-constraint error. Back at the head, every page served again, and nothing re-migrated. The same script also passed at Rollback answers: they match the diff. A revert leaves the migrated rows and the narrowed CHECK. R2 and R25 read those rows, write only tier 1 and refuse a tier 0 manifest before any write. Going without Not run
Notes
|
…#1071) ## What changed This adds release 26's What's new entry, written from `eabf2e6`. It covers everything merged since release 25's `through` (`18b39ae`) and sets the `patchy` release to `0.26.0` in `packages/patchy/package.json` and `CURRENT_RELEASE`. This is the last of three releases for #986: every tier 0 page becomes a tier 1 page, and tier 0 is gone. | Change | PRs | | --- | --- | | Behind the scenes: older pages published from a single HTML file now run the same way as new ones, so Patchy has one kind of page instead of two | #1048 | There's no announced change. Readers see the same pages, and release 25 already stopped every tier 0 publish. #1070 is release 25's own entry. ## Look at - **The entry**, at the top of `releases` in `packages/core/src/whatsNew.ts`. - **Rollback safety, from the live commit `38e0c37` (release 25) to `eabf2e6`:** - #1048 adds migration `0029_tier_zero_is_tier_one`. It turns every tier 0 version into tier 1, in the column, `manifest.tier` and `publish_response.tier`, and narrows the tier CHECK to 1–3. `payload_digest` is untouched, so retried publishes still replay. - Release 25 reads and serves migrated rows, and its CLI and server only write tier 1 and 2. So the narrowed CHECK holds during the rolling deploy and after a rollback to it. CI's `rollback-rehearsal` passed against release 25. Acceptance ran release 23 → R2 → head → R2 → head on real tier 0 data, and release 23 → head → release 25 → head. - Release 24 still writes tier 0 from single files, which the CHECK refuses, so release 25 is the floor. - #1048 isn't labelled `one-way`, because the release before it works with what it leaves. **Rollback line:** If this release misbehaves, roll back to `38e0c37` (release 25). Rolling back past release 25 would break single-file publishing, because release 24 writes tier 0 and the migrated database refuses it. Fix forward instead. ## How it was verified - **Tests.** `whatsNew.test.ts`, `WhatsNewPages.test.ts` and `schemas.test.ts` pass (21 tests), and prettier passes on the changed files. - **The range.** #1048 was reviewed by GPT 6.1 Sol with every finding resolved, and Sol found nothing in its rebase. Acceptance gave PASS with notes at its merged head. It landed with all 12 required checks green, including `rollback-rehearsal` against release 25. - **Deploy state.** The live commit, pinned from `/healthz/deep`, is `38e0c37` (release 25). The Deploy run updated last (#27) succeeded, and none is unfinished. - **Known effect.** One public page in production uses `about:srcdoc#` links for its table of contents. After this deploy those links stop jumping. Its owner is told before this deploys. ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required Text and version numbers only. The `0.26.0` bump tells CLIs and patch repos installed before this deploy to upgrade, as every release does. - **What does a revert leave behind?** Nothing. - **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 could only get keyboard shortcuts if its builder's agent
hand-wrote `keydown` code. That code is easy to get wrong in text
fields, dialogs, sequences, other keyboard layouts and ⌘ versus Ctrl.
Now tier 1 and 2 pages import `patchy/hotkeys`, Patchy's own API over
TanStack Hotkeys, which is bundled inside it, and every tier 1 and 2
repo gets a `patchy-hotkeys` skill.
```tsx
import { HotkeyScope, formatHotkey, useHotkey, useHotkeyList } from "patchy/hotkeys";
useHotkey("G H", () => patchy.route.set("/"), { label: "Go home" });
useHotkey("Mod+K", openSearch, { label: "Search" });
```
Closes #1092. Part of #1086. Stacked on #1087, so keys reach the page
without a click.
Rebuilt from the #1052 prototype, with the issue's changes:
- **No `Control`.** A chord is `Mod`, `Alt` and `Shift`.
- **`HotkeyScope` is always exclusive.**
- **`Mod+Shift+K` is reserved.** The types refuse it in either letter
case, and a string cast past them is skipped with a console warning.
- **Conflicts warn in Patchy's words.** TanStack lets them through. Our
warning fires once, naming both labels, after every hook's update in a
render has landed.
- **Pins:** `@tanstack/preact-hotkeys` 0.17.1 over `@tanstack/hotkeys`
0.19.0, exact.
- **Licences:** both MIT notices, Hotkeys 2026 and Store 2021, are in
`dist/licenses`.
It costs 13.4 KB gzipped, only in pages that import it: a minimal Preact
page goes from 17.9 to 31.4 KB in Vite's production build.
## Look at
**A string that isn't a hotkey fails `pnpm typecheck`, saying what to
write instead.** `packages/patchy/src/hotkeys.test.ts` asserts these
lines exactly, against the published declarations:
```
consumer.ts(2,11): error TS2345: Argument of type '"Ctrl+K"' is not assignable to parameter of type '"'Ctrl+K' isn't a chord: write 'Mod+K', which is ⌘ on a Mac and Ctrl elsewhere"'.
consumer.ts(3,11): error TS2345: Argument of type '"Control+K"' is not assignable to parameter of type '"'Control+K' isn't a chord: write 'Mod+K', which is ⌘ on a Mac and Ctrl elsewhere"'.
consumer.ts(5,11): error TS2345: Argument of type '"Esc"' is not assignable to parameter of type '"'Esc' isn't a chord: write keys like 'Mod+K', 'Escape', '?' or 'G H', modifiers in the order Mod, Alt, Shift"'.
consumer.ts(7,11): error TS2345: Argument of type '"Mod+Shift+K"' is not assignable to parameter of type '"'Mod+Shift+K' is kept by Patchy for its own shortcuts: choose another chord"'.
consumer.ts(9,11): error TS2345: Argument of type '"G Mod+Shift+K"' is not assignable to parameter of type '"'Mod+Shift+K' is kept by Patchy for its own shortcuts: choose another chord"'.
```
The test also covers `"Cmd+K"`, `"Shift+Mod+K"`, `"Mod+Shift+k"` and
`"Ctrl+Shift+K"`. `"Mod+K"`, `"?"`, `"G H"`, `"Alt+ArrowUp"` and a
`Chord[]` built from data typecheck clean.
**A published tier 1 page in the shell**
(`test/browser-tier1/hotkeys.spec.ts`, Chromium):
- `G H` changes the route on the first press, with no click.
- In a text field, `L` waits and `Mod+Enter` fires.
- On a checkbox, radio or range, `L` fires, and Space and the arrow keys
still work the control.
- An open `HotkeyScope` holds back the page's `L` and its `G H`, while
its own `G H` fires. `useHotkeyList` still lists the page's labelled
hotkeys.
- Layouts use trusted key events:
- AZERTY's `?` (Shift on `KeyM`) fires `"?"`.
- Russian `о` on `KeyJ` fires `"J"`.
- AZERTY's Ctrl+`=` on the `/` key fires `"Mod+="`, not `"Mod+/"`
(TanStack/hotkeys#210).
- Ctrl+Shift on the `/` key, which types `?`, fires `"Mod+Shift+/"`: a
shifted ASCII symbol falls back to its key's position.
- On an emulated Mac, `formatHotkey("Mod+K")` is `⌘ K`, and Meta+Enter
fires `Mod+Enter` where Control+Enter doesn't.
- Two sibling components swap `K` and `L` in one state update, and
nothing warns. A third component binding `K` then warns once: `"Second"
and "Third" both use K`.
```
✓ [chromium] › test/browser-tier1/focus.spec.ts:16:1 › a patch hears the keyboard once its frame loads (166ms)
✓ [chromium] › test/browser-tier1/hotkeys.spec.ts:118:1 › patchy/hotkeys fires in the published frame across fields, scopes, layouts and a Mac (721ms)
✓ [chromium] › test/browser-tier1/hotkeys.spec.ts:227:1 › a conflict warning waits for every hook's update, so siblings swapping keys don't warn (293ms)
```
TanStack 0.19.0 fixed the checkbox, radio and range case
(TanStack/hotkeys#206), so the layer carries no workaround for it.
**Fresh agents, `pnpm dev trial` on Sonnet 5.5, two runs per brief.**
Before is #1087's head, which has no helper. After is this PR plus one
local-only commit, never pushed: a `minimumReleaseAgeExclude` for the
two TanStack versions, so the evidence install gets past the release-age
window. That window has since passed, and nothing pushed bypasses the
policy.
- **Directed: a task tracker with `G H`, `G D`, `C T` and `?`.**
- Run 1: the after agent took the single-file route, with no repo,
hand-wrote the keys in one HTML file and published. A single-file page
can't import `patchy/hotkeys` and never sees the project skill. My brief
didn't say tasks are saved, which made a static file a fair pick.
Choosing the route is the global skill's job, outside this PR.
- Run 2, adding "Tasks anyone adds should be saved for everyone": the
after agent read `patchy-hotkeys` and built every shortcut with
`useHotkey`, `HotkeyScope`, `useHotkeyList`, `formatHotkey` and
`hotkeyKeys`. Typecheck and lint were clean and `patchy dev` ran. It
stopped before publishing to look for a browser to press the keys in,
which is #1090. It opened type files only to find `patchy.route`, which
#1088 adds to the skills.
- **Undirected: a support queue "as fast to work through as possible".
Informational.**
- Run 1: the after agent read `patchy-hotkeys`, and its purpose line
says "keyboard-driven triage". The log keeps no file contents, so
whether it imported the helper isn't recorded.
- Run 2: the after agent imported `patchy/hotkeys` without being asked
and published. The before agent's page imported only `patchy/preact` and
the generated client.
<details><summary>Run 2, directed: task tracker</summary>
<!-- patchy-dev:trial:tracker -->
#### Trial `tracker`
> Make me a task tracker patch for our team. Tasks anyone adds should be
saved for everyone. I want to drive it from the keyboard: G then H goes
to the task list, G then D shows the done tasks, C then T opens a dialog
to create a task, and ? shows a list of every shortcut. Put in a few
example tasks. Publish it when it works. Start your reply with one
sentence naming what the page imports from patchy.
Before is `9ff46e3` (--base origin/fix/frame-focus-1087) and after is
`ccaa307` (feat/hotkeys-1092), both on the `team` scenario, from `pnpm
dev trial`.
Each side gave the task to a fresh agent: after's `agent` launcher in
the side's environment, Claude Code on `claude-sonnet-5-5` as the
scenario's publisher, with the side's release of the Patchy skill and no
personal instructions or settings, run without a person within 60 turns
and 20 minutes. The log keeps each tool call, commands with their exit
codes, and one line per failure; not the agent's reasoning or what its
commands printed. Redacted before writing: email addresses outside the
scenarios' example domains; the accounts the run acts as.
One run is a smell test, not a measurement.
| | Before | After |
| --- | --- | --- |
| Finished | Yes | Yes |
| Commands | 14 | 15 |
| Failures | 2 | 4 |
| Help lookups | 0 | 0 |
| Minutes | 1.8 | 1.5 |
**Before** answered: “The page imports `render`, `useState`,
`useEffect`, `useRef` and `useQuery` from `patchy/preact`, and its
config imports `defineConfig`, `table` and `t` from `patchy/config`.
It's published and company colleagues can open it:
<origin>/acme/team-tasks (version 1, tier 1).”
**After** answered: “The page imports `useState`, `useEffect` and
`useQuery` from `patchy/preact`, `useHotkey`, `HotkeyScope`,
`useHotkeyList`, `formatHotkey` and `hotkeyKeys` from `patchy/hotkeys`,
and `defineConfig`, `table` and `t` from `patchy/config`. I haven't
published it yet, for two reasons.”
<details><summary>Before's log: 14 commands, 2 failures</summary>
```console
skill patchy
exit 0 $ patchy status --json; patchy whoami --json
exit 0 $ patchy init ./team-tasks --tier 1 --purpose "Shared team task tracker: add tasks, mark them done, and drive it with keyboard shortcuts (G H list, G D done, C T create, ? help)." --json 2>&1 | tail -30…
exit 0 $ cd <env>/workspace/team-tasks && cat AGENTS.md CLAUDE.md patchy.config.ts src/*.tsx; cat .agents/skills/patchy-loop/SKILL.md; cat patchy/_generated/index.json | head -50; ls fixtures helpers
exit 0 $ cat patchy.config.ts src/*.tsx; ls fixtures helpers src; cat .agents/skills/patchy-tables/SKILL.md
exit 0 $ cat .agents/skills/patchy-preact/SKILL.md; sed -n 1,200p .agents/skills/patchy-loop/SKILL.md
exit 0 $ cat src/styles.css | head -40; grep -n -i -A12 fixture .agents/skills/patchy-loop/SKILL.md | head -60
denied $ cat > patchy.config.ts <<'EOF' …
Contains brace with quote character (expansion obfuscation)
write <env>/workspace/team-tasks/patchy.config.ts
write <env>/workspace/team-tasks/src/App.tsx
exit 0 $ pnpm patchy refresh 2>&1 | tail -5; pnpm typecheck 2>&1 | tail -20; pnpm lint 2>&1 | tail -10
exit 0 $ grep -n -B2 -A8 "Me\b" patchy/_generated/client.ts | head -40; grep -n "Id<" patchy/_generated/client.ts | head -5
exit 0 $ grep -rn "type Me\b\|interface Me\b" node_modules/patchy/dist --include=*.d.ts -A8 | head -20; grep -rn "export type Id\b" node_modules/patchy/dist --include=*.d.ts | head
denied $ sed -i 's/me?\.name ?? "Someone"/me?.user.name ?? "Someone"/; s/function toggle(id: string, done: boolean)/function toggle(id: (typeof rows)[number]["id"], done: boolean)/' src/App.tsx && pnpm typeche…
This Bash command contains multiple operations. The following part requires approval: sed -i 's/me?\.name ?? "Someone"/me?.user.name ?? "Someone"/; s/function toggle(id: string, done: boolean)/functio…
edit <env>/workspace/team-tasks/src/App.tsx
edit <env>/workspace/team-tasks/src/App.tsx
exit 0 $ pnpm typecheck 2>&1 | tail; pnpm lint 2>&1 | tail -5
exit 0 $ pnpm patchy dev --json 2>&1 | tail -15
exit 0 $ pnpm patchy dev stop 2>&1 | tail -2; pnpm patchy publish --json 2>&1 | tail -20
```
</details>
<details><summary>After's log: 15 commands, 4 failures</summary>
```console
skill patchy
exit 0 $ ls -a && patchy status --json && patchy whoami --json
exit 0 $ patchy init ./team-tasks --tier 1 --purpose "Shared team task tracker: add tasks everyone sees, mark them done, and drive it from the keyboard (G H list, G D done, C T new task, ? shortcuts)." --json …
exit 0 $ cd <env>/workspace/team-tasks && cat AGENTS.md patchy.config.ts src/*.tsx; cat .agents/skills/patchy-loop/SKILL.md .agents/skills/patchy-hotkeys/SKILL.md .agents/skills/patchy-tables/SKILL.md; ls src …
exit 0 $ cat patchy.config.ts; ls src fixtures; cat src/App.tsx src/main.tsx; cat .agents/skills/patchy-hotkeys/SKILL.md; cat .agents/skills/patchy-tables/SKILL.md
exit 0 $ grep -n -i -E "route|dialog|export|import" .agents/skills/patchy-preact/SKILL.md | head -50; cat src/styles.css | head -30; ls fixtures; grep -n -i fixture .agents/skills/patchy-loop/SKILL.md | head
denied $ cat > patchy.config.ts <<'EOF' …
Contains brace with quote character (expansion obfuscation)
write <env>/workspace/team-tasks/patchy.config.ts
write <env>/workspace/team-tasks/src/App.tsx
exit 0 $ cat >> src/styles.css <<'EOF' …
exit 0 $ grep -n -B2 -A8 "route" .agents/skills/patchy-preact/SKILL.md .agents/skills/patchy-loop/SKILL.md | head -40; grep -n "route" patchy/_generated/client.ts | head
exit 0 $ grep -rn -A12 "interface.*Route\|route:" node_modules/patchy/dist/*.d.ts 2>/dev/null | head -40
exit 0 $ grep -rln "subscribe" node_modules/patchy/ --include=*.d.ts 2>/dev/null | head; grep -rn "route" node_modules/patchy/ --include=*.d.ts 2>/dev/null | head
exit 0 $ grep -n -B2 -A14 "type Route\b\|interface Route\b" node_modules/patchy/dist/_types/config-ihDgouFZ.d.ts | head -40
denied $ python3 - <<'EOF' …
grep -n "Id\b" node_modules/patchy/dist/_types/config-ihDgouFZ.d.ts
edit <env>/workspace/team-tasks/src/App.tsx
edit <env>/workspace/team-tasks/src/App.tsx
edit <env>/workspace/team-tasks/src/App.tsx
exit 0 $ pnpm typecheck 2>&1 | tail; pnpm lint 2>&1 | tail; pnpm patchy dev --json 2>&1 | tail -15
denied $ which chromium chromium-browser google-chrome firefox 2>&1 | head; ls ~/.cache/ms-playwright 2>&1 | head -3; cd <env>/workspace/team-tasks && tail -15 .patchy/dev/*/dev.log
This Bash command contains multiple operations. The following part requires approval: head; ls ~/.cache/ms-playwright 2>&1
exit 3 $ which chromium chromium-browser google-chrome firefox
/usr/bin/chromium
```
</details>
<!-- /patchy-dev:trial:tracker -->
</details>
<details><summary>Run 2, undirected: support queue</summary>
<!-- patchy-dev:trial:queue -->
#### Trial `queue`
> Make me a support queue patch for our team to work through incoming
customer tickets. It should be as fast to work through as possible. Put
in a few example tickets. Publish it when it works. Start your reply
with one sentence naming what the page imports from patchy.
Before is `9ff46e3` (--base origin/fix/frame-focus-1087) and after is
`ccaa307` (feat/hotkeys-1092), both on the `team` scenario, from `pnpm
dev trial`.
Each side gave the task to a fresh agent: after's `agent` launcher in
the side's environment, Claude Code on `claude-sonnet-5-5` as the
scenario's publisher, with the side's release of the Patchy skill and no
personal instructions or settings, run without a person within 60 turns
and 20 minutes. The log keeps each tool call, commands with their exit
codes, and one line per failure; not the agent's reasoning or what its
commands printed. Redacted before writing: email addresses outside the
scenarios' example domains.
One run is a smell test, not a measurement.
| | Before | After |
| --- | --- | --- |
| Finished | Yes | Yes |
| Commands | 11 | 16 |
| Failures | 2 | 2 |
| Help lookups | 0 | 0 |
| Minutes | 1.5 | 2.6 |
**Before** answered: “The page imports `useQuery`, `useState`,
`useEffect`, `useMemo`, `useRef` and `render` from `patchy/preact`, and
the generated `patchy` table client from `patchy/_generated/client.js`.
The support queue is published at <origin>/acme/support-queue.”
**After** answered: “The page imports `patchy/preact` (Preact and the
`useQuery` hook), `patchy/hotkeys` (keyboard shortcuts), and
`patchy/config` (the table definition at build time). The support queue
is published at <origin>/acme/support-queue.”
<details><summary>Before's log: 11 commands, 2 failures</summary>
```console
skill patchy
exit 0 $ ls -a && patchy status --json && patchy whoami --json
exit 0 $ patchy init support-queue --tier 1 --purpose "Support queue for the team to triage and work through incoming customer tickets quickly with keyboard shortcuts: claim, reply, resolve, snooze." --json 2>…
exit 0 $ cat .agents/skills/patchy-preact/SKILL.md .agents/skills/patchy-tables/SKILL.md .agents/skills/patchy-look/SKILL.md; ls fixtures src; cat fixtures/* | head -20; cat patchy/_generated/context/table-not…
exit 0 $ sed -n 40,200p .agents/skills/patchy-preact/SKILL.md; echo =====; cat .agents/skills/patchy-tables/SKILL.md | head -150; ls fixtures src
exit 0 $ grep -n -i -B2 -A12 "fixture" .agents/skills/patchy-loop/SKILL.md | head -90; cat src/styles.css; grep -n "me\b" patchy/_generated/client.ts | head; grep -o "^\s*--look-[a-z-]*" patchy/_generated/look…
exit 0 $ grep -n -i "me\b\|me(" patchy/_generated/client.ts | head; grep -n -A8 "me()" .agents/skills/patchy-loop/SKILL.md | head -30; sed -n 1,40p patchy/_generated/look.css | cut -c1-120
denied $ cat > patchy.config.ts <<'EOF' …
Contains brace with quote character (expansion obfuscation)
write <env>/workspace/support-queue/patchy.config.ts
write <env>/workspace/support-queue/src/seed.ts
write <env>/workspace/support-queue/src/styles.css
write <env>/workspace/support-queue/src/App.tsx
exit 0 $ pnpm patchy refresh --json 2>&1 | tail -3; pnpm typecheck 2>&1 | tail -15; pnpm lint 2>&1 | tail -15
denied $ sed -i 's/}, \[sel?.id\]);/}, [sel?.id, sel?.reply]);/; s/useEffect(() => setReply(sel?.reply ?? ""), \[sel?.id\]);/useEffect(() => setReply(sel?.reply ?? ""), [sel?.id, sel?.reply]);/' src/App.tsx &&…
This Bash command contains multiple operations. The following part requires approval: sed -i 's/}, \[sel?.id\]);/}, [sel?.id, sel?.reply]);/; s/useEffect(() => setReply(sel?.reply ?? ""), \[sel?.id\])…
edit <env>/workspace/support-queue/src/App.tsx
exit 0 $ pnpm typecheck 2>&1 | tail -5; pnpm lint 2>&1 | tail -5; pnpm patchy dev --json 2>&1 | tail -5
exit 0 $ pnpm patchy dev logs 2>&1 | tail -8; pnpm patchy dev stop >/dev/null 2>&1; pnpm patchy publish --json 2>&1 | tail -5
```
</details>
<details><summary>After's log: 16 commands, 2 failures</summary>
```console
skill patchy
exit 0 $ ls -a && patchy status --json && patchy whoami --json
exit 0 $ patchy init ./support-queue --tier 1 --purpose "Support queue for the team to triage and work through incoming customer tickets quickly, with keyboard shortcuts, claim, reply and resolve." --json 2>&1…
exit 0 $ cat .agents/skills/patchy-hotkeys/SKILL.md .agents/skills/patchy-tables/SKILL.md .agents/skills/patchy-look/SKILL.md; ls fixtures src; cat fixtures/* | head -20; cat src/styles.css
exit 0 $ sed -n 40,200p .agents/skills/patchy-hotkeys/SKILL.md | head -90; echo =====; cat .agents/skills/patchy-tables/SKILL.md | head -150; ls fixtures src; cat src/styles.css | head -30
exit 0 $ grep -n -i -B2 -A12 "fixture" .agents/skills/patchy-loop/SKILL.md | head -80; grep -o "\-\-look-[a-z-]*:[^;]*" patchy/_generated/look.css | head -20; ls fixtures; cat patchy/_generated/context/table-n…
exit 0 $ grep -n "me()\|me:" -r .agents/skills/patchy-preact/SKILL.md .agents/skills/patchy-loop/SKILL.md | head; grep -n "useMe\|useQuery" .agents/skills/patchy-preact/SKILL.md | head
exit 0 $ grep -n "me\b" patchy/_generated/client.ts | head -8; grep -n "me" patchy/_generated/README.md | head
exit 0 $ cat patchy/_generated/client.ts | head -40; grep -rn "\.me\b\|me()" .agents/skills/patchy-preact/SKILL.md node_modules/patchy/dist/*.d.ts 2>/dev/null | head
exit 0 $ grep -rn "me:\|me(" node_modules/patchy/dist --include=*.d.ts | head -8
exit 0 $ grep -rn "me\b" node_modules/patchy/dist/_types/*.d.ts | grep -i "viewer\|Promise\|readonly me" | head -8
exit 0 $ grep -n "type Me\b\|interface Me\b" -A6 node_modules/patchy/dist/_types/config-ihDgouFZ.d.ts
denied $ cat > patchy.config.ts <<'EOF' …
Contains brace with quote character (expansion obfuscation)
write <env>/workspace/support-queue/patchy.config.ts
write <env>/workspace/support-queue/src/styles.css
write <env>/workspace/support-queue/src/App.tsx
exit 0 $ pnpm patchy refresh 2>&1 | tail -5; pnpm typecheck 2>&1 | tail -20; pnpm lint 2>&1 | tail -10
denied $ sed -i 's|^ useEffect(() => { setDraft(sel?.reply ?? ""); }, \[sel?.id\]);| // Reset the draft only when the selected ticket changes, not on every edit to it.\n // oxlint-disable-next-line react-ho…
This Bash command contains multiple operations. The following part requires approval: sed -i 's|^ useEffect(() => { setDraft(sel?.reply ?? ""); }, \[sel?.id\]);| // Reset the draft only when the sel…
edit <env>/workspace/support-queue/src/App.tsx
exit 0 $ pnpm lint 2>&1 | tail -5; pnpm typecheck 2>&1 | tail -3; pnpm patchy dev --json 2>&1 | tail -5
exit 0 $ pnpm patchy dev stop 2>&1 | tail -1; pnpm patchy publish --json 2>&1 | tail -15
```
</details>
<!-- /patchy-dev:trial:queue -->
</details>
## How it was verified
- **`pnpm verify`, at `13378bf`:** 9 of 10 suites pass, including
`browser` (the whole tier 1 suite), `cli-smoke`, `install` and
`tier2-smoke`. In `test`, 12 CLI and executor cases failed. Each failure
is an unexpected `GET /` or other stray request on a local stub server,
which the T3 Code harness sends to local ports on this machine. None are
in a file this PR touches, and the same tests failed or passed between
runs.
- **Packed tarball** (`scripts/packed-preact-e2e.mjs`, in `cli-smoke`).
A consumer of the packed `patchy` installs no `@tanstack` package. It
typechecks `patchy/hotkeys` with `skipLibCheck: false`, with a
`@ts-expect-error` on `"Mod+Shift+K"`. A `G H` hotkey then updates state
on the page's own Preact, in optimized dev and in the single-file build:
```
[packed-preact] patchy/hotkeys installs no TanStack package
[packed-preact] JSX, table and hotkey types resolve without a direct
Preact dependency
[packed-preact] optimized dev: signals, hooks, compat, useQuery and SDK
debugging share one runtime
[packed-preact] single-file published artifact runs with no development
instrumentation
```
- **Unit tests** (`hotkeyRules.test.ts`):
- A cast `"Mod+Shift+K"`, `"G mod+shift+k"` or `"Shift+Mod+K"` is left
out of registration with one warning each.
- Two enabled `Mod+K`s in one scope warn once, naming both labels. A
disabled duplicate, or the same keys in another scope, don't warn.
- **Page imports** (`pageImports.test.ts`):
- `patchy/hotkeys` builds and runs on the page graph: `⌘ K` on a Mac
`navigator`, `Ctrl+K` on Windows.
- It is `import_refused` on the server graph.
- With the entry point removed, the page case fails at the build.
- **Generation** (`SdkApi.test.ts`):
- On tiers 1 and 2 the skill installs with `patchy-preact`, and stays
when a repo moves from tier 2 to 1.
- It is in `index.json`'s skills and capabilities, and in
`patchy-loop`'s catalogue.
- Tier 0 is gone since #1048, so the issue's "fresh tier 0" and "moves
to tier 0" cases no longer exist.
- **Analytics** (`PatchesApi.test.ts`): a publish's `patch.created`
reports `patchy/hotkeys` among its SDK imports.
**Human checks: a merge gate only Allison can clear.** Headless browsers
can't show these, because synthetic key presses skip the browser's own
shortcuts.
- Done, by Allison on 2026-10-30, recorded on #1091: Mod+Shift+K reached
the page, and the browser did nothing of its own, in Chromium and Zen
(Firefox-based) on Linux.
- [ ] Edge: Mod+Shift+K reaches the page. Edge uses Ctrl+Shift+K to
duplicate the tab.
- [ ] A real Mac, in Safari and Chrome: Mod+Shift+K reaches the page,
and the page's shortcuts fire once. The suite runs Chromium on Linux and
only pretends to be a Mac.
**Preact 11.** Main moved to Preact 11.1.0 (#975) while this was open.
Preact 11 runs a passive effect's cleanup after the next paint, so the
layer now does its work in layout effects. `HotkeyScope` activates its
scope there (`c3d82f1`), and every hotkey registers and unregisters
there (`5246547`), so nothing is held back or fires a frame late. Three
acceptance rounds with fresh agents sharpened the skill's dialog section
(`9cf8ac9`, `d168798`): a dialog's own keys go inside its scope, the
page's hotkeys stay enabled, and a dialog focuses its field from code.
The TanStack pins resolve against Preact 11, and CI installs them with
the release-age policy on.
## Release impact
- [ ] **Breaking** — requires action from anyone already running this
- [x] **Not breaking** — no action required. A new page entry point and
a new project skill; nothing that exists changes.
Labelled `one-way`, so the deploying agent reads this:
- **What does a revert leave behind?** Three things:
- published versions whose page bundles `patchy/hotkeys`;
- repos holding `.agents/skills/patchy-hotkeys/`;
- repos whose source imports `patchy/hotkeys`.
- **Does the release before it still work with that?**
- **Viewers: yes.** Helper code is bundled into the page. `sdkImports`
isn't a serving allowlist: `packages/patches/src/Patches.ts` uses it
only to filter analytics.
- **Refresh and dev: only with #1089.** Today generation refuses a skill
it doesn't ship (`SdkApi.test.ts`: `patchy-removed` answers 422). After
a rollback to a release without #1089, every tier 1 and 2 repo refreshed
since this PR would fail refresh and `patchy dev`. **#1089 has to be
live in a release before this one ships.**
- **Repos that import `patchy/hotkeys`: no.** The older package has no
such entry, so their page graph is `import_refused`. They can't build a
new version until production rolls forward, as with any new helper.
Removing the entry point fails `pageImports.test.ts`'s hotkeys case
exactly that way.
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
Tier 0 is gone. Stored tier 0 pages become tier 1 pages, served in the sandboxed frame from their content URL like any other page. Tiers now count from 1. A repo config that still says
tier: 0is refused with the fix, and a tier 0 publish an older CLI left pending is cleared instead of wedging publishing.Closes #986 (PR 4 of 4). It lands on main after release 25 (#1045), which is live.
0029_tier_zero_is_tier_one(patches capability). In one transaction, everypatch_versionsrow at tier 0, deleted patches' included, getstier = 1,manifest.tier = 1andpublish_response.tier = 1.payload_digestis untouched, so a same-key retry still replays. The CHECK becomestier BETWEEN 1 AND 3.Manifest.tierand the publish response'stierare1 | 2 | 3. A raw tier 0 manifest answerstier_mismatchbefore decoding, in feat(patchy): single-file pages publish as tier 1 and may run script #1045's words; feat(patchy): single-file pages publish as tier 1 and may run script #1045's post-decode check goes with the narrowed type. Replay runs before release validation, so migrated receipts replay as they are.InvalidHtmlleaves the publish contract, because only tier 0 could raise it.PATCHY_MAX_HTML_BYTESare gone.PATCH_CONTENT_SECURITY_POLICYstays for notices, without theabout:allowances only srcdoc needed.framedDocumentstays forpatchy look preview --compare.init --tiertakes 1 or 2, and the config type is1 | 2 | 3.tier: 0config gets "Tier 0 is now tier 1. Settier: 1and runpatchy refresh." (tier_mismatch, exit 1) from config execution itself, so refresh refuses it too, not only publish and dev. feat(patchy): single-file pages publish as tier 1 and may run script #1045'srefuseTierZerogoes; it can't see tier 0 through the narrowed type.patchy listand publish again if the page is missing.repoBuild,bundleCheck,devServer(alwaysdocumentTitle, always a colleague URL),initProject,Project,generateClientand the scenario schema.validateHtml, its accept/reject fixtures and their readers are gone.isPageistier === 1. The parse-bound coverage now runs throughdocumentTitle. The look tests' Inter subset moved topackages/core/fixtures/looks/inter.css, licence line kept.seed:devpublishes two inline single-file pages.PATCHY_MAX_BUNDLE_BYTES: "1".docs/product.md, AGENTS/CLAUDE and README; ADR-0004, 0006 and 0010; DEVELOPMENT, OPERATIONS and SKILL_DISTRIBUTION; scenarios; the patches, portal and serving glossaries and the map; thepatchy-look,patchy-loopandpatchy-serverproject skills; the global skill with its lock hash; theui-consistencyreview spec;docs/API.mdre-rendered.Look at
The migration, on a database at the schema before it, in
apps/server/src/migrations.test.ts› "the tier 0 fold":migrate, both tier 0 rows readtier: 1in the column, the manifest and the receipt, with their digests unchanged. The tier 1 and 2 rows are untouched.ConstraintError.A formerly static page, served scripted.
test/browser-tier1/single-file.spec.tsreplaces the srcdoc spec. A single-file page (tier 1, no tables, files or SDK) opens withsandbox="allow-scripts allow-modals"and a content URL, with nosrcdoc. Its#sellerslink scrolls within the frame with no request.The CLI's way out of tier 0.
A raw tier 0 manifest is refused by name at the API, before decoding, with #1045's exact answer, so the contract doesn't change between R2 and R3:
Transcript
tier-zeroRecorded before the rebase onto main. Before is
1d53fee(--base origin/tier-fold/3-file-pages-tier1) and after isd400586(tier-fold/4-no-tier0), whose tree is the head's (6a0d3econly rebased onto1d53fee), both on theteamscenario, frompnpm dev transcript.Each line ran in its own
bash -cfrom the side's agent workspace, as the scenario's signed-in CLI, with stdin closed. Each side's origin reads<origin>, its environment folder<env>, its checkout<checkout>and the home folder~; nothing else is normalized. Nothing in it matched a collected secret (each side's CLI state, machine-token and login-code shapes, email addresses outside the scenarios' example domains, secret-named variables, and any accounts the run acts as).1 of 2 lines changed.
A repo whose config still says tier 0 refreshes, then publishes
Changed. Before, exit 0 in 1.7 s; after, exit 1 in 1.5 s.
$ cd brief && pnpm patchy publish --json: no change, exit 1 in 0.6 sHow it was verified
pnpm checksteps (format, lint, typecheck, synth) pass.The focused suites pass: migrations, Server, ApiGuard, StreamLifecycle, patches, serving, core, portal, mcp, primitives, api, SDK, runtime, the dev scripts and the touched CLI files.
pnpm test:browserpasses all 83, the new spec and look preview included.pnpm verifypasses postgres-concurrency, cli-smoke, install and tier2-smoke.The full offline
pnpm test: 2544 of 2566 pass. The failures are only in the CLI stub suites (cli*.test.ts) and two execution timing tests (LocalTaskProvider,Supervisor). They are a different set on every run, always an unauthenticatedGET /arriving at a local stub, from the shared machine's local port probing. PR 1, 2 and 3's verifies on this machine show the same rotating set. CI, without that prober, is the arbiter.Rollback rehearsal, run locally with live = feat(patchy): single-file pages publish as tier 1 and may run script #1045 (before the rebase onto feat(runtime): tier 1 reaches only its own tables and files #1047, fix(serving): a page that doesn't use the SDK opens without "could not start" #1044 and feat(patchy): single-file pages publish as tier 1 and may run script #1045; see the acceptance verdict for runs at the current head):
pnpm test:rollback-rehearsal --live 6d9ac75passed every step, before feat(patchy): single-file pages publish as tier 1 and may run script #1045's tier 0 refusal (4473d2f) and the rebase onto it. The rebase adds only refusals; the migration and serving are unchanged.CI's
rollback-rehearsalreplays live → head → live against production's live commit, now release 25 (38e0c37). Before release 25 was live, the live step published a file page as tier 0, which the narrowed CHECK refuses on the way back. That's why its earlier runs here failed. The acceptance verdict onb55f247reran the rehearsal locally with--live 38e0c37and--live 18b39ae, and both passed.Not done here.
pullKind. The snapshots stack (feat(patches): each version keeps its repo snapshot, and members can read it #996 → feat(patchy): publish keeps the repo, and patchy pull gets it back #1003 → feat(patches): publish refuses a copy behind the newest version #1004) hasn't merged, sopullKindis unchanged. When it lands,pullKindshould becomerepo === null && originalFilename !== null, with the snapshot check still first.0029_version_repo_snapshots) and feat(companies): store company guests separately #995 (0029_company_guests) also claim0029. Whichever lands first, this migration renumbers at rebase.about:srcdoc#…stops jumping once it's served scripted. Its owner is being told separately; there's no workaround here.Release impact
The manifest and config no longer accept tier 0, and the migration rewrites stored rows.
Upgrade path:
A repo whose
patchy.config.tssaystier: 0is refused with the fix: settier: 1and runpatchy refresh.patchy init --tier 0is gone.An instance that set
PATCHY_MAX_HTML_BYTEScan drop it; nothing reads it now.What does a revert leave behind? Migrated rows: stored tier 0 versions are tier 1 in their column, manifest and replayed receipt. The CHECK is narrowed to
tier BETWEEN 1 AND 3.Does the release before it still work with that? Yes, for R2 (feat(patchy): single-file pages publish as tier 1 and may run script #1045) and later. R2 serves tier 1 rows through the scripted frame and its CLI publishes single files as tier 1, so it reads the migrated rows and writes nothing the CHECK refuses. The same holds while R2 and R3 hosts overlap during the deploy. Rolling back past R2, to a release whose CLI publishes tier 0 file pages, is not safe, so rollback is only safe to R2 or later. Given that, this PR carries no
one-waylabel. feat(patchy): single-file pages publish as tier 1 and may run script #1045 refuses tier 0 repo configs and tier 0 manifests (4473d2f), so an R2 host never tries a tier 0 write against the narrowed CHECK.Built by Claude Opus 5.5 (
claude-opus-5-5) in Claude Code, through T3 Code.