fix: replace shell syntax in run() calls across 8 tools#180
Open
TerminalGravity wants to merge 4 commits intomainfrom
Open
fix: replace shell syntax in run() calls across 8 tools#180TerminalGravity wants to merge 4 commits intomainfrom
TerminalGravity wants to merge 4 commits intomainfrom
Conversation
- examples/.preflight/config.yml — main config with inline docs - examples/.preflight/triage.yml — triage rules with keyword examples - examples/.preflight/contracts/api.yml — sample contract definitions - examples/.preflight/README.md — getting started guide - README.md — link to examples from config section
- 8 real-world examples showing preflight_check triage, correction patterns, sub-agent enrichment, cross-service contracts, session health, scorecards, and semantic search - linked from README nav bar
Tools fixed: - verify-completion: use fs for package.json, execSync for tsc/build/tests - token-audit: use fs for line/byte counting, execSync for tail - session-handoff: use execSync for command -v and gh pr list - audit-workspace: use fs for recursive test file counting - sharpen-followup: use array args for git diff calls - scope-work: use JS array filtering instead of shell pipes - enrich-agent-task: use fs for file reading, JS for filtering - sequence-tasks: use array args + JS slicing The git.run() function uses execFileSync (no shell), so shell operators like |, 2>/dev/null, ||, and non-git commands (wc, find, cat, head, tail) were silently broken — passed as literal git args. Closes #172
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.
Fixes #172
git.run()usesexecFileSync('git', args)— no shell. But 8 tools were passing strings with shell operators (|,2>/dev/null,||, etc.) and non-git commands (wc,find,cat,head,tail) that were silently broken — passed as literal git args.Tools fixed:
verify-completion— use fs for package.json,execSyncfor tsc/build/teststoken-audit— use fsstatSync/readFileSyncfor line/byte countingsession-handoff— useexecSyncwith shell forcommand -vandgh pr listaudit-workspace— recursive fs-based test file countingsharpen-followup— array args for git diff callsscope-work— JS array filtering instead of shell pipesenrich-agent-task— fs for file reading, JS for grep-like filteringsequence-tasks— array args + JS slicingBuild passes, all 43 tests pass.