Mondaic

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()

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
  • store ContentStoreBase — Explicitly local content store.
  • records RecordStore — Complete record database for this content store.
  • task str | None — Registered task name; explicitly None selects the whole store.
  • purge_provenance bool — Also remove disposable manifests and history.
  • delete bool — Apply the plan; otherwise return a read-only preview.
  • assume_idle bool — Required acknowledgement of exclusive idle maintenance. Prevent all writers and other collectors until this call ends.
Returns PruneReport

Classes

PruneReport

class 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_keys tuple[str, ...] — Cache entries selected for removal.
  • binding_keys tuple[str, ...] — Publication bindings selected for removal.
  • blob_digests tuple[str, ...] — Unprotected content selected for removal.
  • manifest_ids tuple[int, ...] — Disposable provenance selected for removal.
  • observation_digests tuple[str, ...] — Digests whose file observations are removed.
  • observation_count int — Number of those observation rows.
  • run_ids tuple[str, ...] — Entire runs selected for removal.
  • event_count int — Number of events belonging to those runs.
  • deleted bool — Whether every planned deletion completed successfully.
Attributes
counts dict[str, int]

Return the number of selected objects and database rows by kind.