Skip to content

ci: install and CLI checks on macOS and Windows - #945

Merged
allisonmahmood merged 7 commits into
mainfrom
ci/cli-install-macos-windows
Oct 26, 2026
Merged

allisonmahmood merged 7 commits into
mainfrom
ci/cli-install-macos-windows

Conversation

@allisonmahmood

@allisonmahmood allisonmahmood commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner

Stacked on #944 (ticket #943); merges with #944, after it.

What changed

Every CI job ran on Linux. So the installer's Windows path (cmd quoting, the new patchy.cmd launcher, patchy setup's junctions, the PowerShell install line) and everything on macOS had never run in CI. This adds an install job on Linux, macOS and Windows for the code that runs on people's machines.

Look at

  • scripts/packed-install-e2e.mjs. A dependency-free script run against the release packed once on Linux and served from a stub instance. On throwaway machines whose home has a space (and a % on Windows), with one npm prefix per Node as version managers keep them, it runs:
    1. the platform's own install line from /llms.txt: POSIX through sh and curl, PowerShell through Windows PowerShell 5.1, then patchy --version in the same shell;
    2. a Node switch, 22.22.0 → 26.11.1, with Node 22 removed from PATH and a preload recording which Node actually ran patchy, then validate and status --json;
    3. the old-Node refusal;
    4. a rerun over its own launcher;
    5. setup --remove, checked with lstat so a dangling link counts, then setup, with both links resolving to the copy;
    6. auth set, then whoami and the same file (its name has a space) published twice against the stub, the second as an update from the cached patch id. Each runs in a fresh shell with bare patchy, which is Windows PowerShell on Windows;
    7. an install an earlier installer left in Node's npm prefix moving;
    8. the not-on-PATH message.
  • .github/workflows/ci.yml.
    • release-tarball packs the release on ubuntu-24.04 and uploads packages/patchy/artifacts.
    • install (linux|macos|windows) downloads it on ubuntu-24.04, macos-15 and windows-2025, sets up both Nodes and runs the script. These jobs need no pnpm install.
  • pnpm verify runs the same script on the local platform (pnpm test:packed-install-e2e), and docs/DEVELOPMENT.md says so.

On the head, 535d897 (run), all three pass, as they did on every earlier head. The first try of the run failed on test (24) with #723, a known dev-server flake in code this PR doesn't touch, and passed on a rerun. The Windows log for this head:

[packed-install-e2e] Node a C:\hostedtoolcache\windows\node\22.22.0\x64\node.exe, Node b C:\hostedtoolcache\windows\node\26.11.1\x64\node.exe, release 0.19.0
[packed-install-e2e] a fresh install through the install line, then a Node switch
[packed-install-e2e] the executable refuses a Node older than the package needs
[packed-install-e2e] a rerun under the other Node reinstalls over its own launcher
[packed-install-e2e] setup --remove takes the skill links and copy, and setup puts them back
[packed-install-e2e] a saved key, whoami and a file published twice, from a fresh shell with bare patchy
[packed-install-e2e] an install an earlier installer left in Node a's npm prefix moves
[packed-install-e2e] without ~/.local/bin on PATH it installs, then names the directory to add
[packed-install-e2e] PASS on win32

install (macos) prints the same steps ending PASS on darwin. Run against main's installer, the script fails at the first step, because that installer's Executable: is in Node's npm prefix.

How it was verified

  • Locally on Linux with real Node 22.22.0 and 26.12.1: PASS in 14 s. It also runs with Node 22.22.0 itself running the script, which imports packages/api/src/install.ts through Node's type stripping.
  • actionlint on ci.yml, prettier, eslint scripts/verify.ts and pnpm typecheck:tests pass.
  • The new jobs aren't required checks. Once a week of runs shows their queue times and flake rate, Allison can add release-tarball, install (linux), install (macos) and install (windows) to the ruleset. release-tarball has to be in that list: if it fails, GitHub skips the install jobs, and a skipped required check counts as passing.

Release impact

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

CI and a test script only; nothing ships to the server or the package.

  • What does a revert leave behind? Nothing.
  • Does the release before it still work with that? Yes.

Built by Claude Opus 5.5 (xhigh) in Claude Code on T3 Code; reviewed and accepted by GPT-6.1-Sol (xhigh).

allisonmahmood and others added 4 commits October 26, 2026 00:44
The installer put the CLI in the current Node's global npm prefix, so a
Node version manager switching versions left the new Node without it.
It now installs into ~/.patchy/cli and links ~/.local/bin/patchy
(patchy.cmd on Windows), removes the copy an earlier installer left in
the current Node's prefix, and accepts a version manager's shim that
hands over to the new install. The package's executable refuses a Node
older than 22.22.0 before loading the CLI.

Closes #943

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review round 1: an earlier install whose npm prefix is ~/.local owns
~/.local/bin/patchy and now migrates instead of being refused; a shim
that hands over is accepted only when ~/.local/bin is itself on PATH,
exits 0, and answers within 30 seconds; dist/bin.js is executable in
the checkout.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review round 2: when npm's prefix is ~/.local, the advised
npm uninstall --global patchy also removes the new launcher, so the
advice now ends with rerunning the installer, which restores it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every job ran on Linux, so the installer's Windows path (cmd quoting,
the patchy.cmd launcher, setup's junctions, the PowerShell install line)
and macOS never ran in CI. A new install job packs the release once on
Linux, then runs scripts/packed-install-e2e.mjs on Linux, macOS and
Windows: each platform's install line, a Node switch, an earlier
install moving, setup and setup --remove, and the old-Node refusal.
pnpm verify runs it on the local platform.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added area:ci CI, shared testing infrastructure, development scripts and tooling area:docs Touches the docs area size:m 100-500 changed lines labels Oct 26, 2026
allisonmahmood and others added 2 commits October 26, 2026 02:20
Review round 1: a preload records which Node runs patchy after the
switch; setup --remove is checked with lstat so a dangling link counts;
a timeout kills the whole process tree instead of waiting on pipes;
and a saved key, whoami and a file published twice run from fresh
shells with bare patchy, PowerShell on Windows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review round 2: on timeout the harness ignores a failed taskkill or an
ended process group and destroys the child's pipes, so a descendant
holding them can't keep the run alive.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@allisonmahmood

Copy link
Copy Markdown
Owner Author

Review rounds (GPT-6.1-Sol, xhigh)

Round 1 on 59e45f8: nothing blocking. Two should-fix and three nits, all addressed in 6080c84.

  1. should-fix: the Node switch wasn't proved. A launcher pinned to Node 22 still passed. Fixed: a preload records the process.execPath that runs patchy after the switch, and the script asserts it is Node 26 by real path. docs/DEVELOPMENT.md now says a default local run switches only the npm prefix.
  2. should-fix: the setup --remove check used existsSync, so dangling links passed. Fixed: absence is now checked with lstat, and after setup both links must resolve to the copy.
  3. nit: the timeout didn't bound completion when a descendant held the pipes. Fixed: POSIX lines run in their own process group, and the timer kills the group, or the tree on Windows, then settles.
  4. nit: there was no authenticated journey. Added: auth set, then from fresh shells with bare patchy (Windows PowerShell 5.1 on Windows), whoami and a spaced filename published twice. The second must be an update from the cached patch id.
  5. nit: if only the matrix checks become required, a failed release-tarball makes them skip, and skipped counts as passing. Answered in the PR body: the advice now includes release-tarball.

Round 2 on 6080c84: nothing blocking and nothing should-fix. One nit, fixed in 535d897.

  1. nit: a Windows timeout could leave live pipes holding the harness open if taskkill targeted a PID that had already exited. Fixed: a failed taskkill or an already-ended process group is ignored, and the child's pipes are destroyed on timeout.

Round 2 confirmed rounds 1's fixes, the Windows preload, the PowerShell quoting, the stub's response shapes, the saved-key authentication and the cached-id update. It also checked every job's log for 6080c84.

@allisonmahmood

Copy link
Copy Markdown
Owner Author

Acceptance: PASS with notes

Checked 535d897d8f228dc3d3a920fa555756928147d01f (base 02ab5573a66015037027f98e6b909f6a9f61905b, fix/cli-survives-node-change / #944) on the packed-install script's throwaway Ada/Example machines, by GPT-6.1-Sol (xhigh) in the Codex harness through T3 Code. This verdict covers #945's cross-platform acceptance coverage; #944 supplies the product fix for #943.

Done means

  • Release and platform jobs: passed. On this head, release-tarball, install (linux), install (macos), and install (windows) pass. I read each job's log, not just its status. Each platform ran every checkpoint below with Node 22.22.0 → 26.11.1 and ended in PASS on linux, PASS on darwin, or PASS on win32. The Windows path uses Windows PowerShell 5.1; its disposable home contains spaces and %.
  • Local Linux with two real Nodes: passed, exit 0 in 15.29 s. Copied the real Node 22.22.0 and 26.11.1 executables and their npm distributions into /tmp; no version-manager wrappers. Node 22.22.0 ran the script itself. Its preload assertion confirmed that the switched CLI actually ran Node B; validation and status --json also passed.
  • Bug detection: passed. Temporarily substituted origin/main (fe8a0f2086f31ce17f39f5c582c3c8ed269e9f37)'s installer, keeping the same packed release. The script exited 1 in 2.70 s at the stable-launcher assertion: the old installer itself exited 0 and printed release 0.19.0, but its Executable: was in machine 1/npm prefix a/bin/patchy. Expected was machine 1/home/.local/bin/patchy. This catches the per-Node install before the switch. Restored the original bytes in finally; SHA-256 remained 5f7844531cabf0eb2a1b1597facc62e43027e5656e397377a58c1474d2043044, and git status --short was empty.
  • Verify entry point and docs: passed. Ran the exact pnpm test:packed-install-e2e command configured by scripts/verify.ts: exit 0, all checkpoints passed. Compared docs/DEVELOPMENT.md with the workflow, package script, verify suite and actual execution: CI shares one Linux-packed artifact across the three runners; the default local command uses the current Node on both sides and changes npm prefixes; explicit flags switch real Nodes. Local runs used the head CI artifact, whose tarball integrity matched release.json.
Scenario checkpoints present in all three CI logs and both passing local runs
[packed-install-e2e] a fresh install through the install line, then a Node switch
[packed-install-e2e] the executable refuses a Node older than the package needs
[packed-install-e2e] a rerun under the other Node reinstalls over its own launcher
[packed-install-e2e] setup --remove takes the skill links and copy, and setup puts them back
[packed-install-e2e] a saved key, whoami and a file published twice, from a fresh shell with bare patchy
[packed-install-e2e] an install an earlier installer left in Node a's npm prefix moves
[packed-install-e2e] without ~/.local/bin on PATH it installs, then names the directory to add

The setup assertions use lstat for absence and real paths for restored links. The authenticated assertions check the saved identity, the spaced filename, and the cached patch ID on the second publish.

Golden journeys

  • CLI portions of authentication and publishing: passed against the loopback stub, locally and in the platform jobs: save key, fresh-shell whoami, publish a file with a space in its name, then update it through the cached ID. This is not a real-server publish/view/retire/restore test or a browser device-login test.
  • Unaffected by this CI/script-only diff; not rerun: sign in; browser machine login/logout/revoke; publish/view/retire/restore on a real instance; share/unshare; find/open a tool; live tier 1; tier 2; invite/join/revoke/deactivate/reactivate.

Rollback answers: match the diff. Only workflow, test script, package-script/verify wiring and development docs change. No shipped runtime, schema, persistent data or external contract changes; reverting leaves no incompatible state, so no one-way label is needed. Applicable mirror checks were workflow → package script → verify → development docs; the other product surfaces are unchanged.

Not run

  • macOS or Windows locally: this host is Linux. Those results are from the completed CI jobs and their logs.
  • Full local pnpm verify, live Clerk, and a full dev instance: outside this CI-only change's acceptance scope. The focused install suite ran; existing CI browser, CLI smoke, tier 2, concurrency and live Clerk checks pass.

Notes

  • test (24) is still rerunning at posting time. I checked the first attempt's failure: devServer.test.ts, “serves and synchronizes local documents, refuses foreign admission, and swaps completed builds”, expected '' to include 'Second local build'. This matches the open, flaky-labelled flaky: dev server build-swap case reads an empty page on CI #723; it is unrelated to this diff. Acceptance passes with this note; this is not a claim that every required check is green.
  • CLI/installer homes, npm prefixes/caches, state and temporary Node/npm copies were disposable. No installer or CLI was pointed at production, and nothing was installed into the real ~/.patchy, ~/.local/bin, ~/.npm, mise or Node installations. The script removed its temporary machine directories; the source checkout is clean.

@allisonmahmood

Copy link
Copy Markdown
Owner Author

The test (24) rerun the acceptance note was waiting on passed (#723 flake). All 18 checks are green on 535d897.

Base automatically changed from fix/cli-survives-node-change to main October 26, 2026 10:41
@allisonmahmood
allisonmahmood merged commit 7edd481 into main Oct 26, 2026
33 of 34 checks passed
@allisonmahmood
allisonmahmood deleted the ci/cli-install-macos-windows branch October 26, 2026 13:34
allisonmahmood added a commit that referenced this pull request Oct 28, 2026
… patchy survives a Node update (#962)

## What changed

This PR adds release 20's What's new entry, written from `c5175bd`. It
covers everything merged since release 19's `through` (`156a228`), and
it sets the `patchy` release to `0.20.0` in
`packages/patchy/package.json` and `CURRENT_RELEASE`. With this release
patches can read and answer a company email address on Pidgeon, and the
`patchy` command keeps working after a Node version change.

| Change | PRs |
| --- | --- |
| New: Patches can read and answer a company email address | #921, #954,
#955 |
| Fixed: The patchy command survives a Node update | #944 |
| Behind the scenes: Patchy keeps only a key for the connected address,
never the Pidgeon admin key | #921 |

Two merged PRs get no line: #941 is release 19's own entry, and #945
adds CI install checks on macOS and Windows, which is tooling.

## Look at

- **The entry**, at the top of `releases` in
`packages/core/src/whatsNew.ts`. Its labels are the pages' own:
Integrations, Read, Read and send. The 200 sends a day is
`pidgeon.sends.daily`'s default. The Node fix says what #944's Release
impact asks of the note: people whose terminal doesn't look in
`~/.local/bin` are shown the line to add when they rerun the install
line.
- **Rollback safety, from the live commit `fe8a0f2` to `c5175bd`.**
Three PRs in the range are labelled `one-way`:
- **#921 and #954 (Pidgeon).** Release 19 hides Pidgeon connections and
ignores the new `pidgeon_sends` table, but a patch whose current version
declares or calls Pidgeon needs this release to serve. Recovering it
means rolling forward.
- **#944 (CLI install).** On machines where the new installer put
`~/.local/bin/patchy` ahead of Node's own bin on PATH, release 19's
install-and-login line refuses after installing. Those people would need
to clean that up by hand.
- **#955 and #945** answer both Release impact questions with "Yes".
`rollback-rehearsal` passed on every landed head, including #954's
migration `0028`.

## How it was verified

- **Tests.** `whatsNew.test.ts` (4), `WhatsNewPages.test.ts` (6),
`schemas.test.ts` (11) and the skill lock (1) pass. Typecheck passes for
core, api and the CLI, and so do prettier and eslint on the changed
files.
- **The stack.** #921, #954 and #955 each had GPT 6.1 Sol reviews to
merge-ready and an acceptance verdict of PASS with notes. Each landed
after all 21 checks passed on its rebased head, `Pidgeon live` included.
Each rebase left the tree byte-identical to the accepted head, and
`main`'s tree at `c5175bd` is identical to #955's accepted `cce5019`.
- **Deploy state.** The live commit was pinned from `/healthz/deep`:
`fe8a0f2`, release 19. 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

This PR changes only the changelog text and the `patchy` version. As
with every release, a CLI installed before this deploy is told to
upgrade.

- **What does a revert leave behind?** Nothing. People whose seen marker
reached 20 would just see no new release.
- **Does the release before it still work with that?** Yes.

Rolling back past #921 and #954 would stop any patch whose current
version uses a Pidgeon connection from serving, and rolling back past
#944 would break the install-and-login line on machines where the new
installer put `~/.local/bin/patchy` ahead of Node on PATH; fix forward
instead.

Made by Claude Opus 5.5 in Claude Code, running in 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:docs Touches the docs area size:m 100-500 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant