Skip to content

refactor(ipc): group SSH and runtime-environment IPC handlers into ipc/ssh/ and ipc/runtime-environments/ - #30362

Merged
nwparker merged 1 commit into
mainfrom
nwparker/r2-m6-ipc-folders
Oct 18, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/r2-m6-ipc-folders

Conversation

@nwparker

@nwparker nwparker commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 102 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​348 $\color{#cf222e}{\Huge{\mathbf{−}}}$​325 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​23
Prod 113 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​473 $\color{#cf222e}{\Huge{\mathbf{−}}}$​450 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​23

ELI5

src/main/ipc had about 130 SSH and runtime-environment IPC handler files sitting loose among everything else. This PR moves them into two subfolders, ipc/ssh/ and ipc/runtime-environments/. Nothing the app does changes.

What Changed

  • SSH handlers. src/main/ipc/ssh.ts, ssh.test.ts and every src/main/ipc/ssh-* file (47 files) move to src/main/ipc/ssh/ with git mv. Names are unchanged.
  • Runtime-environment handlers. src/main/ipc/runtime-environment*, orcad-* and managed-orcad-actions* (85 files) move to src/main/ipc/runtime-environments/ with git mv. Names are unchanged.
  • References rewritten:
    • imports and vi.mock paths in 69 importers;
    • path literals in reliability-gates.jsonc, ci-shard-timings.json and the compat-boundary importer list;
    • the Windows host lane's src/main/ipc/ssh-host-server-*.ts path filter.
  • E2E routing. Two route regexes (around lines 131 and 251) now accept an optional ssh/ or runtime-environments/ segment.
  • Moves only. git diff -M shows every moved file as a rename. The only edits inside them are their ../ import depth.

Why

This is round 2's folder plan (§4.2, M6): one concept per folder, so the SSH and runtime-environment IPC surfaces sit together and apart from the rest of ipc/.

Linked Issue

N/A (SSH hardening round 2, S11/M6).

Visual Proof

N/A: a pure file move.

Testing

  • typecheck:ci: clean.
  • All of src/main/ipc, src/main/ssh, src/main/managed-server and src/main/wsl, plus the e2e routing, orcad scope and compat-boundary config tests and every other changed test file, single worker: 1,092 files, 11,415 tests, all passing.
  • Path-literal, legacy-relay fence, compat-boundary and process-host import checks: pass.
  • Full local "static analysis and typecheck" job: clean.
  • Codex review (gpt-6.1-sol, high): clean.

…c/ssh/ and ipc/runtime-environments/

git mv plus import, vi.mock and path-literal rewrites; e2e route regexes and the Windows host lane
filter follow the moved handlers.
@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

📝 Walkthrough

The change updates import and mock paths to match the nested runtime-environments and ssh IPC directories. It also updates workflow filters, test routing, reliability-gate references, compatibility baselines, and CI timing keys. The summaries report no changes to runtime behavior or public declarations.

Priority: ⬇️ Low

Merge Risk: 🔵 Low · up to e6798

Historical test records no longer show the commands that produced their results. Restore those commands before merging, or accept this bounded audit-trail inaccuracy.

Pre-merge checks: Passed 3 · Failed 1 · Inconclusive 1

Failed Failed checks: 1 warning · 1 inconclusive

Check name Status Explanation Resolution
Description check Warning The description explains the change, rationale, affected paths, visual impact, and testing. However, it does not provide the required linked issue and omits several template sections, including Review… Add an actual issue reference after "Fixes #" or provide the required repository-approved issue link. Complete the missing template sections, including Review, Notes, Agent skill upstream boundary, and Checklist. Add the AI Disclosure secti…
Docstring Coverage Inconclusive Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 50 files. (153 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly summarizes the primary change: grouping SSH and runtime-environment IPC handlers into dedicated subdirectories.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the change, rationale, affected paths, visual impact, and testing. However, it does not provide the required linked issue and omits several template sections, including Review, Notes, the Agent skill upstream boundary, and the Checklist.

Resolution

Add an actual issue reference after "Fixes #" or provide the required repository-approved issue link. Complete the missing template sections, including Review, Notes, Agent skill upstream boundary, and Checklist. Add the AI Disclosure section if the contributor is external.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 50 files. (153 skipped: 6 unsupported, 147 over the file limit.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 56adb79e-903a-4959-9b3b-51b021d3d1ba
📥 Commits

Reviewing files that changed from the base of the PR and between 658953d and e6798d4.

📒 Files selected for processing: 215
  • .github/workflows/ssh-windows-hosts.yml
  • config/legacy-relay-compat-tags-baseline.txt
  • config/legacy-relay-importers-baseline.txt
  • config/main-layout-writer-baseline.txt
  • config/reliability-gates.jsonc
  • config/scripts/check-compat-boundary-imports.mjs
  • config/scripts/ci-shard-timings.json
  • config/scripts/pr-e2e-route-contracts.test.mjs
  • config/scripts/pr-e2e-source-routing.mjs
  • config/scripts/vitest-node-runtime-files.mjs
  • config/scripts/vitest-sqlite-runtime-files.mjs
  • src/main/ai-vault/runtime-session-scanner.test.ts
  • src/main/ai-vault/runtime-session-scanner.ts
  • src/main/ai-vault/runtime-session-search-call.test.ts
  • src/main/ai-vault/runtime-session-search-call.ts
  • src/main/browser/doc-preview-file-reader.test.ts
  • src/main/browser/doc-preview-file-reader.ts
  • src/main/ephemeral-vm-runtime-ssh.test.ts
  • src/main/ephemeral-vm-runtime-ssh.ts
  • src/main/ipc/agent-session-attachment-upload.test.ts
  • src/main/ipc/agent-session-attachment-upload.ts
  • src/main/ipc/ai-vault-host-leg-cache-retention.test.ts
  • src/main/ipc/ai-vault-search.test.ts
  • src/main/ipc/ai-vault-unresolved-owner.test.ts
  • src/main/ipc/browser.ts
  • src/main/ipc/desktop-browser-bridge-wiring.test.ts
  • src/main/ipc/desktop-browser-bridge-wiring.ts
  • src/main/ipc/ephemeral-vm-managed-ssh.test.ts
  • src/main/ipc/ephemeral-vm-runtime-handlers.ts
  • src/main/ipc/ephemeral-vm.test.ts
  • src/main/ipc/managed-host-status-publication.test.ts
  • src/main/ipc/register-core-handlers/register-core-handlers.test.ts
  • src/main/ipc/register-core-handlers/register-core-handlers.ts
  • src/main/ipc/runtime-environments/managed-orcad-actions.ts
  • src/main/ipc/runtime-environments/orcad-delta-move-handlers.test.ts
  • src/main/ipc/runtime-environments/orcad-delta-move-handlers.ts
  • src/main/ipc/runtime-environments/orcad-leave-behind-handlers.ts
  • src/main/ipc/runtime-environments/orcad-runtime-conversion-handlers.test.ts
  • src/main/ipc/runtime-environments/orcad-runtime-conversion-handlers.ts
  • src/main/ipc/runtime-environments/orcad-runtime-lifecycle-handlers.test.ts
  • src/main/ipc/runtime-environments/orcad-runtime-lifecycle-handlers.ts
  • src/main/ipc/runtime-environments/orcad-runtime-maintenance-handlers.test.ts
  • src/main/ipc/runtime-environments/orcad-runtime-maintenance-handlers.ts
  • src/main/ipc/runtime-environments/orcad-ssh-provisioning-handlers.test.ts
  • src/main/ipc/runtime-environments/orcad-ssh-provisioning-handlers.ts
  • src/main/ipc/runtime-environments/runtime-environment-abortable-requests.ts
  • src/main/ipc/runtime-environments/runtime-environment-browser-client-host-handler.test.ts
  • src/main/ipc/runtime-environments/runtime-environment-browser-client-host-handler.ts
  • src/main/ipc/runtime-environments/runtime-environment-call-queue.ts
  • src/main/ipc/runtime-environments/runtime-environment-capability-evidence.test.ts
  • src/main/ipc/runtime-environments/runtime-environment-capability-evidence.ts
  • src/main/ipc/runtime-environments/runtime-environment-cli-removal-routing.test.ts
  • src/main/ipc/runtime-environments/runtime-environment-connectivity-handlers.ts
  • src/main/ipc/runtime-environments/runtime-environment-diagnostics-broadcast.test.ts
  • src/main/ipc/runtime-environments/runtime-environment-diagnostics-broadcast.ts
  • src/main/ipc/runtime-environments/runtime-environment-federated-read-routing.test.ts
  • src/main/ipc/runtime-environments/runtime-environment-federated-read-transport.bench.test.ts
  • src/main/ipc/runtime-environments/runtime-environment-handler-channels.ts
  • src/main/ipc/runtime-environments/runtime-environment-host-dispatch.test.ts
  • src/main/ipc/runtime-environments/runtime-environment-host-key.test.ts
  • src/main/ipc/runtime-environments/runtime-environment-host-key.ts
  • src/main/ipc/runtime-environments/runtime-environment-host-service-ops.ts
  • src/main/ipc/runtime-environments/runtime-environment-managed-host-disconnect.test.ts
  • src/main/ipc/runtime-environments/runtime-environment-managed-tunnel.test.ts
  • src/main/ipc/runtime-environments/runtime-environment-managed-tunnel.ts
  • src/main/ipc/runtime-environments/runtime-environment-manual-disconnect.ts
  • src/main/ipc/runtime-environments/runtime-environment-mobile-relay-hosts.test.ts
  • src/main/ipc/runtime-environments/runtime-environment-mobile-relay-hosts.ts
  • src/main/ipc/runtime-environments/runtime-environment-pairing-verification.ts
  • src/main/ipc/runtime-environments/runtime-environment-preference.test.ts
  • src/main/ipc/runtime-environments/runtime-environment-preference.ts
  • src/main/ipc/runtime-environments/runtime-environment-recovery-handler.test.ts
  • src/main/ipc/runtime-environments/runtime-environment-recovery-handler.ts
  • src/main/ipc/runtime-environments/runtime-environment-removal-cleanup.test.ts
  • src/main/ipc/runtime-environments/runtime-environment-removal-cleanup.ts
  • src/main/ipc/runtime-environments/runtime-environment-removal-storage.test.ts
  • src/main/ipc/runtime-environments/runtime-environment-repair-handler.ts
  • src/main/ipc/runtime-environments/runtime-environment-request-connections.test.ts
  • src/main/ipc/runtime-environments/runtime-environment-request-connections.ts
  • src/main/ipc/runtime-environments/runtime-environment-retry-connections-probe.test.ts
  • src/main/ipc/runtime-environments/runtime-environment-revision-guard.test.ts
  • src/main/ipc/runtime-environments/runtime-environment-revision-guard.ts
  • src/main/ipc/runtime-environments/runtime-environment-session-reconcile.test.ts
  • src/main/ipc/runtime-environments/runtime-environment-session-reconcile.ts
  • src/main/ipc/runtime-environments/runtime-environment-session-tabs-delta-decoding.test.ts
  • src/main/ipc/runtime-environments/runtime-environment-session-tabs-delta-decoding.ts
  • src/main/ipc/runtime-environments/runtime-environment-session-tabs-delta.integration.test.ts
  • src/main/ipc/runtime-environments/runtime-environment-shared-control-answers.ts
  • src/main/ipc/runtime-environments/runtime-environment-shared-control-support.ts
  • src/main/ipc/runtime-environments/runtime-environment-status-connection.test.ts
  • src/main/ipc/runtime-environments/runtime-environment-status-diagnostics.ts
  • src/main/ipc/runtime-environments/runtime-environment-status-owner.ts
  • src/main/ipc/runtime-environments/runtime-environment-status-probe.ts
  • src/main/ipc/runtime-environments/runtime-environment-status-recovery.test.ts
  • src/main/ipc/runtime-environments/runtime-environment-status-retirement.test.ts
  • src/main/ipc/runtime-environments/runtime-environment-subscription-handlers.ts
  • src/main/ipc/runtime-environments/runtime-environment-subscription-identity.test.ts
  • src/main/ipc/runtime-environments/runtime-environment-subscription-layout-recording.test.ts
  • src/main/ipc/runtime-environments/runtime-environment-support-routing.test.ts
  • src/main/ipc/runtime-environments/runtime-environment-support-routing.ts
  • src/main/ipc/runtime-environments/runtime-environment-tailscale-response.ts
  • src/main/ipc/runtime-environments/runtime-environment-transport-generation.test.ts
  • src/main/ipc/runtime-environments/runtime-environment-transport-generation.ts
  • src/main/ipc/runtime-environments/runtime-environment-transport-routing-tailscale-hint.test.ts
  • src/main/ipc/runtime-environments/runtime-environment-transport-routing.ts
  • src/main/ipc/runtime-environments/runtime-environment-unreachable-hint.test.ts
  • src/main/ipc/runtime-environments/runtime-environment-unreachable-hint.ts
  • src/main/ipc/runtime-environments/runtime-environment-usage-record.ts
  • src/main/ipc/runtime-environments/runtime-environments-call-routing.test.ts
  • src/main/ipc/runtime-environments/runtime-environments-capability-cache.test.ts
  • src/main/ipc/runtime-environments/runtime-environments-ipc-test-harness.ts
  • src/main/ipc/runtime-environments/runtime-environments-pairing.test.ts
  • src/main/ipc/runtime-environments/runtime-environments-repair.test.ts
  • src/main/ipc/runtime-environments/runtime-environments-status-diagnostics.test.ts
  • src/main/ipc/runtime-environments/runtime-environments-subscription-lifecycle.test.ts
  • src/main/ipc/runtime-environments/runtime-environments-subscription-routing.test.ts
  • src/main/ipc/runtime-environments/runtime-environments-subscription-teardown.test.ts
  • src/main/ipc/runtime-environments/runtime-environments.ts
  • src/main/ipc/runtime-upload-file-stream.test.ts
  • src/main/ipc/runtime-upload-file-stream.ts
  • src/main/ipc/runtime-upload-slice-boundaries.test.ts
  • src/main/ipc/runtime-upload-temp-sweep.test.ts
  • src/main/ipc/runtime-upload-temp-sweep.ts
  • src/main/ipc/settings.ts
  • src/main/ipc/skill-cloud-ipc-handlers.test.ts
  • src/main/ipc/skill-cloud-ipc-handlers.ts
  • src/main/ipc/skill-install-management-ipc-handlers.test.ts
  • src/main/ipc/skill-install-management-ipc-handlers.ts
  • src/main/ipc/ssh/ssh-app-shutdown.test.ts
  • src/main/ipc/ssh/ssh-browse.test.ts
  • src/main/ipc/ssh/ssh-browse.ts
  • src/main/ipc/ssh/ssh-connect-attempt-registry.ts
  • src/main/ipc/ssh/ssh-connect-decision-cancellation.test.ts
  • src/main/ipc/ssh/ssh-connect-flow.ts
  • src/main/ipc/ssh/ssh-connection-handlers.ts
  • src/main/ipc/ssh/ssh-connection-state-callbacks.ts
  • src/main/ipc/ssh/ssh-credential-cancel.test.ts
  • src/main/ipc/ssh/ssh-disconnect-cancellation.test.ts
  • src/main/ipc/ssh/ssh-handler-reregistration.test.ts
  • src/main/ipc/ssh/ssh-host-launch-session-note.test.ts
  • src/main/ipc/ssh/ssh-host-launch-session-note.ts
  • src/main/ipc/ssh/ssh-host-server-connect.ts
  • src/main/ipc/ssh/ssh-host-server-decision-failure.test.ts
  • src/main/ipc/ssh/ssh-host-server-on-connect-wiring.test.ts
  • src/main/ipc/ssh/ssh-host-server-on-connect-wiring.ts
  • src/main/ipc/ssh/ssh-host-sleep-reconnect.test.ts
  • src/main/ipc/ssh/ssh-host-sleep-reconnect.ts
  • src/main/ipc/ssh/ssh-host-user-disconnect.test.ts
  • src/main/ipc/ssh/ssh-host-user-disconnect.ts
  • src/main/ipc/ssh/ssh-ipc-context.ts
  • src/main/ipc/ssh/ssh-ipc-mock-shapes.ts
  • src/main/ipc/ssh/ssh-ipc-module-mocks.ts
  • src/main/ipc/ssh/ssh-ipc-test-harness.ts
  • src/main/ipc/ssh/ssh-managed-host-port-forward-lifecycle.test.ts
  • src/main/ipc/ssh/ssh-managed-port-forward-restore.ts
  • src/main/ipc/ssh/ssh-managed-server-unlink-broadcast.test.ts
  • src/main/ipc/ssh/ssh-passphrase.test.ts
  • src/main/ipc/ssh/ssh-passphrase.ts
  • src/main/ipc/ssh/ssh-port-forward-handlers.ts
  • src/main/ipc/ssh/ssh-port-forward-persistence.ts
  • src/main/ipc/ssh/ssh-port-forward-restore.test.ts
  • src/main/ipc/ssh/ssh-renderer-broadcast.ts
  • src/main/ipc/ssh/ssh-session-teardown.ts
  • src/main/ipc/ssh/ssh-shutdown-drain.ts
  • src/main/ipc/ssh/ssh-sign-in-requirement.test.ts
  • src/main/ipc/ssh/ssh-sign-in-requirement.ts
  • src/main/ipc/ssh/ssh-state-broadcast-fanout.test.ts
  • src/main/ipc/ssh/ssh-target-crud-handlers-ownership.test.ts
  • src/main/ipc/ssh/ssh-target-crud-handlers.ts
  • src/main/ipc/ssh/ssh-target-lifecycle-queue.ts
  • src/main/ipc/ssh/ssh-target-registry.test.ts
  • src/main/ipc/ssh/ssh-test-connection-probe-registry.test.ts
  • src/main/ipc/ssh/ssh-test-probe-presence.test.ts
  • src/main/ipc/ssh/ssh.test.ts
  • src/main/ipc/ssh/ssh.ts
  • src/main/ipc/wsl-host-gate-off.test.ts
  • src/main/ipc/wsl-host-handlers.ts
  • src/main/managed-server/lifecycle/orcad-managed-tunnel.ts
  • src/main/managed-server/lifecycle/orcad-runtime-conversion-wiring.ts
  • src/main/managed-server/lifecycle/orcad-runtime-conversion.ts
  • src/main/managed-server/lifecycle/orcad-runtime-deployment.ts
  • src/main/managed-server/lifecycle/orcad-runtime-status.ts
  • src/main/skills/skill-client-mediated-transfer-cancellation.test.ts
  • src/main/skills/skill-client-mediated-transfer.test.ts
  • src/main/skills/skill-client-mediated-transfer.ts
  • src/main/skills/skill-cloud-grant-installation.test.ts
  • src/main/skills/skill-cloud-grant-installation.ts
  • src/main/skills/skill-remote-error-category-parity.test.ts
  • src/main/skills/skill-remote-install-service.test.ts
  • src/main/skills/skill-remote-install-service.ts
  • src/main/skills/skill-runtime-capability.test.ts
  • src/main/skills/skill-runtime-capability.ts
  • src/main/ssh/legacy-relay/ssh-relay-version-mismatch-error.ts
  • src/main/ssh/orcad-migration-delta-move.test.ts
  • src/main/ssh/orcad-migration-delta-snapshot.test.ts
  • src/main/ssh/orcad-migration-repository-link.test.ts
  • src/main/ssh/orcad-runtime-maintenance.ts
  • src/main/ssh/orcad-ssh-provisioning.ts
  • src/main/ssh/runtime-ssh-access.ts
  • src/main/ssh/ssh-connection-reconnect-ladder.test.ts
  • src/main/startup/headless-serve-ssh-registration.test.ts
  • src/main/startup/headless-serve-ssh-registration.ts
  • src/main/startup/main-process-quit.ts
  • src/main/startup/main-process-runtime-launch-activation.test.ts
  • src/main/startup/main-process-runtime-launch.ts
  • src/main/startup/main-process-runtime-service.ts
  • src/main/window/attach-main-window-services.test.ts
  • src/main/window/attach-main-window-services.ts
  • src/main/window/clipboard-agent-session-attachment-paste.test.ts
  • src/main/window/clipboard-ipc-handlers.test.ts
  • src/main/window/clipboard-runtime-image-upload.ts
  • src/main/window/clipboard-runtime-owned-ssh-paste.test.ts
  • src/renderer/src/components/browser-pane/stream-remote/remote-browser-stream-lifecycle-test-harness.ts
  • src/renderer/src/components/browser-pane/stream-remote/remote-browser-stream-lifecycle.test.ts
  • src/renderer/src/components/browser-pane/stream-remote/remote-browser-stream-lifecycle.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

"runner": "local",
"platform": "macos",
"command": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/runtime-environments-subscription-teardown.test.ts",
"command": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/runtime-environments/runtime-environments-subscription-teardown.test.ts",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

git diff 658953dc23b90d3c637a20951669089f3ed04df8 e6798d4330c358e3ba5915443fd2258376fe3820 -- config/reliability-gates.jsonc | rg -n -C 5 '5318|evidenceRuns|currentCommand|subscription-teardown|terminal-hidden|ssh.test.ts'
sed -n '5300,5325p;10662,10684p;12120,12179p;18768,18783p' config/reliability-gates.jsonc
rg -n 'evidenceRuns|currentCommand' config/scripts/check-reliability-gates.mjs | head -60

Repository: stablyai/orca

Length of output: 42140


Preserve historical commands in dated evidence records.

The evidenceRuns[].command fields record the commands that produced the dated results. Keep those commands unchanged. Use relocated paths in commands, testFiles, and currentCommand where present.

@nwparker
nwparker merged commit 1938bd0 into main Oct 18, 2026
58 checks passed
nplez1 added a commit to nplez1/orca that referenced this pull request Oct 24, 2026
…ne runs (#178)

* test(unit-gate): run the unit lane's file set and the fork-local tests

Two gaps made a gate verdict narrower than it read. The suite ran
`defaultExclude` rather than upstream's `UNIT_EXCLUDE`, so it collected 80
files the unit lane quarantines — electron, node-pty, live-shell and the whole
cross-version-wire directory — and charged this fork for their reds. And
`local/**/*.test.mjs` match nothing in `UNIT_INCLUDE`, so the sync-tooling
tests were in no lane at all (fork issue #151 § 3 and § 5).

The exclusion switch is `ORCA_BALANCE_UNIT_SHARDS=1`, the one
`config/vitest.config.ts` already reads; a `--exclude` flag cannot reach the
projects because each sets `extends: false`. Since parity is now a switch, the
gate asserts the report collected none of the quarantined files and fails
closed if one appears, and it treats an allowlist entry for a quarantined file
as a problem rather than letting an entry that can never match sit there.

Fork-local tests run first, so a broken sync tool cannot produce a verdict
about anything else, and the summary line reports both facts.

* test(unit-gate): name every allowlisted failure and drop the quarantined files

The manifest was 15 entries, 14 of them file-level wildcards. A wildcard also
covers a NEW failure in the same file, which is how one hid for two syncs.
Every entry now names its test title, taken from a reconciliation run over the
allowlisted files whose arithmetic closes: 32 allowlisted + 5
upstream-quarantined + 1 fixed = 38 records.

Three files leave the manifest because the gate no longer runs them: upstream's
own unit lane excludes repro-13767, relay-region-correction and the whole
cross-version-wire directory, so their reds are upstream's to carry. Ownership
is corrected where it was unattributed — both remaining `unattributed` files are
upstream files this fork never touched.

* test(runtime): assert the documented undefined read for an unbound pane

`terminal-pane-screen-prompt.ts` returns `undefined` for a pane it cannot bind
to a terminal, and says why in the method's own doc comment: a restored pane
reconnects after the hook store starts, so "cannot see it" must not read as "no
dialog". The case asserted `toBeNull()` for that path in the same commit that
added both (`3526000b5c`), so it never passed — and a file-level allowlist entry
kept it hidden inside a 1,476-case file.

Found by tightening `local/unit-known-red.json` to test titles (fork issue
#151 § 1). Renamed to match what it asserts.

* docs(fork): record issue #151's allowlist rework and correct the extend-test diagnosis

LOCAL-PATCHES.md gains the section for this work, and the extend-test entry is
corrected where fork issue #151 § 4 says it no longer matches the import graph:
`ephemeral-vm-runtime-extend.ts:22` imports only `getSshConnectionManager`, so
the mock was complete for the module under test and the missing export was only
visible to what that module reaches. The 28 `TypeError: {} is not iterable`
rejections were a second cause — the renderer's reclaim bridge iterating a
non-list `listRuntimes` answer, fixed in `2368ed38da` — which the recorded
sentence welded to the mock because both appeared in one run.

BRANCHES.md gets the branch's entry and its place under nplez1/main.

* test(tools): put the unit gate's tests where the unit suite collects them

`tests/tools/**` is in `UNIT_INCLUDE` and is where `local/gate-lint.mjs` keeps
its tests, so the gate's judging rules run in the suite rather than only in the
gate's own fork-local lane. The lane stays, because `local/sync/lib/*.test.mjs`
are still outside `UNIT_INCLUDE` and are what fork issue #151 § 5 is about.

Written as vitest to match `tests/tools/lint-gate.test.mjs`; same assertions.

* fix(unit-gate): judge an isolated re-run per test, and stop a dead entry hiding

Two gaps that naming the entries opened, both from the Opus review round.

The isolation re-run asked whether the *file* passed alone. With named entries
that question is unanswerable: the file's own allowlisted reds still fail when
it runs alone, so a load flake in a file that also has recorded reds always
looked like a real break — process-host-dev-rebuild and orca-runtime are both
that shape. The re-run now writes its own JSON report and a failure counts as
reproduced only when that same test failed there; a missing report still counts
as reproduced, so it fails closed.

`unseen` meant "the file did not fail", which cannot happen to a dead entry in
a file that still reds elsewhere — so a renamed case left its entry matching
nothing forever. It now means "nothing in the run matched this entry and it is
not stale", which covers the renamed case and the vanished file alike.

Also here: the fork-local lane gets its own five-minute deadline instead of the
suite's hour, `closeSync` is imported (every `closeSyncSafe` had been throwing
into its own catch, leaking the log descriptor), the duplicate JSDoc on
`judgeUnhandled` is gone, and `repoPath` normalises the checkout prefix so the
new quarantine check can fire on Windows too. The two new checks are extracted
and tested rather than inlined in `evaluate()`.

* fix(cli): link the launcher this fork actually ships in the privileged repair case

The case symlinked `/Applications/Old Orca.app/.../bin/orca` and expected the
installer to adopt it. This fork ships `orca-np` (`cli-install-constants.ts:6`),
and `isManagedSymlinkTarget` rejects a target whose basename differs from the
launcher's own name (`cli-command-inspection.ts:117`), so the installer read its
own launcher as a foreign command and refused it: `Refusing to replace non-Orca
command at /var/folders/...`.

The two sibling cases in this file already link `old/orca-np` — this one arrived
later from upstream, after the fork's identity patch. One hunk, and the red is
gone rather than recorded, so its allowlist entry goes with it.

`local/unit-known-red.json` therefore drops to 31 named entries and its
`observedRun` arithmetic closes at 38 records: 31 allowlisted, 5
upstream-quarantined, 2 repaired. The note also stops contradicting itself about
keeping an entry that has stopped reproducing: prune wins, and LOCAL-PATCHES.md
stays the history of why a class was red.

* test(ephemeral-vm): mock the module the extend unit actually imports

`vi.mock('./ipc/runtime-environments')` named a path the 2026-10-19 module
reorganisation deleted; the code imports
`./ipc/runtime-environments/runtime-environments` (`ephemeral-vm-runtime-extend.ts:16`)
and the directory has no `index.ts`, so the mock was inert and the real module
loaded with everything it reaches.

That is the mechanism behind the failure `LOCAL-PATCHES.md` recorded by guess:
a gap in the mocked SSH registry surfaced thirty frames away, because the graph
the dead mock failed to cut still read `getSshTargetRegistryStore`. Naming the
real module is the fix; the registry mock stays as it is.

* docs(fork): re-diagnose the extend-test red and record the review round's corrections

The review round found the recorded cause wrong twice over, so LOCAL-PATCHES.md
now says what is checkable:

- the extend test's mock named `./ipc/runtime-environments`, a path the
  2026-10-19 reorganisation deleted, so it was inert and the real module loaded
  — which is why a registry-mock gap surfaced thirty frames away;
- the `TypeError: {} is not iterable` rejections had their own cause, the
  renderer reclaim bridge iterating a non-list answer, fixed in `2368ed38da`;
- both files are fork-owned (`902955072a` is fork PR #81, absent from
  `upstream/main`), so the issue's "send it upstream" premise does not hold.

The `local(test)` section also records the two reds the tightening repaired, the
per-test isolation rule, the new `unseen` meaning, and the resolved keep-vs-prune
contradiction. BRANCHES.md follows: 31 entries, and what § 4 actually turned out
to be.

* fix(unit-gate): do not call every entry unseen when a selector filters the run

A forwarded selector describes a different suite, so every entry outside it
matches nothing. Reporting those as unseen made a one-file smoke run print all
31 entries as prune candidates, which is the false signal the new rule was
supposed to avoid. Unseen is now only judged when the gate runs the whole
suite, and a filtered run says so instead.

The quarantine list also stops at twelve names without saying so; it now counts
the rest.

* fix(unit-gate): waive a failure only when the re-run saw that test pass

The per-test rule asked whether the re-run *failed* the test, which is not the
same as proof it passed. Three shapes slipped through as waivable flakes: a
collect error in the re-run replaces every case with one `(suite)` entry, a
failing `beforeAll` reports its cases as skipped, and a report with no files at
all has an empty failure set. In each, the original test is absent — and absent
is not evidence, which is the rule a missing report already followed.

`reproducedFailures()` now waives only a test the re-run reported as passing; a
`(suite)` failure is waived only when the file itself passed. A corrupt
isolation report is parsed locally instead of through `readJsonFile`, which
would exit mid-verdict.

`prunableEntries()` replaces the bare `fullRun` filter for the same reason: an
entry may be called unseen only on a complete, unfiltered run, and not when its
file reported nothing but a collect failure. `repoPath` now checks the path
separator, so a sibling checkout named `issue-151-x` no longer reads as inside
this one.

The judgement moved to `local/unit-gate-judgement.mjs`: it is pure over data
the gate already holds, it is what the tests now import, and the gate had grown
past this fork's 600-line budget carrying both roles.

* docs(fork): point the old privileged-CLI entry at its re-diagnosis

`local(test)` § "five more environment-bound reds" filed that case under the
`/private/var` symlink cause, which the re-diagnosis two sections down now
contradicts — the recorded error path is `/var/…` and the cause is the fork's
`orca-np` rename. The bullet says so and points at the entry, rather than
leaving two causes for one red.

Also names the reorganisation that deleted the extend test's mock path
(`1938bd055a`, stablyai#30362) and records where the gate's judgement now lives.

* fix(unit-gate): name the preparation steps so the failure line type-checks

The changed-code gate's type-aware pass rejects `${label}` in the preparation
failure line: destructuring a heterogeneous tuple array widens `label` to
`string | string[]`. Objects give it one type, and the fork-local lane still
runs before both.

* fix(unit-gate): refuse a waiver the re-run contradicts, and read one file's report

Round-3 delta findings, both one hunk.

A waiver now needs the pass to be the whole story: a name the same report also
failed (a `test.each` duplicate) or a `(suite)` entry beside it (a hook broken
under) keeps the failure, which is also what puts `rerun.failures` back to work
instead of leaving it built and unread. The re-run is also read per file —
`reportForFile()` filters by path, because a positional selector is a substring
match and `thing.test.ts` collects `thing.test.tsx` too. That function is tested
directly, which the `filePassed` branch was not.

Prune advice stays silent on a report with no tests at all, not merely on one
that did not complete.

* test(ipc): accept the gh-account argument the branch-prefix login now takes

`a8ca9685a3` (#170) made the branch-prefix login follow the repo's pinned gh
account: `resolveLocalGitUsername(repoPath, ghAccount)`. This upstream case
still asserted the one-argument call, so `nplez1/main` has been red on it since
that merge — it surfaced as the only unallowlisted failure of the first full
gate run on this branch, which is exactly what the tightened allowlist exists to
show. The case's repo has no binding, so the second argument is `undefined`.

* docs(fork): record the gate verdict for issue #151

Verdict on the revision that ships, and the honest note that its first full
run found a red the base had carried since #170 rather than a red this branch
made — an upstream case still asserting the one-argument branch-prefix login.
No entry was stale and none was unseen, which is the check that the tightening
was faithful rather than merely equivalent to the wildcard it replaced.

BRANCHES.md carries the same verdict plus the three review rounds.

* fix(unit-gate): order the fs imports

NIT from the merge-resolution review: `closeSync` sorts before `openSync`.
EOF2

* docs(fork): reframe the gate verdict the #177 merge superseded

PR #177 landed `local/gate-verdict-cache.mjs` and made `local/open-pr.mjs`
read it, so a verdict now belongs to one exact revision and the shipped one is
quoted in the PR body. This records the earlier full run as what it was — the
first run after the tightening, before #177 — instead of calling it the shipped
revision's verdict, and notes the merge-resolution review round.

Raised as the only MINOR by the review of the merge resolution.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant