gitreins-judge-repo-venv-shadows-pipx-cli-broken-entrypoint
Solution written to ~/gitreins-judge-repo-venv-shadows-pipx-cli.md.
Root cause: PATH shadowing, not a broken judge. The repo venv carries a stale pip-installed gitreins whose console-script entry point (<repo>/venv/bin/gitreins, line 3: from gitreins.cli import main) references a module the installed dist no longer ships. Prepending the venv to PATH for the judge's tier-1 guard makes bash resolve gitreins to that broken venv copy instead of the healthy pipx shim at <tool>.
Fix (invocation-level): keep the venv on PATH, invoke the pipx CLI by absolute path, and background it:
cd "$REPO" && PATH="$REPO/venv/bin:$PATH" <tool> task complete "$TASK_ID" \
>> "$REPO/judge.log" 2>&1 &
Verification performed — I built a faithful reproduction (/tmp/gitreins-repro) with a stale venv package lacking cli.py and a healthy pipx-like install:
PATH=<venv>/bin:$PATH gitreins … → exactly ModuleNotFoundError: No module named 'gitreins.cli' at line 3PATH=<venv>/bin:$PATH /abs/path/gitreins … → exit 0which -a, head -3, python -c "import gitreins.cli") confirms the venv dist is the broken treeThe document also covers the backgrounding requirement (foreground kills leave tasks.yaml complete with no verdict.json), never-do alternatives, and a general checklist for "venv on PATH + run tool" recipes.
# Evidence - Problem class: gitreins-judge-repo-venv-shadows-pipx-cli-broken-entrypoint - Model: openrouter/deepseek/deepseek-v4.1-flash - Solved: 2026-09-26T11:41:55.010Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "SYMPTOM: running the gitreins Tier-2 judge for a coding-hermes task via 'PATH=<repo-venv>/bin:$PATH gitreins task complete <id>' (the documented judge-env recipe, because the judge's internal tier-1 guard needs the repo venv's tools on PATH) crashed instantly with 'Traceback ... File <repo-venv>/bin/gitreins line 3, in <module> from gitreins.cli import main / ModuleNotFoundError: No module named gitreins.cli'. ROOT CAUSE: PATH lookup, not the judge. The repo venv carried its own stale/broken pip-installed gitreins distribution: its console-script entry point /bin/gitreins does 'from gitreins.cli import main', but the dist's installed modules no longer include gitreins.cli (upstream reorganized the package layout; the venv's copy predates the split). With the repo venv PREPENDED to PATH, bash resolved 'gitreins' to the venv's broken entry point instead of the healthy pipx-installed CLI at <tool> \u2014 the same binary that had worked seconds earlier without the PATH prefix. The working pipx install was never broken; it was shadowed. FIX: keep the repo venv on PATH for the judge's guard tooling but invoke the pipx CLI BY ABSOLUTE PATH so PATH order cannot pick the venv copy: 'cd <repo> && PATH=<repo-venv>/bin:$PATH <tool> task complete <id>' (run backgrounded \u2014 tier 2 takes minutes and foreground tool windows kill it mid-run, leaving tasks.yaml complete with NO verdict.json). VERIFICATION: with the absolute-path invocation the task flipped to complete and evaluation started producing output in the judge log (no import error). GENERAL RULE: when a documented recipe says 'put a project venv on PATH and run <tool>', check whether the venv itself carries a copy of <tool> before trusting PATH resolution; a broken dist inside the venv turns a PATH-order convention into a hard crash. Diagnose by reading the entry-point script named in the traceback (line 3 import) \u2014 it names the exact interpreter tree that owns the failure.", "environment": "Linux host, gitreins pipx CLI at <tool> (healthy), repo venv at <repo>/venv with a stale gitreins dist whose entry point imports a module the installed dist no longer ships", "language": "python", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "gitreins-judge-repo-venv-shadows-pipx-cli-broken-entrypoint", "provider": "openrouter", "solved_at": "2026-09-26T11:41:55.015Z", "version": ""}Solution written to ~/gitreins-judge-repo-venv-shadows-pipx-cli.md.
Root cause: PATH shadowing, not a broken judge. The repo venv carries a stale pip-installed gitreins whose console-script entry point (<repo>/venv/bin/gitreins, line 3: from gitreins.cli import main) references a module the installed dist no longer ships. Prepending the venv to PATH for the judge's tier-1 guard makes bash resolve gitreins to that broken venv copy instead of the healthy pipx shim at <tool>.
Fix (invocation-level): keep the venv on PATH, invoke the pipx CLI by absolute path, and background it:
cd "$REPO" && PATH="$REPO/venv/bin:$PATH" <tool> task complete "$TASK_ID" \
>> "$REPO/judge.log" 2>&1 &
Verification performed — I built a faithful reproduction (/tmp/gitreins-repro) with a stale venv package lacking cli.py and a healthy pipx-like install:
PATH=<venv>/bin:$PATH gitreins … → exactly ModuleNotFoundError: No module named 'gitreins.cli' at line 3PATH=<venv>/bin:$PATH /abs/path/gitreins … → exit 0which -a, head -3, python -c "import gitreins.cli") confirms the venv dist is the broken treeThe document also covers the backgrounding requirement (foreground kills leave tasks.yaml complete with no verdict.json), never-do alternatives, and a general checklist for "venv on PATH + run tool" recipes.
# Evidence - Problem class: gitreins-judge-repo-venv-shadows-pipx-cli-broken-entrypoint - Model: openrouter/deepseek/deepseek-v4.1-flash - Solved: 2026-09-26T11:41:55.010Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "SYMPTOM: running the gitreins Tier-2 judge for a coding-hermes task via 'PATH=<repo-venv>/bin:$PATH gitreins task complete <id>' (the documented judge-env recipe, because the judge's internal tier-1 guard needs the repo venv's tools on PATH) crashed instantly with 'Traceback ... File <repo-venv>/bin/gitreins line 3, in <module> from gitreins.cli import main / ModuleNotFoundError: No module named gitreins.cli'. ROOT CAUSE: PATH lookup, not the judge. The repo venv carried its own stale/broken pip-installed gitreins distribution: its console-script entry point /bin/gitreins does 'from gitreins.cli import main', but the dist's installed modules no longer include gitreins.cli (upstream reorganized the package layout; the venv's copy predates the split). With the repo venv PREPENDED to PATH, bash resolved 'gitreins' to the venv's broken entry point instead of the healthy pipx-installed CLI at <tool> \u2014 the same binary that had worked seconds earlier without the PATH prefix. The working pipx install was never broken; it was shadowed. FIX: keep the repo venv on PATH for the judge's guard tooling but invoke the pipx CLI BY ABSOLUTE PATH so PATH order cannot pick the venv copy: 'cd <repo> && PATH=<repo-venv>/bin:$PATH <tool> task complete <id>' (run backgrounded \u2014 tier 2 takes minutes and foreground tool windows kill it mid-run, leaving tasks.yaml complete with NO verdict.json). VERIFICATION: with the absolute-path invocation the task flipped to complete and evaluation started producing output in the judge log (no import error). GENERAL RULE: when a documented recipe says 'put a project venv on PATH and run <tool>', check whether the venv itself carries a copy of <tool> before trusting PATH resolution; a broken dist inside the venv turns a PATH-order convention into a hard crash. Diagnose by reading the entry-point script named in the traceback (line 3 import) \u2014 it names the exact interpreter tree that owns the failure.", "environment": "Linux host, gitreins pipx CLI at <tool> (healthy), repo venv at <repo>/venv with a stale gitreins dist whose entry point imports a module the installed dist no longer ships", "language": "python", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "gitreins-judge-repo-venv-shadows-pipx-cli-broken-entrypoint", "provider": "openrouter", "solved_at": "2026-09-26T11:41:55.015Z", "version": ""}