Repository navigation
fix(cli): pnpm install, add and remove exit 0 in patch repos - #1176
Conversation
|
Review (GPT 6.1 Sol, xhigh) on 3fd4157: request changes, two P2s, being fixed.
Found sound:
|
|
Re-check (GPT 6.1 Sol, xhigh) on 1100439: FAIL. Both original findings are closed, but inserting into the text still breaks eight valid YAML forms:
Next: narrow the edit to the plain layouts Patchy scaffolds. Leave anything else byte-for-byte unchanged, with a refresh warning that gives the exact line to add. Each of those forms becomes a test case. |
|
Re-check (GPT 6.1 Sol, xhigh) on b3cd107: FAIL, two gaps, being fixed. The eight earlier forms now stay unchanged and warn, confirmed through a real pre-change CLI, and existing choices, aliases and merges included, are kept.
|
|
Re-check (GPT 6.1 Sol, xhigh) on 23649c2: PASS, no findings.
|
Acceptance: PASS with notesChecked Every repo below was a tier 2 repo on a local dev environment at the head, with real pnpm 12.9.1. The "older" repos were scaffolded, then pinned back to a built Done means
Extra probes
Golden journeys
Rollback answers: they match the diff. A revert leaves Not run
Notes
|
Co-Authored-By: Claude Opus 5.5 <[email protected]>
23649c2 to
ad7c649
Compare
…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]>
What changed
With pnpm 12,
pnpm install,pnpm addandpnpm removein a tier 2 patch repo failed withERR_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 everypnpm 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.yamlnow declines it: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, andallowBuildsabsent, 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 }, orworkerd: falseunder the existingallowBuilds. A choice the repo already made for workerd is kept, through aliases or merge keys too.Closes #1170
Look at
Where the write lives.
declineWorkerdBuildruns inProject.generate, the step the newly installed release always runs.pnpm patchy refreshin 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.
withWorkerdBuildDeclinedin the newworkerdBuild.tsparses the file withyamland returns either the file to write or a notice.allowBuildsalready names workerd (workerd: true,"workerd": false,workerd@<version>, or inherited through<<), the file is kept.workerd: falseinto 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, andallowBuildsabsent, 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....marker, an anchored or aliased key, explicit keys, merge keys, an empty ornullvalue, 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 inspectafter generation, and every CLI since early October relays that reply'swarnings. 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,
yaml2.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 indist/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:pnpm add -D [email protected],pnpm remove is-number,pnpm install --forceERR_PNPM_IGNORED_BUILDS … [email protected]pnpm-workspace.yaml(minimumReleaseAge: 1440), thenpnpm patchy refresh --jsonwith the repo's own old CLIwarnings: []pnpm-workspace.yamlafterwardsminimumReleaseAge: 1440, then the block abovepnpm install --force,pnpm add -D [email protected],pnpm remove is-numberpnpm patchy dev, then calling the starter'snotes.listhandler{"ok":true,"value":[]}, logged as a tier 2 query invocation with outcomesuccesspatchy init --tier 2from the environment's global CLI, still the old oneA plain
pnpm installright after init exits 0 even before the fix, because there is nothing to link.--forcerelinks, so pnpm decides about workerd again.Merging with #1185
#1185 changes the same
warnings:expression inpackages/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 }toimport { readFile, writeFile } from "node:fs/promises";. Keep bothimport { typescriptManifest, typescriptNotice } from "./typescriptNotice.js";andimport { withWorkerdBuildDeclined } from "./workerdBuild.js";.Before
output(: keep both declarations, fix(cli): refresh from an old CLI warns about TypeScript 7 #1185'sconst typescript = inspect ? typescriptNotice(…) : undefined;and this PR'sconst workspace = inspect ? withWorkerdBuildDeclined(…) : undefined;.The expression: replace both sides'
warnings:withHow it was verified
vitest run src/workerdBuild.test.ts src/packagePin.test.ts: 48 passed.workerdBuild.test.tshas 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'sminimumReleaseAgeand adds the entry. ForallowBuilds: { # keep me\n}, it leaves the file byte for byte and its--jsonwarnings carry the notice.pnpm install --frozen-lockfile --force:workerd: false, andallowBuilds: {\r workerd: false\r}with bare CRs: exit 0;...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.mjsnow runspnpm install --frozen-lockfile --forcein the freshly initialized tier 2 repo, which fails without the entry, before going on to use workerd throughpatchy dev.pnpm lint,effect-tsgoon the package andtsconfig.test.json,bun fmt: clean.tier2-smokewith the newpnpm install --frozen-lockfile --forcestep. This head is running CI now.pnpm verifyand a before/afterpnpm dev transcript. The shared machine's heavy-command lock had a queue hours long, and CI ran the same suites.Release impact
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.allowBuilds: workerd: falseinpnpm-workspace.yaml.--ignore-workspace --ignore-scripts.Built by Claude Opus 5.5 (
claude-opus-5-5) in Claude Code, through T3 Code.