Skip to content

ci(ssh): hostile-host matrix for the relay runtime ladder - #24146

Merged
OrcaWin merged 5 commits into
mainfrom
OrcaWin/node-rt-p2-hostile
Oct 1, 2026
Merged

OrcaWin merged 5 commits into
mainfrom
OrcaWin/node-rt-p2-hostile

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​564 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​564
Prod 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​630 $\color{#cf222e}{\Huge{\mathbf{−}}}$​17 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​613

ELI5

A CI matrix connects Orca's real relay deploy code to Docker containers acting as SSH hosts. The hosts are set up to be hard: old glibc, musl, no compiler, no internet, a noexec home. Each cell checks that Orca picks the right runtime rung and never runs npm or a compiler on the host.

What Changed

  • ssh-relay-hostile-hosts.docker.test.ts drives deployAndLaunchRelay through a real SshConnection, following the existing Docker SSH test pattern. It runs only when ORCA_RUN_SSH_HOSTILE_HOSTS=1.
  • The seven cells are defined in ssh-hostile-host-cells.ts, with images pinned by digest and a pure outcome checker:
    • debian:10 and almalinux:8 (rung A)
    • Alpine with libstdc++ (rung A on musl)
    • Alpine without libstdc++ (missing_lib)
    • Ubuntu 22.04 with a noexec home (rung D, home_noexec)
    • CentOS 7 (A refused for glibc too old, then onward)
    • a no-internet cell (rung A)
  • Every image gets fake npm, node-gyp and compiler commands that log any call. A second connect must reuse the runtime.
  • New workflow, path-filtered and available through workflow_dispatch. It doesn't run on every PR.
  • Fix: a musl host missing libstdc++ is now classified missing_lib, not wrong_libc.

Why

Design D5 and the Phase 2 exit gate: first connect should succeed with no host Node, npm or compiler.

Linked Issue

Part of the Node runtime plan (Phase 2). Stacked on OrcaWin/node-rt-p2-integration, which merges #24128–#24130 and #24133–#24136.

Visual Proof

N/A. This is CI only.

Testing

  • Unit tests pass for the cells and the outcome checker.

  • There's no Docker locally, so this PR's CI run is the first real run.

  • Not covered:

    • rung C (no cell has a working host Node when rung A is refused)
    • macOS, Windows and arm64 hosts
    • CentOS 7 accepts any error from the npm fallback until rung B ships
  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

@greptile-apps

greptile-apps Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Adds SSH hostile-host matrix testing infrastructure.

The PR appears safe to merge, though the outstanding libc diagnostic classification is worth correcting.

Findings

  1. P2 Libc mismatch misclassified ▶

Summary

The PR adds a path-filtered CI matrix that deploys the SSH relay to constrained container hosts, checks runtime-ladder outcomes and reconnect reuse, and supports building a partial Orcad template for the matrix.

  • The changes since the previous review adjust Windows self-test option handling without changing the reachable pinned-runtime version check.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  CI[Hostile-host workflow] --> Slots[Build glibc and musl slots]
  Slots --> Template[Build partial Orcad template and relay]
  Template --> Hosts[Deploy over SSH to container hosts]
  Hosts --> Checks[Check runtime rung, PTY, GC and reconnect]
Loading

Reviews (3) · Last reviewed commit: "test(ssh): reconnect as the same client ..."

Comment on lines +80 to +88
// Why before relocation: musl reports each symbol of a missing library as "symbol not found".
if (
/error while loading shared libraries|cannot open shared object file|Error loading shared library/i.test(
output
)
) {
return 'missing_lib'
}
if (/Error relocating|symbol not found/i.test(output)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Libc mismatch misclassified If a musl loader error reports a missing libc.so.6 without naming an ld-linux interpreter, this check returns missing_lib before it considers a relocation error. When the cause is a glibc-linked addon on a musl host, the recorded refusal and diagnostics point to a missing library rather than the libc mismatch. Please distinguish that case while retaining the new libstdc++ classification.

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!

Comment thread .github/workflows/ssh-hostile-hosts.yml Resolved

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

  • Musl missing-library classification (ssh-relay-runtime-self-test.ts): the Error relocating/symbol not found branch moves below missing_lib, so a musl Node linking a missing libstdc++ is classified missing_lib rather than wrong_libc. Traced against the ladder: both are PinnedRuntimeRefusals that step down and persist identically, and ld-linux/ld-musl still resolves wrong_libc first, so this is refusal-string/telemetry only. The added test row pins the new behavior and the existing rows still hold.
  • Partial orcad template (build-orcad-template.mjs, verify-packaged-orcad-template.cjs): --targets a,b plus a narrowed targets parameter. The default remains ORCAD_TEMPLATE_TARGETS, so normal builds still verify every target; the main() guard only unblocks importing requestedTemplateTargets from the new test.
  • Hostile-host cells and checker (ssh-hostile-host-cells.ts, ssh-hostile-host-test-fixture.ts): 7 digest-pinned cells with a pure outcome checker; each image shims npm/gcc/... to a logging exit-127 stub. Traced every expected refusal chain against ssh-relay-runtime-ladder.ts, ssh-relay-runtime-step-plan.ts, and ssh-relay-host-node-addons.ts — including the centos7 A:libc_floor → B:runtime_unavailable → C:libc_floor → legacy path, the noexec A→D short-circuit, and the musl missing_lib → … → D no_runtime path — and they match.
  • Docker matrix driver (ssh-relay-hostile-hosts.docker.test.ts): real deployAndLaunchRelay over a real SshConnection, asserting rung, refusals, target, empty forbidden-tool log, terminal echo via $((6*7)), GC retention of the in-use runtime, and a cached second connect. Gated by ORCA_RUN_SSH_HOSTILE_HOSTS=1; the store path it derives from pinnedRelayNodePath matches remoteNodeRuntimeStoreDir, and Alpine retention is satisfied by the /proc/*/exe fallback when busybox ps declines.
  • Workflow (.github/workflows/ssh-hostile-hosts.yml) and ssh-hostile-hosts-workflow.test.mjs: path-filtered pull_request + workflow_dispatch; slot builder digests pinned to the headless-server lanes and asserted equal.

The heavy matrix is documented as not covering rung C or non-Linux hosts, and the workflow test intentionally couples this lane's builder digests to node-server-tests.yml; both are deliberate and noted.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

Reviewed the two commits since the prior pullfrog review — the node-rt-p2-integration merge and the PTY-owner reconnect test.

  • Same-client reconnect in the hostile-host matrix (ssh-relay-hostile-hosts.docker.test.ts): assertTerminalEchoes now takes one clientInstanceId shared by both connects, mirroring the app's target-scoped identity, and retries openSshPtyConsumerSession through retrySshOwnerRecoveryWhileBlocked so the first connect's grace-held owner does not fail the second. The wrapper matches the production admission path (ssh-relay-session.ts:1305), only retries the transient owner states (publication-pending / self-holder / disconnected-holder), and still throws once the budget is exhausted, so it cannot mask a genuinely broken handoff.

No production code changed in this delta, and the prior review's findings remain addressed.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

m4air added 5 commits October 1, 2026 02:35
…wrong_libc

musl's loader follows each missing-library line with one 'Error relocating ... symbol
not found' per unresolved symbol, and the relocation pattern was checked first. Check
missing libraries before relocation errors; the ld-linux/ld-musl interpreter case stays
wrong_libc.
build-orcad-template --targets a,b builds and verifies only the named slots, so a CI job
that can fill just the x64 Linux prebuild slots can still materialize rung A/C addons.
Without the flag every target is still built and verified.
Drives the real client-side relay deploy against Docker sshd targets and asserts the
design D6 rung each lands on: Debian 10 and AlmaLinux 8 (glibc 2.28) and Alpine (musl)
on rung A; Alpine without libstdc++ refused missing_lib down to D; Ubuntu 22.04 with a
host Node 20 and a noexec home straight to D (home_noexec); CentOS 7 (glibc 2.17)
refused libc_floor at A and C, falling to a host-npm path with no Node; and a
no-egress Debian 10 still on rung A. Launched cells also prove the terminal echoes,
no npm or compiler ran, a second connect reuses the uploaded runtime, and runtime GC
keeps the in-use runtime while collecting an idle one.

New workflow ssh-hostile-hosts.yml runs on dispatch and on path-filtered PRs.
…r images

The matrix builds its runtime slots in copies of the node-server lanes' Alpine
and manylinux images; this contract fails when NODE_RUNTIME_PIN or either
builder digest moves in one workflow and not the other.
@OrcaWin
OrcaWin force-pushed the OrcaWin/node-rt-p2-hostile branch from 4dfbd08 to 4fad278 Compare October 1, 2026 09:36
@OrcaWin
OrcaWin changed the base branch from OrcaWin/node-rt-p2-integration to main October 1, 2026 09:40
@OrcaWin OrcaWin closed this Oct 1, 2026
@OrcaWin OrcaWin reopened this Oct 1, 2026
@coderabbitai

coderabbitai Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

🧰 Additional context used
📚 Code guidelines (1)
AGENTS.md — auto-discovered

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: f605e7a8-0cbe-4e8c-913b-20a45a343157

📥 Commits

Reviewing files that changed from the base of the PR and between 67014c8 and 4fad278.

📒 Files selected for processing (12)
  • .github/workflows/ssh-hostile-hosts.yml
  • config/scripts/build-orcad-template.mjs
  • config/scripts/build-orcad-template.test.mjs
  • config/scripts/ssh-hostile-hosts-workflow.test.mjs
  • config/scripts/verify-packaged-orcad-template.cjs
  • config/scripts/verify-packaged-orcad-template.test.mjs
  • src/main/ssh/ssh-hostile-host-cells.test.ts
  • src/main/ssh/ssh-hostile-host-cells.ts
  • src/main/ssh/ssh-hostile-host-test-fixture.ts
  • src/main/ssh/ssh-relay-hostile-hosts.docker.test.ts
  • src/main/ssh/ssh-relay-runtime-self-test.test.ts
  • src/main/ssh/ssh-relay-runtime-self-test.ts

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


📝 Walkthrough

Walkthrough

The change adds a seven-cell Docker matrix for SSH relay runtime behavior, with checks for deployment outcomes, runtime handling, and host restrictions. It adds optional target selection to ORCAD template building and verification. A new workflow builds and smoke-tests Linux x64 glibc and musl slots, builds the selected template targets, and runs the matrix.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 4fad2

No actionable merge-blocking issue is established. Merge after normal checks, including the new Docker workflow, pass.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 4fad2

The inspected changes are confined to runtime verification and testing, with read-only repository permissions and disposable SSH hosts. No introduced security vulnerability was established. Risk remains low rather than minimal because interrupted-resource cleanup and some build-state comparisons remain unresolved.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The identified new execution exposure is PR-controlled code running within CI jobs, including Docker access and generated container-root SSH identities. The inspected configuration does not add production deployment authority or external SSH credentials. This conclusion is bounded to the inspected workflow and fixture paths.

Trust Boundaries and Controls

  • observed — The workflow declares contents-read permission and disables checkout credential persistence in every job. Fixtures generate temporary Ed25519 identities and restrict ordinary SSH exposure to loopback. Readiness probes intentionally disable host-key verification for these locally created test targets.

Resilience and Maintainability Implications

  • observed — The new tests assert content-addressed runtime identity, successful self-test, cached reuse across reconnection, unchanged runtime inode and timestamp, and garbage collection that preserves the active runtime. These are inspected assertions supporting lifecycle guarantees, not evidence that the matrix passed.

Hardening Proposals

  • proposed — For use on persistent developer machines, consider owner-labelled fixture resources and a bounded orphan-reaping mechanism so forced interruption does not depend exclusively on JavaScript cleanup. This is a hardening proposal, not an established introduced security finding.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 30 functions across 11 files. (1 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the CI SSH hostile-host matrix and its purpose for testing the relay runtime ladder.
Description check ✅ Passed The description is mostly complete and explains the purpose, implementation, rationale, testing status, limitations, and non-UI visual proof. It omits the Review, Notes, and Checklist sections, but th…
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: Docstring Coverage

Explanation

Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 30 functions across 11 files. (1 skipped: 1 unsupported.)

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

Autopilot is currently an internal CodeRabbit preview.


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.

@OrcaWin
OrcaWin merged commit 6aed054 into main Oct 1, 2026
47 checks passed
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