Skip to content

fix: replace shell syntax in run() calls across 8 tools#202

Closed
TerminalGravity wants to merge 2 commits intomainfrom
fix/shell-syntax-172
Closed

fix: replace shell syntax in run() calls across 8 tools#202
TerminalGravity wants to merge 2 commits intomainfrom
fix/shell-syntax-172

Conversation

@TerminalGravity
Copy link
Collaborator

@TerminalGravity TerminalGravity commented Mar 10, 2026

Fixes broken run() calls that pass shell syntax (pipes, redirects, &&) to execFileSync which doesn't interpret them.

Tools fixed in this PR:

  • clarify-intent: run()shell() for pnpm tsc and find commands with pipes
  • session-health: run('git diff --stat | tail -1') → array args + JS .pop()
  • what-changed: run('git diff ... || git diff ...') → array args with JS fallback
  • checkpoint: run('git add ... && git commit ...') → separate array-arg calls
  • Plus earlier fixes for other tools

All changes maintain existing behavior while actually working correctly with execFileSync.

Closes #172

run() uses execFileSync (no shell), so pipes, redirects, and non-git
commands were silently broken. Fixed all 8 remaining tools:

- verify-completion: use readFileSync for package.json, shell() for tsc/tests/build
- token-audit: use readFileSync/statSync for line counting and file sizes,
  openSync/readSync for tail-reading large files
- session-handoff: use shell() for command -v and gh pr list
- audit-workspace: use array args for git commands, shell() for find|wc
- sharpen-followup: use array args for git diff/status
- scope-work: use array args, do grep/filter in JS
- enrich-agent-task: use array args, readFileSync, JS filtering
- sequence-tasks: use array args, slice in JS

Added shell() helper to lib/git.ts for commands that genuinely need
shell interpretation (non-git CLIs with pipes/redirects).
Fixes remaining broken run() calls in 4 tools:
- clarify-intent: use shell() for pnpm/find commands with pipes
- session-health: use array args + JS .pop() instead of pipe to tail
- what-changed: use array args with JS fallback instead of || operator
- checkpoint: use array args for add/commit/reset instead of string interpolation

Part of #172
@TerminalGravity
Copy link
Collaborator Author

Closing — superseded by #204 which covers all remaining tools. Let's consolidate there.

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.

Systematic: shell syntax in git.run() calls across 8+ tools

1 participant