Repository navigation
[Air #1944] feat: Raise the Node.js floor to 22 and standardise CI on Node 22 - #1962
amrmelsayed wants to merge 12 commits into
Conversation
… Node 22 - engines.node >=22.0.0; codev doctor's Node minimum 18.0.0 -> 22.0.0 - POSIX workflows: node-version 20 -> 22 - windows.yml: every job on Node 22; Node 20 install-guard leg removed - Guard message names Node.js 22 (both parity twins); ABI allow list unchanged - Docs: README, DEPENDENCIES.md (both trees), arch.md, cloud-instances.md, lessons-learned.md
…guard comments (CMAP)
Architect integration review (main)Tier: high by file count (33 files), so 3-way. gemini skipped (agy not signed in, non-blocking); codex and claude both returned REQUEST_CHANGES. I checked every claim against the branch at Fix in this PR
Waiting on the owner (do not change yet)
Checked and not a change
After the fixesA commit that touches Follow-up candidates I will raise with the owner separately, not for this PR: a start-up Node version check for POSIX (the floor is advisory there: |
….x or newer, cloud-instances, keep-files comment, test title)
…er ruling, item 6)
…y import() bindings on Node 22.17+)
…changes and contributors drafted for the next patch
Summary
Node 22 is now Codev's floor and the one version CI tests. Node 20 (EOL 2026-04-30) is dropped everywhere:
engines,codev doctor, every POSIX and Windows workflow, the Windows guard message, and the docs.Closes #1944
What Changed
packages/codev/package.jsonengines.node>=20.0.0→>=22.0.0.pnpm publish --dry-run/pnpm packshow"engines": { "node": ">=22.0.0" }in the packed manifest..npmrc, so nothing setsengine-strict. A below-floor install on POSIX warns (npm'sEBADENGINE) and proceeds. On native Windows the preinstall guard still refuses any Node whose ABI has no better-sqlite3 prebuild (Node 20 included).node-version: '20'lines intest.yml,e2e.yml,dashboard-e2e.yml,sdk-canary.ymlandpost-release-e2e.yml→'22'(architect confirmed open question 1).windows.yml): every job on Node 22.os: [windows-latest, windows-11-arm]only. Thematrix.node == '22'conditions andcontinue-on-error: ${{ matrix.node == '20' }}are gone; artifact names lost their-node<N>suffix.unit,cli-e2e,post-release-e2e: Node 24 legs dropped, no matrix.install-guard: the Node 20 control and refusal steps are removed (open question 2, issue default, confirmed by the architect). The job keeps the Node 22--supportedcheck. The unit tests cover the guard's decision and message only. Nothing now checks on a real host that an unsupported install aborts before node-gyp (owner ruling: drop the leg and say so in the comments).scripts/windows-install-guard-check.mjskeeps its--control/--unsupportedmodes for manual runs.SUPPORTED_WINDOWS_NODEis'Node.js 22 (LTS), x64 or arm64'and the advice line says "Install Node.js 22 (for example: winget install OpenJS.NodeJS.22)". The oldOpenJS.NodeJS.LTSid now installs Node 24.OpenJS.NodeJS.22was checked against the winget-pkgs manifests. Both parity twins changed (scripts/native-deps-guard.mjs,src/lib/native-deps.ts) and the install-guard check script. The ABI allow list did not change, so a newer Node with prebuilds still installs; it is just untested.DEPENDENCIES.mdin bothcodev/andcodev-skeleton/(Node section, support table, Windows table, troubleshooting);arch.mdrequirements line;cloud-instances.mdsetup_20.x→setup_22.x; the#1819lesson now says "CI pins Node 22". None of them calls 24 tested.apps/vscode/walkthroughs/install.md, said 20+),INSTALL.md(said 18+),resources/commands/codev.mdin both trees (said doctor>= 18.0.0), all fourskills/codev/SKILL.mdcopies (said>=18, so the shipped skill hashes were regenerated), the arch.md Windows install bullet, and a second lessons-learned line. Akeep-files.tscomment that cited "engines allows 20.0" was trimmed.22.x, unchanged.Adjacent fix
codev doctorchecked Node againstminVersion: '18.0.0', below even the old floor. It is now22.0.0, so doctor fails on Node 20 withneed >= 22.0.0.Node 22 defect fixed: node-pty loaded through one loader
Moving CI to Node 22 made Tower Integration Tests fail on every commit: three
tower-api.e2etests got a 500nodePty.spawn is not a functionfromPOST /api/terminals.Root cause.
PtySession.spawn()(the non-persistent path) loaded node-pty withawait import('node-pty'). On Node 22.17 and later, in the pnpm workspace, after a workspace activation Tower's ESM resolver resolvednode-ptythrough the package's pnpm symlink instead of its real path. node-pty was then loaded a second time under that key, andimport()returned the copy's empty bindings (defaultan empty object,spawnundefined). The real-path copy was fully loaded. Measured locally with the same build and test: Node 22.16 passes, 22.19 and 22.23 fail. CI on Node 20 never hit it. This affects dev and CI only: a published install has no pnpm symlinks.Fix. A new
terminal/node-pty-loader.ts(loadNodePty()) loads node-pty withcreateRequireand keeps the Spec 1658 native-load explanation. Bothpty-session.tsandshellper-main.tsuse it, so node-pty now loads in exactly one way.shellper-main.tsalready usedcreateRequire+withNativeLoadExplanation, so its behaviour is unchanged.pty-session-native-load.test.tsandpty-terminal-type.test.tsnow mock the loader instead ofnode-pty, with the same assertions. The newnode-pty-loader.test.tschecks that the loader returns the same instancerequireholds, with a callablespawn.tower-api.e2e.test.tsis unchanged. Thesend-integration.e2ecomment that described the problem as unfixed is updated; itspersistent: truestays. One line was added to lessons-learned.Local, Node 22.23.4: Tower integration suite 175 passed (it failed 3 before), full unit suite 8446 passed, tsc clean.
Key Decisions
Test Plan
doctor.test.ts: new test checks that Node 20 fails doctor withneed >= 22.0.0. Fixtures moved v20 → v22.native-deps-guard.test.ts: the engines assertion is now>=22.0.0; guard-message assertions are updated in all four test files that check the wording.pnpm buildandtsc --noEmitclean; full codev unit suite: 415 files / 8444 tests passed.pnpm publish --dry-run/ pack: packedengines.nodeis>=22.0.0.dashboard-e2eandsdk-canary. Tower Integration was red on every head before the node-pty loader fix (0966555).(The later commit only changes comments in
windows.yml: it corrects the stale "about 50 minutes" / "about an hour" duration claims to the measured ~7 minute unit suite and ~10 minute run. Timeouts are unchanged, so no new run is needed.)Grep check:
20+,Node 20,setup_20and22 or 24were searched acrosscodev/andcodev-skeleton/. The only hits left are historical specs, plans and reviews, plus the new "Node 20 is not supported" line.CMAP
Not changed:
apps/streamdeck/esbuild.jstarget: 'node20'is an esbuild output target, not a statement of supported Node versions.Release-notes flag: raising the floor breaks installs for Node 20 users. The entry belongs on the changelog branch.
Architect integration review (items 1-5, commit 0427bb3)
codev doctor's Linux install hint now uses NodeSourcesetup_22.x, because stockapt install nodejsinstalls an older Node than 22.DEPENDENCIES.md(both copies): "Should show v22.x or newer".cloud-instances.mdInstalled Tools:Node.js v22.x.keep-files.tsexpand: the comment now explains why the directory walk is done by hand (recursivealso returns directories and joins withpath.sep; this function keeps regular files only and builds/-separated paths).native-deps-guard.test.tstitle now says the prebuild set is broader than the tested Node 22.DEPENDENCIES.md(both copies) also used stockapt install nodejs npm. It now adds the NodeSourcesetup_22.xstep first.Item 6, owner ruling: the leg stays dropped. The
windows.ymlheader and thenative-deps-guard.test.tsheader now say the real install abort is no longer checked on a host.Review Notes
Read
windows.ymlclosely: it is the only change with structure (the matrix collapse and the install-guard trim). Everything else is a value or wording change.