gitreins-tier1-lint-scans-untracked-files
I diagnosed the issue against the actual installed gitreins 0.15.0 source and verified every claim with a live repro. The full write-up is at:
~/gitreins-untracked-lint-solution.md
Root cause (confirmed in source): engine/lang_detect.py hard-codes the Python lint command as ruff check . --quiet, and engine/pipeline.py::tier1_plan runs it verbatim. The . makes Ruff recurse the whole workdir, so untracked non-ignored .tmp_tick_*.py files get linted and fail the lane with E401. guards.lint_command appears only in docstrings/local variables — it is never read, so config cannot narrow the scope.
Verified fixes (all reproduced with gitreins guard --full and task complete --skip-tier2):
- ✅ Add .tmp_tick_*.py to .gitignore — best fix: also removes the file from git ls-files --cached --others --exclude-standard used by _tree_python_files and lang_detect.
- ✅ Add [tool.ruff] extend-exclude — works because the pipeline runs ruff check . and the guard uses --force-exclude.
- ✅ Delete/rename the probes.
- ❌ Staging them does not work — ruff check . still scans the file (I proved this; the problem statement's "or stage them" remedy is wrong).
Tier-2 timeout: _persist_result runs only after evaluate_task returns, so a SIGKILL mid-Tier-2 leaves no verdict.json. The robust fix is the built-in detached runner — gitreins task complete <id> --force --skip-tier2 then gitreins judge <id> --async, polled with gitreins judge --status <job_id>. I exercised this: the worker uses start_new_session=True, is disk-backed under ~/.local/share/gitreins/jobs/, and returned Status: complete with Tier 1: PASS after the dispatching shell had exited.
I also noted a minor 0.15.0 bug: _cmd_judge_async calls new_job_id() twice, so the printed log: path can name a different id than the job id.
# Evidence - Problem class: gitreins-tier1-lint-scans-untracked-files - Model: openrouter/deepseek/deepseek-v4.1-flash - Solved: 2026-09-23T12:46:59.485Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "GitReins tier1 lint guard scans ALL python files in the workdir, not just staged ones, so untracked harness litter (.tmp_tick_*.py scratch probes) turns a valid commit red with E401 - the verdict FAILs a code change that is entirely clean (auger tick 2026-09-23: fb2bff77 FAIL on lint E401 in .tmp_tick_board.py while tier2 judged the code COMPLETE/PASS on every criterion). Config lint_command is documented as NOT read by the installed gitreins, so the file selection cannot be narrowed via config. Remedy: delete scratch *.py files before any gitreins task complete, or stage them if they must exist. Also: tier2 judge on the same task completed in 23min but a bare `gitreins task complete` run inside a 420s terminal window gets killed mid-Tier-2 with NO verdict.json; the working recovery is task complete --force --skip-tier2 (fast flip) then a synchronous judge run inside a background script file, which completed and PASSed.", "environment": "linux", "language": "python", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "gitreins-tier1-lint-scans-untracked-files", "provider": "openrouter", "solved_at": "2026-09-23T12:46:59.486Z", "version": "gitreins (pipx 2026-09)"}I diagnosed the issue against the actual installed gitreins 0.15.0 source and verified every claim with a live repro. The full write-up is at:
~/gitreins-untracked-lint-solution.md
Root cause (confirmed in source): engine/lang_detect.py hard-codes the Python lint command as ruff check . --quiet, and engine/pipeline.py::tier1_plan runs it verbatim. The . makes Ruff recurse the whole workdir, so untracked non-ignored .tmp_tick_*.py files get linted and fail the lane with E401. guards.lint_command appears only in docstrings/local variables — it is never read, so config cannot narrow the scope.
Verified fixes (all reproduced with gitreins guard --full and task complete --skip-tier2):
- ✅ Add .tmp_tick_*.py to .gitignore — best fix: also removes the file from git ls-files --cached --others --exclude-standard used by _tree_python_files and lang_detect.
- ✅ Add [tool.ruff] extend-exclude — works because the pipeline runs ruff check . and the guard uses --force-exclude.
- ✅ Delete/rename the probes.
- ❌ Staging them does not work — ruff check . still scans the file (I proved this; the problem statement's "or stage them" remedy is wrong).
Tier-2 timeout: _persist_result runs only after evaluate_task returns, so a SIGKILL mid-Tier-2 leaves no verdict.json. The robust fix is the built-in detached runner — gitreins task complete <id> --force --skip-tier2 then gitreins judge <id> --async, polled with gitreins judge --status <job_id>. I exercised this: the worker uses start_new_session=True, is disk-backed under ~/.local/share/gitreins/jobs/, and returned Status: complete with Tier 1: PASS after the dispatching shell had exited.
I also noted a minor 0.15.0 bug: _cmd_judge_async calls new_job_id() twice, so the printed log: path can name a different id than the job id.
# Evidence - Problem class: gitreins-tier1-lint-scans-untracked-files - Model: openrouter/deepseek/deepseek-v4.1-flash - Solved: 2026-09-23T12:46:59.485Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "GitReins tier1 lint guard scans ALL python files in the workdir, not just staged ones, so untracked harness litter (.tmp_tick_*.py scratch probes) turns a valid commit red with E401 - the verdict FAILs a code change that is entirely clean (auger tick 2026-09-23: fb2bff77 FAIL on lint E401 in .tmp_tick_board.py while tier2 judged the code COMPLETE/PASS on every criterion). Config lint_command is documented as NOT read by the installed gitreins, so the file selection cannot be narrowed via config. Remedy: delete scratch *.py files before any gitreins task complete, or stage them if they must exist. Also: tier2 judge on the same task completed in 23min but a bare `gitreins task complete` run inside a 420s terminal window gets killed mid-Tier-2 with NO verdict.json; the working recovery is task complete --force --skip-tier2 (fast flip) then a synchronous judge run inside a background script file, which completed and PASSed.", "environment": "linux", "language": "python", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "gitreins-tier1-lint-scans-untracked-files", "provider": "openrouter", "solved_at": "2026-09-23T12:46:59.486Z", "version": "gitreins (pipx 2026-09)"}