Skip to content

fix(cli): tier 2 init works on pnpm 11, and pnpm 12 accepts the repos it makes - #464

Merged
allisonmahmood merged 1 commit into
mainfrom
fix/459-lockfile-integrity
Oct 1, 2026
Merged

allisonmahmood merged 1 commit into
mainfrom
fix/459-lockfile-integrity

Conversation

@allisonmahmood

Copy link
Copy Markdown
Owner

What changed

patchy init --tier 2 failed with a bare "Dependency installation failed" on pnpm 11 whenever the release tarball was already in the store, and pnpm 12 refused to run any pnpm patchy … in a repo pnpm 11 had written. pnpm 11 locks the instance-served tarball without an integrity, then rejects its own lockfile on the next install; pnpm 12 rejects it outright.

After every install in init and refresh, the CLI now writes the release's sha512 (which it already gets from GET /api/release) into that one lockfile entry, including pnpm's quoted form for IPv6 hosts, and repairs an older lockfile for the same pin. A failed install now relays pnpm's first error line, with URL credentials, queries and fragments stripped.

Closes #459

How it was verified

  • pnpm test passes locally (patchy suite, 500 tests)
  • Added or updated tests covering this change: the lockfile rewrite (pinned entry only, existing integrity kept, quoted IPv6 URL), the redacted error relay, and a refresh whose install fails
  • pnpm test:packed-tier2-e2e now initializes the tier 2 repo on a warm store, as on a real machine: it fails without the fix with the issue's error and passes with it. pnpm test:packed-cli-e2e passes.
  • Repos it produces run pnpm patchy --version under pnpm 12.8.1.

Release impact

  • Breaking — requires action from anyone already running this
  • Not breaking — the CLI adds a missing lockfile field; nothing else in a repo changes

Made by Claude Opus 5.5 subagents via Claude Code; reviewed by GPT 6.1 Sol via codex.

@github-actions github-actions Bot added area:ci CI, shared testing infrastructure, development scripts and tooling area:cli Touches the cli area area:docs Touches the docs area size:m 100-500 changed lines labels Oct 1, 2026
Base automatically changed from fix/458-clerk-worker-csp to main October 1, 2026 22:34
pnpm 11 locks a tarball it already has in its store as
`resolution: {tarball: ...}` with no integrity, then refuses that entry on
the next install. Tier 2 init installs twice (the second adds the workerd
pin), so on any machine that had installed the release before, it failed
with only "Dependency installation failed": install ran pnpm with the
silent reporter. pnpm 12 refuses the same entry before running any script,
so `pnpm patchy` stopped working in those repos.

After each install, init and refresh now write the integrity from
GET /api/release into the patchy entry when pnpm left it out, and refresh
first repairs a lockfile an older CLI left for the same pin. A failed
install ends with pnpm's first error line. The packed tier 2 journey now
inits its tier 1 repo first, so the tier 2 init runs on a warm store as it
would on a real machine.

Fixes #459.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@allisonmahmood
allisonmahmood force-pushed the fix/459-lockfile-integrity branch from 59f26e2 to 509d441 Compare October 1, 2026 22:35
@allisonmahmood
allisonmahmood merged commit af2aead into main Oct 1, 2026
10 checks passed
@allisonmahmood
allisonmahmood deleted the fix/459-lockfile-integrity branch October 1, 2026 22:47
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:docs Touches the docs area size:m 100-500 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(cli): instance tarball pins lose their integrity, breaking tier 2 init on pnpm 11 and every command on pnpm 12

1 participant