Skip to content

fix: remove shell syntax from run() in checkpoint, sharpen-followup, sequence-tasks, session-handoff (#302)#306

Open
TerminalGravity wants to merge 1 commit intomainfrom
fix/shell-syntax-302-four-tools
Open

fix: remove shell syntax from run() in checkpoint, sharpen-followup, sequence-tasks, session-handoff (#302)#306
TerminalGravity wants to merge 1 commit intomainfrom
fix/shell-syntax-302-four-tools

Conversation

@TerminalGravity
Copy link
Collaborator

Fixes 4 more tools affected by #302 (shell syntax passed to run() which uses execFileSync without a shell).

Changes:

  • checkpoint.ts: Replaced shell-chained git add && git commit with separate run() array calls; inlined staging logic instead of building a shell command string
  • sharpen-followup.ts: Converted 4 run() calls from shell strings with 2>/dev/null to proper arrays
  • sequence-tasks.ts: Replaced git ls-files 2>/dev/null | head -1000 with array args + JS .slice(0, 1000)
  • session-handoff.ts: Replaced command -v (shell builtin) with which via execFileSync; replaced gh pr list ... 2>/dev/null || echo '[]' with direct execFileSync + try/catch

All changes compile clean (tsc --noEmit passes).

Convert shell strings to proper array args for execFileSync:
- checkpoint.ts: inline staging logic, use array args for add/commit/reset
- sharpen-followup.ts: convert diff commands to arrays, remove 2>/dev/null
- sequence-tasks.ts: replace piped git ls-files|head with array + slice
- session-handoff.ts: replace command -v with which, gh pr list with execFileSync
Copy link
Collaborator Author

@TerminalGravity TerminalGravity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — this looks solid. The checkpoint refactor replacing shell-chained addCmd && git commit with separate run() calls is cleaner. The hasCommand switch to which via execFileSync is correct since command -v is a shell builtin. The head -1000 → JS .slice(0, 1000) in sequence-tasks is a nice touch.

One thing to double-check: in checkpoint.ts the error detection changed from commit failed to command failed — make sure run() actually returns that prefix on failure, otherwise the rollback path won't trigger and you'll silently swallow commit errors.

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