Repository navigation
feat(link): let a Remote Link carry an explicit, exclusive SSH route - #8615
Merged
Merged
Conversation
A Home-initiated link may now record explicitRoute {proxyCommand, user, port}
and exclusive. Every SSH builder takes a required route, so each caller decides;
the route reaches ssh on the command line for enrollment, revoke, purge, every
exec and every tunnel start, where ssh_config cannot change it. An exclusive
link refuses route edits. No link has either field until a caller passes the
new flags.
The inspection dependency now takes the link's explicit route after the alias; the mock records it so a routed inspection would show up.
The privacy scan reads tracked files and flags user@domain text; the fixtures keep their @ words without a domain.
Contributor
|
Caution Review failedThe pull request is closed.
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. |
Contributor
|
✅ Deterministic PR hygiene checks passed. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
lidge-jun
added a commit
that referenced
this pull request
Nov 13, 2026
The tombstone of a force-revoked ephemeral link keeps the link's explicit route and exclusive flag (an explicit route requires exclusive, as on the record), and recover passes that route's ProxyCommand, user and port on the ssh command line; a link without one still uses its alias. The operation-recovery slot's target carries the explicit route for O1.
This was referenced Nov 13, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A hub that provisions a disposable machine validates one SSH path to it (a relay ProxyCommand, a user and a port) and needs the Remote Link to keep using exactly that path. Today the Home takes ProxyCommand, User and Port for a link's alias from
~/.ssh/config, so an edit there after enrollment silently moves every later command and tunnel to another path, andocx link routes addcan add a second route to the same machine.This change lets a Home-initiated link record
explicitRoute{proxyCommand, user, port}andexclusive: true:src/link/ssh-argv.tsnow takes a requiredroute(ExplicitRoute | null), so the type checker makes every call site decide. A link with an explicit route passes-o ProxyCommand=… -o ProxyUseFdpass=no -o User=… -o Port=…on the command line, which OpenSSH reads before any ssh_config value, for enrollment (probe, confirm-host, apply with plant, connect, restart and the residual purge), revoke (disconnect and purge), platform discovery, observe, sync and update,ocx syncfan-out,ocx link cleanupand every tunnel start. A builder refuses an explicit route with any destination other than the alias.exclusivemeans the link has exactly one route, its alias. The store refuses a route list beside it and an explicit route without it.POST /api/link/{id}/routeson an exclusive link answers409 link_exclusivebefore any probe, and again under the commit's mutation lock if the link turned exclusive while the new route was being probed.ocx link routesgoes through that route.explicitRouteandexclusive. The probe binds them to the pending host; confirm-host and apply must name the same values (absent means none) or answer409 route_mismatch, so a probe another caller made with another route cannot be confirmed or applied by mistake.ocx link probeandocx link addgain--proxy-command,--ssh-user,--ssh-port(all three together) and--exclusive.GET /api/link/statusrows of exclusive links carryexclusiveandexplicitRoute;ocx link statusandocx link routesaccept them. That document stays limited to the admin token and dashboard sessions (it is not in the Child-readable relay list).Accepted form (refused, never repaired, at the store, the builder, the management body and the CLI)
ssh runs ProxyCommand as
exec <command>through the user's shell, so only this form passes:proxyCommand: 1 to 1024 ASCII characters; 1 to 32 words separated by exactly one space. The first word is an absolute POSIX path (/then letters, digits,.,_,+,-,/), so neither PATH nor anexecflag decides what runs. Every later word uses only letters, digits and. _ / : @ + , = -and does not start with=(zsh expands a leading=). Refused: quotes, backslash,$, backquote,; & | < > ( ) { } [ ] * ? ! # ~,%(ssh expands%h,%p,%r,%nfrom values ssh_config controls), tab, newline, NUL and non-ASCII.user: a letter or_, then up to 31 letters, digits,.,_or-.port: an integer from 1 to 65535.The path form is POSIX only, so a Windows Home cannot use an explicit route yet.
What this does not change: ssh_config stays trusted operator configuration for every other option (identity files, for example), and OpenSSH still evaluates it, so a
Match execblock there still runs as it does today. The explicit route fixes where ssh connects and as whom; it does not make ssh_config inert.What stays unchanged by default
No link has
explicitRouteorexclusiveuntil a caller passes the new flags or body keys, and nothing in this repository does. Withroute: nullevery builder emits exactly the argv it emitted before (asserted against a literal argv). Status rows, route documents and request bodies are unchanged for every link without the fields; the dashboard parser ignores the new keys. Child-initiated links (src/client/) and messaging (src/messaging/) always pass null. Known trade-off, the same asroutes,childKindandremotePlatform: a Home downgraded below this release rejects alinks.jsonholding the new fields.Verification
Tests that failed first, and why (each run against unmodified origin/dev sources):
tests/clients/link-explicit-route.test.ts"an ssh_config edit after enrollment … does not change the route of any command an exclusive link runs": a hostile ssh_config for the alias (ProxyCommand with %h/%p, ProxyJump, User, Port, HostName, ProxyUseFdpass, a Match block) andssh -Gon the argv the supervisor builds for the tunnel and on the exec, probe and Windows-probe argv. Before:proxycommand /usr/bin/evil-relay %h %p,user intruder,port 2222,proxyusefdpass yes, because nothing passed the route. After: the route's values; ProxyJump absent.tests/server/link-route-edit-exclusive.test.ts"adding a direct route to an exclusive link … is refused before any probe": before, the add answered 200 and stored the route; now 409link_exclusive, no SSH, store unchanged. Same file: remove and order refused; a link that turns exclusive during the new route's probe is refused at commit.tests/server/link-enrollment-explicit-route.test.ts: every SSH argv of probe, confirm and apply carries the route and the record keeps it; revoke's disconnect carries it; confirm or apply with another route, or none, answers 409route_mismatch; refused forms answer 400 before any SSH. (8 of 9 failed before; the ninth,exclusive: false→ 400, already passed because origin/dev refuses unknown body keys.)tests/clients/link-explicit-route-paths.test.ts: platform discovery (both variants), runtime inspection, purge, observe and the pinned sync carry the record's route.tests/cli/cli-link-explicit-route.test.ts: the CLI sends the route with all three requests; bad combinations and forms are usage errors before any request; without the flags the bodies are unchanged.tests/clients/link-explicit-route.test.tsalso covers the accepted and refused forms (each refusal reason), the store rules, every builder with and without a route, and the status projection plusocx link statusvalidation.Commands (Bun 1.4.4, TMPDIR=/tmp):
bun run typecheck→ exit 0bun run privacy:scan→ exit 0bun run structure:check→ exit 0bun run skill:surface:check→ exit 0bun scripts/test.ts --parallel=2over tests/clients/link-, tests/clients/client-link-, tests/server/link-, tests/cli/cli-link, tests/cli/sync-, tests/cli/link-, tests/codex-integration/messaging-remote*, the layout, structure, file-size ratchet, skill-ocx and CLI capability tests, and tests/clients/link-boundary.test.ts → exit 1: 2279 pass, 27 skip, 3 fail across 143 files (run on a12b7a9). The 3 failures are the Rust-toolchain cases listed under NOT RUN and fail identically on origin/dev. The last commit (0c47081) changes only two fixture strings in tests/clients/link-explicit-route.test.ts; that file rerun alone: 73 pass, 0 fail. typecheck, privacy:scan and structure:check rerun on 0c47081: exit 0 each.NOT RUN: the full
bun run testsuite (this machine is limited to focused files);tests/clients/link-ocx-child-e2e.test.ts(2 cases) and the Rust conformance runner intests/clients/link-ocx-child-conformance.test.ts, which need a Rust toolchain this machine does not have (rustup has no default toolchain; they fail identically on origin/dev); the opt-in real OpenSSH fixture (OCX_OPENSSH_ROUTE_FIXTURE=1); Windows and macOS. A Windows Home cannot use an explicit route (POSIX path form).Review: an independent read-only review of e85a975..a12b7a9 (injection, call-site completeness, ssh_config precedence, exclusivity, inertness, enrollment binding) reported no P0-P2 findings. Its only note was the
Match execlimitation stated above. It could not run tests in its own checkout (no installed dependencies), so the test evidence is the runs listed here. It did not see 0c47081 (fixture strings only).Docs:
structure/remote-link.mdgains "Explicit route"; the English Remote Link guide documents the flags; the generated skill surface is regenerated from the capability registry.Checklist
devsrc/has focused regression tests in the matching domain folders, registered in the test layout mapsImplemented by Claude Opus 5.5 (anthropic/claude-opus-5-5) in GOAT through the Codex harness; in-lane review by GPT-6.1 Terra (xhigh). Received as a git bundle from the VM that built it and pushed by the coordinator.