FN-5909: run configured merge bootstrap before verification

Ensure AI merge verification reuses the configured worktree bootstrap command.

- run merge dependency sync unconditionally when a non-blank worktreeInitCommand is configured
- reuse the configured init command instead of inferred package-manager install commands during merge verification
- add merger verification coverage for warm/cold worktrees, inferred-install fallback, and whitespace-only init commands
- document the expanded worktreeInitCommand behavior and add a published changeset

Files changed:
 .changeset/fn-5909-merge-install-script.md         |   5 +
 docs/settings-reference.md                         |   2 +-
 packages/engine/src/__tests__/merger-verification.test.ts      | 159 +++++++++++++++------
 packages/engine/src/merger.ts                      |  30 +++-
 4 files changed, 143 insertions(+), 53 deletions(-)

Fusion-Task-Id: FN-5909

Fusion-Task-Lineage: 8530c641-9574-45e2-b9ac-82e42c9c00a7
This commit is contained in:
gsxdsm
2026-06-02 18:43:29 -07:00
parent 5c4c765134
commit cf23c6f571
4 changed files with 148 additions and 58 deletions

View File

@@ -265,7 +265,7 @@ Sandbox backend precedence is:
| `pushAfterMerge` | `boolean` | `false` | Auto-push to remote after successful direct merge. Includes pulling latest and AI conflict resolution. |
| `pushRemote` | `string` | `"origin"` | Git remote (and optional branch) to push to after merge. |
| `worktreeInitCommand` | `string` | `undefined` | Shell command run after worktree creation. For pnpm repos, prefer `pnpm install --frozen-lockfile` for deterministic bootstrap. |
| `worktreeInitCommand` | `string` | `undefined` | Shell command run after worktree creation and again to bootstrap the merge worktree before AI merge verification. Useful for project-specific setup beyond package install (for example `pnpm install --frozen-lockfile`, `cp .env.local .env`, or codegen/bootstrap scripts). |
| `testCommand` | `string` | `undefined` | Merge-time test command (hard gate). When unset, Fusion auto-detects from lockfile. |
| `buildCommand` | `string` | `undefined` | Merge-time build command (hard gate). |
| `recycleWorktrees` | `boolean` | `false` | Default: off (opt-in). Reuse worktrees from a pool for faster startup. |