Skip to content

refactor(executor): move the executor out of internal/cmd into its own package - #20

Merged
mbalazy merged 4 commits into
mainfrom
refactor/move-executor-package
Oct 10, 2026
Merged

mbalazy merged 4 commits into
mainfrom
refactor/move-executor-package

Conversation

@mbalazy

@mbalazy mbalazy commented Oct 10, 2026

Copy link
Copy Markdown
Owner

Stacked on #19.

internal/cmd held the CLI and the executor together, and most of its lines were the executor. The executor's files and their tests now live in internal/executor. That covers pm work, pm run-epic, pm finish, pm executor ..., the pm worker-guard hook and the review policy. internal/cmd/root.go registers the five exported constructors (NewWorkCmd, NewRunEpicCmd, NewFinishCmd, NewExecutorCmd, NewWorkerGuardCmd).

  • git diff -M shows 64 renames. In the moved production code the only changes are the package clause and the five constructor names.
  • Two tests that exercise the root rather than the executor move out of the moved test files and stay in internal/cmd (root_test.go, context_test.go). internal/cmd/helpers_test.go holds the test helpers internal/cmd's own tests still need.
  • Only cmd/pm imports internal/cmd, and internal/executor imports storage plus the leaf packages from refactor: move the helpers the CLI and the executor share out of internal/cmd #19.
  • The contract tests from test(cli): pin the executor commands' exit codes and command tree #18 pass unchanged.
  • CLAUDE.md and the current docs point at the new paths. docs/design-log.md keeps the old ones, because it records what was true then.

…n package

pm work, pm run-epic, pm finish, the worker guard, the review policy and
the pm executor commands - 26 files and their 38 test files - move with
git mv to internal/executor. The package clause changes, and the five
command constructors root.go registers are exported (NewWorkCmd,
NewRunEpicCmd, NewFinishCmd, NewExecutorCmd, NewWorkerGuardCmd); nothing
else is exported and no logic changes. internal/executor imports only
storage and the leaf helper packages, never internal/cmd.

Tests: cmd keeps its own copies of the small store/stdout helpers it
used from the executor's test files (helpers_test.go); the root
registration check and the `pm context` case of the unreadable
project.yaml test stay in cmd, where those commands live.
@mbalazy
mbalazy changed the base branch from refactor/extract-cli-shared-helpers to main October 10, 2026 16:47
@mbalazy
mbalazy merged commit e712011 into main Oct 10, 2026
2 checks passed
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