@@ -93,6 +93,42 @@ Run tests in Docker:
9393docker compose exec app pytest
9494```
9595
96+ ## Rollout and Rollback Checkpoints (Route/Security Changes)
97+
98+ Use these checkpoints when deploying route-method and security-control changes.
99+
100+ ### Rollout
101+
102+ 1 . Pre-deploy verification:
103+ ``` bash
104+ pytest tests/test_mark_mutation_security.py tests/test_stored_xss_regression.py tests/test_fetch_path_url_targets.py tests/test_config_and_import_status_isolation.py
105+ ```
106+ 2 . Deploy and verify route-method hardening:
107+ - Confirm ` GET /mark/delete/<id> ` and ` GET /mark/inc ` return ` 405 ` .
108+ - Confirm UI delete/click flows still work via form/JS ` POST ` requests with CSRF token.
109+ 3 . Verify security controls:
110+ - Confirm stored HTML renders escaped/sanitized (no script execution).
111+ - Confirm private/loopback/link-local fetch targets are rejected.
112+ - Confirm production startup fails fast when required secrets are missing.
113+ 4 . Observe runtime after deploy:
114+ - Watch for spikes in ` 400 ` CSRF failures (could indicate stale clients/forms).
115+ - Watch for unexpected URL validation rejections on legitimate public links.
116+
117+ ### Rollback
118+
119+ 1 . If route-method changes break clients:
120+ - Roll back the route-method/template commit(s) first (` /mark/delete ` , ` /mark/inc ` ), then redeploy.
121+ - Re-run ` tests/test_mark_mutation_security.py ` to confirm restored behavior.
122+ 2 . If security controls block legitimate behavior:
123+ - Roll back the specific control commit(s) (HTML sanitization, URL target validation, or config guard) instead of full rollback.
124+ - Re-run the matching regression tests before redeploying:
125+ ``` bash
126+ pytest tests/test_stored_xss_regression.py tests/test_fetch_path_url_targets.py tests/test_config_and_import_status_isolation.py
127+ ```
128+ 3 . Post-rollback validation:
129+ - Smoke-test add/edit/delete/click flows in UI.
130+ - Confirm app startup and login succeed in the target environment.
131+
96132## Docker Commands
97133
98134``` bash
0 commit comments