# Mod Conflict Detection

Task: `TODOS.phase-72.72.14.2.11`

V2 mod conflict detection evaluates provider-neutral mutation records before
load. It detects when two mods modify the same entity or asset, warns the user
for optional conflicts, blocks destructive or required conflicts, and provides
resolution actions that UI and install flows can present.

## Policy

`BuildDefaultModConflictDetectionPolicy` enables:

- asset conflict warnings
- entity, component, and data-row conflict warnings
- load-order resolution suggestions
- disable-mod resolution suggestions
- manual compatibility patch requirements for blockers
- a deterministic conflict cap

## Mutations

`FV2ModConflictMutation` records the mod id, display name, target type, target
id, optional asset path, operation label, load-order index, destructive flag,
and optional flag. A mutation must identify either a target id or an asset path.
Missing targets are blocking validation issues because they cannot be resolved
deterministically.

## Severity

`EvaluateModConflicts` groups mutations by target type plus target id and
returns an `FV2ModConflictReport`. Conflicts between two required mods, or
conflicts where either mutation is destructive, become `Blocker` issues.
Optional same-target edits become `Warning` issues so the user can keep loading
after reviewing the risk.

## Resolutions

Each detected conflict produces suggested actions:

- keep the first mod
- keep the second mod
- reorder mods
- create a manual compatibility patch for blockers
- disable a conflicting mod for blockers

The report exposes `WarningCount`, `BlockingCount`, `Issues`, and `Actions` so
native UI, mod browser install flows, and load gates can warn user and suggest
resolution without duplicating conflict logic.

## Verification

Run:

```bash
python3 V2/ue/Tools/check-v2-mod-conflict-detection.py
python3 -m json.tool V2/ue/Content/V2/Modding/ModConflictDetection_V2_Contract.json
```

The focused checker verifies runtime types, asset conflict detection, entity
conflict detection, warning severity, blocking severity, suggested resolution
actions, missing-target validation, automation assertions, docs, CI/Horde
wiring, and TODO evidence for `72.14.2.11`.
