Skip to content

[CI] Make SSH permission probe fixture independent of real PID reuse - #26190

Merged
nwparker merged 1 commit into
mainfrom
nwparker/ssh-denied-probe-fixture-isolation
Oct 7, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/ssh-denied-probe-fixture-isolation

Conversation

@nwparker

@nwparker nwparker commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

The SSH permission test sometimes tested PID reuse instead of permission denial. It invented PID4242, mocked kill, and then consulted the runner's real process table. If another process occupied that PID, the identity check correctly returned DEAD before the mocked permission check could run.

What Changed

The permission fixture now also supplies a matching slot identity for exactly ps -o args= -p 4242. Other ps queries refuse; it never consults a real PID. The locale-sensitive denied signal mock and UNKNOWN assertion remain unchanged. The adjacent real-process PID-reuse test still expects DEAD.

Why

Permission handling needs a known process identity. Making both observations deterministic preserves that boundary and avoids depending on which processes the CI runner happens to start. It adds no process, wait, production change or relaxed assertion.

Linked Issue

CI failure in https://github.com/stablyai/orca/actions/runs/37606869393/job/112745317690 (composer performance PR#26179).

Visual Proof

N/A — test fixture only; no application behavior or UI change.

Testing

Before/after evidence (correctness and reliability; no performance claim):

Check Before After
Actual original CI SSH file 29 passing cases,1 permission-case failure (UNKNOWN expected,DEAD received) All30 cases pass in isolated full PR CI (0 failures)
Controlled foreign-identity fixture, selected case under Bun and Node 1 expected assertion failure per runtime; raw red reports retained Matching-slot fixture passes the selected case under both Bun and Node (1/1 per runtime)

The controlled red model explicitly supplies an unrelated command for the invented PID, reproducing the incomplete fixture. It does not demonstrate a production permission bug: production's PID-reuse branch correctly classifies that different identity. The corrected fixture exercises permission handling with a matching slot identity and still expects UNKNOWN.

  • No real PID lookup/signal from the selected case: both shell boundaries are modeled. Local macOS checks use ORCA_BACKGROUND_LAUNCH=1 and only this case with -t; the other29 native-process cases are unexecuted locally, not removed from CI.
  • Original assertion, locale-dependent denied mock, adjacent reused-PID test and every other case/cleanup preserved. Four production command/host/escaping modules retain exact hashes.
  • Node typecheck, changed-code quality, formatting and whitespace checks passed. Full PR CI passes all five Linux ARM shards and all applicable gates at head 4355e65b, tested merge source b125d4f9 (incoming main 2584ed90 plus this head). The actual Bun SSH module passes all30 cases (7.103s, no skips). Canonical discovery and all five assignments cover all11,678 physical files exactly once: 11,538 passing files,140 existing skipped files;112,608 passing cases,one expected failure,1,052 existing skipped cases,zero unhandled errors. Every11,669 prior-source file remains with nine incoming additions and no removals. Runtime configuration is unchanged:10,552 Bun files,1,125 actual Node runtime files,one Node measurement file. Stock artifacts establish file enrollment and raw counts; selected local reports separately preserve exact permission-case identity.

Review

Exact failed synthetic source c08333f6c7aaeaee20625140771ad16e8364afaf has incoming main 5cafefe726a28bc0052aed5255bfce1cd8fcfb42. That main introduced this case; the composer change did not edit it. Prepared against main 520033b0e12a752036b40dd4cf53dac47ba2fd3b. Independent source review is clear: exact modeled identity, original permission assertion and real PID-reuse coverage retained. Final head has green applicable checks and a clean merge state. Zero review threads were observed; no bot review completion is claimed.

Agent skill upstream boundary

  • Not applicable; no agent-skill source changed.

Notes

The owning-host distinction between live, unverifiable and exited is unchanged. Windows implementation, remote protocol, SSH runtime routing and stop behavior are unchanged. Real lifecycle/teardown validation stays in isolated full CI.

Checklist

  • Small focused fixture fix; mechanism and alternatives explained.
  • N/A visual proof explained; platform/SSH boundaries considered.
  • Final automated gates and full PR CI pass; source-bound full enrollment checked.

@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a9b1747a-2c90-46ca-a6a5-0de326f399c2
📥 Commits

Reviewing files that changed from the base of the PR and between 2584ed9 and 4355e65.

📒 Files selected for processing (1)
  • src/main/ssh/orcad-remote-shell-commands.integration.test.ts

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


📝 Walkthrough

Walkthrough

The permission-denied liveness test now stubs ps to return this slot’s orcad.js path for PID 4242. The locale-dependent kill stub and the expected UNKNOWN result remain.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 4355e

This test-only change makes the permission-denied check independent of real PID reuse while retaining the UNKNOWN assertion. No actionable merge risk remains from the change.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
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.
Title check ✅ Passed The title clearly describes the main change: making the SSH permission-test fixture independent of real PID reuse.
Description check ✅ Passed The description covers the change, reason, testing, visual-proof status, review, and checklist. The Linked Issue section points to a CI run rather than an actual issue, as the template requests.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autopilot · 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.

@nwparker
nwparker merged commit b8c9671 into main Oct 7, 2026
30 checks passed
@nwparker nwparker changed the title Make SSH permission probe fixture independent of real PID reuse [CI] Make SSH permission probe fixture independent of real PID reuse Oct 9, 2026
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