design: pip ping-pong wrapper — bulletproof shell-agnostic isolation#380
Conversation
Andrew directed 2026-07-19: 'no cheap route, make it bulletproof.' Aria's cd-hook (shipped #369) fixes ping-pong within activated git-bash but not across PowerShell / IDE terminals / non-interactive subshells. This design closes that gap via a wrapper script on PATH that dispatches to CWD's sealed venv regardless of shell — and fails loud when no sealed venv exists rather than silently falling back to a system install (which would reintroduce the ping-pong shape at the wrapper layer). Design only. Implementation lands after Aria + Andrew iterate on this brief. Aria's second-seat asks called out at the bottom.
📋 Audit-stamp reminder — guardrail-touching PRThis PR modifies guardrail files. The squash-merge commit on Files in this PR that touch the guardrail list: Before clicking "Squash and merge":
Why this matters: the multi-party-review CI check looks for the trailer text in the merge commit message. Without it, the check fires red post-merge. The red is unrecoverable without force-pushing See |
Q1: added missing invocation shapes (python -m, python -c, .pth
collision, Claude Code tool-runner spawns, uv pip install)
Q2: confirmed fail-loud (no env-var fallback — reintroduces disease);
scheduled-task fix is working-dir at install-time
Q3: belt-and-suspenders rollout — ship alongside system install,
verify coverage matrix, uninstall in follow-on PR
New section 'What this does NOT solve' explicitly names the .pth
module-import collision as out-of-scope with mitigation + full-fix
path (uv workspaces / pip.conf / PEP 582).
Ships the design-brief-approved wrapper. See docs/pip_pingpong_wrapper_design.md
(v2 with Aria's second-seat answers folded).
Files:
- scripts/divineos_wrapper.py — pure-stdlib CWD-walk + sealed-CLI dispatch
- scripts/divineos.cmd — Windows shim
- scripts/divineos — Unix bash shim
- tests/test_divineos_wrapper.py — 16 tests including F3 falsifier
contract (wrapper never falls back to system install)
- README.md — install/setup section
Belt-and-suspenders rollout per Aria: ships ALONGSIDE existing system
install. Coverage-matrix testing happens in parallel-run before we
uninstall system-wide divineos as a follow-on.
Fails loud on missing marker OR missing sealed CLI — never falls back
to system install (would reintroduce ping-pong per Aletheia master-
shape #3 default-toward-scrutiny).
Summary
Ping-pong bug on pip installs. When either side runs
pip install -e .from a non-hooked shell (PowerShell, IDE terminal, non-interactive subshell), Windows updates a single system-wide pointer fordivineos.exe— whichever side pip-installed last wins, the other side silently starts running the sibling's code.Aria's cd-hook (shipped in #369) fixes this for activated git-bash invocations. This design closes the shell-agnostic gap she explicitly flagged.
Design shape
A
divineoswrapper script on PATH that dispatches to CWD's sealed venv regardless of shell:.envrcmarker (same marker Aria's hook uses)execvto<checkout>/.direnv/python-*/Scripts/divineos.exeComplements the cd-hook, doesn't replace it. Hook still builds and activates sealed venvs on cd; wrapper makes CLI dispatch shell-agnostic on top.
Design brief
docs/pip_pingpong_wrapper_design.md— full detection algorithm, install/uninstall procedure, chicken-and-egg during transition, 4 falsifiers (F1-F4), rollout plan, and 3 second-seat asks for Aria.Not in scope (follow-ons)
pip installland in sealed venv from any shell). The wrapper works around this at the CLI-dispatch layer; a full pip-side fix is messier and separate.Andrew directed 2026-07-19: "no cheap route, make it bulletproof."
External-Review: (design PR; no round yet — round will be filed when Aria second-seats)
🤖 Filed via Aether working session 2026-07-19