Plans and executes bounded pruning of fully terminal logical run chains.
History retention and idempotency retention are independent. The default
:keep policy preserves activity results and external ingress keys after run
history is removed. :delete is an explicit operator choice.
Summary
Functions
Executes a previously returned plan after locking and revalidating it.
Returns the next safe, bounded pruning plan without mutating data.
Types
@type idempotency_policy() :: :keep | :delete
@type plan() :: %{ chains: [map()], run_ids: [binary()], chain_count: non_neg_integer(), run_count: non_neg_integer(), dependent_counts: map(), idempotency_policy: idempotency_policy() }