generated from john/python-template
Continue GC code review and cleanup
This commit is contained in:
@@ -145,14 +145,15 @@ The canonical MVP prompt is:
|
||||
|
||||
## Destructive test procedure (with data backup)
|
||||
|
||||
AI execution policy: before running any unit tests, create a backup of `./data` first. After tests succeed, always pause and ask whether to restore now.
|
||||
AI execution policy: before the first unit-test run in a test/fix cycle, create one backup of `./data`. Reuse that same backup for every subsequent test run in the cycle. After tests succeed, always pause and ask whether to restore now.
|
||||
|
||||
Use the cross-platform Python wrapper below whenever an AI agent runs tests against this repository.
|
||||
|
||||
1. Create backup of `./data`.
|
||||
1. Create one backup of `./data` and mark it as the active test-cycle backup.
|
||||
2. Run your test command.
|
||||
3. On success, always prompt whether to restore now (do not auto-restore unless explicitly approved).
|
||||
4. On failure, keep backup and current state for inspection.
|
||||
3. On failure, fix the errors and run the wrapper again; it reuses the active backup and never backs up post-test data.
|
||||
4. On success, always prompt whether to restore now (do not auto-restore unless explicitly approved).
|
||||
5. Close the cycle only by restoring the active backup or explicitly accepting the current data.
|
||||
|
||||
Preflight behavior:
|
||||
|
||||
@@ -183,10 +184,18 @@ uv run python tools/run_destructive_tests.py --skip-restore-prompt -- pytest
|
||||
|
||||
This keeps both the current post-test state and the backup, so restore can be decided explicitly later.
|
||||
|
||||
Repeated wrapper invocations reuse the backup recorded in `.test-backups/.active-backup`. If that backup is missing, the wrapper stops rather than creating a replacement from potentially destructive post-test data.
|
||||
|
||||
### Restore later from a saved backup
|
||||
|
||||
```bash
|
||||
uv run python tools/run_destructive_tests.py --restore-from data-backup-YYYYMMDD-HHMMSS
|
||||
```
|
||||
|
||||
To keep the current data and close the active cycle without restoring:
|
||||
|
||||
```bash
|
||||
uv run python tools/run_destructive_tests.py --accept-current-data
|
||||
```
|
||||
|
||||
Backups are stored in `.test-backups/` and ignored by git.
|
||||
|
||||
Reference in New Issue
Block a user