Skip to content

refactor: group agent launch and workspace hook owners - #37612

Merged
nwparker merged 2 commits into
mainfrom
module-layout-v2/m03-agent-launch-workspace-hooks
Nov 3, 2026
Merged

nwparker merged 2 commits into
mainfrom
module-layout-v2/m03-agent-launch-workspace-hooks

Conversation

@nwparker

@nwparker nwparker commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 76 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​287 $\color{#cf222e}{\Huge{\mathbf{−}}}$​220 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​67
Prod 56 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​181 $\color{#cf222e}{\Huge{\mathbf{−}}}$​161 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​20

Agent launch trust/preflight rules and workspace setup/archive hooks currently share the main-process root with unrelated services. Group 39 source/test files under agent-launch, workspace-hooks and their existing concrete owners, and retarget callers and mocks atomically.

Moved code imports Git command operations, WSL paths and agent contracts from their defining modules. Remove the hooks parser forwarding export and import the shared YAML parser directly; preserve the existing hoisted mock identities.

Validation: 75 focused test files (2,472 assertions passed, five skipped), six CI scope-routing assertions, node typecheck, path-literal ratchet and the 154-gate reliability-manifest check passed. Two independent exact-head source/boundary audits passed, then both approved the rebase. On the final head, pnpm check:changed --maxWorkers=2 --timeout=2 passed all 40 non-unit checks; the broad related-test selection exceeded the declared two-minute limit. Its unit gate is not reported as green. Focused test evidence remains applicable because post-rebase code/mocks are byte-identical. CI must pass before merge.

Retarget the trust CI scope prefix and active reliability paths; preserve original historical command fields and link their current command.

Follows merged #37606 and is rebased onto its main merge. This batch reduces direct main-root files from 369 to 330.

@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

The changes update imports, test mocks, and CI and configuration references to match relocated agent-launch, workspace-hooks, Codex configuration, provider-account, and runtime modules. The workspace-hooks module no longer re-exports parseOrcaYaml; tests and mocks now import it from shared/orca-yaml. The described runtime logic and tracked counts remain unchanged.

Merge Risk: Minimal · up to 4873a

The relocation has no established merge-blocking defect; CI should pass before merging.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description covers the main sections a reviewer needs. It has a summary of the file moves, the reasons (the main-process root holds unrelated services), validation evidence, and notes on the CI sc… Add the missing template sections: an ELI5 explanation in plain language; a What Changed section that states the before and after behavior and the mechanism; a Why section that explains why this grouping beats the alternatives; a Linked Iss…
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title "refactor: group agent launch and workspace hook owners" matches the main change. The PR moves 39 source and test files into src/main/agent-launch/ and src/main/workspace-hooks/ and retarget…
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: Title check

Explanation

The title "refactor: group agent launch and workspace hook owners" matches the main change. The PR moves 39 source and test files into src/main/agent-launch/ and src/main/workspace-hooks/ and retargets their imports and mocks. The title is short, single-sentence, and specific. It does not mention the parser export removal or the CI and reliability config updates, which is acceptable because the title need not cover every detail.

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. (75 skipped: 6 unsupported, 69 over the file limit.)

Full details: Description check

Explanation

The description covers the main sections a reviewer needs. It has a summary of the file moves, the reasons (the main-process root holds unrelated services), validation evidence, and notes on the CI scope prefix and reliability path updates. It also reports a partial validation: the broad related-test selection exceeded the time limit and the unit gate is not reported green. The template sections ELI5, Visual Proof, Linked Issue, Risk level, Testing checkboxes, and Checklist are missing or unfilled. There is no 'Fixes #' issue link, no risk level, and no explicit statement about the user-facing before and after. The template asks for these. The description is mostly complete on substance but lacks several required template sections.

Resolution

Add the missing template sections: an ELI5 explanation in plain language; a What Changed section that states the before and after behavior and the mechanism; a Why section that explains why this grouping beats the alternatives; a Linked Issue entry (replace the empty 'Fixes #' with a real issue, or note that none applies if the PR is by a maintainer); a Visual Proof entry, which can be 'N/A' with a short reason since this is a structural refactor; a Testing section that lists the platforms actually tested and ticks the manual or automated test checkboxes; a Risk section with a Level (Low, Medium, or High), the riskiest part of the move, and how to back it out with a revert; and the Review, Agent skill upstream boundary, and Checklist sections. Also state whether the 'pnpm test' unit gate was run, since the description says it is not reported green.

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/ruby/security/insecure-randomness-token-rand-ruby.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: e0cf19f9-b7f8-498f-a5f5-47a04b09bb85
Commits

Reviewing files that changed from the base of the PR and between 45a2935 and 4873a52.

Files selected for processing: 132
  • .github/workflows/pr.yml
  • config/flaky-test-pattern-baseline.txt
  • config/main-sync-spawn-baseline.txt
  • config/process-host-direct-import-baseline.txt
  • config/reliability-gates.jsonc
  • config/scripts/ci-shard-timings.json
  • config/scripts/pr-code-change-scope.mjs
  • config/scripts/pr-codex-unit-only-selection.test.mjs
  • src/main/acp/acp-at-rest-commands.ts
  • src/main/acp/acp-model-catalog-probe.ts
  • src/main/acp/acp-structured-launch-resolution.ts
  • src/main/agent-launch/preflight/agent-cli-version-probe.test.ts
  • src/main/agent-launch/preflight/agent-cli-version-probe.ts
  • src/main/agent-launch/trust/agent-trust-presets.test.ts
  • src/main/agent-launch/trust/agent-trust-presets.ts
  • src/main/agent-launch/trust/agent-trust-write-deadline.ts
  • src/main/agent-launch/trust/agent-workspace-trust-guard-failure.test.ts
  • src/main/agent-launch/trust/agent-workspace-trust-spawn.test.ts
  • src/main/agent-launch/trust/agent-workspace-trust-spawn.ts
  • src/main/agent-launch/trust/agent-workspace-trust.test.ts
  • src/main/agent-launch/trust/agent-workspace-trust.ts
  • src/main/agent-launch/trust/execution-host-workspace-trust.test.ts
  • src/main/agent-launch/trust/execution-host-workspace-trust.ts
  • src/main/agent-launch/trust/workspace-trust-test-fixtures.ts
  • src/main/automations/automation-run-agent-evidence.ts
  • src/main/codex/codex-cli-installation-error.ts
  • src/main/codex/codex-minimum-version.test.ts
  • src/main/codex/codex-path-observation.ts
  • src/main/codex/codex-trust-config-concurrent-launch.test.ts
  • src/main/codex/config-settings-baseline.ts
  • src/main/codex/configuration/agent-state-file-reader.test.ts
  • src/main/codex/configuration/agent-state-file-reader.ts
  • src/main/codex/sta-4823-shared-state-survives-a-failed-read.test.ts
  • src/main/external-conversations/external-conversation-events.ts
  • src/main/git/worktree-configured-paths-concurrency.test.ts
  • src/main/git/worktree-shared-directories.ts
  • src/main/ipc/ephemeral-vm-recipe-context.ts
  • src/main/ipc/hooks/register-worktree-hook-check-handler.ts
  • src/main/ipc/hooks/register-worktree-hook-file-handlers.ts
  • src/main/ipc/hooks/worktree-hook-execution-host.test.ts
  • src/main/ipc/pty/spawn-options-agent-workspace-trust.test.ts
  • src/main/ipc/pty/spawn-options-assembly.ts
  • src/main/ipc/repos/project-host-setup-wsl-move-fence.test.ts
  • src/main/ipc/worktree-remote.ts
  • src/main/ipc/worktrees-authoritative-local-metadata-pruning.test.ts
  • src/main/ipc/worktrees-automation-create-terminals.test.ts
  • src/main/ipc/worktrees-background-removal.test.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-metadata-persistence.test.ts
  • src/main/ipc/worktrees-create-registry.test.ts
  • src/main/ipc/worktrees-delete-pty-teardown.test.ts
  • src/main/ipc/worktrees-detected-scan-cache.test.ts
  • src/main/ipc/worktrees-discovery-metadata-backfill.test.ts
  • src/main/ipc/worktrees-existing-branch-checkout.test.ts
  • src/main/ipc/worktrees-failed-removal.test.ts
  • src/main/ipc/worktrees-forget-local.test.ts
  • src/main/ipc/worktrees-issue-command-overrides.test.ts
  • src/main/ipc/worktrees-lineage-hydration.test.ts
  • src/main/ipc/worktrees-listing-fallback-rows.test.ts
  • src/main/ipc/worktrees-local-base-ref-resolution.test.ts
  • src/main/ipc/worktrees-local-create-flow.test.ts
  • src/main/ipc/worktrees-local-create-path-claim.test.ts
  • src/main/ipc/worktrees-mutation-scan-generation-order.test.ts
  • src/main/ipc/worktrees-orphan-directory-cleanup.test.ts
  • src/main/ipc/worktrees-removal-recovery.test.ts
  • src/main/ipc/worktrees-remove-archive-hooks.test.ts
  • src/main/ipc/worktrees-remove-preflight.test.ts
  • src/main/ipc/worktrees-setup-launch-sparse-checkout.test.ts
  • src/main/ipc/worktrees-ssh-pr-head-fetch.test.ts
  • src/main/ipc/worktrees-ssh-repo-owner-resolution.test.ts
  • src/main/ipc/worktrees-windows.test.ts
  • src/main/ipc/worktrees-wsl-runtime-routing.test.ts
  • src/main/ipc/worktrees/removal/execute-worktree-removal.ts
  • src/main/orcad/orcad-account-services.ts
  • src/main/pi/rpc-launch-resolution.ts
  • src/main/pi/rpc-model-catalog-probe.ts
  • src/main/preflight/codex-cli-installation.test.ts
  • src/main/providers/accounts/agent-auth-restart-preservation.test.ts
  • src/main/providers/accounts/agent-auth-restart-preservation.ts
  • src/main/providers/accounts/provider-account-services.ts
  • src/main/runtime/agent-session/structured-agent-session-transport-overrides.ts
  • src/main/runtime/agent-state-rules/agent-turn-idle-verdict.test.ts
  • src/main/runtime/agent-state-rules/agent-turn-idle-verdict.ts
  • src/main/runtime/fit-override-integration.test.ts
  • src/main/runtime/mobile-presence-lock.test.ts
  • src/main/runtime/mobile-session-tabs-churn-coalescing.test.ts
  • src/main/runtime/orca-runtime-structured-agent-session-create-intent.test.ts
  • src/main/runtime/orca-runtime-test-mocks/imported-values.spec.ts
  • src/main/runtime/orca-runtime-test-mocks/setup.spec.ts
  • src/main/runtime/remote-desktop-driver.test.ts
  • src/main/runtime/rpc/structured-worker-cli.integration.test.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.ts
  • src/main/runtime/runtime-local-worktree-create.ts
  • src/main/runtime/runtime-local-worktree-setup.ts
  • src/main/runtime/runtime-registered-local-worktree-removal.ts
  • src/main/runtime/runtime-repository-hooks-commands.test.ts
  • src/main/runtime/runtime-repository-hooks-commands.ts
  • src/main/runtime/runtime-repository-issue-command.ts
  • src/main/runtime/structured-agent-launch-support.test.ts
  • src/main/runtime/structured-agent-launch-support.ts
  • src/main/runtime/structured-agent-model-catalog-discovery.test.ts
  • src/main/runtime/structured-agent-runtime-metadata.ts
  • src/main/runtime/structured-agent-runtime-registration-types.ts
  • src/main/startup/codex-launch-per-agent-hook-opt-out.test.ts
  • src/main/startup/main-process-account-services.ts
  • src/main/startup/main-window-core-services.test.ts
  • src/main/startup/main-window-core-services.ts
  • src/main/update-restart-preservation.ts
  • src/main/workspace-hooks/effective-hook-config.ts
  • src/main/workspace-hooks/hook-archive-timeout-observation.test.ts
  • src/main/workspace-hooks/hook-runtime-target.ts
  • src/main/workspace-hooks/hook-termination-real-process.test.ts
  • src/main/workspace-hooks/hooks-archive-exit-observation.test.ts
  • src/main/workspace-hooks/hooks-effective-hook-resolution.test.ts
  • src/main/workspace-hooks/hooks-orca-yaml-parsing.test.ts
  • src/main/workspace-hooks/hooks-orca-yaml-unc-drive.test.ts
  • src/main/workspace-hooks/hooks-runner.test.ts
  • src/main/workspace-hooks/hooks-setup-runner-script.test.ts
  • src/main/workspace-hooks/hooks-test-fixtures.ts
  • src/main/workspace-hooks/hooks.test.ts
  • src/main/workspace-hooks/hooks.ts
  • src/main/workspace-hooks/issue-command-file.ts
  • src/main/workspace-hooks/issue-command-ignore.test.ts
  • src/main/workspace-hooks/issue-command-wsl-stopped-distro.test.ts
  • src/main/workspace-hooks/setup-hook-env-vars.ts
  • src/main/workspace-hooks/setup-runner-script-text.ts
  • src/main/workspace-hooks/worktree-runner-script.ts
  • src/renderer/src/components/sidebar/CommentMarkdown.test.tsx
  • tests/e2e/structured-agent-session-launch-continuation.unit.test.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 7983d50 into main Nov 3, 2026
80 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