ConsolidationPass

One composable step in a consolidation cycle. A pass receives the current snapshot of propositions for a context, decides what should change, and reports it back as a ConsolidationPassResult — it never writes anything itself.

Purity contract

A pass works only with the snapshot it is handed and never touches a repository directly. The orchestrator owns all writes: it fetches the snapshot once, runs each pass over it, and applies the accumulated saves/deletes in a single write per cycle.

Passes MUST be idempotent: running the same pass twice with no intervening write must produce ConsolidationPassResult.NoOp on the second run. The orchestrator runs each pass once per cycle, so successive scheduled cycles converge on a settled snapshot; a pass that keeps returning ConsolidationPassResult.Changed for an already-consolidated snapshot would re-save the same data every cycle instead of quieting down.

Implement this interface to add domain-specific consolidation behavior without touching DICE core.

Inheritors

Properties

Link copied to clipboard
abstract val name: String

Short, stable identifier used in reports and logging (e.g. "abstraction").

Functions

Link copied to clipboard
abstract fun run(contextId: <Error class: unknown class>, propositions: List<Proposition>): ConsolidationPassResult

Consolidate the snapshot propositions for contextId, reporting the outcome.