fix: replace run() with shell() across 9 tools — closes #215 - #220
fix: replace run() with shell() across 9 tools — closes #215#220TerminalGravity wants to merge 1 commit into
Conversation
…failures Fixes #215. The run() helper uses execFileSync('git', args) which breaks for non-git commands, pipes, redirects, and shell operators. This commit: - Adds shell() helper to lib/git.ts using execSync for commands needing shell features (pipes, redirects, non-git binaries) - Converts git commands with 2>/dev/null to proper run() array args - Replaces fs-readable operations (cat package.json) with Node fs APIs Affected tools: verify-completion, clarify-intent, session-handoff, audit-workspace, sharpen-followup, enrich-agent-task, sequence-tasks, checkpoint, scope-work
TerminalGravity
left a comment
There was a problem hiding this comment.
Reviewed — this is the right fix. The shell() helper with timeout protection and graceful error returns is clean. All 9 tool migrations look correct: run() kept for pure git commands with array args, shell() for pipes/redirects.
Two small things for follow-up (not blocking):
-
scope-work.tsinput escaping —grepTermsinterpolated intoshell()usesshellEscape, but double-check edge cases (terms with|in them would break the grep pattern vs shell pipe ambiguity). -
checkpoint.tscommit message — thecommitMsg.replace(/"/g, '\\"')in ashell()call is fragile for summaries with$or backticks. Since it's a pure git command,run(['commit', '-m', commitMsg])would be safer.
This supersedes #217 and #219 — close those once this merges. Ready to go. 🚀
Fixes #215
All 9 affected tools now use the correct execution method:
Zero new dependencies. Types clean, all 43 tests pass.