2.9 KiB
2.9 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec | |
|---|---|---|---|---|---|---|---|
| 02-close-missing-payload | Close missing Go-cache payloads | done | 2 |
|
plan.md | ../../specs/system-page/storage-maintenance.md |
Task 02: Close Missing Go-cache Payloads
Intent
Make permanent deletion idempotent when a Go-cache quarantine payload is already absent. Preserve the live original path and keep restore fail-closed.
Acceptance
- Eligible and forced permanent deletion transition a valid missing-payload entry to
deleted. - The deletion path does not inspect recursively, remove, rename, or replace a populated original cache, and bulk purge reports zero deleted bytes for the absent payload.
- Restore of the same state returns
storage.ErrConflictand leaves the entry active.
Files Likely Touched
apps/backend/internal/backendapp/storage_maintenance.goapps/backend/internal/backendapp/storage_maintenance_test.godocs/plans/go-cache-quarantine-lifecycle/plan.mddocs/plans/go-cache-quarantine-lifecycle/task-02-close-missing-payload.md
Dependencies
- Task 01: retained rotation behavior and result classification.
Parallelism
sequential.
Inputs
- Spec sections: Go build cache, Failure modes, and Scenarios.
- Plan section: Missing-payload permanent deletion.
- Existing tests:
TestQuarantineControllerDoesNotTreatPopulatedReplacementAsRestoredPayloadandTestQuarantineControllerDoesNotMarkMissingPayloadPlaceholderRestored.
TDD Sequence
- Split the existing combined restore/delete assertion and add eligible, forced, and bulk missing-payload deletion cases.
- Run
go test ./internal/backendapp -run 'TestQuarantineController.*MissingGoCachePayload'and record the expected conflict failures. - Refactor the delete path without changing restore behavior.
- Run the backendapp package and record the passing result.
Verification
cd apps/backend && go test ./internal/backendapp
Output Contract
Report the files changed, the red and green test commands, the exact outcomes, filesystem and database assertions, remaining risks, and the synchronized task and plan status.
Results
- Red:
cd apps/backend && go test ./internal/backendapp -run 'TestQuarantineController.*MissingGoCachePayload'failed for the eligible, forced, and bulk missing-payload cases because deletion returnedstorage.ErrConflict. - Green: the same focused command passed (4 tests), and
cd apps/backend && go test ./internal/backendapppassed (316 tests). - Permanent deletion now closes a validated missing Go-cache payload without reading or changing the original cache path. Restore continues through the existing fail-closed missing-payload guard. Purge uses the deletion-time payload outcome and reports zero deleted bytes when the durable entry was already missing on disk, including a payload disappearing before the deletion check.