Epic 1: Core Operations Refactoring — Issue 1/4
Source: 1-agent worktree (wt-a6gki1)
Description
Move merge orchestration (state transitions, git merge, cleanup) from commands/merge.ts into core/operations/merge.ts. The CLI command becomes a thin wrapper that parses args and calls the core operation.
Acceptance Criteria
Context
This is the single most important architectural contribution from the worktree review. The 1-agent worktree demonstrated that extracting shared business logic from CLI commands into core/operations/ enables both CLI and REST API to reuse the same orchestration without duplication.
Files to Create/Modify
src/core/operations/merge.ts (new)
src/core/operations/merge.test.ts (new)
src/commands/merge.ts (simplify)
Epic 1: Core Operations Refactoring — Issue 1/4
Source: 1-agent worktree (wt-a6gki1)
Description
Move merge orchestration (state transitions, git merge, cleanup) from
commands/merge.tsintocore/operations/merge.ts. The CLI command becomes a thin wrapper that parses args and calls the core operation.Acceptance Criteria
core/operations/merge.tsexports aperformMerge()function with typed optionsactive → merging → merged → cleaned--squashand--no-ffmerge strategiescommands/merge.tssimplified to arg parsing + callingperformMerge()Context
This is the single most important architectural contribution from the worktree review. The 1-agent worktree demonstrated that extracting shared business logic from CLI commands into
core/operations/enables both CLI and REST API to reuse the same orchestration without duplication.Files to Create/Modify
src/core/operations/merge.ts(new)src/core/operations/merge.test.ts(new)src/commands/merge.ts(simplify)