Skip to content

refactor(#402): simplify run command execution path and parameter passing - #475

Merged
admarble merged 6 commits into
mainfrom
feature/402-simplify-run-command-execution-path-and-parameter-
Mar 27, 2026
Merged

admarble merged 6 commits into
mainfrom
feature/402-simplify-run-command-execution-path-and-parameter-

Conversation

@admarble

Copy link
Copy Markdown
Contributor

Summary

  • Replace 15 positional parameters in runIssueWithLogging with a structured IssueExecutionContext object, eliminating fragile call sites
  • Extract executeOneIssue() helper to unify duplicated log bookkeeping (startIssue/completeIssue/setPRInfo) across sequential and parallel loops
  • Add typed normalizeCommanderOptions() function to replace as any cast for Commander.js --no-X flag handling
  • Move RunOptions and ProgressCallback types to types.ts for shared use; re-export from batch-executor.ts for backwards compatibility

AC Coverage

AC Description Status
AC-1 Single execution helper replaces duplicated sequential/default loops ✅ executeOneIssue()
AC-2 Context object instead of 14 positional params ✅ IssueExecutionContext
AC-3 All 3 call sites construct context objects ✅ sequential, parallel, batch
AC-4 Typed normalizeCommanderOptions() replaces as any ✅ With CommanderRawOptions interface
AC-5 No behavioral change, all tests pass ✅ 2342/2342 passed
AC-6 ~60 line reduction in runCommand ✅
AC-7 onProgress in context type ✅
AC-8 Unit tests for normalizeCommanderOptions ✅ 8 tests covering all 6 flags

Test plan

  • npm run build passes
  • npm run lint passes
  • npm test — 2342 passed (1 pre-existing timeout flake in state-utils)
  • All existing batch-executor tests updated to context-based API
  • New normalizeCommanderOptions tests added

Closes #402

🤖 Generated with Claude Code

…sing

- Add IssueExecutionContext type to replace 15 positional params in
  runIssueWithLogging (AC-2)
- Move RunOptions and ProgressCallback to types.ts for shared use
- Add normalizeCommanderOptions() to replace `as any` cast for
  Commander.js --no-X flag handling (AC-4)
- Extract executeOneIssue() helper to unify duplicated log
  bookkeeping in sequential and parallel loops (AC-1)
- Update all 3 call sites (sequential, parallel, batch) to construct
  context objects (AC-3)
- Update all existing tests to use context-based API
- Add unit tests for normalizeCommanderOptions covering all 6 flag
  mappings (AC-8)
- No behavioral change — all existing tests pass (AC-5)
- Net ~60 line reduction in runCommand function body (AC-6)
…sing

- Add IssueExecutionContext type to replace 15 positional params in
  runIssueWithLogging (AC-2)
- Move RunOptions and ProgressCallback to types.ts for shared use
- Add normalizeCommanderOptions() to replace `as any` cast for
  Commander.js --no-X flag handling (AC-4)
- Extract executeOneIssue() helper to unify duplicated log
  bookkeeping in sequential and parallel loops (AC-1)
- Update all 3 call sites (sequential, parallel, batch) to construct
  context objects (AC-3)
- Update all existing tests to use context-based API
- Add unit tests for normalizeCommanderOptions covering all 6 flag
  mappings (AC-8)
- No behavioral change — all existing tests pass (AC-5)
- Net ~60 line reduction in runCommand function body (AC-6)
…Issue

Replace 11 positional params in executeBatch and redundant field listing
in executeOneIssue with a shared BatchExecutionContext object (#402).
…ameter-' of https://github.com/sequant-io/sequant into feature/402-simplify-run-command-execution-path-and-parameter-

# Conflicts:
#	src/commands/run.ts
#	src/lib/workflow/batch-executor.ts
#	src/lib/workflow/types.ts
Remove LogWriter, StateManager, ProgressCallback, ShutdownManager, and
WorktreeInfo imports that were left behind during #402 refactor.
@admarble
admarble merged commit 8983197 into main Mar 27, 2026
5 checks passed
@admarble
admarble deleted the feature/402-simplify-run-command-execution-path-and-parameter- branch April 6, 2026 21:49
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.

Simplify run command execution path and parameter passing

1 participant