Repository navigation
Closed
Labels
area:cliTouches the cli areaarea:docsTouches the docs areaarea:serverTouches the server areaenhancementNew feature or request
Description
Problem
There are three tiers, and their jobs overlap. Tier 0 is a static page. Tier 1 is a browser tool, but it can also reach company integrations straight from the browser, as the viewer. That makes tier 1's boundary "whatever the browser can call". Guest sharing (#969) needed special cases because of it, and every agent has to choose among three tiers.
Direction
Two tiers, each with one clear boundary:
- Tier 1: a page, static or interactive, with the patch's own tables and files, shared tables and stores, and the member directory. No integrations.
- Tier 2: the full app, with server handlers. It is the only tier that reaches company integrations.
Tier 0 goes away. Publishing a single HTML file produces a tier 1 patch. Tiers 3 and 4 keep their numbers.
What production has today
A read-only check on 2026-10-28:
- Tier 1 patches using an integration belong only to Patchy.
patchy-analytics's current version declares PostHog, and an older retained tier 1 version ofcloud-pulsedeclares PostHog too. We migrate these ourselves. - Tier 0: 25 live pages. 19 are Patchy's; 6 belong to four other companies, and 2 of those 6 are public. All of them must keep serving at the same addresses with nothing for their owners to do.
To settle while building
- Existing tier 0 versions, numbered historical ones included, keep serving unchanged. Convert them when serving, or migrate the rows.
- Older CLIs in the wild still publish tier 0, so the server accepts those publishes as tier 1 (ADR-0004).
patchy publish page.htmlstays a single-file publish with no repo.- Public pages lose tier 0's "the document runs no script" promise. It becomes tier 1's sandbox promise: patch code has no network access, and a public shell starts only Patchy's broker. Restate it in
docs/product.md. - Tier 2 runs on the execution fleet while someone has the patch open. A dashboard that reads an integration and was a tier 1 page becomes fleet time.
- On tier 2, PostHog is callable only from actions (
docs/product.md› Connecting PostHog). A live PostHog dashboard moving off tier 1 loses live updates unless tier 2 queries can call PostHog. - Update the docs, the global and project skills, glossaries and What's new.
Guest access
#969 ships guests on tiers 0 and 2. Once this lands, tier 0 guest access carries over to tier 1, limited to the patch's own data, and #969's tier table changes to match.
Done means
- A builder chooses between two tiers: tier 1 for a page and its own data, tier 2 for anything that reaches an integration.
- Every page that served before still serves at its address, with no action from its owner.
- Tier 1 can't call an integration, and Patchy's own tier 1 integration patches have moved to tier 2.
Metadata
Metadata
Assignees
Labels
area:cliTouches the cli areaarea:docsTouches the docs areaarea:serverTouches the server areaenhancementNew feature or request
Activity
allisonmahmood commentedon Oct 29, 2026
The plan below has been agreed and reviewed by GPT 6.1 Sol. Building starts now, as four PRs over three releases.
Repo allisonmahmood/patchy-cloud, base
origin/main2f9f7c1. v2 folds in Sol's first review (GPT 6.1 xhigh, 2026-10-29); v3/v4 fold in Allison's answers (2026-10-29).Decided by Allison (2026-10-29)
me()(who is viewing) and routing. It has no integrations, no shared tables or stores of other patches, and no member directory. Because member columns require the members declaration (memberColumnsValid), tier 1 has no member columns either. All of those are tier 2. On the portal, tier 1 patches are Pages and tier 2 patches are Tools.Production facts (read-only, 2026-10-29)
original_filenameis set andrepo_nameis null.uses.url()or@import.href="about:srcdoc#…"table-of-contents links, which work only inside srcdoc. No other page has them. The only other non-fragment link is on one of our own pages.cloud-pulsev1 declares PostHog. It's an old version (the current one is tier 2), but it can still be opened at/~v/1.patchy-analyticsv1 declares PostHog. It's the current version of a retired patch.scenarios/pidgeon/patches/support-deskandscenarios/attio/patches/deal-desk.scenarios/brightline/patches/kudosis tier 1 and uses members and member columns.manifest.sdkImports.WIRE_VERSIONhas always been 1.publish_response.tieris stored on every row and replayed on publish retry. Replay runs before the release check (PatchesApi.ts:505).apps/infra/src/AppStack.ts:403).scripts/rollback-rehearsal.ts:857) and has no one-way exemption.Rollout: expand, then contract
Each release can be rolled back to the one before it, and the rehearsal passes at every step. There are no one-way labels and no exemptions.
Allison cuts each release as soon as the previous one is healthy (minutes, not days). PR 4 does not wait for Srikar's guest stack; that stack is being closed and rebuilt and picks up
tier = 1itself. Migration id allocated at landing (after #996 if it lands first).PR 1: tier 1 reaches only its own patch (ships alone)
uses: nopostgres,posthog,pidgeon,attio,sharedTable,sharedStoreormembers. Anything else fails withtier_mismatchinPatchesApi. Member columns already requiremembers, so they fall out.patchy devenforces the same rule.shared.*andmembers.*operation at every tier withServerRequired(packages/runtime/src/Runtime.ts), generalizing the existing tier 2 rule. This covers retained and restored versions.CallbackGateway, the handlers and the schemas stay for tier 2.principalbootstrap for public tier 1 andpublicDirectoryinpackages/serving/src/Pages.ts. Public versions then reach no data.tables.*only (packages/api/src/api.ts:1149).patchy.connections,patchy.sharedandpatchy.members, and generation stops resolving them for tier 1.createPidgeonClientandcreateAttioClientexports inpatchy/clientstay, because tier 2 generated modules import them.support-deskanddeal-deskmove to tier 2 actions, andkudosmoves to tier 2: their configs,scenario.jsonand page calls.docs/product.md, both the integrations and the tiers sections.sdkCapabilities.tstext.patchy-postgres,patchy-posthog,patchy-pidgeon,patchy-attio,patchy-members,patchy-shared-tables,patchy-shared-storesandpatchy-loop.docs/DEVELOPMENT.mdanddocs/API.md.test/browser-tier1.PR 2: the shell no longer requires the SDK handshake (ships alone)
packages/serving/src/broker.ts:351). The missing-attributesbootstrap_failedpath and the wirestale()path stay.ready(or the first subscription, as today), and thereadyhandler starts it if it isn't running.PR 3: single files publish as tier 1 (after R1 is live)
patchy publish page.htmlandpatchy validatebuild a tier 1 manifest with nosdkImports.repoBuild.tsinto a shared helper. Inline script and style are allowed, external resources are refused, and the cap is 10 MiB.validateHtmlleaves the CLI.tier <= 1, because tier 0 rows still exist; PR 4 makes ittier === 1. The tier is already on the row, so nothing new is carried. One predicate drives:patchMark;isWelcomePageon Home and in the guide;patch.first_opened'swelcomePage.skills/patchy/SKILL.md, plus itsskills-lock.jsonhash: a file publish is tier 1, script is allowed, it must be self-contained and is capped at 10 MiB, and the "fetch a public tier 0 page directly" line goes.packages/patchy/README.mdand ADR-0004.PR 4: tier 0 is gone (after R2 is live)
Migration (patches capability), one transaction over every row, deleted patches included:
tiercolumn,manifest.tierandpublish_response.tierto 1 where they are 0, leavingpayload_digestalone;tier BETWEEN 1 AND 3.The vitest template and dev seed follow.
Schemas.
Manifest.tierbecomesLiterals([1, 2, 3])inschemas.ts:604andmanagement.ts:161, and the publish response follows.CLI.
init --tieraccepts 1 or 2, and the config type becomes1 | 2 | 3.tier: 0gets: "Tier 0 is now tier 1. Settier: 1and runpatchy refresh."State.ts:387) is cleared with a message: checkpatchy list, and republish if it's missing.repoBuildanddevServer(which then always usesdocumentTitle);initProject,ProjectandexecuteConfig;generateClient.ts:5andscripts/dev/src/scenario.ts:28.Server publish.
validateHtml,maxHtmlBytes).PatchesApi.ts:373), and the publish envelope cap keeps the snapshots allowance (PatchesConfig.ts:52).PATCHY_MAX_HTML_BYTESgoes, fromapi.ts,docs/API.md, OPERATIONS, the packed CLI harness andci.yml:142. The poison value there is replaced with a surviving setting.Serving.
Pages.tsandshell.ts.shell-headers.ts;PATCH_CONTENT_SECURITY_POLICYstays for notices.framedDocumentstays only forlookPreview.Core.
validateHtmlgoes, along with theacceptandrejectfixtures and their readers (seed:dev,test/cli.ts,repoBuild.test.ts:26,look-preview.spec.ts:151,cliLook.test.ts:5).documentTitleand the parse-bound coverage stay.Stacks.
tier IN (0, 1)checks becometier = 1, and its tier 0 guest serving path folds into tier 1. Grants are patch-bound, so they carry over.pullKindbecomesrepo === null && originalFilename !== null, with snapshots still taking precedence.The one page with
about:srcdoc#links: the break is accepted. Its owner is told before R3 is deployed.Sweep.
packed-install-e2e.mjs:59,packed-preact-e2e.mjs:135,packed-cli-e2e.mjs:2168.apps/server/src/test/server.ts:72,test/browser/fixtures.ts:97,packages/mcp/src/test/door.ts:343(its negative case becomes tier 1) and the package fixtures.transcript.test.ts:52.scripts/rollback-rehearsal.ts:995, whose subscription expectations should follow what each patch actually subscribes to.patchy-serverskill at line 365.Docs.
docs/product.md, CLAUDE.md and AGENTS.md.scenarios/README.md.patchy-lookandpatchy-loopskills.GLOSSARY-MAP.md.README.mdand What's new.Planned by Claude Opus 5.5 in Claude Code, through T3 Code.
feat(patchy): single-file pages publish as tier 1 and may run script
fix(serving): a page that doesn't use the SDK opens without "could no…
feat(patchy): single-file pages publish as tier 1 and may run script
feat(runtime): tier 1 reaches only its own tables and files
fix(serving): a page that doesn't use the SDK opens without "could no…
feat(runtime): tier 1 reaches only its own tables and files
feat(runtime): tier 1 reaches only its own tables and files
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 no…
fix(serving): a page that doesn't use the SDK opens without "could no…
feat(patchy): single-file pages publish as tier 1 and may run script
docs(whats-new): company data goes through a patch's own rules (#1060)
feat(patchy): single-file pages publish as tier 1 and may run script
feat(patchy): single-file pages publish as tier 1 and may run script (#…
docs(whats-new): pages published from one HTML file can run script (#…
docs(whats-new): older single-file pages run the same way as new ones (…