# V2 Asset Change Notification

This guide covers `TODOS.phase-72.72.20.1.11`: notifying the relevant teams when
binary assets they own or use are modified.

## Source Of Truth

- Manifest: `V2/ue/Build/AssetPipeline/v2-asset-change-notification.json`
- Tool: `V2/ue/Tools/v2_asset_change_notification.py`
- Validator: `V2/ue/Tools/check-v2-asset-change-notification.py`
- Report: `V2/ue/Saved/CI/AssetChangeNotificationReport.json`
- Payload root: `V2/ue/Saved/CI/AssetChangeNotifications`

## Change Detection

The planner inspects changed files from Git:

```bash
python3 V2/ue/Tools/v2_asset_change_notification.py plan \
  --base-ref origin/main \
  --head-ref HEAD \
  --json-report V2/ue/Saved/CI/AssetChangeNotificationReport.json \
  --payload-dir V2/ue/Saved/CI/AssetChangeNotifications
```

Only binary asset extensions declared in
`V2/ue/Build/AssetPipeline/v2-binary-asset-attributes.json` are routed.

## Routing

Notifications are routed by direct asset ownership and by dependency evidence.
The dependency scan checks repository-relative paths, V2/ue-relative paths,
text-file-relative paths, Unreal `/Game` soft object paths, and plugin soft
object paths, matching the asset pruning reference model. If an asset has no
specific owner rule, it routes to `@v2-asset-pipeline` so no binary asset change
is silently dropped.

The generated report records every changed asset, matched route, source file,
reference token, and routing reason. Use that evidence to identify whether the
alert came from a directly owned asset or from content that consumes the changed
asset.

## Payloads

CI runs in dry-run mode. The tool writes Slack, Microsoft Teams, email, and
generic webhook JSON payloads under `V2/ue/Saved/CI/AssetChangeNotifications`;
it does not send them from CI and no webhook URL is stored in the repository.
Studio automation can post those payloads later using secrets managed outside
source control.

## Fixture Mode

For deterministic local tests, pass a newline-delimited changed asset list:

```bash
python3 V2/ue/Tools/v2_asset_change_notification.py plan \
  --changed-list changed-assets.txt \
  --json-report V2/ue/Saved/CI/AssetChangeNotificationReport.json \
  --payload-dir V2/ue/Saved/CI/AssetChangeNotifications
```

The validator uses this mode to prove owner routing, dependency routing, dry-run
payload generation, and fallback coverage without depending on live repository
diffs.

## Validation Commands

```bash
python3 V2/ue/Tools/v2_asset_change_notification.py self-test
python3 V2/ue/Tools/check-v2-asset-change-notification.py
python3 -m json.tool V2/ue/Build/AssetPipeline/v2-asset-change-notification.json
python3 V2/ue/Tools/check-v2-ci-workflow.py
```
