Fix stop-gate infinite loop on large TS projects + README rewrite - #35
Merged
Conversation
stop-gate.sh: The TypeScript phase ran `npx tsc --noEmit` against the entire project but did not filter output to changed files. In repos with hundreds of pre-existing TS errors, this blocked every Stop event with 5 errors at a time — Claude fixed those, then 5 more appeared, forever. Fix: filter tsc error output through `grep -F` against $CHANGED_FILES, matching the pattern the Python/ruff phase already uses. Pre-existing errors in untouched files no longer block the agent. README.md: Rewritten from 567 to 323 lines. Install instructions are now a single numbered section at the top (was scattered across 3 places). Each plugin install is a copy-pasteable command. Removed the ASCII art diagram, empty presets section, and roadmap changelog.
Tri-review consensus (Claude + Codex + Gemini):
- grep -F substring matching caused false positives (button.tsx matching
icon-button.tsx). Now extracts path before "(" and uses grep -Fx for
exact line matching.
- tsc exit code was silently discarded by || true. Restored TSC_EXIT
check so tsc crashes (OOM, missing tsconfig) don't silently pass.
- Replaced echo with printf to avoid -e/-n flag interpretation.
- Consistent [ ] brackets matching surrounding code sections.
- Add tr -d '\r' to path extraction in stop-gate.sh TypeScript phase. Windows/cross-platform tsc output may include carriage returns that break grep -Fx exact matching. - Update README test count: 141 tests across 6 packages (was "100+ across 5").
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tsc --noEmitagainst the entire project, blocking on pre-existing errors in untouched files. Now filters output to only changed files viagrep -F, matching the pattern the Python/ruff phase already uses.The bug
In repos with many pre-existing TS errors (e.g., 757), the stop-gate hook would:
npx tsc --noEmiton the whole projectThe Python/ruff phase already had the right pattern — filter errors to
$CHANGED_FILES. The TS phase was missing this.Test plan
bash -n hooks/stop-gate.sh— syntax validgrep -F -f <(changed files)correctly filters tsc output to only changed files