diff --git a/apps/server/src/main/kotlin/com/correx/apps/server/Main.kt b/apps/server/src/main/kotlin/com/correx/apps/server/Main.kt index 4a41ade2..62609572 100644 --- a/apps/server/src/main/kotlin/com/correx/apps/server/Main.kt +++ b/apps/server/src/main/kotlin/com/correx/apps/server/Main.kt @@ -26,6 +26,7 @@ import com.correx.core.inference.InferenceRouter import com.correx.core.inference.ModelCapability import com.correx.core.kernel.orchestration.DefaultOrchestrationReducer import com.correx.core.kernel.orchestration.DefaultSessionOrchestrator +import com.correx.core.kernel.orchestration.JournalCompactionService import com.correx.core.kernel.orchestration.OrchestrationConfig import com.correx.core.kernel.orchestration.OrchestrationProjector import com.correx.core.kernel.orchestration.OrchestrationRepository @@ -235,6 +236,18 @@ fun main() { workspaceToolRegistryProvider = wsToolRegistryProvider, ) val decisionJournalRepository = InfrastructureModule.createDecisionJournalRepository(eventStore) + val defaultOrchestrationConfig = OrchestrationConfig( + sandboxRoot = sandboxRoot, + defaultSystemPromptPath = toolsConfig.defaultSystemPromptPath, + ) + val journalCompactionService = JournalCompactionService( + artifactStore = artifactStore, + summarize = { prompt -> + // TODO: wire real LLM summarizer — returns placeholder until inference is wired here + "Compacted journal summary (${prompt.lines().size} records)" + }, + tokenThreshold = defaultOrchestrationConfig.journalCompactionTokenThreshold, + ) val orchestrator = DefaultSessionOrchestrator( repositories = repositories, engines = engines, @@ -242,10 +255,7 @@ fun main() { artifactStore = artifactStore, tokenizer = firstProvider.tokenizer, decisionJournalRepository = decisionJournalRepository, - ) - val defaultOrchestrationConfig = OrchestrationConfig( - sandboxRoot = sandboxRoot, - defaultSystemPromptPath = toolsConfig.defaultSystemPromptPath, + compactionService = journalCompactionService, ) val routerConfig = correxConfig.router val embedder = InfrastructureModule.createEmbedderFromConfig(routerConfig.embedder)