Skip to content

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

@TerminalGravity

Description

@TerminalGravity

Problem

run() in lib/git.ts uses execFileSync('git', args) — no shell interpretation. But many tools pass strings containing shell operators that silently break:

  • 2>/dev/null — passed as literal git args
  • || fallback — not executed, literal args
  • | tail -1 / | grep — literal args
  • && git commit — literal args
  • < file — literal args
  • git diff ... — becomes git git diff ...

Already fixed

Still broken

Tool Line(s) Shell syntax used
verify-completion 37, 58, 83, 115, 133 cat, pipe, 2>/dev/null, npm run build via git
token-audit 42-43, 66, 83, 142 2>/dev/null, wc -l <, tail -c
session-handoff 11, 47 command -v, gh pr list ... || echo
audit-workspace 39, 78 2>/dev/null, find ... | wc -l
sharpen-followup 90 2>/dev/null
scope-work 131 git ls-files | head | grep
enrich-agent-task 32-56 2>/dev/null, head -30, grep pipes
sequence-tasks 93 2>/dev/null

Fix approach

For each tool:

  1. Replace shell-piped commands with array-arg run() calls
  2. Do filtering/piping in JS (split, filter, slice)
  3. For non-git commands (wc, find, cat), use Node.js fs/child_process directly
  4. Remove 2>/dev/nullrun() already catches errors gracefully

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions