fix: replace shell syntax in run() calls across all 8 remaining tools#195
fix: replace shell syntax in run() calls across all 8 remaining tools#195TerminalGravity wants to merge 1 commit intomainfrom
Conversation
TerminalGravity
left a comment
There was a problem hiding this comment.
This looks like a cleaner take on the same fix from #192 — both close #172. I'd go with this one since it removes the dead shellEscape functions too. The approach is solid: shell pipes → JS filtering, non-git CLIs → direct execFileSync, dropping 2>/dev/null since run() handles errors already.
One thing to double-check: in verify-completion, the npx tsc --noEmit call — make sure you're handling the exit code properly since execFileSync throws on non-zero. If tsc finds type errors, that throw is the expected signal, but worth a try/catch with a meaningful message rather than an unhandled exception.
If this supersedes #192, let's close that one to keep things tidy.
51ca8cf to
07f4064
Compare
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.
07f4064 to
95c1752
Compare
|
Closing — superseded by #204 which covers all remaining tools. Let's consolidate there. |
Closes #172
Systematic fix for the shell-in-
run()bug class across all 8 remaining tools.Problem:
git.run()usesexecFileSync('git', args)— no shell. But tools passed pipes, redirects, and non-git commands that silently failed.Fix: Convert git args to arrays, use
execFileSync/fsfor non-git ops, replace shell pipes with JS filtering, remove deadshellEscapehelpers.Tools fixed: verify-completion, token-audit, session-handoff, audit-workspace, sharpen-followup, scope-work, enrich-agent-task, sequence-tasks
All 43 tests pass, clean build.