Skip to content

fix: shell syntax bugs in 8 remaining tool files#123

Open
TerminalGravity wants to merge 4 commits intomainfrom
fix/shell-syntax-scope-sharpen
Open

fix: shell syntax bugs in 8 remaining tool files#123
TerminalGravity wants to merge 4 commits intomainfrom
fix/shell-syntax-scope-sharpen

Conversation

@TerminalGravity
Copy link
Collaborator

Closes #110

Problem

After the execFileSync migration, 8 tool files still passed shell syntax (|, ||, 2>/dev/null, 2>&1) or prefixed git in strings through run(), which uses execFileSync (no shell). These commands silently broke or produced wrong results.

Fix

  • Added shell() helper to git.ts — uses execSync with shell for commands that genuinely need pipes/redirects
  • Converted simple git commands to array args: run(['diff', '--name-only'])
  • Converted complex shell commands to shell(): pipes, redirects, ||, non-git commands (cat, find, wc, command -v, tsc, head)

Files changed

  • src/lib/git.ts — added exported shell() helper
  • verify-completion.ts, token-audit.ts, clarify-intent.ts, session-handoff.ts, audit-workspace.ts, enrich-agent-task.ts, sequence-tasks.ts, scope-work.ts, sharpen-followup.ts

Build clean, all 43 tests pass.

Covers LanceDB native binary failures, CLAUDE_PROJECT_DIR config,
vector search not returning results, MCP handshake debugging,
and performance tips. Links from README nav bar.
- examples/.preflight/config.yml: profile, related projects, thresholds, embeddings
- examples/.preflight/triage.yml: strictness, always_check/skip/cross-service keywords
- examples/.preflight/README.md: setup instructions and env var fallback reference
- README.md: link to examples from Configuration Reference section
Add shell() helper to git.ts for commands needing pipes/redirects/||.
Fix run() calls that passed shell syntax or prefixed 'git' in strings:

- verify-completion: tsc, build, cat → shell(); git diff → array args
- token-audit: git diff → array args; wc -l → shell()
- clarify-intent: tsc pipe, find pipe → shell()
- session-handoff: command -v, gh pr list → shell()
- audit-workspace: git diff → array args; find pipe → shell()
- enrich-agent-task: git ls-files pipes, head → shell()
- sequence-tasks: git ls-files pipe → shell()
- scope-work: run('git status/diff') → run([...]) (removed 'git' prefix)
- sharpen-followup: run() with shell redirects → run([...]) array args
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.

Widespread shell syntax in run() calls after execFileSync migration

1 participant