Repository navigation
refactor(orcad): make profile backup and preflight runtime-neutral - #24088
Conversation
The profile preflight parser now takes the expected runtime identity from the caller (shipped callers pass the pinned Bun identity), and the native preflight is renamed to orcad-runtime-native-preflight with neutral wording.
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (1)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughOrcad preflight now validates runtime and version against an expected identity, and its native preflight entry point uses a runtime-neutral name. Profile-state backup worker selection now uses the worker for Electron and Bun, and uses it for other runtimes only when the worker path exists; otherwise, it writes the backup inline. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The reviewed runtime identity and backup changes preserve their stated contracts and are mergeable. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The inspected identity checks and backup safeguards remain intact, with no introduced security issue identified. Confidence is limited by incomplete deployment and security coverage. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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.
✅ No new issues found.
Reviewed changes
- Preflight runtime identity generalized —
parseOrcadProfilePreflightnow takes anOrcadPreflightRuntimeIdentityand comparesruntime/runtimeVersionagainst it instead of hard-coding'bun'. All four shipped callers pass the newORCAD_BUN_RUNTIME_IDENTITY, so today's behavior (bun + pinned version) is unchanged; a Node candidate and mismatch-in-either-direction are now covered by tests. - Backup worker selection made runtime-neutral —
runProfileStateBackupuses the worker whenelectron || bun || existsSync(workerPath), with a new optionalworkerPathtest seam; plain Node with no bundled entry still falls back to inlinewriteProfileStateBackup. Three new tests pin the worker-present, built-entry, and missing-entry branches. - Rename to drop the Bun assumption —
orcad-bun-native-preflight.*→orcad-runtime-native-preflight.*,preflightOrcadBunNativeRuntime→preflightOrcadNativeRuntime, watcher-timeout copy now says "Bundled file watcher", andci-shard-timings.jsontracks the new test path.
I verified the focused suites pass (orcad preflight + ssh remote-deploy + backup worker, 96 tests), pnpm tc:node is clean, the changed-code quality gate reports 0 findings, and a HEAD grep finds no stale references to the old module path, function name, or watcher message.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
…-neutral # Conflicts: # src/shared/orcad-bun-runtime.ts
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Merged the base branch (
origin/main, base now3135fbb) into the PR branch. The only delta in a PR-authored file issrc/shared/orcad-bun-runtime.ts, where the conflict resolution keepsORCAD_BUN_RUNTIME_IDENTITY(runtimebun, pinned1.4.2) and adopts the base'sexport type OrcadBunTarget = ServerTarget.SERVER_TARGETSis the same eight-target list the PR previously inlined, so the alias is behavior-preserving. Every other PR-authored file is byte-identical to the previously reviewed revision.
I re-ran the focused orcad preflight and profile-backup suites (64 tests) plus pnpm tc:node on the merged head; both pass. A tree-wide grep finds no dangling ORCAD_BUN_TARGETS reference and confirms ORCAD_TEMPLATE_TARGETS now lives in node-runtime-pin.ts (a base-branch move, not this PR).
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

ELI5
Some of orcad's startup and backup code assumed it would always run under Bun or Electron. This removes those assumptions, so the same code works when orcad runs on plain Node. What ships today still runs under Bun, so nothing changes for it.
What Changed
parseOrcadProfilePreflighttakes the expected runtime identity instead of hard-coding'bun'. Every current caller passesORCAD_BUN_RUNTIME_IDENTITY, so today's behaviour is unchanged. Tests cover a Node candidate and rejection of a mismatch in either direction.orcad-bun-native-preflight.tsbecomesorcad-runtime-native-preflight.ts. Its PTY spawn, watcher delivery and Windows process-identity probes don't depend on Bun. The timeout message says "Bundled file watcher" instead of "Bun file watcher".Why
These are the Node runtime plan's Phase 1 prerequisites that don't depend on the cutover itself. Landing them separately keeps the cutover PR focused on the runtime swap.
Linked Issue
Part of the Node runtime plan (Phase 1).
Visual Proof
N/A. The only visible change is the wording of an internal error message.
Testing
The targeted suites pass: backup-worker, orcad-profile-preflight (shared and main), orcad-runtime-native-preflight, orcad-artifact-preflight, orcad-remote-deploy and profile-state-store-backups.
The backup-worker test passes under Bun too. A fix commit skips the plain-Node cases in the Bun profile suite.
pnpm tcand the changed-code gate pass.Known and pre-existing: 3 tests in
profile-state-backup-rotation.test.tstime out on this machine's Node 26.6.0 onmaintoo. This change doesn't touch that path under vitest.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.