class RailsAiAdmin::Prune
Deletes bookkeeping rows that can no longer be used (RAA-005): proposed intents and fixed selections whose expiry passed more than older_than ago. It never touches a run that started, succeeded or belongs to a collection, anything still referenced by work, batch or child rows, or audit events (their retention is the hostβs decision, see ADR 0005).
Constants
- BATCH
- DEFAULT_AGE
- Result
Public Class Methods
Source
# File lib/rails_ai_admin/prune.rb, line 14 def initialize(older_than: DEFAULT_AGE, now: Time.current) unless older_than.is_a?(ActiveSupport::Duration) || older_than.is_a?(Numeric) raise ConfigurationError, "older_than must be a duration" end raise ConfigurationError, "older_than must not be negative" if older_than.to_i.negative? @cutoff = now - older_than end
Public Instance Methods
Source
# File lib/rails_ai_admin/prune.rb, line 22 def call Result.new(prune_intents, prune_selections) end