3.3 KiB
3.3 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec | |
|---|---|---|---|---|---|---|---|
| 02-temp-artifact-provider-api | Temporary-artifact storage provider and API | done | 2 |
|
plan.md | ../../specs/system-page/requirements/storage-maintenance.md |
Task 02: Temporary-artifact storage provider and API
Expose the registered artifacts through the existing Storage overview and run contracts. Cleanup is an explicit-only provider: scheduled maintenance and an unscoped full run must not delete temp roots.
Acceptance
GET /api/v1/system/storagereportstemporary_artifactsbytes/counts and capability state while analysis remains read-only; active/recent and unsafe records are separated from stale candidates.POST /api/v1/system/storage/runacceptsresources: ["temporary_artifacts"], moves only valid stale roots into quarantine, and returns provider counts/warnings; the empty selection and scheduled paths do not perform temp cleanup.- The new
temporary_artifactquarantine type survives list/restore/purge flows, cross-device or partial failures remain visible and retryable, and existing activity-gate/force semantics remain.
Verification
cd apps/backend && go test ./internal/system/storage/... ./internal/backendapp/... -run 'Temporary|TempArtifact|Storage|Quarantine' -count=1
Files likely touched
apps/backend/internal/system/storage/types.goapps/backend/internal/system/storage/operations.goapps/backend/internal/system/storage/runner.goapps/backend/internal/system/storage/handler.goapps/backend/internal/system/storage/store.goapps/backend/internal/system/storage/store_migrations.goapps/backend/internal/system/storage/tempartifacts/provider.goapps/backend/internal/system/storage/tempartifacts/provider_test.goapps/backend/internal/system/storage/handler_test.goapps/backend/internal/system/storage/operations_test.goapps/backend/internal/system/storage/runner_test.goapps/backend/internal/backendapp/storage_maintenance.goapps/backend/internal/backendapp/storage_test.go
Dependencies
Task 01.
Parallelism
sequential; it owns shared storage contracts and backend composition.
Inputs
- Plan Backend sections: Storage provider and API composition.
- Existing
ExplicitCleanupProviderused by the Go-cache action. - Existing workspace/Go-cache quarantine and overview-cache implementations.
Output contract
Report the provider resource name, summary/result JSON shapes, default-versus-explicit dispatch behavior, quarantine integration, exact focused test output, and synchronized task/plan status.
Results
- Added the manual-only
temporary_artifactsprovider with read-only analysis, active/recent protection, fixed 24-hour stale eligibility, and same-filesystem quarantine moves. - Added storage summary/capability JSON, explicit resource dispatch, provider results/warnings, and
temporary_artifactquarantine restore/permanent-delete integration. - Crash reconciliation covers rename-before-lifecycle-update and interrupted-rename cases; restored artifacts can be quarantined again with a fresh quarantine entry ID.
- Backend verification passed:
go test ./internal/system/storage/... ./internal/improvekandev/... ./internal/agent/hostutility/... ./internal/backendapp/... -count=1.