Repository navigation
test: measure first-party egress paths and route Git over SSH through the turn proxy - #2644
Merged
schlessera merged 6 commits intoOct 22, 2026
Conversation
SSH has no proxy variable, so an egress worker's Git SSH transport had no way out of its private network namespace. The trusted worker bootstrap now sets a first-party CONNECT helper as Git's ProxyCommand, unless the caller already chose GIT_SSH_COMMAND. The proxy sees only host, port and opaque bytes, as for any other CONNECT. Refs #1665 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Run Git over HTTPS and SSH, curl, the brain CLI's embedding provider and headless Chromium in real governed workers through the turn proxy, inside a private network namespace whose fixture /etc/hosts and /run hold the only reachable origin and host sockets. Walk every mask root completely and the rest of the visible filesystem under a deadline. All five paths pass. The walk finds no socket below a mask and cannot reach the fixture /run and home sockets, but host sockets outside today's masks stay visible (a CUPS socket under /var/snap accepted a connection), so the gate does not pass and ordinary turns keep their current network. The measurement table and the gap are recorded in agent-workers.md and the decision record. Refs #1665 Co-Authored-By: Claude Opus 5.5 <[email protected]>
schlessera
added this pull request to stack #2646
October 22, 2026 12:19
5 of 8 tasks
This was referenced Oct 22, 2026
Closed
schlessera
marked this pull request as ready for review
October 22, 2026 13:12
schlessera
marked this pull request as draft
October 22, 2026 13:12
…ess-measurement-044 # Conflicts: # docs/hosting/agent-workers.md
This was referenced Oct 22, 2026
schlessera
added a commit
that referenced
this pull request
Oct 22, 2026
) For an upper layer of a native stack, `edited` events report the stack's base (`main`) as `github.base_ref`, so the contract gate diffed the layer against `main` and blamed it for its parent's contract-doc edit (#2644). The gate now reads the PR's declared base from `pulls/N` with the read-only token on every trigger and diffs against that remote-tracking ref. A missing PR number, a refused or failed lookup, a foreign or invalid base, or an unfetched base fails the gate (exit 2) instead of falling back to `main`. The event's value is logged only to show a disagreement. The workflow lint refuses a contract step that takes its base from event context, and a workflow-level harness executes the installed step against a loopback PR lookup for every trigger, stacked, ordinary and failure cases. Closes #2650 Refs #2141 Co-authored-by: Claude Opus 5.5 <[email protected]>
schlessera
marked this pull request as ready for review
October 22, 2026 17:21
schlessera
marked this pull request as draft
October 22, 2026 17:22
…ess-measurement-044
With all of /var masked (#2657), the walk of the visible filesystem finds no host socket outside the masks in either profile. Assert that no socket there accepts a connection, and record the passing walk in the measurement table and decision record. Refs #1665 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ess-measurement-044
schlessera
marked this pull request as ready for review
October 22, 2026 21:22
This was referenced Oct 22, 2026
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.
Refs #1665
Second layer of the #1665 stack. Parent: #2399 (
feat/1665-durable-egress-records-r2). Child: #2645.What changed
Git's SSH transport now works from an egress worker. The trusted worker bootstrap sets a first-party CONNECT helper (
egress-connect.ts) as Git'sProxyCommand, unless the caller already choseGIT_SSH_COMMAND. The proxy sees only host, port and opaque bytes.The new
tests/egress-first-party-paths.test.tsis the gate's measurement. It runs Git over HTTPS and SSH,curl, thebrainCLI's Gemini embedding provider and headless Chromium in real governed workers through the turn proxy. The fixture runs in its own network namespace with a fixture/etc/hostsand/run, so every upstream is a loopback fixture; a loopbacksshdserves the SSH clone. The socket walk covers each mask root completely and the rest of the visible filesystem under a deadline. It fails if any socket outside the masks accepts a connection.The measurement table is in
docs/hosting/agent-workers.md, and the decision record notes the result.Why this shape
#1665 makes the measurement the gate, and the decision record calls for a
ProxyCommandCONNECT helper for SSH. A helper that dials the bind-mounted proxy socket directly needs no extra tool in the worker. The whole fixture runs in a private namespace, so the proxy's real DNS resolution can reach a named fixture host without touching a public name.Proof
Head
547795928, parent8406e0062(#2399 refreshed ontoorigin/main4ba50d824). Round 3 merged the refreshed parent in cleanly (4958d6aa3), reran the socket walk with #2657's all-/varmask (66e3072be), and merged the parent again after #2671 landed (547795928, clean).Socket walk, round 3. With all of
/varmasked, the walk passes in both profiles. It covers the visible filesystem completely (complete: true) and finds no socket outside the masks (reachable: {}). The test now assertsEGRESS_SOCKET_WALK_NO_REACHABLE_HOST_SOCKET, and the measurement table and decision record say the walk passes.HOST_MASKSreverted to the pre-fix(ui-sdk): mask all host /var in worker profiles #2657/var/run+/var/lib. Both profiles failEGRESS_SOCKET_WALK_NO_REACHABLE_HOST_SOCKETwith/var/snap/cups/common/run/cups.sockreachable (5 pass / 2 fail). Restored byte-for-byte; 7/7 green.Result on
547795928: passed (exit 0). Lint, metadata and the fast phase pass (770 tests), and import-graph feedback passes 7/7 (tests/egress-first-party-paths.test.ts).The receipts below were taken on round 1's head
290f8fe3c. The later merges change none of the files they guard./runand home sockets are unreachable. Including the existing egress runtime, proxy, relay and citation suites, the focused set passes 73 tests.GIT_SSH_COMMANDset to plainssh: thegit over SSH through the CONNECT helperrow fails withssh: connect to host ithaca.odysseus.test port …: Connection refused(exit 128 ≠ 0)./homeremoved fromHOST_MASKS:EGRESS_HOST_HOME_SOCKET_UNREACHABLEfails in both profiles./runbreaks the egress bind at launch setup, so it is not used as a receipt.Checklist
docs/reflect the change, or nothing documented moved.docs/decisions/provider-history.md): the provider-history guard passes, or nothing on a turn's path changed.Anything left open
/var), and the walk now passes on the measured host.🤖 Generated with Claude Code