StatusTransitionPolicy

Policy SPI: determines whether a proposition should transition lifecycle status.

Lifecycle state is the output of a policy evaluation over proposition signals (effective confidence, importance, reinforcement, pinned). The PropositionStatus enum is a label applied after the policy runs; this interface separates "what state should this proposition be in?" (policy) from "what is its current state?" (the label).

Implementations are stateless and are invoked per-proposition by a sweep (see com.embabel.dice.proposition.DecaySweeper). Return null to indicate that no transition is needed.

Consumers may supply their own implementations to handle domain-specific staleness signals (e.g. a schema-version policy) without editing DICE core.

Example usage:

val policy: StatusTransitionPolicy = DecayStatusPolicy()
val target = policy.evaluate(proposition)
if (target != null) {
// proposition.withStatus(target)
}

Inheritors

Functions

Link copied to clipboard
abstract fun evaluate(proposition: Proposition): PropositionStatus?

Evaluate the target lifecycle status for a proposition.