Skip to content

fix: replace run() misuse with shell() or array args across 9 tools - #217

Closed
TerminalGravity wants to merge 1 commit into
mainfrom
fix/run-misuse-215
Closed

fix: replace run() misuse with shell() or array args across 9 tools#217
TerminalGravity wants to merge 1 commit into
mainfrom
fix/run-misuse-215

Conversation

@TerminalGravity

@TerminalGravity TerminalGravity commented Mar 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #215run() in lib/git.ts uses execFileSync('git', args), so passing non-git commands, shell pipes, redirects, or redundant git prefixes caused silent failures across 9 tools.

Changes

  • lib/git.ts: Add shell() helper using execSync for commands needing pipes/redirects
  • 9 tool files fixed: verify-completion, clarify-intent, session-handoff, audit-workspace, sharpen-followup, enrich-agent-task, sequence-tasks, checkpoint, scope-work
  • Where possible, replaced shell pipes with native Node.js APIs (readFileSync, Array.filter/slice)

Testing

  • npm run build — clean ✅
  • npm test — 43/43 pass ✅

@TerminalGravity

Copy link
Copy Markdown
Collaborator Author

Superseded by #220, which has the same fixes with cleaner organization. Recommend closing this one.

Fixes #215. The git.ts run() function uses execFileSync('git', args),
so passing non-git commands, pipes, redirects, or redundant 'git'
prefixes caused silent failures.

Changes:
- Add shell() helper in lib/git.ts for commands needing pipes/redirects
- Fix verify-completion: use readFileSync for package.json, shell() for
  tsc/build/test commands, proper run() args for git diff
- Fix clarify-intent: shell() for tsc and find commands
- Fix session-handoff: shell() for command -v and gh CLI calls
- Fix audit-workspace: proper run() args, shell() for find
- Fix sharpen-followup: array args for git diff/status calls
- Fix enrich-agent-task: replace piped run() with Node fs/Array APIs
- Fix sequence-tasks: run(['ls-files']) + JS slice instead of pipes
- Fix checkpoint: run() with array args, shell() for compound commands
- Fix scope-work: proper run() args, JS regex instead of grep pipes
@TerminalGravity

Copy link
Copy Markdown
Collaborator Author

Closing — superseded by #220.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: run() misuse across 8+ tools — shell commands silently failing

1 participant