docs(FN-4333): document postMergeAuditMode + add mode=off/warn integration tests

Adopts the documentation and integration test additions from the
Fusion executor's parallel work on FN-4333 (sleek-oak worktree). The
core hot-fix already landed in ccd718acd.

- AGENTS.md: update the post-squash audit paragraph to describe the
  three modes and the verified-tree short-circuit.
- docs/settings-reference.md: add postMergeAuditMode row.
- packages/engine/src/__tests__/merger-merge-lifecycle.test.ts: add
  integration tests covering postMergeAuditMode=off (skips audit) and
  postMergeAuditMode=warn (continues despite dirty findings).

Fusion-Task-Id: FN-4333
This commit is contained in:
Fusion
2026-05-13 09:53:45 -07:00
parent 6ccf468517
commit 1777a34c7a
3 changed files with 65 additions and 1 deletions

View File

@@ -190,6 +190,7 @@ Defaults from `DEFAULT_PROJECT_SETTINGS`; key scope from `PROJECT_SETTINGS_KEYS`
| `mergeDiffVolumeThreshold` | `number` | `0.2` | Minimum staged-to-branch-net ratio allowed for a non-allowlisted file during auto-resolved squash finalization. Applied at merge time and clamped to `0..1`. |
| `mergeDiffVolumeAllowlist` | `string[]` | `[]` | Additional glob patterns skipped by the pre-commit diff-volume gate, beyond the built-in generated-file and lockfile allowlists. |
| `mergeStrategyOverlapBehavior` | `"flip-to-prefer-branch" \| "warn-only" \| "ignore"` | `"flip-to-prefer-branch"` | Safety control for `mergeConflictStrategy="smart-prefer-main"`. Before the Attempt 3 `-X ours` fallback, Fusion checks whether the task branch and recent `main` history overlap on the same files (30-commit lookback, matching the squash audit heuristics). `flip-to-prefer-branch` makes overlapping files prefer the task branch so hardening is not silently discarded (the FN-3936 class of regression). `warn-only` logs the overlap but keeps the legacy main-wins fallback. `ignore` disables the overlap guard and preserves legacy behavior exactly. |
| `postMergeAuditMode` | `"block" \| "warn" \| "off"` | `"block"` | Controls the post-merge audit gate. **Block** refuses to auto-complete merges that show duplicate-subject or touched-file overlap risks (most conservative). **Warn** logs findings but auto-completes the merge. **Off** skips the audit entirely. Default: Block. Switching to Warn or Off is recommended only if you trust your branches don't silently drop edits. Regardless of mode, rebase-strategy overlap-only findings are auto-cleared when deterministic merge verification has already proven the tree (FN-4333). |
### Per-task direct-merge override