# AI Video Signal V23 — Production Change & Rollback Operating Plan

## Objective
Record the exact production modification attached to each controlled experiment and make a surgical rollback possible without restoring an entire old page.

## Workflow
1. Freeze the experiment baseline in Conversion Intelligence.
2. Create a V23 change manifest for exactly one controlled change set.
3. Validate the manifest against the extracted site copy.
4. Apply it with `assets/aivs_change_manager_v23.py apply`.
5. Keep the generated `.rollback-v23.json` with the deployment record.
6. Deploy the changed site.
7. Register the change manifest in the V23 Change Registry and mark the deployment.
8. Evaluate on the planned date using the aligned measurement window.
9. If the outcome is KEEP, preserve the change. If EXTEND, keep measuring. If REVERT, run the surgical rollback against the latest site copy and deploy that result.

## Safety rules
- V23 supports only `replace_exact` operations.
- A target fragment must occur exactly the expected number of times.
- Rollback reverses only the controlled `after_exact` fragment. It never replaces a whole file.
- If later work changed the controlled fragment, rollback refuses. Resolve the conflict manually rather than overwriting later improvements.
- Do not bundle unrelated SEO, copy, tracking and layout edits into the same experiment manifest.
- Keep affiliate destination URLs unchanged unless the experiment explicitly tests the merchant/offer and that change has separate approval.

## Commands
```bash
python assets/aivs_change_manager_v23.py validate manifest.json /path/to/site
python assets/aivs_change_manager_v23.py apply manifest.json /path/to/site
python assets/aivs_change_manager_v23.py package-rollback manifest.rollback-v23.json rollback-package.zip
python assets/aivs_change_manager_v23.py rollback manifest.rollback-v23.json /path/to/site
```

## Cloud ledger
V23 reuses the existing `EXPERIMENT_LEDGER` KV binding. No additional Cloudflare binding is required for change metadata. The private API can append an immutable change manifest to an experiment record and later mark it DEPLOYED or ROLLED_BACK.
