You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
improve(run): add unit tests for exported utility functions #317
src/commands/run.ts is the core workflow execution engine (3,459 lines) with many exported utility functions that have minimal test coverage. Add focused unit tests for the testable utility functions.
Current State
run.test.ts exists but has limited meaningful coverage. The following exported functions lack tests:
parseQaVerdict() — parses QA verdict strings into structured results
listWorktrees() — lists git worktrees with metadata
getWorktreeChangedFiles() — detects changed files in a worktree
detectPhasesFromLabels() — maps issue labels to workflow phases
parseRecommendedWorkflow() — parses workflow recommendations from issue comments
determinePhasesForIssue() — determines which phases to run for an issue
These are critical path functions with complex branching logic.
Proposed Change
Expand src/commands/run.test.ts (or create focused test files) with unit tests for each exported utility function. Focus on:
Happy path and edge cases
Error conditions and fallback behavior
Various input formats (especially for parsing functions)
Acceptance Criteria
parseQaVerdict tested with pass/fail/partial verdicts and malformed input
detectPhasesFromLabels tested with various label combinations
parseRecommendedWorkflow tested with various workflow formats
Worktree utility functions tested (may need git mocking)
Added 5 tests for filterResumedPhases (resume=true/false, all-completed, none-completed, immutability)
Coverage
Most functions listed in the issue already had tests. The remaining gaps (getWorktreeDiffStats, determinePhasesForIssue, filterResumedPhases) are now covered.
Activity
admarble commentedon Mar 10, 2026
Spec Plan — #317
Current Coverage Analysis
Most functions listed in this issue already have test coverage in
run.test.ts:parseQaVerdictlistWorktreesgetWorktreeChangedFilesdetectPhasesFromLabelsparseRecommendedWorkflowdeterminePhasesForIssueRemaining Gaps (Exported Functions Without Tests)
getWorktreeDiffStatsspawnSyncfilterResumedPhasesgetResumablePhasesForIssuedeterminePhasesForIssueImplementation Plan
determinePhasesForIssueso it can be unit testedgetWorktreeDiffStats(parsing git diff stat output)filterResumedPhases(resume logic)determinePhasesForIssue(phase determination with options)AC Coverage
getWorktreeDiffStatstestsRecommended Workflow
Phases: exec → qa
Quality Loop: disabled
Reasoning: Test-only issue, most work already done, small remaining gap
test(#317): add unit tests for getWorktreeDiffStats and determinePhas…
test(#317): add filterResumedPhases unit tests
admarble commentedon Mar 11, 2026
/fullsolve Complete
Issue: #317
Status: READY_FOR_MERGE
Summary
Changes Made
determinePhasesForIssuefor testability (+1 line inrun.ts)getWorktreeDiffStats(parsing git diff stat output, error handling)determinePhasesForIssue(testgen insertion, UI label handling, immutability)filterResumedPhases(resume=true/false, all-completed, none-completed, immutability)Coverage
Most functions listed in the issue already had tests. The remaining gaps (
getWorktreeDiffStats,determinePhasesForIssue,filterResumedPhases) are now covered.PR: #346
test(#317): add unit tests for exported utility functions (#346)