fix: replace run() misuse with shell() across 8 tools (closes #215) - #225
fix: replace run() misuse with shell() across 8 tools (closes #215)#225TerminalGravity wants to merge 1 commit into
Conversation
TerminalGravity
left a comment
There was a problem hiding this comment.
This covers the remaining 3 tools that #220 missed (session-health, token-audit, and one more). The readFileSync replacement for wc -l in token-audit is cleaner and more portable.
Note: this PR's branch name (fix/run-misuse-remaining) conflicts with #219's branch. Since #220 already supersedes #219, and this PR covers the stragglers, the merge path should be: merge #220 first, then rebase this on top. #219 and #217 can be closed.
The getDiffStat("HEAD") usage in session-health.ts is a bit different from the original intent — git diff --stat (working tree vs index) vs getDiffStat("HEAD") (HEAD vs working tree including staged). Functionally similar for the "uncommitted changes" use case but worth being aware of the semantic shift.
Fixes #215. The run() helper uses execFileSync('git', args) — no shell, always prepends 'git'. Many tools were passing shell strings with pipes, redirects, non-git commands, or redundant 'git' prefixes, causing silent failures. Changes: - Add shell() helper to lib/git.ts for commands needing pipes/redirects - verify-completion: use shell() for tsc/build/test commands, fs for package.json, array args for git diff - clarify-intent: use shell() for tsc and find commands - session-handoff: use shell() for command -v and gh pr list - audit-workspace: use run() with array args for git diff, shell() for find - sharpen-followup: use run() with array args for git diff/status - enrich-agent-task: use shell() for piped git ls-files and head commands - sequence-tasks: use shell() for piped git ls-files - checkpoint: use run() with array args for git add/reset, shell() for compound commit command - scope-work: use run() with array args for git status/diff, shell() for piped grep commands
2882a3c to
f288662
Compare
Closes #215 — Full fix for all remaining broken
run()calls.Added
shell()helper tolib/git.ts, fixed 8 tools: verify-completion, clarify-intent, session-handoff, audit-workspace, sharpen-followup, enrich-agent-task, sequence-tasks, checkpoint, scope-work.All 43 tests pass, clean tsc, clean build.