Skip to content

fix: shell syntax bugs in what-changed, checkpoint, session-health#109

Closed
TerminalGravity wants to merge 1 commit intomainfrom
fix/shell-syntax-in-run
Closed

fix: shell syntax bugs in what-changed, checkpoint, session-health#109
TerminalGravity wants to merge 1 commit intomainfrom
fix/shell-syntax-in-run

Conversation

@TerminalGravity
Copy link
Collaborator

Bug

run() was refactored to use execFileSync (no shell), but several tool files still pass shell syntax (||, &&, |, 2>/dev/null) and prefix git in command strings. This causes these tools to silently fail — execFileSync passes shell operators as literal git arguments.

Fixed in this PR

  • what-changed.ts: Replaced shell || fallbacks with JS conditional logic using array args
  • checkpoint.ts: Split compound && commands into separate run() calls with array args
  • session-health.ts: Replaced git diff --stat | tail -1 with array args + JS .split().pop()

Still affected (see #17)

~8 more tool files have the same issue: verify-completion, token-audit, clarify-intent, session-handoff, audit-workspace, enrich-agent-task, scope-work, sequence-tasks.

All tests pass, clean build.

run() uses execFileSync (no shell), but what-changed, checkpoint, and
session-health were passing shell operators (||, &&, |, 2>/dev/null)
and prefixing 'git' in command strings. This caused silent failures
since execFileSync passes these as literal git arguments.

Fixes:
- what-changed: use array args with JS fallback logic
- checkpoint: use array args, separate add/commit calls
- session-health: use array args, JS string split instead of pipe
@TerminalGravity
Copy link
Collaborator Author

Closing — superseded by #116 which covers all files with the cleaner three-tier approach.

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