Repository navigation
refactor(ipc): import worktree, watcher and runtime-environment helpers from their owning modules - #30375
Conversation
…rs from their owning modules Removes the re-export lines in worktree-logic, worktree-base-directory-poller, filesystem-watcher and runtime-environment-transport-routing. Test mocks that supplied a re-exported name now mock the module that defines it, so they still reach the code under test.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to
|
ELI5
Four IPC modules were forwarding names that are defined in other files. Some tests mocked those names through the forwarding module. This PR imports each name from the file that defines it, moves those mocks to the same file, and removes the forwarding lines. Nothing the app does changes.
What Changed
ipc/worktree-logic.ts:computeBranchNameand related names, plusmergeWorktreeand the display-name helpersipc/worktree-base-directory-poller.ts:WORKTREE_BASE_BACKSTOP_TICKSipc/filesystem-watcher.ts: the local/remote removal helpers,registerFilesystemWatcherHandlersandcloseAllWatchersipc/runtime-environments/runtime-environment-transport-routing.ts:getRuntimeEnvironmentStatusipc,agent-hooks,skills,startup,runtimeand two top-levelsrc/mainmodules.worktree-branch-name,filesystem-watcher-handlersandruntime-environment-status-probe, across six tests.vi.mockcalls:runtime-environment-host-dispatch,runtime-environment-managed-host-disconnectandfolder-repo-git-upgrade-lifetime. The new marker-poller mock keeps the real module and overrides only the constant.Why
The user's rule is that no module re-exports another module's names. These four needed the mock moves, so they got their own PR instead of riding along with the mechanical one (#30369).
Three ipc modules are still pending, all for the same mock reason:
filesystem-auth, which also hasimport * asnamespace users in tests,markdown-documentsandpreflight.dashboard-payload-validationis skipped because open PRs #30145, #29953 and #28445 edit it.Linked Issue
N/A (SSH hardening round 2, de-barrel follow-up).
Visual Proof
N/A: an import-only refactor.
Testing
typecheck:ciis clean.src/main/ipc,agent-hooks,skills,startupandruntime/workspaces, plus every touched runtime and top-level module's tests and every changed test file, pass single-worker: 852 files, 8,091 tests.