Summary
The AGENTTOWER_TEST_FORCE_HOST_PEER=1 test seam makes the FEAT-011 host-vs-container peer check (_peer_is_host_process in socket_api/methods.py) return True for any caller — a process-wide bypass of the FR-042 host-only gate. It exists because WSL2 / Docker-in-Docker / sandboxed CI runners false-positive the /proc container probe, so the FEAT-011 integration suite cannot run without it.
A prior remediation (PR #19, commit 0aaeb1e) made the bypass auditable: the daemon emits a host_peer_check_bypassed warn-level lifecycle event at startup when the seam is set. That is a mitigation, not a fix — the daemon still boots and serves with the gate disabled.
Desired hardening
The daemon should refuse to boot when AGENTTOWER_TEST_FORCE_HOST_PEER is set in a production-shaped environment — mirroring the existing _guard_production_test_seam_unset() pattern in cli.py (which refuses a lone AGENTTOWER_TEST_PROC_ROOT).
The constraint that deferred it
tests/integration/_daemon_helpers.py currently sets AGENTTOWER_TEST_FORCE_HOST_PEER=1 as the only AGENTTOWER_TEST_* var in the test daemon's environment. A naive "refuse if set without a companion AGENTTOWER_TEST_* var" guard would therefore break the entire FEAT-011 integration suite. The fix needs a coordinated change:
- Add a daemon-side guard (
daemon.py startup) that refuses to boot when AGENTTOWER_TEST_FORCE_HOST_PEER is set without a recognized companion test seam.
- Update
tests/integration/_daemon_helpers.py to set a companion AGENTTOWER_TEST_* marker alongside it, so the integration suite still boots.
Acceptance criteria
Found by the FEAT-011 orchestrated code review. Tracked deferred from PR #19.
🤖 Generated with Claude Code
Summary
The
AGENTTOWER_TEST_FORCE_HOST_PEER=1test seam makes the FEAT-011 host-vs-container peer check (_peer_is_host_processinsocket_api/methods.py) returnTruefor any caller — a process-wide bypass of the FR-042 host-only gate. It exists because WSL2 / Docker-in-Docker / sandboxed CI runners false-positive the/proccontainer probe, so the FEAT-011 integration suite cannot run without it.A prior remediation (PR #19, commit
0aaeb1e) made the bypass auditable: the daemon emits ahost_peer_check_bypassedwarn-level lifecycle event at startup when the seam is set. That is a mitigation, not a fix — the daemon still boots and serves with the gate disabled.Desired hardening
The daemon should refuse to boot when
AGENTTOWER_TEST_FORCE_HOST_PEERis set in a production-shaped environment — mirroring the existing_guard_production_test_seam_unset()pattern incli.py(which refuses a loneAGENTTOWER_TEST_PROC_ROOT).The constraint that deferred it
tests/integration/_daemon_helpers.pycurrently setsAGENTTOWER_TEST_FORCE_HOST_PEER=1as the onlyAGENTTOWER_TEST_*var in the test daemon's environment. A naive "refuse if set without a companionAGENTTOWER_TEST_*var" guard would therefore break the entire FEAT-011 integration suite. The fix needs a coordinated change:daemon.pystartup) that refuses to boot whenAGENTTOWER_TEST_FORCE_HOST_PEERis set without a recognized companion test seam.tests/integration/_daemon_helpers.pyto set a companionAGENTTOWER_TEST_*marker alongside it, so the integration suite still boots.Acceptance criteria
agenttowerdinvocation withAGENTTOWER_TEST_FORCE_HOST_PEER=1set (and no companion test seam) exits non-zero with a clear error, rather than booting with the gate bypassed.tests/integration/test_story*.py) still passes — the test daemon boots because_daemon_helpers.pysets the companion marker.host_peer_check_bypassedwarn-event remains for the legitimate test-harness path.Found by the FEAT-011 orchestrated code review. Tracked deferred from PR #19.
🤖 Generated with Claude Code