fix: use shellRun for non-git shell commands#35
Closed
TerminalGravity wants to merge 3 commits intomainfrom
Closed
fix: use shellRun for non-git shell commands#35TerminalGravity wants to merge 3 commits intomainfrom
TerminalGravity wants to merge 3 commits intomainfrom
Conversation
… and contracts The README references .preflight/ config extensively but there were no concrete example files to copy. This adds a ready-to-use examples/.preflight/ directory with annotated config.yml, triage.yml, and contracts/api.yml, plus a README explaining how to use them.
Created examples/USAGE_EXAMPLES.md with 8 real-world scenarios showing what each tool looks like in practice: preflight_check catching vague prompts, scope_work creating execution plans, enrich_agent_task for sub-agents, sharpen_followup resolving ambiguity, session health checks, semantic history search, weekly scorecards, and prompt grading. Added link to usage examples in README nav bar.
clarify-intent and audit-workspace were passing shell pipelines to
run(), which calls execFileSync('git', args). This means commands like
'pnpm tsc --noEmit 2>&1 | grep -c error' were actually running as
'git pnpm tsc --noEmit ...' — always failing silently.
Added shellRun() to git.ts for commands that need a shell (pipes,
redirects, non-git binaries). Fixed 3 call sites:
- clarify-intent: type error detection, test file discovery
- audit-workspace: test file counting
Also removed dead gitCmd() function.
TerminalGravity
commented
Feb 28, 2026
Collaborator
Author
TerminalGravity
left a comment
There was a problem hiding this comment.
Nice catch. run() shells out via execFileSync('git', ...) so piping find | wc through it was silently breaking. The shellRun helper is clean — good error handling with the timeout detection and fallback stderr output. One minor thought: might be worth exporting a shellRunSafe variant that returns {ok, stdout, stderr} instead of flattening errors into the return string, since callers like parseInt(shellRun(...)) could accidentally parse an error message. Not blocking though — this is solid as-is.
Collaborator
Author
|
Superseded by newer PRs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
clarify_intentandaudit_workspacewere passing shell pipelines torun(), which callsexecFileSync('git', args). This means:run("pnpm tsc --noEmit 2>&1 | grep -c 'error TS'")→ actually runsgit pnpm tsc --noEmit 2>&1 | grep ...run("find tests -name '*.spec.ts' ...")→ actually runsgit find tests ...These always failed silently, so type error detection and test file discovery in
clarify_intentwere completely broken, and test file counting inaudit_workspacealways returned 0.Fix
shellRun()export togit.ts— usesexecSync(with shell) for non-git commands that need pipes/redirectsshellRun()instead ofrun()gitCmd()functionTesting
tsc --noEmitpasses