fix: broken shell syntax in git.run() calls (checkpoint, what-changed, session-health)#171
Closed
TerminalGravity wants to merge 1 commit intomainfrom
Closed
fix: broken shell syntax in git.run() calls (checkpoint, what-changed, session-health)#171TerminalGravity wants to merge 1 commit intomainfrom
TerminalGravity wants to merge 1 commit intomainfrom
Conversation
…, session-health) run() uses execFileSync which doesn't interpret shell operators (|, ||, &&, 2>/dev/null). These tools were passing shell pipelines/redirects as git args, causing silent failures or incorrect results. Fixed: - what-changed: use getDiffFiles() helper and array args for log - checkpoint: use array args for add/commit/reset instead of shell chains - session-health: use array args for diff --stat, split output in JS Same bug class as PR #170 (clarify-intent). Many more tools still affected — see forthcoming issue for tracking.
This was referenced Mar 8, 2026
Collaborator
Author
|
Superseded by #175 which covers all the shell syntax fixes in one PR. Closing in favor of that. |
TerminalGravity
added a commit
that referenced
this pull request
Mar 10, 2026
Fixes #172 — remaining tools after #170 and #171. Tools fixed: - verify-completion: replaced shell-piped tsc/test/build commands with execFileSync, read package.json via fs instead of cat - token-audit: replaced wc/tail shell commands with fs.readFileSync, fs.statSync, and Buffer reads - session-handoff: replaced 'command -v' with 'which' via execFileSync, replaced gh shell pipe with direct execFileSync call - audit-workspace: replaced shell-piped find|wc with git ls-files + JS filter - sharpen-followup: replaced shell-string run() calls with array args - scope-work: replaced git ls-files|head|grep pipe with JS array ops, fixed 'git git' double-prefix on status/diff calls - enrich-agent-task: replaced all shell-piped git/head/grep with JS fs.readFileSync and array filtering - sequence-tasks: replaced git ls-files pipe with array args + JS slice All changes use Node.js fs/child_process directly or pass proper array args to run(), eliminating silent failures from shell operators being passed as literal git arguments.
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
run()inlib/git.tsusesexecFileSyncwhich does not interpret shell operators (|,||,&&,2>/dev/null). Multiple tools were passing shell pipelines and redirects as if they were shell commands, causing silent failures.Same bug class as #170 (clarify-intent).
Fixed in this PR
getDiffFiles()helper + array args forgit logadd/commit/resetinstead of shell chainsdiff --stat, split output in JS instead of piping totail -1Still affected (tracked in separate issue)
verify-completion, token-audit, session-handoff, audit-workspace, sharpen-followup, scope-work, enrich-agent-task, sequence-tasks — all have the same pattern.
Testing
pnpm tsc --noEmitclean