Skip to content

fix: replace shell syntax in run() calls across 4 tools#198

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

fix: replace shell syntax in run() calls across 4 tools#198
TerminalGravity wants to merge 4 commits intomainfrom
fix/172-shell-syntax-remaining

Conversation

@TerminalGravity
Copy link
Collaborator

Closes #172

Fixes the remaining broken shell syntax in run() calls across 4 tools:

  • verify-completion: Added shell() helper for non-git commands (tsc, test runners, build). Read package.json via fs instead of cat. Tail filtering done in JS.
  • audit-workspace: Array-arg run() for git commands. Replaced find | wc -l with recursive fs directory walk.
  • scope-work: Array-arg run() for git commands. Replaced git ls-files | head | grep with JS filtering.
  • enrich-agent-task: Array-arg run() for git commands. Read files via fs. Filter in JS.

Removed unused shellEscape functions from scope-work and enrich-agent-task.

Build clean, all 43 tests pass.

…lates

The README documents .preflight/ config extensively but there were no
actual example files to copy. Adds:
- examples/.preflight/config.yml — profile, related projects, thresholds
- examples/.preflight/triage.yml — keyword rules and strictness
- examples/.preflight/contracts/api.yml — manual contract definitions
- examples/.preflight/README.md — setup instructions and tips
- README.md pointer to the examples directory
Part of #172. Fixes 4 broken patterns in token-audit.ts:
- run('git diff ... 2>/dev/null') → run(['diff', ...]) (array args)
- run('wc -l < file') → countLines() using fs.readFileSync
- run('wc -c < file') → fileSize() using fs.statSync
- run('tail -c N file') → readTail() using fs.openSync/readSync

These shell operators were passed as literal git args since run()
uses execFileSync without a shell.
…yntax in run() calls

- session-handoff: hasCommand() uses 'which' instead of 'command -v' via git;
  gh pr list uses execFileSync directly instead of run()
- sharpen-followup: diff commands use array args; status uses array args
- sequence-tasks: ls-files uses array args, pipe to head replaced with JS slice

Part of #172.
Fix broken shell pipes/redirects passed to git.run() (which uses
execFileSync without a shell) in:

- verify-completion: use new shell() helper for tsc/test/build commands,
  read package.json via fs instead of cat, do tail in JS
- audit-workspace: use array-arg run(), replace find|wc -l with fs walk
- scope-work: use array-arg run(), do grep/head filtering in JS
- enrich-agent-task: use array-arg run(), read files via fs, filter in JS

Also removes now-unused shellEscape functions from scope-work and
enrich-agent-task.
@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