Clean up stored data
Preview a retention policy and remove eligible runtime data while preserving recoverable work.
Preview a policy
Section titled “Preview a policy”Start by previewing a retention policy. The report shows which runtime entries could be removed and which remain protected. Apply it only after reviewing the result.
Without --apply, the command only prints its plan: one line per entry of .outpost, then the projected size.
--json prints { dryRun, plan } instead. --repository defaults to the current directory.
Apply it
Section titled “Apply it”Each candidate is checked again right before removal. One that changed since the plan stays, with reason PLAN_CHANGED. The output adds a REMOVED line per deleted entry.
The command exits with status 1 when the inventory is incomplete, when what remains exceeds maxBytes or maxWorkspaces, or when a candidate could not be removed.
Write the policy
Section titled “Write the policy”API reference: RecoveryRetentionPolicy.
maxBytes and maxWorkspaces never make more entries eligible: they tell you whether the policy frees enough space.
Read why an entry stays
Section titled “Read why an entry stays”API reference: RecoveryRetentionEntry.
Prune from code
Section titled “Prune from code”planRecoveryRetention() builds the same plan as the dry run. pruneRecoveryRetention() applies it and returns what it removed and kept.
For data kept in a remote transport, pass transporter to planRecoveryRetention() and { transporter } to pruneRecoveryRetention(). Only closed-logs and task-cache apply there.
Clean what retention keeps
Section titled “Clean what retention keeps”- Named branchesPruning a worktree keeps its branch. Delete merged ones with
git branch -d outpost/fix-tests. - Worktrees with changesCommit, copy or discard the files, after a look with Recover work.
git -C <worktree> clean -fdXdeletes only ignored files. - Cache volumesThey outlive sandboxes and images. Remove them with the container engine, label
io.outpost.cache=true(Prepare the environment).
A worktree that became clean is removed by the next run of a clean-workspaces policy.
Reserve storage between writers
Section titled “Reserve storage between writers”A reservation claims bytes in .outpost before a job writes them. It is refused when current usage, active reservations and the new request exceed maxBytes.
API reference: RecoveryQuotaOptions and RecoveryStorageReservationOptions.
A refused reservation rejects with code configuration; a failed assertRecoveryQuota() rejects with code workspace (Errors).
Limits
Section titled “Limits”- Reservations coordinate writers that use them. They are not a filesystem quota: any other process can still write to
.outpost. - A reservation whose process died stays in the ledger (
reservations/ledgerin the transport) and keeps counting. Remove its entry only after checking that its owner stopped, with a conditional write (ifRevision) through the same transport. - Retention never removes branches, checkpoints, artifacts, conversations, recovery transfers or locks.
- A remote transport cannot use the
clean-workspacesscope ormaxWorkspaces. - Do not delete
.outpostby hand: it can hold the only copy of unfinished work.
API: planRecoveryRetention · pruneRecoveryRetention · RecoveryRetentionPolicy · RecoveryRetentionPlan · reserveRecoveryStorage · assertRecoveryQuota · WorkspaceOptions.