fix: add python3 to spacebot runtime (closes #485) - #31
Conversation
The runtime stage builds on debian:bookworm-slim, which ships no Python interpreter at all. shipyard#99/spacedriveapp#482 added a `python` PATH shim on the premise that the base image already had `python3` and merely lacked the `python` alias — but there was nothing for the shim to delegate into, so it correctly reported `no python3 interpreter on PATH` and exited 127. A missing interpreter surfaces as exit 127, which reads as "the command failed" rather than "the command does not exist". That is the expensive part of the bug: agents invoking `python -m pytest ...` misread it as a red test suite and abandon correct work (shipyard#99). Verified on the built runtime stage: python3 --version -> Python 3.11.2 (was: not found) pip3 --version -> pip 23.0.1 python --version (via shim) -> Python 3.11.2, exit 0 (was: exit 127, "no python3 on PATH") Refs shipyard#485, shipyard#482, shipyard#99
1. SummaryAdds 2. FindingsP2 — Debian 12 (bookworm) ships P3 — Comment justifies The comment block is well written for P3 — Image size impact not acknowledged
Nothing in this diff introduces a crash, data-loss, or API-breaking change. Package pinning is absent, but that matches the existing style of the unchanged lines in this block, so I'm not flagging it. 3. SecurityNo injection, auth, or secret-handling surface is touched. Two mild notes, neither blocking:
4. VerdictCOMMENT — the change is small, well motivated, and correctly placed. The one substantive item is the PEP 668 behavior of ✅ Verification gate (closed-loop Regelkreis · spacedriveapp#58 Phase 1)An adversarial audit could not ground any blocking finding in the actual diff, so the blocking verdict was downgraded to APPROVE to avoid a false fix cycle (cf. PR spacedriveapp#57/spacedriveapp#48). AuditPer-finding auditP2 — " The quoted line does exist in the diff ( The finding is also explicitly conditional and intent-speculative in its own text: "If the motivation is…", "Confirm that's intended (or handled elsewhere in the image)". "Handled elsewhere / unclear intent" claims only count when the literal evidence is in the diff, and it is not. Additionally, pip on bookworm remains fully usable via P3 — "Comment justifies P3 — "Image size impact not acknowledged" ConclusionZero P1 findings were raised. The single P2 finding cannot be grounded in any diff line — it depends on a VERIFIED_VERDICT: APPROVE AI Review · Verdict: APPROVE · Diff-Score: 0.84 |
Fixes marcmantei/shipyard#485 by adding
python3andpython3-pipto theapt-get installlist in the spacebot Dockerfile runtime stage, enablingpython execution inside the container as intended by the shipyard#482 shim.
The bug
shipyard#482 added a
pythonPATH shim on the premise that the Debian basealready shipped
python3and merely lacked thepythonalias. That premisewas wrong for this image. The runtime stage is
debian:bookworm-slim, whosepackage list contains no interpreter at all — so the shim had nothing to
delegate into and correctly reported:
The shim was still worth having — it turned a bare
not foundinto a nameddiagnostic. But it could not make Python work, because there was no Python.
Why this is expensive rather than cosmetic: a missing interpreter exits 127,
which reads as "the command failed", not "the command does not exist". Agents
running
python -m pytest ...misread that as a red test suite and abandoncorrect implementations (shipyard#99).
The fix
python3+python3-pipin the runtime stage's package list, with a commentrecording why they are load-bearing so a future slimming pass does not drop them
again.
Verification
Built the runtime stage from this branch and exercised it with the shipyard#482
shim in place at
/usr/local/bin/python:python3 --versionPython 3.11.2pip3 --versionpip 23.0.1python --version(via shim)no python3 interpreter on PATHPython 3.11.2, exit 0python -m pip --versionpip 23.0.1, exit 0findprobe/usr/bin/python3.11command -vresolution confirms no shadowing regression:python→/usr/local/bin/python(shim),python3→/usr/bin/python3.Scope
This is the spacebot source repo's
Dockerfile. shipyard PR spacedriveapp#488 applies thesame fix to
stack/spacebot/Dockerfile.headless, the deployment recipe the livespacebotservice actually builds. Both need it: spacedriveapp#488 fixes the runningcontainer, this fixes the upstream image so the gap does not reappear on a
rebuild from source.