FE-1110: Consolidate executor sandbox port internals#276
Conversation
PR SummaryLow Risk Overview Shared subprocess runner: New Narrower test port contract: Shared test doubles: Also removes obsolete Reviewed by Cursor Bugbot for commit a3edf51. Bugbot is set up for automated code reviews on this repo. Configure here. |
The test runner runs inside the worktree, so the repo-root cwd was dead weight carried only for shape-symmetry with GitWorktreeCreateArgs. Remove it from the port arg type, the executor call site, and the port tests. Pure interface tidy; no behavior change. (REFACTOR.md commit 1/3)
Both execution ports duplicated the same spawn-based subprocess runner. Extract it into a single command-runner module (spawn wrapper + CommandResult carrying an explicit spawnError signal); the git-worktree and test-runner ports now keep only their command/args and result mapping. Behavior preserved: the git port still surfaces its spawn-error text, now via a spawnError fallback, locked by a new git spawn-failure test. (REFACTOR.md commit 2/3)
Three copies of the port fakes existed: the shared fake-ports helper, a parametrized inline fake in the worktree test, and local copies in the extension registry test. Parametrize the shared git-worktree fake with an optional create override, then point the worktree and registry tests at the shared helpers and delete their local duplicates. (REFACTOR.md commit 3/3)
REFACTOR.md was a temporary execution aid; all three commits landed.
8ee8fe2 to
4434358
Compare
ec60195 to
a3edf51
Compare
* FE-1110: Drop unused cwd from TestRunArgs The test runner runs inside the worktree, so the repo-root cwd was dead weight carried only for shape-symmetry with GitWorktreeCreateArgs. Remove it from the port arg type, the executor call site, and the port tests. Pure interface tidy; no behavior change. (REFACTOR.md commit 1/3) * FE-1110: Extract shared app-layer command-runner Both execution ports duplicated the same spawn-based subprocess runner. Extract it into a single command-runner module (spawn wrapper + CommandResult carrying an explicit spawnError signal); the git-worktree and test-runner ports now keep only their command/args and result mapping. Behavior preserved: the git port still surfaces its spawn-error text, now via a spawnError fallback, locked by a new git spawn-failure test. (REFACTOR.md commit 2/3) * FE-1110: Consolidate port test fakes onto shared fake-ports Three copies of the port fakes existed: the shared fake-ports helper, a parametrized inline fake in the worktree test, and local copies in the extension registry test. Parametrize the shared git-worktree fake with an optional create override, then point the worktree and registry tests at the shared helpers and delete their local duplicates. (REFACTOR.md commit 3/3) * FE-1110: Remove completed refactor plan REFACTOR.md was a temporary execution aid; all three commits landed.
* FE-1110: Drop unused cwd from TestRunArgs The test runner runs inside the worktree, so the repo-root cwd was dead weight carried only for shape-symmetry with GitWorktreeCreateArgs. Remove it from the port arg type, the executor call site, and the port tests. Pure interface tidy; no behavior change. (REFACTOR.md commit 1/3) * FE-1110: Extract shared app-layer command-runner Both execution ports duplicated the same spawn-based subprocess runner. Extract it into a single command-runner module (spawn wrapper + CommandResult carrying an explicit spawnError signal); the git-worktree and test-runner ports now keep only their command/args and result mapping. Behavior preserved: the git port still surfaces its spawn-error text, now via a spawnError fallback, locked by a new git spawn-failure test. (REFACTOR.md commit 2/3) * FE-1110: Consolidate port test fakes onto shared fake-ports Three copies of the port fakes existed: the shared fake-ports helper, a parametrized inline fake in the worktree test, and local copies in the extension registry test. Parametrize the shared git-worktree fake with an optional create override, then point the worktree and registry tests at the shared helpers and delete their local duplicates. (REFACTOR.md commit 3/3) * FE-1110: Remove completed refactor plan REFACTOR.md was a temporary execution aid; all three commits landed.
* FE-1110: Drop unused cwd from TestRunArgs The test runner runs inside the worktree, so the repo-root cwd was dead weight carried only for shape-symmetry with GitWorktreeCreateArgs. Remove it from the port arg type, the executor call site, and the port tests. Pure interface tidy; no behavior change. (REFACTOR.md commit 1/3) * FE-1110: Extract shared app-layer command-runner Both execution ports duplicated the same spawn-based subprocess runner. Extract it into a single command-runner module (spawn wrapper + CommandResult carrying an explicit spawnError signal); the git-worktree and test-runner ports now keep only their command/args and result mapping. Behavior preserved: the git port still surfaces its spawn-error text, now via a spawnError fallback, locked by a new git spawn-failure test. (REFACTOR.md commit 2/3) * FE-1110: Consolidate port test fakes onto shared fake-ports Three copies of the port fakes existed: the shared fake-ports helper, a parametrized inline fake in the worktree test, and local copies in the extension registry test. Parametrize the shared git-worktree fake with an optional create override, then point the worktree and registry tests at the shared helpers and delete their local duplicates. (REFACTOR.md commit 3/3) * FE-1110: Remove completed refactor plan REFACTOR.md was a temporary execution aid; all three commits landed.
Follow-up cleanup on top of #275. No behavior change.
What changed
cwdfield fromTestRunArgs— it was never read.src/app/command-runner.tsso the git worktree port and test runner port stop duplicating spawn logic. Git spawn-error behavior preserved (covered by a new test).src/executor/__tests__/fake-ports.ts.Verification
npm run verifypasses: 165 test files, 1111 tests, build ok.