DreamLoopOrchestrator

Composes ConsolidationPasses into a repeatable consolidation cycle — the "dream loop".

Each cycle fetches the ACTIVE snapshot for a context once, runs every registered pass over it in registration order, aggregates what all passes want to save into a single write, and returns a DreamLoopReport. Passes are pure; only the orchestrator writes to the repository.

There are two ways to trigger a cycle:

  • consolidate is threshold-gated and returns null when not enough has changed.

  • consolidateNow always runs regardless of how much has changed.

val orchestrator = DefaultDreamLoopOrchestrator.withRepository(repository)
.withPass(sessionConsolidationPass)
.withPass(abstractionPass)
.withPass(contradictionResolutionPass)
.withPass(decaySweepPass)

// Scheduled / threshold-gated: may return null if little has changed.
val maybeReport = orchestrator.consolidate(contextId)

// Always runs.
val report = orchestrator.consolidateNow(contextId)

Inheritors

Functions

Link copied to clipboard
abstract fun consolidate(contextId: <Error class: unknown class>): DreamLoopReport?

Run a consolidation cycle only if enough has changed since the last cycle.

Link copied to clipboard
abstract fun consolidateNow(contextId: <Error class: unknown class>): DreamLoopReport

Run a consolidation cycle unconditionally, regardless of how much has changed.

Link copied to clipboard
abstract fun maintain(contextId: <Error class: unknown class>, sessionPropositions: List<Proposition> = emptyList()): MaintenanceResult

Run all maintenance stages for the given context.

Link copied to clipboard

Add a pass and return a new orchestrator with it appended. Registration order is execution order.