Skip to content

refactor: group workspace creation and preparation owners - #37614

Merged
nwparker merged 3 commits into
mainfrom
module-layout-v2/m07-workspace-creation
Nov 3, 2026
Merged

nwparker merged 3 commits into
mainfrom
module-layout-v2/m07-workspace-creation

Conversation

@nwparker

@nwparker nwparker commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 96 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​328 $\color{#cf222e}{\Huge{\mathbf{−}}}$​162 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​166
Prod 79 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​255 $\color{#cf222e}{\Huge{\mathbf{−}}}$​252 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3

Workspace creation, checkout preparation and related IPC watch policies currently sit directly under src/main and src/main/ipc. Group 62 source/test files under workspaces/creation and ipc/worktrees/creation, updating 175 logical paths atomically. This reduces direct main-root files from 330 to 292.

Moved code imports defining owners directly. Remove the candidate/preparation forwarding exports, retarget consumers and preserve the existing graph/default-ref mock identities, including real WSL delegation. Share the existing IPC default-ref stub with its concrete owner so WSL prefetch fixtures retain their interception. Update the benchmark import, active reliability paths and existing current-command link while retaining the original historical command.

Validation: the original 69-file focused run passed 2,135 assertions (four skipped). The amended 29-file IPC run passed 251 assertions (one skipped), including the WSL prefetch failure reproduced locally and in CI on the previous head. Two independent exact-source and post-rebase preservation audits cover the moves; independent amendment audits cover the same-object IPC mock registrations. On the final head, pnpm check:changed --maxWorkers=2 --timeout=2 passed all 28 non-unit checks; broad related-test selection exceeded the declared two-minute limit. Its unit gate is not reported as green. Focused evidence remains applicable because the rebase preserves source/mocks exactly. CI must pass before merge.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

Worktree IPC watcher and workspace creation modules now use reorganized paths. Imports, test mocks, and configuration entries were updated to match. Some preparation-pool and candidate-module re-exports were removed. Test mock setup also changed to preserve original module exports while overriding selected functions.

Merge Risk: Minimal · up to 2ede5

No actionable issue remains from this review. Complete the normal CI checks before merging.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description clearly explains the refactor and reports validation results, but it does not follow the required template. It omits the required section headings and information for ELI5, What Change… Rewrite the description using the repository template. Add every required section, provide an actual linked issue after “Fixes #”, state N/A with a reason for Visual Proof if there is no UI or interaction change, document testing platform…
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary change: grouping workspace creation and preparation owners.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 50 files. (84 skipped: 4 unsupported, 80 over the file limit.)

Full details: Description check

Explanation

The description clearly explains the refactor and reports validation results, but it does not follow the required template. It omits the required section headings and information for ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Risk, AI Disclosure, Review, Notes, and Checklist. No actual issue link is provided.

Resolution

Rewrite the description using the repository template. Add every required section, provide an actual linked issue after “Fixes #”, state N/A with a reason for Visual Proof if there is no UI or interaction change, document testing platforms and commands, describe risks and rollback, complete the applicable checkboxes, and retain the current validation details.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

ast-grep (0.51.1)

ast-grep could not parse rule config: /ast-grep-rules/ast-grep-essentials/rules/cpp/security/dont-call-system-cpp.yml

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1dfe4e29-b886-4ab8-9718-a99257d05536
Commits

Reviewing files that changed from the base of the PR and between 7983d50 and 2ede5e5.

Files selected for processing: 148
  • config/flaky-test-pattern-baseline.txt
  • config/reliability-gates.jsonc
  • config/repo-host-read-baseline.txt
  • config/scripts/ci-shard-timings.json
  • config/scripts/worktree-base-pending-marker-benchmark.mjs
  • src/main/__mocks__/worktree-create-preparation.ts
  • src/main/ephemeral-vm/provisioned-root-source.ts
  • src/main/git/worktree-add-remote-branch-upstream-real-git.test.ts
  • src/main/git/worktree-create-git-executor-real-git.test.ts
  • src/main/git/worktree-create-preparation-real-git.test.ts
  • src/main/git/worktree-preparation-lock-real-git.test.ts
  • src/main/git/worktree-preparation-tip-refresh-real-git.test.ts
  • src/main/ipc/folder-repo-git-upgrade-lifetime.test.ts
  • src/main/ipc/folder-repo-git-upgrade.test.ts
  • src/main/ipc/folder-repo-git-upgrade.ts
  • src/main/ipc/git-status-upstream-ref-watch-request.test.ts
  • src/main/ipc/git-status-upstream-ref-watch-request.ts
  • src/main/ipc/repos-add-linked-worktree.test.ts
  • src/main/ipc/repos-create.test.ts
  • src/main/ipc/repos-execution-host-catalog.test.ts
  • src/main/ipc/repos-local-add-and-project-setup.test.ts
  • src/main/ipc/repos-local-clone-lifecycle.test.ts
  • src/main/ipc/repos-nested-import.test.ts
  • src/main/ipc/repos-nested-scan.test.ts
  • src/main/ipc/repos-remote-base-ref-queries.test.ts
  • src/main/ipc/repos/local-repo-registration.test.ts
  • src/main/ipc/repos/local-repo-registration.ts
  • src/main/ipc/repos/nested-repo-import-handler.ts
  • src/main/ipc/repos/project-host-setup-handlers.ts
  • src/main/ipc/repos/repo-catalog-handlers.ts
  • src/main/ipc/repos/repo-clone-lifecycle.ts
  • src/main/ipc/repos/repo-creation-handlers.ts
  • src/main/ipc/repos/repo-update-handler.ts
  • src/main/ipc/repos/repos-changed-notification.ts
  • src/main/ipc/settings-delayed-response.test.ts
  • src/main/ipc/settings.test.ts
  • src/main/ipc/settings.ts
  • src/main/ipc/worktree-git-common-narrow-watch.ts
  • src/main/ipc/worktree-git-common-polling.test.ts
  • src/main/ipc/worktree-git-common-polling.ts
  • src/main/ipc/worktree-git-common-primary-polling.ts
  • src/main/ipc/worktree-git-common-primary-watch.ts
  • src/main/ipc/worktree-git-common-root-lifetime.test.ts
  • src/main/ipc/worktree-git-common-snapshot-diff.ts
  • src/main/ipc/worktree-git-common-watch-reconciliation.test.ts
  • src/main/ipc/worktree-git-common-watch-reconciliation.ts
  • src/main/ipc/worktree-git-common-watch.test.ts
  • src/main/ipc/worktree-git-common-watch.ts
  • src/main/ipc/worktree-git-status-attribution-real-git.test.ts
  • src/main/ipc/worktree-git-status-ref-watch.ts
  • src/main/ipc/worktree-remote.ts
  • src/main/ipc/worktrees-create-event-timing.test.ts
  • src/main/ipc/worktrees-create-label-only-first-work.test.ts
  • src/main/ipc/worktrees/create/register-worktree-create-handlers.ts
  • src/main/ipc/worktrees/create/register-worktree-prefetch-handler.ts
  • src/main/ipc/worktrees/creation/worktree-base-directory-change-collector.ts
  • src/main/ipc/worktrees/creation/worktree-base-directory-event-filter.test.ts
  • src/main/ipc/worktrees/creation/worktree-base-directory-event-filter.ts
  • src/main/ipc/worktrees/creation/worktree-base-directory-marker-poller.ts
  • src/main/ipc/worktrees/creation/worktree-base-directory-notifications.test.ts
  • src/main/ipc/worktrees/creation/worktree-base-directory-notifications.ts
  • src/main/ipc/worktrees/creation/worktree-base-directory-poller-marker-fanout.test.ts
  • src/main/ipc/worktrees/creation/worktree-base-directory-poller.test.ts
  • src/main/ipc/worktrees/creation/worktree-base-directory-poller.ts
  • src/main/ipc/worktrees/creation/worktree-base-directory-watch-events.ts
  • src/main/ipc/worktrees/creation/worktree-base-directory-watch-targets.test.ts
  • src/main/ipc/worktrees/creation/worktree-base-directory-watch-targets.ts
  • src/main/ipc/worktrees/creation/worktree-base-directory-watcher.test.ts
  • src/main/ipc/worktrees/creation/worktree-base-directory-watcher.ts
  • src/main/ipc/worktrees/creation/worktree-create-lineage.test.ts
  • src/main/ipc/worktrees/creation/worktree-head-identity-cached-paths.test.ts
  • src/main/ipc/worktrees/creation/worktree-head-identity-cached-paths.ts
  • src/main/ipc/worktrees/creation/worktree-head-identity-reader-incremental.test.ts
  • src/main/ipc/worktrees/creation/worktree-head-identity-reader.test.ts
  • src/main/ipc/worktrees/creation/worktree-head-identity-reader.ts
  • src/main/ipc/worktrees/creation/worktree-head-identity-refresh.test.ts
  • src/main/ipc/worktrees/creation/worktree-head-identity-refresh.ts
  • src/main/ipc/worktrees/creation/worktree-head-identity-retirement.test.ts
  • src/main/ipc/worktrees/creation/worktree-head-identity-scope.ts
  • src/main/ipc/worktrees/listing/detected-provider-listing.ts
  • src/main/repo-maintenance-idle-gate.ts
  • src/main/runtime/external-worktree-paired-client-discovery.integration.test.ts
  • src/main/runtime/managed-worktree-create-telemetry.test.ts
  • src/main/runtime/orca-runtime-create-base-prefetch.test.ts
  • src/main/runtime/orca-runtime-test-mocks/setup.spec.ts
  • src/main/runtime/rpc/repo-add-cli.integration.test.ts
  • src/main/runtime/runtime-branch-reuse-real-git.test.ts
  • src/main/runtime/runtime-created-worktree-terminal-target.test.ts
  • src/main/runtime/runtime-local-git-worktree-create.ts
  • src/main/runtime/runtime-local-worktree-create-base.ts
  • src/main/runtime/runtime-local-worktree-create-candidate.ts
  • src/main/runtime/runtime-local-worktree-create-pr-conflict.test.ts
  • src/main/runtime/runtime-local-worktree-create-pr-conflicts.test.ts
  • src/main/runtime/runtime-local-worktree-create-test-harness.ts
  • src/main/runtime/runtime-local-worktree-create.test.ts
  • src/main/runtime/runtime-local-worktree-create.ts
  • src/main/runtime/runtime-local-worktree-materialization.ts
  • src/main/runtime/runtime-project-host-setup-controller.ts
  • src/main/runtime/runtime-repository-clone-controller.ts
  • src/main/runtime/runtime-repository-clone-host-dedupe.test.ts
  • src/main/runtime/runtime-repository-registration-controller.test.ts
  • src/main/runtime/runtime-repository-registration-controller.ts
  • src/main/runtime/runtime-repository-registration-host-dedupe.test.ts
  • src/main/runtime/runtime-repository-settings-controller.ts
  • src/main/runtime/workspaces/startup/workspace-terminal-provisioning.ts
  • src/main/runtime/workspaces/workspace-catalog.ts
  • src/main/runtime/workspaces/workspace-creation.ts
  • src/main/startup/main-process-quit.ts
  • src/main/window/attach-main-window-services.test.ts
  • src/main/window/attach-main-window-services.ts
  • src/main/workspaces/creation/preparation/worktree-create-preparation-activity.ts
  • src/main/workspaces/creation/preparation/worktree-create-preparation-burst.ts
  • src/main/workspaces/creation/preparation/worktree-create-preparation-cancellation.test.ts
  • src/main/workspaces/creation/preparation/worktree-create-preparation-claim-registry.ts
  • src/main/workspaces/creation/preparation/worktree-create-preparation-claim.test.ts
  • src/main/workspaces/creation/preparation/worktree-create-preparation-claim.ts
  • src/main/workspaces/creation/preparation/worktree-create-preparation-contention.test.ts
  • src/main/workspaces/creation/preparation/worktree-create-preparation-pool.ts
  • src/main/workspaces/creation/preparation/worktree-create-preparation-reservation.ts
  • src/main/workspaces/creation/preparation/worktree-create-preparation-stale-cleanup.test.ts
  • src/main/workspaces/creation/preparation/worktree-create-preparation-stale-cleanup.ts
  • src/main/workspaces/creation/preparation/worktree-create-preparation-timing.test.ts
  • src/main/workspaces/creation/preparation/worktree-create-preparation-wsl-root.test.ts
  • src/main/workspaces/creation/preparation/worktree-create-preparation.test.ts
  • src/main/workspaces/creation/preparation/worktree-create-preparation.ts
  • src/main/workspaces/creation/preparation/worktree-preparation-discard-retry.test.ts
  • src/main/workspaces/creation/preparation/worktree-preparation-discard-retry.ts
  • src/main/workspaces/creation/preparation/worktree-preparation-fetch-barrier.test.ts
  • src/main/workspaces/creation/preparation/worktree-preparation-refresh-queue.ts
  • src/main/workspaces/creation/preparation/worktree-preparation-tip-refresh.test.ts
  • src/main/workspaces/creation/workspace-create-event-fields.test.ts
  • src/main/workspaces/creation/workspace-create-event-fields.ts
  • src/main/workspaces/creation/workspace-create-telemetry.ts
  • src/main/workspaces/creation/worktree-create-base-prefetch.test.ts
  • src/main/workspaces/creation/worktree-create-base-prefetch.ts
  • src/main/workspaces/creation/worktree-create-base.test.ts
  • src/main/workspaces/creation/worktree-create-base.ts
  • src/main/workspaces/creation/worktree-create-candidates.test.ts
  • src/main/workspaces/creation/worktree-create-candidates.ts
  • src/main/workspaces/creation/worktree-create-concurrency.ts
  • src/main/workspaces/creation/worktree-create-execution-host-route.ts
  • src/main/workspaces/creation/worktree-create-first-work-test-harness.ts
  • src/main/workspaces/creation/worktree-create-in-flight.test.ts
  • src/main/workspaces/creation/worktree-create-in-flight.ts
  • src/main/workspaces/creation/worktree-create-timing.test.ts
  • src/main/workspaces/creation/worktree-create-timing.ts
  • src/main/workspaces/creation/worktree-root-preparation.test.ts
  • src/main/workspaces/creation/worktree-root-preparation.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.

@nwparker
nwparker merged commit aaf4a5d into main Nov 3, 2026
58 of 59 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