Skip to content

fix: replace broken run() calls with shell() or array args across 9 tools - #219

Closed
TerminalGravity wants to merge 2 commits into
fix/token-audit-shell-commandsfrom
fix/run-misuse-remaining
Closed

fix: replace broken run() calls with shell() or array args across 9 tools#219
TerminalGravity wants to merge 2 commits into
fix/token-audit-shell-commandsfrom
fix/run-misuse-remaining

Conversation

@TerminalGravity

Copy link
Copy Markdown
Collaborator

Fixes the remaining run() misuse tracked in #215. Builds on the shell() helper from #214.

Problem

run() uses execFileSync('git', args) — no shell, always prepends git. 9 tools were passing shell strings with pipes, redirects, or non-git commands, causing silent failures.

Changes (9 files)

  • verify-completion: cat package.jsonreadFileSync, tsc/test/build commands → shell(), git diff → array args
  • clarify-intent: tsc + find commands → shell()
  • session-handoff: command -v + gh pr listshell()
  • audit-workspace: git diff → array args, find → shell()
  • sharpen-followup: git diff/status → array args
  • enrich-agent-task: git ls-files | grepshell(), head -30readFileSync + slice
  • sequence-tasks: git ls-files | headshell()
  • checkpoint: git add → array args, compound && command → shell(), git reset → array args
  • scope-work: git status/diff → array args, git ls-files | grepshell()

Testing

Closes #215

* add .preflight/ example config directory with commented starter files

- examples/.preflight/config.yml — profile, related projects, thresholds, embeddings
- examples/.preflight/triage.yml — keyword rules and strictness tuning
- examples/.preflight/contracts/api.yml — manual cross-service contract definitions
- examples/README.md — quick setup instructions
- README.md — link to examples from config reference section

* docs: add troubleshooting section with common setup issues

* fix: add preflight-dev-serve bin so npm users can actually start the MCP server

The 'preflight-dev' bin runs the init wizard, not the server. Users following
the npm install path had no way to launch the actual MCP server without
pointing into node_modules (which the init script was doing incorrectly,
referencing 'preflight' instead of 'preflight-dev').

- Add bin/serve.js as 'preflight-dev-serve' entry point
- Fix init CLI to generate correct .mcp.json using preflight-dev-serve
- Update README quickstart to use npx -y preflight-dev-serve

* docs: add concrete usage examples for 6 common workflows
@TerminalGravity

Copy link
Copy Markdown
Collaborator Author

Superseded by #220. Recommend closing.

…d, session-health

- token-audit: use run() with array args for git commands, Node fs APIs
  for line/byte counting instead of shell wc, shell() for tail
- what-changed: use run() with array args + fallback logic
- session-health: use getDiffStat() instead of shell pipe
- git.ts: add shell() helper for commands needing pipes/redirects

Closes #215
@TerminalGravity

Copy link
Copy Markdown
Collaborator Author

Closing — superseded by #220 which covers the same fixes with a cleaner approach. #225 handles the remaining stragglers.

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.

1 participant