Skip to content

fix(cli): refresh from an old CLI warns about TypeScript 7 - #1185

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

allisonmahmood merged 1 commit into
mainfrom
lane-d/refresh-ts7-warning

Conversation

@allisonmahmood

@allisonmahmood allisonmahmood commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

What changed

Refreshing an old patch repo that was still on TypeScript 6 printed "warnings": []. Only the next patchy dev said publishing needs TypeScript 7, and publish refused until then. The repo upgrades through its own pinned CLI, and CLIs older than 0.22 never checked TypeScript. Now the release being installed reports it, so the refresh that moves the repo warns, whichever CLI runs it. patchy-loop also lists the accepted toolchain ranges now, and how to move from ESLint to Oxlint, with a version.

Closes #1165

Look at

  • The installed release runs the check. pnpm patchy refresh runs the repo's pinned CLI, which installs the new release and then runs that release's toolchainChild.js inspect. Every CLI since early October relays that reply's warnings; that's how Vite warnings already reached old CLIs. The TypeScript check now runs there too (toolchainChild.ts), and refresh no longer checks TypeScript itself (Project.ts). Dev and publish keep their own check. All three share one message, typescriptNotice.ts, which now points at patchy-loop.
  • Toolchain in patchy-loop. A table of the accepted and tested versions, what publish, dev and refresh do with each, and the ESLint-to-Oxlint move with oxlint@^1.90.0. A test keeps the table and the Oxlint version in step with toolchain.json and the scaffold. patchy-preact keeps the .oxlintrc.json and points to it.
  • A real 0.13 CLI, before and after. A repo pinned to a 0.13.0 release built from its own commit, on TypeScript 6, refreshed by that CLI on throwaway instances at main and at this branch:

Transcript old-cli-typescript-6

Before is 1f187a9 (where this branch left main) and after is 8fea661 (lane-d/refresh-ts7-warning), 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 2 lines changed.

A repo pinned to the 0.13 CLI and still on TypeScript 6, as repos started before TypeScript 7 are
$ patchy init old-notes --purpose "Synthetic notes" --json > /dev/null && cd old-notes && pnpm add --s…: no change, exit 0 in 4.4 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 && pnpm --silent patchy --version && pnpm exec tsc --version
0.13.0
Version 6.0.3
Its own 0.13 CLI refreshes it to the instance's release

Changed. Before, exit 0 in 1.5 s; after, exit 0 in 2.1 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."
  ]
}
@@ 4 unchanged lines @@
     "to": "0.34.0"
   },
-  "warnings": []
+  "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 pinned to an older release refreshes through its installed CLI and through the workspace CLI, and both must warn about TypeScript. With toolchainChild.ts restored to main's, it fails:

    AssertionError: expected { ok: true, release: { …(2) }, …(3) } to match object { ok: true, release: { …(2) }, …(2) }
    -     StringContaining "This repo has TypeScript 7.0.2; this release publishes only TypeScript ^99.0.0",
    

How it was verified

Locally, with CI running the full suite:

  • pnpm check: format, lint, typecheck and synth pass. Its offline test step lost 59 tests to workers killed at a load average around 65 from other work on the machine; the files this change touches (cliRepo, cliRepoBuild, initProject, devLifecycle, and packages/sdk's SdkApi, which serves patchy-loop) then passed on their own, one stray-request flake passing on rerun.
  • 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.
  • The automated test can't run a CLI that old: a release tarball is 22 MB and only builds from its own commit. Its refreshing CLI now checks no TypeScript itself, so the warning can only come from the installed release's reply, which is the path older CLIs take. The transcript covers the real old CLI.
  • 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 a warning to refresh, and moves skill text. A repo pinned to 0.22–0.34 that is still on TypeScript 6 sees the warning twice on its next refresh: its own CLI's line, pointing at patchy-preact, and the new release's, pointing at patchy-loop. Both say the same thing. From then on it sees one.

  • What does a revert leave behind? Nothing stored. Repos refreshed meanwhile keep the release's skills until their next refresh.
  • 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:cli Touches the cli area area:docs Touches the docs area size:m 100-500 changed lines labels Nov 1, 2026
@allisonmahmood

Copy link
Copy Markdown
Owner Author

Review (GPT 6.1 Sol, xhigh) on 8fea661: PASS with notes, no findings.

  • The warning reaches old CLIs. Older refresh implementations relay the installed release's warnings. A real 0.13.0 CLI warned on TypeScript 6.0.3, and said nothing on 7.0.2.
  • Dev and publish keep their checks. The Toolchain table matches toolchain.json, and the Oxlint guidance stays advisory.
  • Tests: removing the child-side check makes the new test fail.

Notes:

  • Repos pinned to 0.22–0.34 see the warning twice on one upgrade. That's acceptable: the old parent adds its own differently worded text, so a simple dedupe can't fix it.
  • The automated fixture uses current code behind an old pin. The real 0.13 tarball was verified separately.

@allisonmahmood

Copy link
Copy Markdown
Owner Author

Acceptance: PASS with notes

Checked 8fea661 (base 1f187a9) on team, by Claude Opus 5.5 in Claude Code.

Done means

  • Refreshing a repo pinned to an old CLI, still on TypeScript 6, to the current release prints the TypeScript 7 warning in that refresh's output: passed. I started repos with the environment's CLI, pinned them to a real 0.13.0 release tarball, and refreshed each through its own 0.13 CLI:
    • TypeScript 6.0.3, --json: release 0.13.0 → 0.34.0, warnings holds the TypeScript notice (below).
    • TypeScript 6.0.3, plain text: the same notice prints above Refreshed 0.13.0 → 0.34.0.
    • TypeScript 7.0.2, --json: "warnings": [].
  • A test covers a real old-to-current upgrade: passed, with a note. cliRepo.test.ts refreshes a repo from a 0.21.0 pin through both the installed and the workspace CLI, and expects the TypeScript notice. CI is green on this head. See Notes.
  • patchy-loop states the accepted toolchain ranges and the ESLint-to-Oxlint move, with a version: passed. After the refresh, the repo's .agents/skills/patchy-loop/SKILL.md has ## Toolchain with typescript ^7.0.2, vite ^8.3.0, vite-plugin-singlefile ^2.3.3 and @types/node ^22.19.0. Those match the release's toolchain.json. It also gives the Oxlint move with oxlint@^1.90.0.
The refreshes through the 0.13 CLI
$ pnpm --silent patchy --version          # TypeScript 6.0.3 repo
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'. 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."
  ]
}

$ pnpm --silent patchy refresh            # a second TypeScript 6.0.3 repo, plain text
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.
Refreshed 0.13.0 → 0.34.0.
Updated managed pins and installed the release's dependencies.

$ pnpm --silent patchy refresh --json     # TypeScript 7.0.2 repo
{
  "ok": true,
  "release": { "from": "0.13.0", "to": "0.34.0" },
  "warnings": []
}

Beyond Done means

  • Publish still refuses TypeScript 6, and following the warning clears it: passed. On the refreshed TypeScript 6 repo, patchy publish --json exited 1 with toolchain_unsupported, and its message names .agents/skills/patchy-loop/SKILL.md. I then ran the warning's command, pnpm add --save-dev 'typescript@^7.0.2'. The next refresh had "warnings": [], pnpm typecheck passed, and publish succeeded.

Golden journeys

Rollback answers: they match the diff. There's no migration, nothing is stored, and the toolchain child's reply keeps its shape. A revert only drops the child-side notice and the skill text, so one-way isn't needed.

Not run

  • The ESLint-to-Oxlint steps on a repo that lints with ESLint: the scaffold already uses Oxlint. initProject.test.ts keeps the skill's Oxlint version in step with the scaffold's.
  • patchy dev's TypeScript 6 warning: this PR only rewords it, and CI's tests cover it.
  • The double warning on repos pinned to 0.22–0.34, which the PR describes: only a 0.13 tarball was at hand.

Notes

  • The automated test's "old" CLI is today's build installed under a 0.21.0 pin, not a real old release. The real old CLI is covered only by the PR's transcript and this run, not by CI. That holds up: the refreshing CLI no longer checks TypeScript, so the test fails if the installed release stops reporting the notice, and old CLIs can't change. Read literally, though, the Done means line asks for a test of a real old-to-current upgrade.

@allisonmahmood
allisonmahmood force-pushed the lane-d/refresh-ts7-warning branch from 8fea661 to 4cb292c Compare November 4, 2026 02:53
@allisonmahmood
allisonmahmood merged commit 80b72d7 into main Nov 4, 2026
24 checks passed
@allisonmahmood
allisonmahmood deleted the lane-d/refresh-ts7-warning branch November 4, 2026 03:05
allisonmahmood added a commit that referenced this pull request Nov 4, 2026
…tch (#1186)

## 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 #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 #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 #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:

<!-- patchy-dev:transcript:old-cli-crossed-releases -->

#### 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

<details><summary><code>$ patchy init old-notes --purpose "Synthetic
notes" --json &gt; /dev/null &amp;&amp; cd old-notes &amp;&amp; pnpm add
--s…</code>: no change, exit 0 in 4.8 s</summary>

```console
$ 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._

</details>

##### 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.

```console
$ 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."
  ]
}
```

```diff
@@ 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

<details><summary><code>$ cd old-notes &amp;&amp; pnpm --silent patchy
refresh --json | node -e 'const r = JSON.parse(require("fs").re…</code>:
no change, exit 0 in 2.0 s</summary>

```console
$ 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."
  ]
}
```

</details>

<!-- /patchy-dev:transcript:old-cli-crossed-releases -->

- **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 #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
- [x] **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.

Co-authored-by: Claude Opus 5.5 <[email protected]>
allisonmahmood added a commit that referenced this pull request Nov 4, 2026
## What changed

With pnpm 12, `pnpm install`, `pnpm add` and `pnpm remove` in a tier 2
patch repo failed with `ERR_PNPM_IGNORED_BUILDS … Ignored build scripts:
workerd`, even though each still applied its change. Agents couldn't
trust the exit code. pnpm 12 also runs an install before every `pnpm
patchy …` command, so that error printed there too.

Patchy runs workerd's platform binary directly, so its install script
isn't needed. A patch repo's `pnpm-workspace.yaml` now declines it:

```yaml
# Patchy runs workerd's binary itself; its install script is not needed.
allowBuilds:
  workerd: false
```

The installed release's generation step adds this entry, so init,
refresh and pull all write it, including a refresh started by an older
CLI. It edits only plain layouts: one document with LF or CRLF line
breaks whose block mapping starts at column 0, with no anchors, aliases,
merge keys, `?` keys, tags or document markers, and `allowBuilds`
absent, or a block or one-line flow mapping whose keys are all scalars.
Any other file is left byte for byte, and refresh warns with the line to
add: `allowBuilds: { workerd: false }`, or `workerd: false` under the
existing `allowBuilds`. A choice the repo already made for workerd is
kept, through aliases or merge keys too.

Closes #1170

## Look at

- **Where the write lives.** `declineWorkerdBuild` runs in
`Project.generate`, the step the newly installed release always runs.
`pnpm patchy refresh` in an older repo runs that repo's old CLI, and
code only in the invoking CLI's refresh would not land until a second
refresh.
- **What gets edited.** `withWorkerdBuildDeclined` in the new
`workerdBuild.ts` parses the file with `yaml` and returns either the
file to write or a notice.
- It first resolves the settings as pnpm reads them: aliases and merges
included, and line breaks normalised to LF, since YAML and pnpm treat a
bare CR as one. If `allowBuilds` already names workerd (`workerd: true`,
`"workerd": false`, `workerd@<version>`, or inherited through `<<`), the
file is kept.
- Otherwise it splices `workerd: false` into plain layouts only, judged
from the parse and the lexer's tokens: one document with LF or CRLF line
breaks, a block mapping at column 0, none of anchors, aliases, merge
keys, `?` keys, tags or document markers, and `allowBuilds` absent, or a
block or one-line flow mapping whose keys are all scalars. Only a flow
mapping with no entries is replaced whole. Quoted keys are fine.
- For anything else it changes nothing and returns the line to add. That
covers a `...` marker, an anchored or aliased key, explicit keys, merge
keys, an empty or `null` value, an indented or flow root, a multi-line
flow mapping, a tag, two documents, a duplicate key, any bare CR, and a
non-scalar key such as `{ [esbuild]: true }`. `yaml`'s own console
logging is off, so refresh's output stays clean.
- **Where the warning comes from.** Refresh runs the installed release's
`toolchainChild.js inspect` after generation, and every CLI since early
October relays that reply's `warnings`. The inspection reads the file
generation left and adds the notice there, so an older CLI's refresh
shows it too.
- **One new bundled dependency, `yaml` 2.9.1.** It was already in the
lockfile through Vite, so no new package enters the tree. It has no
dependencies of its own, and its ISC licence now ships in
`dist/licenses/`. The CLI bundle grows from about 3.79 MB to 4.07 MB,
unminified. It's used only to parse; the edit is a splice into the
original text, so nothing else is reformatted.
- **A real old repo, on a local dev environment.** I scaffolded a tier 2
repo with `main`'s CLI, then restarted the instance on this branch:

  | Step | Result |
  |---|---|
| Old repo, before refresh: `pnpm add -D [email protected]`, `pnpm remove
is-number`, `pnpm install --force` | each exit 1,
`ERR_PNPM_IGNORED_BUILDS … [email protected]` |
| Give it its own `pnpm-workspace.yaml` (`minimumReleaseAge: 1440`),
then `pnpm patchy refresh --json` with the repo's own old CLI | exit 0,
pin changed, `warnings: []` |
| `pnpm-workspace.yaml` afterwards | `minimumReleaseAge: 1440`, then the
block above |
| `pnpm install --force`, `pnpm add -D [email protected]`, `pnpm remove
is-number` | each exit 0 |
| `pnpm patchy dev`, then calling the starter's `notes.list` handler |
healthy; `{"ok":true,"value":[]}`, logged as a tier 2 query invocation
with outcome `success` |
| `patchy init --tier 2` from the environment's global CLI, still the
old one | the new repo has the file; install, add and remove each exit 0
|

A plain `pnpm install` right after init exits 0 even before the fix,
because there is nothing to link. `--force` relinks, so pnpm decides
about workerd again.

## Merging with #1185

#1185 changes the same `warnings:` expression in
`packages/patchy/src/toolchainChild.ts`, and taking either side drops
the other's warning. Whichever PR lands second resolves it like this, so
the loaded-toolchain, TypeScript and workspace warnings all survive:

- **Imports:** keep both. Each changes `import { writeFile }` to `import
{ readFile, writeFile } from "node:fs/promises";`. Keep both `import {
typescriptManifest, typescriptNotice } from "./typescriptNotice.js";`
and `import { withWorkerdBuildDeclined } from "./workerdBuild.js";`.
- **Before `output(`:** keep both declarations, #1185's `const
typescript = inspect ? typescriptNotice(…) : undefined;` and this PR's
`const workspace = inspect ? withWorkerdBuildDeclined(…) : undefined;`.
- **The expression:** replace both sides' `warnings:` with

  ```ts
  warnings: [
    ...loaded.warnings,
    ...(typescript === undefined ? [] : [typescript]),
...(workspace !== undefined && "notice" in workspace ?
[workspace.notice] : [])
  ],
  ```

## How it was verified

- `vitest run src/workerdBuild.test.ts src/packagePin.test.ts`: 48
passed. `workerdBuild.test.ts` has 8 plain layouts that are edited, 8
existing workerd choices that are kept (block, quoted, flow,
version-specific, aliased key, aliased mapping, merged, across bare CR
breaks), and 18 files that are left byte for byte with the right line to
add. Sol's latest two cases, a bare CR and a non-scalar flow key, were
red before this commit.
- `vitest run src/cliRepo.test.ts -t "pnpm-workspace|refreshes the
generated client"`, against a rebuilt CLI: refresh keeps a repo's
`minimumReleaseAge` and adds the entry. For `allowBuilds: { # keep
me\n}`, it leaves the file byte for byte and its `--json` warnings carry
the notice.
- Real pnpm 12.9.1 on fixtures, in a scratch project with workerd as a
devDependency, running `pnpm install --frozen-lockfile --force`:
  - edited flow mapping, edited quoted key and appended block: exit 0;
- kept: a merged `workerd: false`, and `allowBuilds: {\r workerd:
false\r}` with bare CRs: exit 0;
- left as written: a `...` marker, an anchored flow key, a bare-CR block
mapping without workerd, and `{ [esbuild]: true, sharp: true }`: exit 1,
which is what their notice tells the person to fix.
- `packed-tier2-e2e.mjs` now runs `pnpm install --frozen-lockfile
--force` in the freshly initialized tier 2 repo, which fails without the
entry, before going on to use workerd through `patchy dev`.
- `pnpm lint`, `effect-tsgo` on the package and `tsconfig.test.json`,
`bun fmt`: clean.
- CI passed every check on the first head (22 pass, 2 skipped),
including `tier2-smoke` with the new `pnpm install --frozen-lockfile
--force` step. This head is running CI now.
- Not run locally: `pnpm verify` and a before/after `pnpm dev
transcript`. The shared machine's heavy-command lock had a queue hours
long, and CI ran the same suites.
- README, ADR-0004 and the patchy-loop skill's list of managed writes
now include the entry.

## Release impact

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

Repos gain a `pnpm-workspace.yaml`, or one entry in theirs, on their
next init, refresh or pull. A hand-written file in a layout refresh
doesn't edit gets a warning naming the one line to add.

- **What does a revert leave behind?** Repos with `allowBuilds: workerd:
false` in `pnpm-workspace.yaml`.
- **Does the release before it still work with that?** Yes. The previous
release never reads that file, and its own installs pass
`--ignore-workspace --ignore-scripts`.

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 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:cli Touches the cli area area:docs Touches the docs area area:server Touches the server area size:m 100-500 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refresh across the TypeScript 7 boundary doesn't warn, and the skills don't state the toolchain

1 participant