Skip to content

feat(patches): tier 0 is gone; existing pages are tier 1 - #1048

Merged
allisonmahmood merged 1 commit into
mainfrom
tier-fold/4-no-tier0
Oct 29, 2026
Merged

allisonmahmood merged 1 commit into
mainfrom
tier-fold/4-no-tier0

Conversation

@allisonmahmood

@allisonmahmood allisonmahmood commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

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: 0 is 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.

  • Migration 0029_tier_zero_is_tier_one (patches capability). In one transaction, every patch_versions row at tier 0, deleted patches' included, gets tier = 1, manifest.tier = 1 and publish_response.tier = 1. payload_digest is untouched, so a same-key retry still replays. The CHECK becomes tier BETWEEN 1 AND 3.
  • Wire. Manifest.tier and the publish response's tier are 1 | 2 | 3. A raw tier 0 manifest answers tier_mismatch before 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. InvalidHtml leaves the publish contract, because only tier 0 could raise it.
  • Server.
    • The safe-HTML branch and PATCHY_MAX_HTML_BYTES are gone.
    • Owner actions keep their own 1.5 MiB request cap, the same value as before.
    • The publish envelope stays three times both bundle caps.
  • Serving.
    • Every shell frames its version's content URL. The srcdoc path and the static CSPs are gone, leaving one content policy and one shell policy.
    • PATCH_CONTENT_SECURITY_POLICY stays for notices, without the about: allowances only srcdoc needed.
    • framedDocument stays for patchy look preview --compare.
  • CLI.
    • init --tier takes 1 or 2, and the config type is 1 | 2 | 3.
    • A tier: 0 config gets "Tier 0 is now tier 1. Set tier: 1 and run patchy 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's refuseTierZero goes; it can't see tier 0 through the narrowed type.
    • A pending tier 0 attempt is cleared with a message to run patchy list and publish again if the page is missing.
    • The tier 0 branches are gone from repoBuild, bundleCheck, devServer (always documentTitle, always a colleague URL), initProject, Project, generateClient and the scenario schema.
  • Core. validateHtml, its accept/reject fixtures and their readers are gone. isPage is tier === 1. The parse-bound coverage now runs through documentTitle. The look tests' Inter subset moved to packages/core/fixtures/looks/inter.css, licence line kept.
  • Sweep.
    • Test helpers and fixtures publish tier 1.
    • seed:dev publishes two inline single-file pages.
    • The packed Preact e2e uses tier 1.
    • CI's ambient poison is PATCHY_MAX_BUNDLE_BYTES: "1".
    • The rollback rehearsal expects live-query deliveries only for pages that subscribe, or that step 1 saw deliveries for. Every repo page used to be required to deliver, which a page without the SDK never does after fix(serving): a page that doesn't use the SDK opens without "could not start" #1044.
  • Docs. The tier sections of 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; the patchy-look, patchy-loop and patchy-server project skills; the global skill with its lock hash; the ui-consistency review spec; docs/API.md re-rendered.

Look at

The migration, on a database at the schema before it, in apps/server/src/migrations.test.ts › "the tier 0 fold":

  • A live tier 0 page, a deleted patch's tier 0 page, and tier 1 and tier 2 versions are inserted as old publishes stored them.
  • After migrate, both tier 0 rows read tier: 1 in the column, the manifest and the receipt, with their digests unchanged. The tier 1 and 2 rows are untouched.
  • A tier 1 insert, as the release before writes, still goes in. A tier 0 insert is a ConstraintError.
✓ apps/server/src/migrations.test.ts > the tier 0 fold > makes every stored static page tier 1, deleted ones too, in its row, manifest and receipt, and refuses tier 0 after

A formerly static page, served scripted. test/browser-tier1/single-file.spec.ts replaces the srcdoc spec. A single-file page (tier 1, no tables, files or SDK) opens with sandbox="allow-scripts allow-modals" and a content URL, with no srcdoc. Its #sellers link scrolls within the frame with no request.

✓ [chromium] › test/browser-tier1/single-file.spec.ts:5:1 › a single-file page opens in the scripted frame and its same-page link scrolls (231ms)

The CLI's way out of tier 0.

✓ packages/patchy/src/executeConfig.test.ts > refuses a config still at tier 0, saying how to move it, with resolution true
✓ packages/patchy/src/executeConfig.test.ts > refuses a config still at tier 0, saying how to move it, with resolution false
✓ packages/patchy/src/State.test.ts > clears an older patchy's tier 0 attempt, which can't be sent again, saying what to check

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:

✓ packages/patches/src/PatchesApi.test.ts > refuses unsupported tiers and missing connections before writing content
  → 422 { ok: false, code: "tier_mismatch", error: "Tier 0 is now tier 1. Publish with a tier 1 manifest; a current patchy CLI sends one." }
✓ packages/patchy/src/cliRepoPublish.test.ts > refuses a tier 0 repo by publish and dev before building, and init at tier 0   (#1045's test, kept)

Transcript tier-zero

Recorded before the rebase onto main. Before is 1d53fee (--base origin/tier-fold/3-file-pages-tier1) and after is d400586 (tier-fold/4-no-tier0), whose tree is the head's (6a0d3ec only rebased onto 1d53fee), both on the team scenario, from pnpm dev transcript.

Each line ran in its own bash -c from 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.

$ patchy init brief --purpose "A one-page brief" --json > /dev/null && sed -i 's/tier: 1,/tier: 0,/' brief/patchy.config.ts && cd brief && pnpm patchy refresh --json
[stderr]
{"ok":false,"error":"Tier 0 is now tier 1. Set `tier: 1` and run `patchy refresh`.","kind":"local","code":"tier_mismatch"}
-{"ok":true,"release":{"from":"0.22.0","to":"0.22.0"},"changed":{"pin":false,"generated":["patchy/_generated/manifest.json"],"skills":[],"fixtures":[]},"addedCapabilities":[],"warnings":[]}
+[stderr]
+{"ok":false,"error":"Tier 0 is now tier 1. Set `tier: 1` and run `patchy refresh`.","kind":"local","code":"tier_mismatch"}
$ cd brief && pnpm patchy publish --json: no change, exit 1 in 0.6 s
$ cd brief && pnpm patchy publish --json
[stderr]
{"ok":false,"error":"Tier 0 is now tier 1. Set `tier: 1` and run `patchy refresh`.","kind":"local","code":"tier_mismatch"}

How it was verified

  • pnpm check steps (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:browser passes all 83, the new spec and look preview included.

  • pnpm verify passes 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 unauthenticated GET / 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 6d9ac75 passed 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.

    Rehearsing 6d9ac75 → 5008d4d → 6d9ac75 → 5008d4d on one set of data.
    ▶ Step 1: the live commit (6d9ac75) seeds the data      passed in 48s
    ▶ Step 2: HEAD (5008d4d) upgrades it                     passed in 25s
    ▶ Step 3: the live commit (6d9ac75) comes back           passed in 21s
    ▶ Step 4: HEAD (5008d4d) comes back                      passed in 21s
    Exercised rollback paths passed: 6d9ac75 → 5008d4d → 6d9ac75 → 5008d4d, in 115s.
    

CI's rollback-rehearsal replays 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 on b55f247 reran the rehearsal locally with --live 38e0c37 and --live 18b39ae, and both passed.

Not done here.

Release impact

  • Breaking — requires action from anyone already running this
  • Not breaking — no action required

The manifest and config no longer accept tier 0, and the migration rewrites stored rows.

Upgrade path:

  • A repo whose patchy.config.ts says tier: 0 is refused with the fix: set tier: 1 and run patchy refresh.

  • patchy init --tier 0 is gone.

  • An instance that set PATCHY_MAX_HTML_BYTES can 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-way label. 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.

@github-actions github-actions Bot added area:server Touches the server area area:ci CI, shared testing infrastructure, development scripts and tooling area:cli Touches the cli area area:core Touches the core area area:docs Touches the docs area area:primitives Patch tables and files area:integrations Company connections and integration implementations area:ui Portal and first-party browser pages, shared rendering and styles size:xl Over 1,000 changed lines; review in multiple passes labels Oct 29, 2026
@allisonmahmood
allisonmahmood force-pushed the tier-fold/4-no-tier0 branch 2 times, most recently from d400586 to 6a0d3ec Compare October 29, 2026 12:54
@allisonmahmood
allisonmahmood force-pushed the tier-fold/3-file-pages-tier1 branch from 1d53fee to bc2b7d2 Compare October 29, 2026 21:42
@allisonmahmood
allisonmahmood force-pushed the tier-fold/3-file-pages-tier1 branch from bc2b7d2 to 8309978 Compare October 29, 2026 21:53
Base automatically changed from tier-fold/3-file-pages-tier1 to main October 29, 2026 22:22
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]>
@allisonmahmood

Copy link
Copy Markdown
Owner Author

Acceptance: PASS with notes

Checked b55f247 (base 38e0c37) on brightline, by Claude Opus 5.5 in Claude Code, through T3 Code. I first ran everything at f3afd1b (base 18b39ae, #1045). The head was then rebased over #1070, release 25's What's new, which touches only whatsNew.ts, CURRENT_RELEASE and the patchy version. git range-diff shows the commit unchanged. At b55f247 I re-ran the migration chain, the CLI checks and the rehearsal.

The data. Release 23's code (0aa8d48) brought up brightline, and its own CLI (0.23.0) published single-file pages at tier 0, as production's were written:

  • the scenario's kickoff brief, shared public;
  • launch-notes, two versions, each with a #sellers link;
  • old-memo, then deleted;
  • replay-page, whose publish request I captured.

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:

  • at f3afd1b: release 23 → R2 (18b39ae) → head → R2 → head;
  • at b55f247: release 23 → head → R25 (38e0c37) → head.

Done means (#986, this PR's part)

  • Every page that served before still serves at its address, with no action from its owner: passed. At every head and rollback step, every former tier 0 page answered 200 at its address with sandbox="allow-scripts allow-modals", data-tier="1" and no srcdoc. That covers the current version, /~v/1 and /~v/2, the public brief signed out, and the deleted patch once restored. Before the migration, R2 still served them as sandbox="" with srcdoc. In Chromium as Jordan, each opened in the scripted frame with no "could not start" notice and no page errors. Its #sellers link scrolled the frame from 0 to 3345 px with no request.

    Serving at b55f247, after the migration
    /brightline/launch-notes [jordan]: 200 frame=/~content/… title="Launch notes" notice=0 scroll 0→3345 hash=#sellers requests=0 errors=[]
    /brightline/launch-notes/~v/1 [jordan]: 200 frame=/~content/… title="Launch notes" notice=0 scroll 0→3345 hash=#sellers requests=0 errors=[]
    /brightline/harbor-pine-kickoff [jordan]: 200 frame=/~content/… title="Kickoff brief: Harbor & Pine Coffee rebrand" notice=0 errors=[]
    /brightline/replay-page [jordan]: 200 frame=/~content/… title="Replay page" notice=0 scroll 0→3345 hash=#sellers requests=0 errors=[]
    /brightline/harbor-pine-kickoff [signed out]: 200 frame=/~content/… title="Kickoff brief: Harbor & Pine Coffee rebrand" notice=0 errors=[]
    /brightline/launch-notes [signed out]: 401
    Home tools: new-business(mono) spend(mono)
    Home pages: replay-page(page) launch-notes(page) harbor-pine-kickoff(page)
    All patches › pages: replay-page(page) launch-notes(page) harbor-pine-kickoff(page) kudos(page)
    All patches › tools: new-business(mono) spend(mono)
    Home search "launch": launch-notes under Pages
    
  • Migration 0029_tier_zero_is_tier_one: passed on rows release 23 wrote, at both heads.

    • Every tier 0 row moved to tier 1 in its column, manifest.tier and publish_response.tier, including the deleted patch's row.
    • payload_digest and the rest of each manifest and receipt are byte-for-byte unchanged.
    • Tier 1 and tier 2 rows are untouched.
    • The CHECK is 1..3, and an UPDATE … SET tier = 0 fails on patch_versions_tier_check.
    patch_versions before and after b55f247's first start
    name                | n | tier  | manifest | receipt | digest    | rest of JSON | deleted
    harbor-pine-kickoff | 1 | 0 → 1 | 0 → 1    | 0 → 1   | unchanged | unchanged    | no
    kudos               | 1 | 1     | 1        | 1       | unchanged | unchanged    | no
    launch-notes        | 1 | 0 → 1 | 0 → 1    | 0 → 1   | unchanged | unchanged    | no
    launch-notes        | 2 | 0 → 1 | 0 → 1    | 0 → 1   | unchanged | unchanged    | no
    new-business        | 1 | 2     | 2        | 2       | unchanged | unchanged    | no
    old-memo            | 1 | 0 → 1 | 0 → 1    | 0 → 1   | unchanged | unchanged    | yes
    replay-page         | 1 | 0 → 1 | 0 → 1    | 0 → 1   | unchanged | unchanged    | no
    spend               | 1 | 2     | 2        | 2       | unchanged | unchanged    | no
    patch_versions_tier_check: CHECK (((tier >= 1) AND (tier <= 3)))
    ERROR:  new row for relation "patch_versions" violates check constraint "patch_versions_tier_check"
    
  • A retried tier 0 publish key still replays: passed end to end, which the last verdict didn't run. I re-sent release 23's captured tier 0 publish, same key and body, to this head and to R25 after the migration. Both answered 201 with the original version, now tier: 1, and wrote no row. The same key with a changed body is a conflict. A new tier 0 manifest is refused before any write.

    same key, same body (release 23's tier 0 publish): 201 {"ok": true, "name": "replay-page", "versionNumber": 1, "tier": 1}
    same key, changed body: 409 publish_key_conflict
    new key, tier 0 at release 0.23.0: 422 release_mismatch
    new key, tier 0 at release 0.25.0: 422 tier_mismatch "Tier 0 is now tier 1. Publish with a tier 1 manifest; a current patchy CLI sends one."
    
  • A builder chooses between two tiers: passed for this PR's part, with this head's packed CLI (0.25.0).

    • init --tier lists 1, 2. --tier 0 is refused, and 1 and 2 scaffold.
    • A config still at tier: 0 is refused by refresh, publish and dev, each with exit 1.
    • Following the message (tier: 1, refresh), the publish succeeds at tier 1.
    tier: 0 config, patchy refresh → exit 1 {"ok":false,"error":"Tier 0 is now tier 1. Set `tier: 1` and run `patchy refresh`.","kind":"local","code":"tier_mismatch"}
    tier: 0 config, patchy publish → exit 1 (same)
    tier: 0 config, patchy dev     → exit 1 (same)
    
  • A pending tier 0 attempt from an older CLI is cleared: passed on a real attempt, at both heads. Release 23's CLI saved it. This head's CLI, on the same state directory, printed the message, and the attempt file was gone. The next publish created pending-page at tier 1.

    run 1 → exit 1 {"ok":false,"error":"An older patchy started a tier 0 publish that was never confirmed. Tier 0 is now tier 1, so it can't be sent again and was cleared. Run `patchy list` to see whether the page was published, and publish it again if it's missing.","kind":"local"}
    run 2 → exit 0 {"ok": true, "name": "pending-page", "tier": 1, "versionNumber": 1}
    
  • Tier 1 can't reach integrations, shared data or members: passed, so PR 1's rules survive.

    • A tier 1 repo declaring members(), posthog(…) or sharedTable(…) is refused by patchy publish with tier_mismatch, and by refresh too at f3afd1b. A raw tier 1 manifest declaring members gets 422 tier_mismatch from the server.
    • In the browser session, a migrated page gets server_required for members.list, shared.list, posthog.query and attio.records.list. Kudos gets it for members.*, shared.list and posthog.query. me and Kudos's own tables.list answer 200.

Golden journeys

  • Sign in: passed (persona sign-in). Signed out, a company page answers 401. Signing in with return= lands on it. CI clerk-live is green.
  • Publish a page: passed. This head's CLI published, and Jordan opened the page at its address and on Home. delete --yes took replay-page off its address. restore brought it back in the scripted frame.
  • Share and unshare: passed. The migrated kickoff brief answered 200 signed out, 401 after share … company and 200 after public.
  • Find and open a tool: passed. Home lists the studio's patches, and search finds the migrated page under Pages. Kudos and New Business open in their frames.
  • Use a tier 1 tool live, and use a tier 2 tool: passed as far as the rehearsal reaches. At every step it opens every patch and requires the live-query deliveries step 1 saw. CI browser and tier2-smoke are green.

Rollback to R2 and R25: passed. R2 and R25 each started on the migrated data, past ledger id 29. On it, each:

  • served every page in the scripted frame, with the #sellers scroll;
  • had its own CLI publish a third version of launch-notes and a new file page, both at tier 1;
  • restored the deleted old-memo, which then served;
  • replayed the migrated receipt, and refused a raw tier 0 publish with 422.

Neither server logged a check-constraint error. Back at the head, every page served again, and nothing re-migrated.

Rehearsing 38e0c37 → b55f247 → 38e0c37 → b55f247 on one set of data.
▶ Step 1: the live commit (38e0c37) seeds the data   passed in 44s
▶ Step 2: HEAD (b55f247) upgrades it                  passed in 24s
▶ Step 3: the live commit (38e0c37) comes back        passed in 19s
▶ Step 4: HEAD (b55f247) comes back                   passed in 18s
Exercised rollback paths passed: 38e0c37 → b55f247 → 38e0c37 → b55f247, in 105s.

The same script also passed at f3afd1b against 18b39ae, in 108s.

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 one-way holds only while R25 or later is the release before this one. Rolling back to release 24 or earlier is not safe, as the PR says.

Not run

  • Log a machine in, and Invite and join: the diff doesn't touch login or membership. CI cli-smoke and clerk-live are green.
  • The two-viewer halves of the tier 1 and tier 2 journeys: not driven by hand. The rehearsal's live-query checks and CI browser and tier2-smoke cover the stream paths.
  • R2 between release 23 and b55f247: skipped in the second chain. R2 doesn't rewrite tier 0 rows, and the first chain ran it.

Notes

@allisonmahmood
allisonmahmood merged commit eabf2e6 into main Oct 29, 2026
38 of 39 checks passed
@allisonmahmood
allisonmahmood deleted the tier-fold/4-no-tier0 branch October 29, 2026 23:07
allisonmahmood added a commit that referenced this pull request Oct 29, 2026
…#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]>
allisonmahmood added a commit that referenced this pull request Nov 1, 2026
## 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:
&lt;origin&gt;/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 &lt;origin&gt;/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 &lt;origin&gt;/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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci CI, shared testing infrastructure, development scripts and tooling area:cli Touches the cli area area:core Touches the core area area:docs Touches the docs area area:integrations Company connections and integration implementations area:primitives Patch tables and files area:server Touches the server area area:ui Portal and first-party browser pages, shared rendering and styles size:xl Over 1,000 changed lines; review in multiple passes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tiers: static pages fold into tier 1, and only tier 2 reaches integrations

1 participant