Skip to content

feat(cli): refresh lists what the releases it crosses change for a patch - #1186

Merged
allisonmahmood merged 1 commit into
mainfrom
lane-d/refresh-release-changes
Nov 4, 2026
Merged

allisonmahmood merged 1 commit into
mainfrom
lane-d/refresh-release-changes

Conversation

@allisonmahmood

@allisonmahmood allisonmahmood commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

What changed

Refresh named new SDK capabilities, but not the behaviour changes in the releases it skipped. An agent upgrading a patch across several releases wasn't told that pages had moved to Preact 11's stricter types, or that ctx.members.list() now returns the patch's guests. One patch counts every member as staff, so a guest would be miscounted. Now a refresh that crosses releases lists each change in them that can make an existing patch build or behave differently. A refresh within one release lists nothing.

Closes #1166

Look at

  • The changes come from What's new. Each release in packages/core/src/whatsNew.ts gains patchChanges: sentences for the agent refreshing a patch, naming what to check. It's required, so the agent writing the next release decides each time, and the header says when to write one. Backfilled for releases 22 (TypeScript 7), 24 (tier 1 reaches only its own tables and files), 25 (tier 0 gone), 30 (Preact 11's types), 31 (guests in the member directory), 32 (Pidgeon's recipient cooldown) and 35, which merged after this was written (patchy/hotkeys's repeat: false, input-method composition and symbol keys, from fix(sdk): hotkeys hold repeat: false across remounts, wait during composition and accept shifted symbols #1152). The rest are []. These never reach the What's new page or /whats-new.json.
  • The installed release lists them, so old CLIs show them too. As with the TypeScript warning in fix(cli): refresh from an old CLI warns about TypeScript 7 #1185, which this PR stacks on, an old pinned CLI only relays what the installed release's toolchain inspection reports. The inspection reads the release the repo's last generation names (patchy/_generated/index.json, not yet replaced at that point), and adds a Changed in 0.<id>.0: … warning for each patch change after it, oldest first (releaseChanges.ts). The CLI's import allowlist gains @patchy/core/whatsNew.
  • A real 0.13 CLI, before and after. The repo from fix(cli): refresh from an old CLI warns about TypeScript 7 #1185's transcript, refreshed by its 0.13.0 CLI, then once more by the release it now pins. Today's instance won't let a 0.13 CLI start a repo, so today's CLI starts it and the first line marks its last generation as release 13's:

Transcript old-cli-crossed-releases

Before is 8fea661 (--base) and after is 3d330d1 (lane-d/refresh-release-changes), 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, login-code, API-key and access-token shapes, email addresses outside the scenarios' example domains, secret-named variables, and any accounts the run acts as).

1 of 3 lines changed.

A repo last generated by release 13, pinned to its 0.13 CLI and still on TypeScript 6
$ patchy init old-notes --purpose "Synthetic notes" --json > /dev/null && cd old-notes && pnpm add --s…: no change, exit 0 in 4.8 s
$ patchy init old-notes --purpose "Synthetic notes" --json > /dev/null && cd old-notes && pnpm add --save-dev --ignore-workspace 'patchy@file:/tmp/patchy-0.13.0.tgz' 'typescript@^6' > /dev/null 2>&1 && node -e 'const fs = require("fs"); const file = "patchy/_generated/index.json"; fs.writeFileSync(file, JSON.stringify({ ...JSON.parse(fs.readFileSync(file, "utf8")), release: "0.13.0" }))' && pnpm -…
0.13.0

Lines are cut at 400 characters. --json has it all.

Its own 0.13 CLI refreshes it to the instance's release

Changed. Before, exit 0 in 3.4 s; after, exit 0 in 2.4 s.

$ cd old-notes && pnpm --silent patchy refresh --json | node -e 'const r = JSON.parse(require("fs").readFileSync(0, "utf8")); console.log(JSON.stringify({ ok: r.ok, release: r.release, warnings: r.warnings }, null, 2))'
{
  "ok": true,
  "release": {
    "from": "0.13.0",
    "to": "0.34.0"
  },
  "warnings": [
    "This repo has TypeScript 6.0.3; this release publishes only TypeScript ^7.0.2 (tested against 7.0.2). Run: pnpm add --save-dev 'typescript@^7.0.2'. typescript-eslint doesn't run beside TypeScript 7: if the lint script runs ESLint, move it to Oxlint as .agents/skills/patchy-loop/SKILL.md says.",
    "Changed in 0.22.0: Publish needs TypeScript 7: it refuses a repo whose installed TypeScript is outside the release's range. typescript-eslint can't run beside TypeScript 7, so a lint script on ESLint moves to Oxlint, as Toolchain in .agents/skills/patchy-loop/SKILL.md says.",
    "Changed in 0.24.0: A tier 1 page reaches only its own tables and files. Company connections, other patches' shared tables and stores, the member directory and member columns are tier 2's, reached from server handlers; refresh, dev and publish refuse a tier 1 repo that declares any of them with tier_mismatch.",
    "Changed in 0.25.0: Tier 0 is gone: a repo still at tier 0 is refused until patchy.config.ts says tier: 1 and refresh runs.",
    "Changed in 0.30.0: Pages build on Preact 11, whose types are stricter, so publish's typecheck can fail where it passed before. Attribute and event types such as HTMLAttributes, TargetedEvent and CSSProperties come from patchy/preact, no longer from its JSX namespace.",
    "Changed in 0.31.0: The member directory includes the patch's guests, people at another company it's shared with: list, search, get, pickers and member columns can return them, with guest: true and never admin. Code that counts every member as company staff should check guest, and a handler result schema that lists a member's fields needs guest too.",
    "Changed in 0.32.0: A Pidgeon send held by the recipient cooldown, a new message to someone the address wrote to recently, fails with source_rate_limited and details.limit recipient_cooldown: nothing was sent, and sending again soon is held too, so reply in the conversation instead."
  ]
}
@@ 5 unchanged lines @@
   },
   "warnings": [
-    "This repo has TypeScript 6.0.3; this release publishes only TypeScript ^7.0.2 (tested against 7.0.2). Run: pnpm add --save-dev 'typescript@^7.0.2'. typescript-eslint doesn't run beside TypeScript 7: if the lint script runs ESLint, move it to Oxlint as .agents/skills/patchy-loop/SKILL.md says."
+    "This repo has TypeScript 6.0.3; this release publishes only TypeScript ^7.0.2 (tested against 7.0.2). Run: pnpm add --save-dev 'typescript@^7.0.2'. typescript-eslint doesn't run beside TypeScript 7: if the lint script runs ESLint, move it to Oxlint as .agents/skills/patchy-loop/SKILL.md says.",
+    "Changed in 0.22.0: Publish needs TypeScript 7: it refuses a repo whose installed TypeScript is outside the release's range. typescript-eslint can't run beside TypeScript 7, so a lint script on ESLint moves to Oxlint, as Toolchain in .agents/skills/patchy-loop/SKILL.md says.",
+    "Changed in 0.24.0: A tier 1 page reaches only its own tables and files. Company connections, other patches' shared tables and stores, the member directory and member columns are tier 2's, reached from server handlers; refresh, dev and publish refuse a tier 1 repo that declares any of them with tier_mismatch.",
+    "Changed in 0.25.0: Tier 0 is gone: a repo still at tier 0 is refused until patchy.config.ts says tier: 1 and refresh runs.",
+    "Changed in 0.30.0: Pages build on Preact 11, whose types are stricter, so publish's typecheck can fail where it passed before. Attribute and event types such as HTMLAttributes, TargetedEvent and CSSProperties come from patchy/preact, no longer from its JSX namespace.",
+    "Changed in 0.31.0: The member directory includes the patch's guests, people at another company it's shared with: list, search, get, pickers and member columns can return them, with guest: true and never admin. Code that counts every member as company staff should check guest, and a handler result schema that lists a member's fields needs guest too.",
+    "Changed in 0.32.0: A Pidgeon send held by the recipient cooldown, a new message to someone the address wrote to recently, fails with source_rate_limited and details.limit recipient_cooldown: nothing was sent, and sending again soon is held too, so reply in the conversation instead."
   ]
 }
Refreshing again, now within one release
$ cd old-notes && pnpm --silent patchy refresh --json | node -e 'const r = JSON.parse(require("fs").re…: no change, exit 0 in 2.0 s
$ cd old-notes && pnpm --silent patchy refresh --json | node -e 'const r = JSON.parse(require("fs").readFileSync(0, "utf8")); console.log(JSON.stringify({ ok: r.ok, release: r.release, warnings: r.warnings }, null, 2))'
{
  "ok": true,
  "release": {
    "from": "0.34.0",
    "to": "0.34.0"
  },
  "warnings": [
    "This repo has TypeScript 6.0.3; this release publishes only TypeScript ^7.0.2 (tested against 7.0.2). Run: pnpm add --save-dev 'typescript@^7.0.2'. typescript-eslint doesn't run beside TypeScript 7: if the lint script runs ESLint, move it to Oxlint as .agents/skills/patchy-loop/SKILL.md says."
  ]
}
  • The test, red then green. In cliRepo.test.ts, a repo last generated by release 29 must list exactly what releases 30 onward record, then nothing on a second refresh. With toolchainChild.ts restored to the base's, it fails: AssertionError: expected [] to deeply equal [ …(3) ].

How it was verified

Locally, with CI running the full suite:

  • pnpm check on this branch: format, lint and synth pass. Typecheck caught the portal's What's new test fixtures missing patchChanges; they have it now, one fixture showing it stays out of /whats-new.json, and turbo run typecheck typecheck:tests passes. The offline test step's 25 failures were stray-request asserts and 5-second timeouts under load in files this doesn't touch; those files passed on their own, cliPublish's request-counting sharing test on 3 reruns of 3.
  • cliRepo.test.ts (the new test, and fix(cli): refresh from an old CLI warns about TypeScript 7 #1185's cross-release test, which now also expects a crossed release's line through an installed CLI), whatsNew.test.ts and WhatsNewPages.test.ts pass.
  • The red-then-green run above, rebuilding the CLI package each way.
  • The transcript above: a real 0.13.0 CLI refreshing to this branch's release on throwaway instances.
  • No full pnpm verify locally; CI is the judge for the full suite.

Release impact

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

It adds warnings to refresh and a field to the release list.

  • What does a revert leave behind? Nothing stored.
  • Does the release before it still work with that? Yes. The toolchain reply's shape is unchanged.

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:ui Portal and first-party browser pages, shared rendering and styles size:m 100-500 changed lines labels Nov 1, 2026
@allisonmahmood

Copy link
Copy Markdown
Owner Author

Review (GPT 6.1 Sol, xhigh) on 3d330d1: PASS, no findings.

  • Reading the last release: inspection reads the previous generated index before replacing it. A missing or legacy index produces no notes, safely.
  • Which notes print: only releases strictly after the last generation, oldest first. A same-release refresh or a downgrade prints none.
  • The backfilled notes match their originating PRs, including the guest result-schema change and Pidgeon's changed cooldown classification.
  • No leaks: the What's new page and the JSON feed select other fields, and sentinel notes reached neither.
  • The deploy procedure: the required patchChanges field fits it. CLAUDE.md sends writers to the updated header.
  • Tests: the real 0.13 upgrade printed six notes, then none on repeat. Reverting the change makes the test fail.

@allisonmahmood

Copy link
Copy Markdown
Owner Author

Acceptance: PASS with notes

Checked 3d330d1 (base 8fea661, #1185's head) on team, by Claude Opus 5.5 in Claude Code.

Done means

  • A refresh that crosses releases lists the changes in them that can change how an existing patch builds or behaves, from release information Patchy already keeps: passed. Each repo was started by the environment's CLI, pinned to a real 0.13.0 release tarball and refreshed through that 0.13 CLI:
    • Last generated by release 13, on TypeScript 6.0.3: the TypeScript notice, then Changed in lines for 0.22.0, 0.24.0, 0.25.0, 0.30.0, 0.31.0 and 0.32.0. They're oldest first, each listed once, and match patchChangesBetween(13, 34) from this head's whatsNew.ts word for word.
    • Last generated by release 29, on TypeScript 7.0.2, plain text: only 0.30.0, 0.31.0 and 0.32.0 print, above Refreshed 0.13.0 → 0.34.0., with no TypeScript notice.
  • A refresh that changes nothing lists nothing: passed. Refreshing the release-13 repo a second time (0.34.0 → 0.34.0) printed only the TypeScript notice and no Changed in lines. A repo whose index.json has no release field listed nothing, and its refresh still succeeded.
  • The notes never show on the What's new page or /whats-new.json: passed. Signed in as Ben, I fetched /whats-new and Home, and fetched /whats-new.json signed out. All three answered 200. I probed each response with two 40-character slices of every patch change (12 probes) and with Changed in. None matched any of them. The page and the JSON did carry the release titles for 30 and 31. /whats-new.json releases hold only id, date, changes. As a control, the same probes found 12 of 12 in the refresh output.
The crossing refresh, its repeat, and the comparisons
$ pnpm --silent patchy --version          # repo last generated by release 13, TypeScript 6.0.3
0.13.0
$ pnpm --silent patchy refresh --json     # trimmed to ok, release, warnings
{
  "ok": true,
  "release": { "from": "0.13.0", "to": "0.34.0" },
  "warnings": [
    "This repo has TypeScript 6.0.3; this release publishes only TypeScript ^7.0.2 (tested against 7.0.2). Run: pnpm add --save-dev 'typescript@^7.0.2'. …",
    "Changed in 0.22.0: Publish needs TypeScript 7: …",
    "Changed in 0.24.0: A tier 1 page reaches only its own tables and files. …",
    "Changed in 0.25.0: Tier 0 is gone: …",
    "Changed in 0.30.0: Pages build on Preact 11, whose types are stricter, …",
    "Changed in 0.31.0: The member directory includes the patch's guests, …",
    "Changed in 0.32.0: A Pidgeon send held by the recipient cooldown, …"
  ]
}
compared with patchChangesBetween(13, 34): {"releasesListed":[22,24,25,30,31,32],"matchesReleaseList":true,"noDuplicates":true,"oldestFirst":true}

$ pnpm --silent patchy refresh --json     # again, now on 0.34.0
{
  "ok": true,
  "release": { "from": "0.34.0", "to": "0.34.0" },
  "warnings": [
    "This repo has TypeScript 6.0.3; this release publishes only TypeScript ^7.0.2 (tested against 7.0.2). …"
  ]
}
compared with patchChangesBetween(34, 34): {"releasesListed":[],"matchesReleaseList":true,"noDuplicates":true,"oldestFirst":true}
/whats-new (Ben)          200  patch-change probes 0/12, "Changed in" absent, release titles 2/2
/ (Ben)                   200  patch-change probes 0/12, "Changed in" absent
/whats-new.json (public)  200  patch-change probes 0/12, "Changed in" absent, release titles 2/2
refresh output (control)       patch-change probes 12/12

Golden journeys

  • Publish a page: passed. Ada's CLI published an HTML page, and Ben opened it at its address, where its frame loaded, and on Home. Signed out, the address answered 401. Retired, the address showed the retired page. Restored, the patch was back in its frame. No other journey reaches refresh or What's new.

Rollback answers: they match the diff. There's no migration and nothing is stored. patchChanges lives only in the server's built-in list and the CLI bundle, and /whats-new.json keeps its shape. A revert drops the notes and the field, so one-way isn't needed.

Not run

  • A repo actually generated by an older release's server: today's instance generates only as 0.34.0. As in the PR's transcript, I set the release field of the repo's patchy/_generated/index.json to "0.13.0" (and "0.29.0") by hand. Git history shows real generations carry it: generation has written release: CURRENT_RELEASE into index.json since feat(sdk): initialize and refresh patch projects #220, and CURRENT_RELEASE has been 0.<id>.0 since 0.9.0. Refresh at releases 13, 21, 29 and 34 also runs the installed release's inspection before it activates the new generated files, so the old index is still there when the notes are read.

Notes

  • The note above is the only gap. The notes' from comes from a field I set by hand, though every release since 0.9.0 writes that field the same way.

@allisonmahmood
allisonmahmood force-pushed the lane-d/refresh-ts7-warning branch from 8fea661 to 4cb292c Compare November 4, 2026 02:53
Base automatically changed from lane-d/refresh-ts7-warning to main November 4, 2026 03:05
@allisonmahmood
allisonmahmood force-pushed the lane-d/refresh-release-changes branch from 3d330d1 to 2363aab Compare November 4, 2026 03:05
@allisonmahmood
allisonmahmood merged commit cdda393 into main Nov 4, 2026
23 checks passed
@allisonmahmood
allisonmahmood deleted the lane-d/refresh-release-changes branch November 4, 2026 03:17
allisonmahmood added a commit that referenced this pull request Nov 4, 2026
…ges publish (#1241)

## What changed

This adds release 36's What's new entry, written from `1acc968`. It
covers everything merged since release 35's `through` (`dd0e2ec`), and
sets the `patchy` release to `0.36.0` in `packages/patchy/package.json`
and `CURRENT_RELEASE`.

| Change | PRs |
| --- | --- |
| Improved: shortcuts work where you use them (keys for one part of a
patch, the closest wins, text boxes keep their typing keys) | #1231 |
| Improved: the shortcuts sheet shows what works where you are (Ctrl+/
and ⌘/ open it, its commands run, it opens from a patch's menu and in
view on a narrow screen, keeps the look, spells keys out away from a
Mac) | #1231, #1181, #1178, #1180, #1177 |
| Fixed: keys pressed while a patch opens reach it | #1183 |
| Fixed: pages styled with Tailwind 4 publish, and a look with the same
rule saves | #1191 |
| Fixed: an old copy of a patch no longer replaces newer work
(**Breaking** for such a copy: it needs `patchy pull` or one
`--allow-behind` publish) | #1179 |
| Improved: your agent can check a publish before sending it | #1188 |
| Improved: your agent hears what changed when it updates a patch |
#1186, #1185 |
| Fixed: your agent stops chasing false alarms (`pnpm install` exit
codes, `manifest.json` bytes, the description notice, a copied dev
record) | #1176, #1174, #1175 |
| Behind the scenes: fuller hotkeys instructions for agents; fewer
redraw costs for patches with many shortcuts | #1182, #1187 |

`patchChanges` has three sentences for the agent refreshing a patch
across this release:
- #1231's, from its PR: text fields keep their keys, `preventDefault()`,
and the sheet's Mod+/ and `.hotkey-row` buttons.
- The sheet's dialog renders in `document.body`, and element-only page
rules don't reach it (#1178, #1180). Its own row lists last (#1181). The
hotkey label helpers take only valid literals (#1177).
- Publish's `unknown_base_version` (#1179).

It also rewords release 33's "Press ? to see every shortcut a patch
has". That was true only for a patch that mounts the shortcuts sheet, so
it now says a patch *can* list its shortcuts.

The rest get no line:
- #1206, #1207, #1209 and #1220 are `pnpm dev eval` tooling.
- #1222 is release 35's own entry.

## Look at

- **The entry**, at the top of `releases` in
`packages/core/src/whatsNew.ts`, and release 33's reworded line.
- **Rollback safety, from the live commit `d28fdd0` (release 35) to
`1acc968`:**
- #1191 is labelled `one-way`. Its Release impact: a company look
published after this release with a nested `@supports` condition stays
stored after a revert. Release 35 refuses any bundle carrying it, so
repo publishes in that company would fail until an admin runs `patchy
look restore` to an earlier revision. Pages and Tailwind 4 repos already
published stay published.
- #1183 is the only change to what the server serves browsers: the
shell's script, under a digest-named URL. Its revert leaves nothing
behind.
- The hotkeys PRs change `patchy/hotkeys`, which patches bundle when
they are built. Published patches keep their copy.
- The CLI PRs change what a CLI writes and refuses. Release 35 reads
everything they leave behind: #1176's `allowBuilds` entry, #1174's
indented `manifest.json`, and the `version` recorded by an
`--allow-behind` publish.

**Rollback line:** If this release misbehaves, roll back to `d28fdd0`
(release 35). First check that no company's look has a nested
`@supports` condition, and `patchy look restore` an earlier revision
where one does (#1191).

## How it was verified

- **Tests.** `whatsNew.test.ts`, `WhatsNewPages.test.ts` and
`schemas.test.ts` pass (22 tests), and `bun fmt` passes on the changed
files.
- **Facts.** The sheet's new `document.body` home and its element-rule
reset were checked against `hotkeys.ts` and `hotkeySheet.ts` on main.
- **Deploy state.** I pinned the live commit from `/healthz/deep`:
`d28fdd0` (release 35). The Deploy run updated last succeeded, and none
is unfinished.

## Release impact

- [ ] **Breaking** — requires action from anyone already running this
- [x] **Not breaking** — no action required

Text and version numbers only. Like every release, the `0.36.0` bump
tells CLIs and patch repos installed before this deploy to upgrade.

- **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]>
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:server Touches the server area area:ui Portal and first-party browser pages, shared rendering and styles size:m 100-500 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refresh doesn't mention behaviour changes in the releases it skips

1 participant