Repository navigation
feat(runtime): pin the Node 24.21.0 server runtime with an offline CI check - #24087
Conversation
… check Add src/shared/node-runtime-pin.ts (NODE_RUNTIME_PIN, SERVER_TARGETS, NODE_RUNTIME_ASSETS for all 8 server targets plus the headers tarball), generated by config/scripts/update-node-runtime-pin.mjs from the nodejs.org and unofficial-builds SHASUMS. check-node-runtime-pin.mjs verifies, with no network, that the pin tracks the locked Electron, matches engines.node's major, and covers exactly SERVER_TARGETS; it runs in the static analysis job. ORCAD_BUN_TARGETS consumers now read SERVER_TARGETS so there is one target list; orcad's Bun runtime and build output are unchanged.
|
| if (target === currentTarget()) { | ||
| const reported = run(executablePath, [ | ||
| '-p', | ||
| '`${process.version} ${process.versions.napi}`' | ||
| ]).trim() |
There was a problem hiding this comment.
Unsigned download is executed. On a linux-arm64-musl developer host, the updater checks the downloaded Node executable against a checksum from the same unsigned, unofficial source, then runs it here. If that source is compromised, it can supply both a malicious executable and a matching checksum, causing code execution during pin regeneration. Avoid running the executable without an independent trust check.
How this was verified: The linux-arm64-musl asset uses unsigned unofficial checksums, and a matching host runs the extracted executable.
| try { | ||
| const shasumsPath = join(workDir, 'SHASUMS256.txt') | ||
| await download(nodeRuntimeReleaseUrl('official', 'SHASUMS256.txt', version), shasumsPath) | ||
| await verifyOfficialShasums(version, workDir, shasumsPath) |
There was a problem hiding this comment.
Failed verification still writes pin. If gpg is unavailable or the release keyring cannot be fetched, signature verification returns false, but this call ignores the result. Regeneration then writes hashes from the unverified official SHASUMS file, and the offline CI check cannot detect that the hashes were not authenticated. Require successful signature verification before writing the pin.
How this was verified: Both verification-skip paths return false, while the caller continues to consume the checksums and write the table.
| @@ -0,0 +1,134 @@ | |||
| /** | |||
| * The one Node runtime Orca runs outside Electron (docs/reference/node-runtime-design.html, D1). | |||
There was a problem hiding this comment.
Design reference is missing. This comment points readers to
docs/reference/node-runtime-design.html for the Node version policy, but that document is absent from the repository. Add the document or replace the reference with an available explanation so future pin updates have a policy to follow.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 📝 WalkthroughWalkthroughThe change adds shared Node runtime pin data for eight server targets and a script that generates the pin block from Node release artifacts. It adds an offline check for pin consistency with package and lockfile metadata, and runs that check in lint and static analysis. ORCAD code and scripts now use the shared server-target definitions. Priority: ⬇️ Low Merge Risk: 🔵 Low · up to This change adds a pinned Node runtime definition and checks that keep it consistent with the repository. The runtime behavior does not change, because nothing downloads Node yet. The one concern is that the pin generator can write hashes without verifying the release signature. Regenerate the pin with GPG available before relying on it. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The runtime migration is not activated, and current packaging still uses Bun. However, the manual updater can generate trusted pin data without completing release-signature verification. HTTPS, checksum comparisons, and explicit signature-failure rejection limit exposure, but do not eliminate this authentication gap. Retained concerns
Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 16.13% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 31 functions across 12 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: bcb638ca-cf87-4b58-8c6b-186080cd1441
📒 Files selected for processing (14)
.github/workflows/pr.ymlconfig/scripts/build-orcad-template.mjsconfig/scripts/check-node-runtime-pin.mjsconfig/scripts/check-node-runtime-pin.test.mjsconfig/scripts/orcad-artifact-version.test.mjsconfig/scripts/orcad-template-test-fixture.mjsconfig/scripts/orcad-watcher-package.mjsconfig/scripts/update-node-runtime-pin.mjsconfig/scripts/update-node-runtime-pin.test.mjsconfig/scripts/verify-packaged-orcad-template.cjspackage.jsonsrc/main/orcad/orcad-artifact-identity.tssrc/shared/node-runtime-pin.tssrc/shared/orcad-bun-runtime.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
| async function verifyOfficialShasums(version, workDir, shasumsPath) { | ||
| if (!gpgAvailable()) { | ||
| console.warn( | ||
| '\n!!! WARNING: gpg is not installed, so SHASUMS256.txt was NOT signature-verified.\n' + | ||
| '!!! Its hashes are trusted over TLS only. Install gpg and rerun before committing a pin.\n' | ||
| ) | ||
| return false | ||
| } |
There was a problem hiding this comment.
🔒 Security & Privacy | 🛡️ Detected with Advanced Tier | 🟡 Minor | ⚡ Quick win
Security Misconfiguration
Reachability: Internal
Exploitability: Difficult
CWE: CWE-345
Fail by default when the generator cannot verify the SHASUMS256.txt signature. main ignores the false result from verifyOfficialShasums, so the script can write pin data after signature verification was skipped. Throw unless the user passes an explicit --allow-unverified opt-out.
There was a problem hiding this comment.
ℹ️ No blocking issues — the pinned hashes check out against the live SHASUMS files. Three small suggestions inline.
Reviewed changes
This PR adds the shared Node runtime pin and its offline consistency gate, with no runtime behaviour change:
src/shared/node-runtime-pin.ts(new) —SERVER_TARGETS(8 targets),ORCAD_TEMPLATE_TARGETS,NODE_RUNTIME_PIN(Node 24.21.0 / Electron 43.7.5 / NAPI 10 / headers hash), the generatedNODE_RUNTIME_ASSETStable, and thenodeRuntimeReleaseUrl/nodeRuntimeExecutablePathhelpers.config/scripts/update-node-runtime-pin.mjs(new) — network regenerator that fetchesSHASUMS256.txt(optional gpg verify), downloads/extracts/hashes each target, and rewrites the@generatedblock.config/scripts/check-node-runtime-pin.mjs(new) — offline gate over the Electron pin, lockfile,engines.node, napi, headers, and the 8 assets' names/hashes/sizes.src/shared/orcad-bun-runtime.ts— dropsORCAD_BUN_TARGETS/ORCAD_TEMPLATE_TARGETS;OrcadBunTargetaliased toServerTarget.- Consumer repointing + wiring — build/watcher/verify scripts and
orcad-artifact-identity.tsmoved toSERVER_TARGETS;check:node-runtime-pinwired intolintand thestatic_analysisjob.
I verified locally that pnpm run tc:node, pnpm run check:node-runtime-pin, and both new test files pass, and confirmed every archiveSha256 (plus the Windows node.exe hashes) against the live official and unofficial SHASUMS files. linux-x64-musl is correctly marked official (nodejs.org does publish it, with a different hash than unofficial) and linux-arm64-musl correctly unofficial.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| @@ -0,0 +1,134 @@ | |||
| /** | |||
| * The one Node runtime Orca runs outside Electron (docs/reference/node-runtime-design.html, D1). | |||
There was a problem hiding this comment.
This JSDoc treats docs/reference/node-runtime-design.html as the authority for decision D1, but no such file exists: docs/reference/ is entirely .md, and there are no .html files anywhere under docs/. config/scripts/check-node-runtime-pin.mjs:59 cites the same path. The deferred-design rationale is unfollowable until the doc is added or the reference is corrected to where D1 actually lives.
| NODE_RUNTIME_PIN, | ||
| SERVER_TARGETS | ||
| } from '../../src/shared/node-runtime-pin.ts' | ||
| import { nodeDistArchiveName } from './update-node-runtime-pin.mjs' |
There was a problem hiding this comment.
This gate's own header says the updater owns the network and this check is static/offline, yet it imports nodeDistArchiveName from the 340-line network client — pulling build-orcad-bun.mjs and the download/extract tooling into every pnpm lint and static_analysis run. The archive-name mapping is shared contract (nodeRuntimeReleaseUrl and nodeRuntimeExecutablePath already live in node-runtime-pin.ts); moving NODE_DIST_PLATFORMS/nodeDistArchiveName there would keep this gate dependency-light and give later phases the same table.
| for (const target of SERVER_TARGETS) { | ||
| expect(nodeDistArchiveName('24.21.0', target)).not.toContain('undefined') | ||
| } |
There was a problem hiding this comment.
not.toContain('undefined') passes for any mapping that isn't literally the string undefined, so a wrong platform suffix (e.g. mapping linux-arm64-glibc to linux-x64) would still pass. Asserting the exact expected archive name per target would make this pin the mapping instead of smoke-testing it.

ELI5
Orca will run its headless and remote server on one exact Node version: the one Electron embeds, 24.21.0 today. This adds the table that records that version and the checksum of the official Node download for each platform, plus a CI check that fails if Electron is bumped without updating the table.
What Changed
src/shared/node-runtime-pin.ts:NODE_RUNTIME_PIN: Node 24.21.0, Electron 43.7.5, N-API 10, and the hash of the headers tarball.SERVER_TARGETS: the 8 server targets, now the only list.ORCAD_BUN_TARGETSis removed and its consumers use this list.NODE_RUNTIME_ASSETS: the archive name, archive sha256, and executable sha256 and size for each target. Every target uses an official nodejs.org build except linux-arm64-musl, which comes from unofficial-builds.config/scripts/update-node-runtime-pin.mjs --version X: regenerates the table. It fetchesSHASUMS256.txt, verifies the official signature with gpg when gpg is installed, downloads and extracts each archive, and hashes the executable.config/scripts/check-node-runtime-pin.mjs: an offline check instatic_analysisandpnpm lint. It verifies that:engines.node;Why
This is the first step of the Node runtime plan, where orcad and the SSH relay run on a pinned Node instead of Bun or the host's Node. One table that build scripts, the client materializer and CI all import, following the existing
orcad-bun-runtime.tspattern, avoids having three places that each know the version. What happens when Electron's Node is newer or older than the pin is still an open design question, so the check only enforces the parts that hold either way.Linked Issue
Part of the Node runtime plan (Phase 1). Related: #23525.
Visual Proof
N/A. It adds build and CI metadata and changes no runtime behaviour.
Testing
pnpm run check:node-runtime-pinpasses, and unit tests cover the checker and the updater.pnpm tc, oxlint and the changed-code gate pass.Checked every archive hash against the live SHASUMS files. Independently downloaded linux-x64: the archive hash, executable hash and size match.
Not yet run: the gpg signature path, because gpg isn't installed on the machine that generated the table. Regenerate with gpg before relying on it.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.