2026-09-05 15:27:08 +00:00
|
|
|
# Stage: cleanup
|
|
|
|
|
|
|
|
|
|
## Purpose
|
|
|
|
|
|
2026-11-30 02:40:17 +00:00
|
|
|
Remove eligible run data only after a successful publish, according to the
|
|
|
|
|
workspace cleanup policy. Explicit session cleanup is a separate operator action.
|
2026-09-05 15:27:08 +00:00
|
|
|
|
|
|
|
|
## Authorization And Targets
|
|
|
|
|
|
2026-11-30 02:40:17 +00:00
|
|
|
`workspace.cleanup_after_publish` enables automatic cleanup. It requires a
|
|
|
|
|
succeeded upload and matching published run, commit, and pointer evidence.
|
|
|
|
|
Cleanup confines deletion to that run and protects managed latest log/debug
|
|
|
|
|
view targets and the original session-durable Notarius bundle. Subprocess state
|
|
|
|
|
and caches are outside its scope.
|
2026-09-05 15:27:08 +00:00
|
|
|
|
|
|
|
|
## Execution And Resume
|
|
|
|
|
|
2026-11-30 02:40:17 +00:00
|
|
|
Cleanup is idempotent and retries failed deletion without republishing. Retained
|
|
|
|
|
protected files are intentional and do not trigger endless cleanup. Bounded
|
|
|
|
|
runs ending before cleanup do not execute it. See [operations](../operations.md#cleanup).
|
2026-09-05 15:27:08 +00:00
|
|
|
|
|
|
|
|
## Implementation And Tests
|
|
|
|
|
|
2026-11-30 02:40:17 +00:00
|
|
|
`internal/stage/cleanup_plan.go`, `cleanup.go`, `internal/fileops/cleanup.go`
|
|
|
|
|
and their tests own authorization, protected targets, and confined deletion.
|