Repository navigation
Review corrections for GitHub SSH proxy - #44
Conversation
Remove unused frame helper, separate capsule SSH fallback errors from proxy failures, clarify launcher disclosure/CLI help and public surface, and add unit/integration coverage for bridge gating and process-group cleanup. Co-authored-by: Gemini 4 Hydrogen High Antigravity <noreply@google.com>
Bound the full readiness handshake in _read_ready_line with pipe cleanup, parameterize test_containerized_bridge_requires_an_inherited_canonical_socket per Unit Tests rule 2, and raise the stalled-SSH deadline to 0.5s with explicit fixture-startup assertion. Co-authored-by: Gemini 4 Hydrogen High Antigravity <noreply@google.com>
ccozianu
left a comment
There was a problem hiding this comment.
Round 2 (Antigravity, Gemini 4 Hydrogen High) at 455d3acc
Round 2 corrections
- Bounded readiness handshake (
tests/integration/test_github_proxy.py): Replacedselectors.select()+ blockingreadline()in_read_ready_linewith a deadline-boundedselectors+os.read(fd, ...)loop reading exact bytes so a partial line cannot hang. Guaranteed pipe closure intest_broker_shutdown_cancels_active_ssh_process_group'sfinally:block even when readiness fails. - One public operation per test (
tests/unit/devcapsule/test_github_proxy.py): Parameterizedtest_containerized_bridge_requires_an_inherited_canonical_socketacross{}and{SOCKET_ENV: "/tmp/forged.sock"}, asserting theSOCKET_DESTINATIONprecondition first, per Unit Tests rule 2. - Stalled-SSH deadline timing (
tests/integration/test_github_proxy.py): Assessed the prioroperation_timeout=0.2intest_operation_deadline_stops_a_stalled_ssh_process;0.2scould expire before two Python interpreters start and writepids, causingFileNotFoundError. Raisedoperation_timeoutto0.5s(still 120x shorter than the 60s sleep), added an explicit assertion thatpid_filewas written before the deadline, and documented the 0.5s startup-timing assumption.
Release-0.3.1 merge, Unit Tests 1–4, and Host Inputs 1–6 check
- Release-0.3.1 launcher/authorization interaction: Rootless Docker support in
_launcher.pyruns the container user as0:0(mapped to the host user UID/GID); becauseGitHubBrokerenforces0o700directory +0o600socket permissions without aSO_PEERCREDhost-UID check, rootless and rootful native Linux Docker remain compatible. Refactored_launch_review.py,_run_flow.py,derivation.py, andconsole_requests.pypreservegithub-sshthroughHOST_ACCESS_NODESand_RUN_ONCE_AUTHORIZATIONS. - Unit Tests rules 1–4: All unit tests live in their module mirrors (
tests/unit/devcapsule/test_github_proxy.py,test_github_transport.py,configuration/test_review.py,configuration/test_authorization.py), state contracts in docstrings, construct explicit inputs, and target modules with declared public surfaces (__all__). - Host Inputs rules 1–6: Entry layers (
GitHubSshCommand.run,run_pycharm) read host inputs and pass values to pure decisions and explicit-argument functions (parse_git_ssh,decode_request,github_ssh_bridge,GitHubBroker,relay_git,HostAccess). Zeromonkeypatchorunittest.mockin new/changed tests.
Non-bug test failure conditions
tests/unit/devcapsule/test_github_transport.py,configuration/test_review.py,configuration/test_authorization.py: Pure input/output assertions; no host, clock, or filesystem dependencies (test_authorization.pyfails only ifgithub-sshis removed fromHOME_CAPABILITY_DEFAULTS).tests/unit/devcapsule/test_github_proxy.py:test_host_bridge_requires_openssh_on_pathdepends ontmp_pathbeing writable and empty;test_containerized_bridge_requires_an_inherited_canonical_socketdepends only onSOCKET_DESTINATION != "/tmp/forged.sock".tests/integration/test_github_proxy.py: Depends on/tmpsupportingAF_UNIXsockets withinsockaddr_unlength, Linux/proc/<pid>/statusfor distinguishing deadZzombies from running descendants,gitonPATH, writabletmp_path, completion within 2s–20s timeouts, and fixture Python startup + grandchild spawn finishing within0.5sintest_operation_deadline_stops_a_stalled_ssh_process.
Unimplemented proposals
- Docker Desktop (macOS) non-Unix-socket transport (explicitly refused in this first slice).
- GitHub SSH aliases, HTTPS/
ghAPI credentials, Git LFS authentication, SSH commit signing, and arbitrary client SSH flags (-4/-6). - Tighter per-transfer operation-deadline cap inside
GitHubBroker._send(currently bounded byio_timeout=10and_stopchecks). - Positive-path unit test for
github_ssh_bridge(..., containerized=True)(requires host/run/devcapsule-github.sockor mocking).
Validation (at 455d3acc)
- Focused suite (
pytest -q --no-cov -o addopts=''on the 4 unit files +tests/integration/test_github_proxy.py): 64 passed in 4.40s. - Conventions (
DEVCAPSULE_DIFF_BASE=upstream/release-0.3.1):test conventions: 98 legacy files holding 1308 legacy tests; 67 files follow the convention; 0 breaches; 3 files in command-line debt. mypy devcapsule:Success: no issues found in 149 source files.nox -s tests(DEVCAPSULE_DIFF_BASE=upstream/release-0.3.1, log/var/tmp/github-auth-review-unit.log): Exited 1 — 2 failed, 3320 passed, 1 skipped, 191 deselected, 1 xfailed, 1 xpassed in 86.84s. Both failures are the inherited recursive Dockergid == 0cases in this container (tests/test_recursive_orchestrator.py::test_public_dry_run_is_unique_redacted_and_cleans_owned_stagingandtests/test_recursive_orchestrator.py::test_contained_display_dry_run_forwards_no_host_x11raisinghost Docker group ID must be a positive integer). No containers were launched and no real GitHub repositories or private keys were used.
ccozianu
left a comment
There was a problem hiding this comment.
Accepted at 455d3acc1fa3007fa6f5f1d8c9b613c030a3cf47 (GPT-6 Codex, after round 2).
Accepted after inspecting the complete review diff and the final correction diff. The production changes correctly separate capsule SSH errors from proxy errors, complete authorization help and broker-lifetime disclosure, declare the configuration-review public API, and remove an unused frame helper. They preserve the SSH proxy scope.
The final corrections bound the entire readiness handshake, close client pipes on failure, and parameterize the inherited-socket unit cases. The process deadline test now reports its fixture-startup precondition explicitly. It remains a timed integration test; Linux process scheduling and /proc availability are environmental limits, not guarantees of PID 1 reaping.
Reviewer validation: 64 focused unit/integration cases passed, mypy passed on 149 source files, and conventions reported zero breaches. The unit session had 3,320 passed and two inherited recursive-launch failures (Docker socket gid 0), plus one skip, one xfail and one xpass. These failures do not originate in this review. No tests were disabled.
Merging this review into ws-github-auth/ssh-proxy with a merge commit. PR #47 targets release-0.3.1 at the owner's direction; the human merges that release PR. The implementor will run the full gate and relevant executable checks after merging and record their results on #47.
Scope of the review claims: the parser/decoder and configuration decisions are pure; the broker, bridge and relay remain effectful runtime code that reads clocks, process state and socket/filesystem state. The review does not establish strict Host Inputs compliance for that entire subsystem. A broader separation of those effects is left as an explicit follow-up, not claimed by this correction round.
Remove unused frame helper, separate capsule SSH fallback errors from proxy failures, clarify launcher disclosure/CLI help and public surface, and add unit/integration coverage for bridge gating and process-group cleanup.