# Mod Error Isolation

This document covers `TODOS.phase-72.72.14.1.12`: isolating broken mods so one
mod panic or crash does not take down the game.

## Runtime Surface

- module: `V2Modding`
- policy: `FV2ModErrorIsolationPolicy`
- runtime error: `FV2ModRuntimeError`
- issue: `FV2ModErrorIsolationIssue`
- action: `FV2ModErrorIsolationAction`
- result: `FV2ModErrorIsolationResult`
- helper functions: `BuildDefaultModErrorIsolationPolicy`,
  `BuildModRuntimeError`, `EvaluateModErrorIsolation`,
  `BuildModErrorPlayerNotification`, and `ApplyModErrorIsolation`
- subsystem forwarding: `UV2ModLoadingSubsystem::EvaluateErrorIsolation`
- automation: `V2/ue/Source/V2Tests/Private/Modding/ModLoadingSystem.spec.cpp`
- contract: `V2/ue/Content/V2/Modding/ModErrorIsolation_V2_Contract.json`

## Isolation Policy

`BuildDefaultModErrorIsolationPolicy` catches mod panics, crashes, and timeouts,
prevents the game from crashing, disables broken mods, quarantines disabled mods
for review, and queues a player notification. Recoverable errors are allowed up
to `MaxRecoverableErrorsPerWindow` before the mod is treated as broken.

## Results

`EvaluateModErrorIsolation` filters errors for the target mod, emits issues for
caught panics, caught crashes, caught timeouts, and exceeded recoverable error
budgets, then emits actions to continue the game, disable the mod, quarantine
the mod, and notify the player as appropriate.

Player notification text is short and operational. It names the affected mod and
states that the game is still running. `ApplyModErrorIsolation` preserves the
protected-game state and ensures the notification remains available.

## Verification

```bash
python3 V2/ue/Tools/check-v2-mod-error-isolation.py
python3 V2/ue/Tools/check-v2-mod-loading-system.py
python3 V2/ue/Tools/check-v2-ci-workflow.py
python3 V2/tools/validate-v2-docs.py
python3 -m py_compile V2/ue/Tools/check-v2-mod-error-isolation.py V2/ue/Tools/check-v2-mod-performance-profiling.py V2/ue/Tools/check-v2-ci-workflow.py
python3 -m json.tool V2/ue/Content/V2/Modding/ModErrorIsolation_V2_Contract.json
```
