diff --git a/apps/server/integration/OrchestrationEngineHarness.integration.ts b/apps/server/integration/OrchestrationEngineHarness.integration.ts index 408ea827c2..152ed1d608 100644 --- a/apps/server/integration/OrchestrationEngineHarness.integration.ts +++ b/apps/server/integration/OrchestrationEngineHarness.integration.ts @@ -289,9 +289,10 @@ export const makeOrchestrationIntegrationHarness = ( ); const checkpointStoreLayer = CheckpointStoreLive.pipe(Layer.provide(GitCoreLive)); + const projectionSnapshotQueryLayer = OrchestrationProjectionSnapshotQueryLive; const runtimeServicesLayer = Layer.mergeAll( - orchestrationLayer, - OrchestrationProjectionSnapshotQueryLive, + projectionSnapshotQueryLayer, + orchestrationLayer.pipe(Layer.provide(projectionSnapshotQueryLayer)), ProjectionCheckpointRepositoryLive, ProjectionPendingApprovalRepositoryLive, checkpointStoreLayer, @@ -333,7 +334,9 @@ export const makeOrchestrationIntegrationHarness = ( Layer.provideMerge(providerCommandReactorLayer), Layer.provideMerge(checkpointReactorLayer), ); - const layer = orchestrationReactorLayer.pipe( + const layer = Layer.empty.pipe( + Layer.provideMerge(runtimeServicesLayer), + Layer.provideMerge(orchestrationReactorLayer), Layer.provide(persistenceLayer), Layer.provideMerge(ServerSettingsService.layerTest()), Layer.provideMerge(ServerConfig.layerTest(workspaceDir, rootDir)), diff --git a/apps/server/src/server.ts b/apps/server/src/server.ts index 40a8eb09bc..4e296e817a 100644 --- a/apps/server/src/server.ts +++ b/apps/server/src/server.ts @@ -99,12 +99,24 @@ const ReactorLayerLive = Layer.empty.pipe( Layer.provideMerge(RuntimeReceiptBusLive), ); -const OrchestrationLayerLive = Layer.empty.pipe( - Layer.provideMerge(OrchestrationProjectionSnapshotQueryLive), - Layer.provideMerge(OrchestrationEngineLive), - Layer.provideMerge(OrchestrationProjectionPipelineLive), - Layer.provideMerge(OrchestrationEventStoreLive), - Layer.provideMerge(OrchestrationCommandReceiptRepositoryLive), +const OrchestrationEventInfrastructureLayerLive = Layer.mergeAll( + OrchestrationEventStoreLive, + OrchestrationCommandReceiptRepositoryLive, +); + +const OrchestrationProjectionPipelineLayerLive = OrchestrationProjectionPipelineLive.pipe( + Layer.provide(OrchestrationEventStoreLive), +); + +const OrchestrationInfrastructureLayerLive = Layer.mergeAll( + OrchestrationProjectionSnapshotQueryLive, + OrchestrationEventInfrastructureLayerLive, + OrchestrationProjectionPipelineLayerLive, +); + +const OrchestrationLayerLive = Layer.mergeAll( + OrchestrationInfrastructureLayerLive, + OrchestrationEngineLive.pipe(Layer.provide(OrchestrationInfrastructureLayerLive)), ); const CheckpointingLayerLive = Layer.empty.pipe(