Harden demo export cleanup safety
GeoIntel CI / docs-smoke (push) Has been cancelled
GeoIntel CI / contract-smoke (push) Has been cancelled

This commit is contained in:
Codex
2026-06-17 23:47:49 +02:00
parent 212be9ae48
commit 949614e336
9 changed files with 140 additions and 9 deletions
+24
View File
@@ -2267,3 +2267,27 @@ Limitations:
Next recommended pass:
- Consider a safe export retention/cleanup command if the artifact table keeps growing beyond demo needs.
## Sprint 57 safer demo export cleanup (2026-06-17)
Changed:
- Hardened the existing dry-run-first demo export cleanup command instead of creating a parallel cleanup path.
- Added `--max-delete` with a default cap of 25 so large `--apply` runs are blocked until explicitly reviewed and raised.
- Added repeatable `--export-type` filters for targeted cleanup, e.g. reports only.
- Extended the cleanup summary with `keep_latest`, `max_delete`, `export_types`, `type_filtered_export_count` and `blocked_reason`.
- Updated the root wrapper to expose the new filter helper.
- Updated `scripts/README.md`, `docs/STORAGE_ARCHITECTURE.md`, `backend/README.md`, `docs/TODO.md` and `CHANGELOG.md`.
- Added regression coverage for export-type filtering, parser defaults and max-delete options.
Tested:
- `python -m py_compile scripts/cleanup_demo_artifacts.py backend/scripts/cleanup_demo_artifacts.py`
- `cd backend && python -m pytest tests/test_sprint24_cleanup_demo_artifacts.py tests/test_readiness_gate.py -q` (`16 passed`)
Open:
- Run full readiness, deploy Tower and optionally perform a live cleanup dry run inside the all-in-one container before using `--apply`.
Limitations:
- Cleanup still targets demo export records/files only. It does not delete source uploads, vector features, projects, AOIs, QA/QC records, rasters, tiles, masks or production data.
Next recommended pass:
- Add a small live maintenance smoke that runs cleanup in dry-run mode through the deployed all-in-one container.