The database vacuum service. Periodically schedules cleanup tasks for old
flow runs and orphaned resources (logs, artifacts, artifact collections)
past a configurable retention period.A single perpetual service (schedule_vacuum_tasks) enqueues one docket task
per resource type on each cycle. Each task runs independently with its own
error isolation and docket-managed retries. Deterministic keys prevent
duplicate tasks from accumulating if a cycle overlaps with in-progress work.
Schedule independent cleanup tasks for each resource type.Each task is enqueued with a deterministic key so that overlapping
cycles (e.g. when cleanup takes longer than loop_seconds) naturally
deduplicate instead of piling up redundant work.
Reconcile artifact collections whose latest_id points to a deleted artifact.Re-points to the next latest version if one exists, otherwise deletes
the collection row.