IW-238: Add deterministic phase lifecycle commands #243

Merged
mprihoda merged 10 commits from IW-238 into main 2026-03-09 20:43:46 +00:00
mprihoda commented 2026-03-09 19:05:51 +00:00 (Migrated from github.com)

Summary

  • Adds four new iw commands (phase-start, phase-commit, phase-pr, phase-advance) that encapsulate the complete phase lifecycle into single CLI calls
  • Replaces ~20 manual git/gh commands that LLM agents had to assemble for each implementation phase
  • Follows FCIS architecture: pure domain logic in model/, I/O in adapters/, orchestration in commands/

Changes

Domain Layer (model/)

  • PhaseBranch - sub-branch name derivation
  • CommitMessage - structured commit message construction
  • PhaseTaskFile - markdown parsing/rewriting for phase task files
  • PhaseOutput - typed JSON output structures
  • ForgeType - GitHub/GitLab detection from remote URL
  • PhaseArgs - CLI argument parsing and issue ID resolution
  • FileUrlBuilder - browseable file URLs for PR bodies

Infrastructure Layer (adapters/)

  • Extended GitAdapter with branch creation, staging, committing, pushing
  • Extended GitHubClient with PR creation
  • Extended GitLabClient with MR creation
  • New ReviewStateAdapter for shared review-state operations

Presentation Layer (commands/)

  • phase-start.scala - create phase sub-branch and initialize
  • phase-commit.scala - stage, commit, and update phase tasks
  • phase-pr.scala - push and create PR/MR with optional batch merge
  • phase-advance.scala - sync feature branch after PR merge

Testing

  • Unit tests for all domain model types
  • Unit tests for adapter extensions (GitTest, GitHubClientTest, GitLabClientTest)
  • Unit tests for ReviewStateAdapter
  • E2E BATS tests for all four commands

Test plan

  • All unit tests pass (./iw test unit)
  • All E2E tests pass (./iw test e2e)
  • Pre-push hooks pass (compilation + tests)
  • Manual verification of commands in a real workflow

Release Notes

See project-management/issues/IW-238/release-notes.md (Czech)

🤖 Generated with Claude Code

## Summary - Adds four new `iw` commands (`phase-start`, `phase-commit`, `phase-pr`, `phase-advance`) that encapsulate the complete phase lifecycle into single CLI calls - Replaces ~20 manual git/gh commands that LLM agents had to assemble for each implementation phase - Follows FCIS architecture: pure domain logic in `model/`, I/O in `adapters/`, orchestration in `commands/` ## Changes ### Domain Layer (model/) - `PhaseBranch` - sub-branch name derivation - `CommitMessage` - structured commit message construction - `PhaseTaskFile` - markdown parsing/rewriting for phase task files - `PhaseOutput` - typed JSON output structures - `ForgeType` - GitHub/GitLab detection from remote URL - `PhaseArgs` - CLI argument parsing and issue ID resolution - `FileUrlBuilder` - browseable file URLs for PR bodies ### Infrastructure Layer (adapters/) - Extended `GitAdapter` with branch creation, staging, committing, pushing - Extended `GitHubClient` with PR creation - Extended `GitLabClient` with MR creation - New `ReviewStateAdapter` for shared review-state operations ### Presentation Layer (commands/) - `phase-start.scala` - create phase sub-branch and initialize - `phase-commit.scala` - stage, commit, and update phase tasks - `phase-pr.scala` - push and create PR/MR with optional batch merge - `phase-advance.scala` - sync feature branch after PR merge ### Testing - Unit tests for all domain model types - Unit tests for adapter extensions (GitTest, GitHubClientTest, GitLabClientTest) - Unit tests for ReviewStateAdapter - E2E BATS tests for all four commands ## Test plan - [x] All unit tests pass (`./iw test unit`) - [x] All E2E tests pass (`./iw test e2e`) - [x] Pre-push hooks pass (compilation + tests) - [ ] Manual verification of commands in a real workflow ## Release Notes See `project-management/issues/IW-238/release-notes.md` (Czech) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No description provided.