pregate: a missing pytest is PREGATE_LANE_FAILED (blames the diff), not PREGATE_ENVIRONMENT
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python, typescript
Research direction
Read the pytest branch of detectRunner in lib/pregate/checks/lanes.ts and compare it with the PATH checks for pnpm/yarn, cargo, and dart/flutter in planRuns. Reproduce with Python available but pytest missing, then check that the lane reports PREGATE_ENVIRONMENT (missing-binary) and gives the install-or-run-remotely guidance instead of PREGATE_LANE_FAILED.
Written by the indexing model from the issue text.
Description
What happened
On a machine without pytest, gstack-pregate's lanes check blames the diff for it. A selected Python test runs as python3 -m pytest {files}. That exits 1 with No module named pytest, and the lane reports PREGATE_LANE_FAILED with "fix the in-branch failure". The test itself is fine: it is a unittest test, and python3 -m unittest passes it.
$ python3 -m unittest tests/test_alpha.py
OK
$ python3 -m pytest --version
/opt/homebrew/opt/[email protected]/bin/python3.15: No module named pytest
# upstream main, 1.91.311.0 (94165fff3)
$ gstack-pregate run --stage tests --only lanes --base origin/main --allow-repo-commands
...
lanes: fix: read ~/.gstack/projects/repro-pytest/pregate/runs/…/lanes/lanes.log, fix the in-branch failure, rerun gstack-pregate --stage tests
PREGATE: fail tree=075ba803dd3a head=7ae1d5e297a9 checks=1
gstack-pregate: lanes: local lane exited 1 (? failed of ? ran; 1 files; pipefail); … (PREGATE_LANE_FAILED)
Expected: the same verdict a missing pnpm, cargo, dart or flutter gets: PREGATE_ENVIRONMENT (missing-binary), "install pytest on this machine and rerun, or run the lane remotely; the diff is not at fault". The machine is missing a tool; the diff did nothing wrong.
classifyCommandEnvironment can't catch this at run time: the command's binary is python3, which is on PATH, and No module named pytest is not a not-found line. planRuns already checks PATH before a run for pnpm/yarn (packageRunner), cargo (cargoRunner) and dart/flutter (dartRunner). The pytest branch of detectRunner (lib/pregate/checks/lanes.ts) does no such check.
Steps to reproduce
- A machine where
python3 -m pytestfails withNo module named pytest. - A repo with no
package.jsonand one committed test,tests/test_alpha.py:import unittest class T(unittest.TestCase): def test_a(self): self.assertEqual(1 + 1, 2) - On a branch, change
tests/test_alpha.py, then rungstack-pregate run --stage tests --only lanes --base origin/main --allow-repo-commands.
Found while fixing mixed .mjs + .py root selections, which today get no runner at all (PR follows). Once each language gets its own runner, the Python part hits this on such a machine. This issue is pre-existing and separate from that PR.
Readiness report
gstack doctor 1.91.275.0
ok install root ~/.claude/skills/gstack: claude global current (1.91.275.0)
ok rescue refs none in ~/.claude/skills/gstack
ok state root ~/.gstack durable=yes (selected by default)
ok bun 1.4.3 at /opt/homebrew/bin/bun (floor 1.3.3, tested 1.4.2)
ok hooks 9 hook(s) parse
ok codex codex-cli 0.164.0; self-locate ok; model gpt-6.1-sol (source: ~/.codex/config.toml model)
ok codex probe cached MODEL_OK, 17h ago (not re-run; --live probes now)
not configured artifacts sync off; cross-machine artifacts sync is unavailable
ok browse bundle browse/dist built
ok binaries find-browse, design, pdf, gstack-global-discover launch (4 of 4)
ok cso native helper 1.91.275.0 (f8d0ab033914)
ok claude code 2.1.312 (Claude Code) at ~/.local/bin/claude
ok session journal largest of 60: 36.3 MiB
ok guard log 30 decisions (4 denied)
warn CLAUDE.md the gstack section in ~/.claude/CLAUDE.md lists 39 skills; …
13 ok, 1 warn, 1 not configured, 0 fail
The repro above was also run against upstream main (1.91.311.0), with the same result.
Environment
- Host (Claude Code, Codex, Cursor, ...) and its version: Claude Code 2.1.312
- OS: macOS 26.6.2, Python 3.15 (Homebrew), no pytest installed
- Dominant language
- TypeScript
- Stars
- 138k
- Forks
- 20.5k
- Avg merge
- 8h 32m
- Merged PRs (30d)
- 292
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from garrytan/gstack
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
components-web-app/docs#307 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
localstack/localstack-mcp-server#112 ·
Maintainers usually reply within 1 day
-
area:frontend kind:bug priority:p1 ready
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
bug ready-for-agent
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
PhyberApex/kuroshiro#1687 ·
Maintainers usually reply within 1 day
-
Performance (Web Vitals) collector: LCP/FCP from background tabs are not discarded, inflating p75Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
umami-software/umami#4720 ·
Maintainers usually reply within 3 days