refactor(worktree): delete positional allocation adapters - #1278
Merged
Conversation
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
marked this pull request as ready for review
August 28, 2026 02:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
WorktreeLifecycleinterface:worktree_plan_request,worktree_add_request,show_repo.Workspaceimplements that contract.WorktreeAllocationOperationtakesWorktreeLifecyclein the constructor. It no longer doesnew Workspace()internally.new WorktreeAllocationOperation(new Workspace()).worktree_plan()/worktree_add()wrappers fromWorkspaceWorktreeLifecycle.Workspaceitself.Still not done (#1243)
Workspaceis still 15 traits.WorkspaceWorktreeLifecycleis still a 6.7k-line trait, not a standalone service.WorkspaceAbilities/WorkspaceCommandstillnew Workspace()for everything except plan/add.Verification
bin/dmc-test tests/workspace-operation-architecture.php tests/worktree-allocation-request.php tests/workspace-cleanup-drainability-repair.phpbin/dmc-test tests/worktree-add-lifecycle.php tests/workspace-lock-sqlite-contention.phpphp -lon changed PHPAI 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.