test(sidecars): integration sweep for the bundle path (PRD 0024 chunk 4) #58
Reference in New Issue
Block a user
Delete Branch "prd-0024-chunk-4-integration-tests"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
PRD 0024 chunk 4: integration test sweep for the bundle path. Three deliverables.
1.
test_pipelock_apply.pyun-skippedReplaced the
.start-based bringup (deleted in chunk 3) with a directdocker runsequence that mirrors what the production renderer does —docker createon the internal network → bind-mount yaml + CAs → connect egress network →docker start. Critically: stages the yaml + CAs to the realpipelock_state_dir(slug)rather than a private tempdir, so the bind-mount source and theapply_allowlist_changewrite target are the same file (otherwise the hot-reload writes to a nowhere-mounted host path and the container never sees the update).All 4 cases passing locally.
2. New bundle-path smoke
tests/integration/test_sidecar_bundle_compose.pybrings up a real bottle withCLAUDE_BOTTLE_SIDECAR_BUNDLE=1and verifies the agent reaches pipelock + supervise via the bundle's legacy network aliases — proving no agent-side config changes are needed between flag positions. Skipped under act_runner like other multi-stage-build tests.3. Two bundle bugs found + fixed running PRD 0022 with the flag on
egress_entrypoint.shnow passes--set confdir=/home/mitmproxy/.mitmproxyto mitmdump. The legacyDockerfile.egressruns as usermitmproxy(so~/.mitmproxy/resolves correctly); the bundle runs as root, where~/.mitmproxy/is/root/.mitmproxy/— the bind-mounted CA at/home/mitmproxy/.mitmproxy/mitmproxy-ca.pemwould be invisible to mitmdump, which would then mint a fresh CA the agent's installed trust anchor doesn't recognize. Symptom:curl: (60) SSL certificate problem: unable to get local issuer certificate.sidecar_init.pynow passes--listen 0.0.0.0:8888to pipelock. Without it pipelock defaults to 127.0.0.1, so the in-bundle egress's upstream connect toclaude-bottle-pipelock-<slug>(which DNS-resolves to the bundle on the docker network, not localhost) gets refused. The legacy renderer passed this flag verbatim; the bundle's argv had dropped it. Symptom: HTTP 502 withConnect call failed ('172.x.x.x', 8888).PRD 0022's 5-attack sandbox-escape suite now passes with the flag on AND off.
Test status
test_sandbox_escapefull suite).Remaining for chunk 5
Flip the default, delete the flag, delete
Dockerfile.{egress,git-gate,supervise}, update README + CLAUDE.md.Three deliverables: 1. Rewrite test_pipelock_apply bringup with a direct `docker run`. Replaces the .start-based bringup deleted in chunk 3. Stages the yaml + CAs to the real pipelock_state_dir so the bind- mount target matches what apply_allowlist_change writes to — the legacy .start path did this implicitly because it lived inside the production flow; the new bringup needs to be explicit about the path. All 4 cases pass. 2. New tests/integration/test_sidecar_bundle_compose.py: end- to-end smoke with CLAUDE_BOTTLE_SIDECAR_BUNDLE=1. Brings up a real bottle via the compose path and verifies the agent can reach pipelock + supervise through the bundle's legacy aliases (no agent-side config changes between flag positions). Skipped under act_runner — multi-stage build + bind mounts. 3. Two bundle-path bugs surfaced and fixed while running PRD 0022 with the flag on: - egress_entrypoint.sh: add `--set confdir=/home/mitmproxy/ .mitmproxy` so mitmdump finds the bind-mounted CA. The legacy Dockerfile.egress runs as user mitmproxy (~mitmproxy resolves correctly); the bundle runs as root and otherwise would look in /root/.mitmproxy/ and mint a NEW CA the agent doesn't trust. Symptom: PRD 0022 attack-3 curl failed with "unable to get local issuer certificate". - sidecar_init.py: add `--listen 0.0.0.0:8888` to pipelock's argv. Without it pipelock defaults to 127.0.0.1, so the in-bundle egress's upstream connect to the `claude-bottle-pipelock-<slug>` alias arrives over the docker network and gets refused. The legacy renderer passed this flag verbatim; the bundle dropped it. Symptom: egress returned HTTP 502 with "Connect call failed ('172.x.x.x', 8888)". PRD 0022's 5-attack sandbox-escape suite now passes with the bundle flag on AND off. Test status: - Unit: 533 passing. - Integration: 9 passing locally with flag off, 5 passing with flag on. Bundle compose smoke + PRD 0022 sandbox-escape both green under CLAUDE_BOTTLE_SIDECAR_BUNDLE=1. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>