salvus.flow.acta.memo.prune
salvus.flow.acta.memo.prune salvus flow acta memo prune Explicit, label-rooted cleanup of local experiments and their provenance.
Functions
prune()
prune()def prune(
store: ContentStoreBase,
records: RecordStore,
task: str | None,
purge_provenance: bool = False,
delete: bool = False,
assume_idle: bool = False,
) -> PruneReport: ...Remove unlabelled experiments regardless of age or retention class.
Labels, out-of-scope computations, and their producer dependencies survive. Whole-store pruning also removes orphan blobs and bindings. Task-scoped pruning leaves unrelated orphan objects and unknown bindings alone.
Storage errors propagate; no success is reported on partial failure. Database metadata is kept until blob deletion completes.
Parameters
storeContentStoreBase — Explicitly local content store.recordsRecordStore — Complete record database for this content store.taskstr | None — Registered task name; explicitlyNoneselects the whole store.purge_provenancebool =False— Also remove disposable manifests and history.deletebool =False— Apply the plan; otherwise return a read-only preview.assume_idlebool =False— Required acknowledgement of exclusive idle maintenance. Prevent all writers and other collectors until this call ends.
Returns PruneReport
Classes
PruneReport
PruneReportclass PruneReport(builtins.object):
def __init__(
self,
record_keys: tuple[str, ...],
binding_keys: tuple[str, ...],
blob_digests: tuple[str, ...],
manifest_ids: tuple[int, ...] = (),
observation_digests: tuple[str, ...] = (),
observation_count: int = 0,
run_ids: tuple[str, ...] = (),
event_count: int = 0,
deleted: bool = False,
) -> None: ...An explicit cleanup preview, or a successfully applied cleanup.
Parameters
record_keystuple[str, ...] — Cache entries selected for removal.binding_keystuple[str, ...] — Publication bindings selected for removal.blob_digeststuple[str, ...] — Unprotected content selected for removal.manifest_idstuple[int, ...] =()— Disposable provenance selected for removal.observation_digeststuple[str, ...] =()— Digests whose file observations are removed.observation_countint =0— Number of those observation rows.run_idstuple[str, ...] =()— Entire runs selected for removal.event_countint =0— Number of events belonging to those runs.deletedbool =False— Whether every planned deletion completed successfully.
Attributes
counts dict[str, int]
counts dict[str, int]Return the number of selected objects and database rows by kind.