Skip to content

refactor(worktree): delete positional allocation adapters - #1278

Merged
chubes4 merged 1 commit into
mainfrom
refactor/1243-worktree-lifecycle-services
Aug 28, 2026
Merged

refactor(worktree): delete positional allocation adapters#1278
chubes4 merged 1 commit into
mainfrom
refactor/1243-worktree-lifecycle-services

Conversation

@chubes4

@chubes4 chubes4 commented Aug 28, 2026

Copy link
Copy Markdown
Member

Refs #1243 — next slice after #1272. Does not close the issue.

What this is

PR #1272 merged the first bounded operations. Issue #1243 is still open because the trait aggregate, CLI, and abilities remain. This slice removes the leftover positional allocation API and makes the operation depend on an explicit lifecycle contract.

Changes

  • New WorktreeLifecycle interface: worktree_plan_request, worktree_add_request, show_repo.
  • Workspace implements that contract.
  • WorktreeAllocationOperation takes WorktreeLifecycle in the constructor. It no longer does new Workspace() internally.
  • Ability adapters pass the lifecycle in: new WorktreeAllocationOperation(new Workspace()).
  • Deleted positional worktree_plan() / worktree_add() wrappers from WorkspaceWorktreeLifecycle.
  • Tests call the typed request. Architecture tests forbid restoring the positional adapters and forbid the operation constructing Workspace itself.

Still not done (#1243)

  • Workspace is still 15 traits.
  • WorkspaceWorktreeLifecycle is still a 6.7k-line trait, not a standalone service.
  • WorkspaceAbilities / WorkspaceCommand still new Workspace() for everything except plan/add.
  • Repository lifecycle, inventory, locking, operation-declared metadata, bootstrap special-cases — untouched.

Verification

Command Result
bin/dmc-test tests/workspace-operation-architecture.php tests/worktree-allocation-request.php tests/workspace-cleanup-drainability-repair.php 3 passed
bin/dmc-test tests/worktree-add-lifecycle.php tests/workspace-lock-sqlite-contention.php 2 passed
php -l on changed PHP clean

AI assistance disclosure

Claude Fable 5 via OpenCode (Claude Code CLI) implemented this slice, migrated the tests off the positional adapters, and published this PR. Chris Huber directed continuing #1243 after #1272 merged.

Allocation now depends on an explicit WorktreeLifecycle contract instead
of constructing Workspace internally. Positional worktree_plan/worktree_add
wrappers are gone; tests and adapters use the typed request.
@chubes4
chubes4 marked this pull request as ready for review August 28, 2026 02:24
@chubes4
chubes4 merged commit 2359fe6 into main Aug 28, 2026
11 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