fix: resolve remaining shell syntax in run() calls (closes #110)#119
Open
TerminalGravity wants to merge 1 commit intomainfrom
Open
fix: resolve remaining shell syntax in run() calls (closes #110)#119TerminalGravity wants to merge 1 commit intomainfrom
TerminalGravity wants to merge 1 commit intomainfrom
Conversation
This was referenced Mar 5, 2026
d57447c to
5594e3d
Compare
Collaborator
Author
|
CI is green on this one ✅. However, looking at #120, it covers 4 additional files that this PR misses (checkpoint.ts, session-health.ts, sharpen-followup.ts, what-changed.ts). If we go with #119 we'd still have shell syntax lurking in those files. Recommendation: either expand this PR to cover those 4 files too, or let #120 be the canonical fix once its CI passes. As-is, #120 is the more complete solution. |
…files Fixes #110. The run() function uses execFileSync (no shell), but many tool files were passing shell syntax (pipes, redirects, ||, &&) that silently broke after the execFileSync migration. Added a shell() helper to git.ts that uses execSync for commands that genuinely need shell features. Migrated all affected tool files: - verify-completion.ts: tsc pipes, build pipes, cat → readFileSync - checkpoint.ts: git add/commit chains, git reset - clarify-intent.ts: tsc | grep, find | head - enrich-agent-task.ts: git ls-files | grep/head, head -30 - audit-workspace.ts: git diff || echo, find | wc -l - session-handoff.ts: command -v, gh pr list || echo - scope-work.ts: git ls-files | head | grep - sequence-tasks.ts: git ls-files | head - token-audit.ts: wc -l, wc -c, tail -c, git diff (converted to array args where no shell needed)
5594e3d to
8901479
Compare
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.
Problem
After the
execFileSyncmigration, 8 tool files still passed shell syntax (pipes, redirects, non-git binaries likewc,find,cat,head,tail,command -v,gh) torun(), which wrapsexecFileSync('git', args). These commands silently fail because shell operators become literal git arguments.Solution
Option 3 from #110: both approaches.
shell()helper ingit.ts— usesexecSyncfor commands that genuinely need shell features (pipes, redirects, non-git binaries)Files fixed (all 8 from the issue)
verify-completion.ts—cat,tsc | tail,build | tailtoken-audit.ts—wc -l,wc -c,tail -c, git diff → array argsclarify-intent.ts—tsc | grep,find | headsession-handoff.ts—command -v,gh pr list || echoaudit-workspace.ts— git diff → array args,find | wc -lenrich-agent-task.ts—git ls-files | grep,head -30scope-work.ts—git ls-files | head | grepsequence-tasks.ts—git ls-files | headBuild clean, all 43 tests pass.
Closes #110