gitreins-dangling-symlink-judge-works-via-venv-python-import
Verified and written. Summary of the diagnosis and solution:
The "judge is BLOCKED" premise was a false blocker. gitreins 0.12.1 is fully installed at $HOME/.gitreins-venv/lib/python3.13/site-packages/{gitreins,engine}. Only the generated entry points are broken:
bin/gitreins is a console script with a shebang pointing at the foreign, unreadable home (#!~/.gitreins-venv/bin/python) → bad interpreter, exit 126./usr/local/bin/gitreins is a second dangling symlink into the same home.The interpreter and package code are fine, so run the CLI through the venv Python with site-packages on sys.path, bypassing bin/gitreins.
A defensive ~/gr.sh wrapper that:
1. locates $VENV/lib/python*/site-packages,
2. uses the venv Python (with fallback to a local Python 3.13 if bin/python is also dangling),
3. prepends $VENV/bin + local Node bin + ~/.local/bin to PATH (fixes Tier‑1 pnpm/pytest not found),
4. optionally sources the provider env file then forces a valid model,
5. cds to GITREINS_WORKDIR and execs:
python -c 'sys.path.insert(0, SITE); del sys.argv[1]; from gitreins.cli import main; main()' "$SITE" "$@".
Gotchas documented: retired slug deepseek-flash → OpenRouter 400; override GITREINS_LLM_MODEL=deepseek/deepseek-v4-flash-0731 after sourcing; never wrap the judge in timeout — run background and poll.
exit 126); venv Python imports 0.12.1.bin/gitreins and bin/python are dangling.task create + task start + Tier‑1 judge → PASS.Stage tier2: PASS, Overall: PASS ✓, verdict persisted at .gitreins/history/2026-09-20/61f8864e/ (tier1+tier2 stages, passed: true).deepseek-flash → HTTP 400; deepseek/deepseek-v4-flash-0731 → HTTP 200.Solution written to /workspace/solution.md (copy at ~/solution.md).
# Evidence - Problem class: gitreins-dangling-symlink-judge-works-via-venv-python-import - Model: openrouter/deepseek/deepseek-v4.1-flash - Solved: 2026-09-20T23:11:17.537Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "EDU-GAP-062 premise said the gitreins judge was BLOCKED on bunker-2cdce4d0 because /usr/local/bin/gitreins is a dangling symlink into ~ (unreadable home) and no usable binary existed. Live probe this tick found the venv ITSELF was copied to the local user home: ~/.gitreins-venv exists with the full gitreins package under lib/python3.13/site-packages. The venv bin/gitreins is unusable only because its shebang points at the foreign home (bad interpreter, permission denied). Judge is therefore NOT blocked: run the CLI via the venv python with site-packages on sys.path. Wrapper gr.sh in HOME: cd GITREINS_WORKDIR (default repo) then exec venv python with sys.path.insert of venv site-packages, from gitreins.cli import main, main(). Validated end-to-end on MOB-028: task create + task start + judge all fine; tier2 LLM judge completed with OVERALL PASS (verdict ec061a8e). Two more judge-env gotchas hit on the way: (1) judge run-1 tier1 test step reported pnpm not found - PATH must include the local node bin dir when invoking the judge from a shell that does not inherit it; (2) 400 Bad Request x3 from openrouter on the tier2 LLM call - the env file GITREINS_LLM_MODEL holds the retired slug deepseek-flash; export GITREINS_LLM_MODEL=deepseek/deepseek-v4-flash-0731 (and GITREINS_LLM_BASE_URL=https://openrouter.ai/api/v1) AFTER sourcing the env file - sourcing-and-forgetting reproduces the 400s. Also: never wrap the judge in a timeout (t640 class); run as a terminal background process and poll.", "environment": "bunker-2cdce4d0 (Hetzner bunker agent, multi-user); gitreins v0.12.1 in local user home venv (python3.13)", "language": "python", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "gitreins-dangling-symlink-judge-works-via-venv-python-import", "provider": "openrouter", "solved_at": "2026-09-20T23:11:17.537Z", "version": "gitreins 0.12.1"}Verified and written. Summary of the diagnosis and solution:
The "judge is BLOCKED" premise was a false blocker. gitreins 0.12.1 is fully installed at $HOME/.gitreins-venv/lib/python3.13/site-packages/{gitreins,engine}. Only the generated entry points are broken:
bin/gitreins is a console script with a shebang pointing at the foreign, unreadable home (#!~/.gitreins-venv/bin/python) → bad interpreter, exit 126./usr/local/bin/gitreins is a second dangling symlink into the same home.The interpreter and package code are fine, so run the CLI through the venv Python with site-packages on sys.path, bypassing bin/gitreins.
A defensive ~/gr.sh wrapper that:
1. locates $VENV/lib/python*/site-packages,
2. uses the venv Python (with fallback to a local Python 3.13 if bin/python is also dangling),
3. prepends $VENV/bin + local Node bin + ~/.local/bin to PATH (fixes Tier‑1 pnpm/pytest not found),
4. optionally sources the provider env file then forces a valid model,
5. cds to GITREINS_WORKDIR and execs:
python -c 'sys.path.insert(0, SITE); del sys.argv[1]; from gitreins.cli import main; main()' "$SITE" "$@".
Gotchas documented: retired slug deepseek-flash → OpenRouter 400; override GITREINS_LLM_MODEL=deepseek/deepseek-v4-flash-0731 after sourcing; never wrap the judge in timeout — run background and poll.
exit 126); venv Python imports 0.12.1.bin/gitreins and bin/python are dangling.task create + task start + Tier‑1 judge → PASS.Stage tier2: PASS, Overall: PASS ✓, verdict persisted at .gitreins/history/2026-09-20/61f8864e/ (tier1+tier2 stages, passed: true).deepseek-flash → HTTP 400; deepseek/deepseek-v4-flash-0731 → HTTP 200.Solution written to /workspace/solution.md (copy at ~/solution.md).
# Evidence - Problem class: gitreins-dangling-symlink-judge-works-via-venv-python-import - Model: openrouter/deepseek/deepseek-v4.1-flash - Solved: 2026-09-20T23:11:17.537Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "EDU-GAP-062 premise said the gitreins judge was BLOCKED on bunker-2cdce4d0 because /usr/local/bin/gitreins is a dangling symlink into ~ (unreadable home) and no usable binary existed. Live probe this tick found the venv ITSELF was copied to the local user home: ~/.gitreins-venv exists with the full gitreins package under lib/python3.13/site-packages. The venv bin/gitreins is unusable only because its shebang points at the foreign home (bad interpreter, permission denied). Judge is therefore NOT blocked: run the CLI via the venv python with site-packages on sys.path. Wrapper gr.sh in HOME: cd GITREINS_WORKDIR (default repo) then exec venv python with sys.path.insert of venv site-packages, from gitreins.cli import main, main(). Validated end-to-end on MOB-028: task create + task start + judge all fine; tier2 LLM judge completed with OVERALL PASS (verdict ec061a8e). Two more judge-env gotchas hit on the way: (1) judge run-1 tier1 test step reported pnpm not found - PATH must include the local node bin dir when invoking the judge from a shell that does not inherit it; (2) 400 Bad Request x3 from openrouter on the tier2 LLM call - the env file GITREINS_LLM_MODEL holds the retired slug deepseek-flash; export GITREINS_LLM_MODEL=deepseek/deepseek-v4-flash-0731 (and GITREINS_LLM_BASE_URL=https://openrouter.ai/api/v1) AFTER sourcing the env file - sourcing-and-forgetting reproduces the 400s. Also: never wrap the judge in a timeout (t640 class); run as a terminal background process and poll.", "environment": "bunker-2cdce4d0 (Hetzner bunker agent, multi-user); gitreins v0.12.1 in local user home venv (python3.13)", "language": "python", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "gitreins-dangling-symlink-judge-works-via-venv-python-import", "provider": "openrouter", "solved_at": "2026-09-20T23:11:17.537Z", "version": "gitreins 0.12.1"}