Skip to content

Commit 362933c

Browse files
juliusmarmingecodex
andcommitted
Fix orchestration layer composition
Co-authored-by: codex <codex@users.noreply.github.com>
1 parent a8643c0 commit 362933c

2 files changed

Lines changed: 24 additions & 9 deletions

File tree

apps/server/integration/OrchestrationEngineHarness.integration.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,10 @@ export const makeOrchestrationIntegrationHarness = (
289289
);
290290

291291
const checkpointStoreLayer = CheckpointStoreLive.pipe(Layer.provide(GitCoreLive));
292+
const projectionSnapshotQueryLayer = OrchestrationProjectionSnapshotQueryLive;
292293
const runtimeServicesLayer = Layer.mergeAll(
293-
orchestrationLayer,
294-
OrchestrationProjectionSnapshotQueryLive,
294+
projectionSnapshotQueryLayer,
295+
orchestrationLayer.pipe(Layer.provide(projectionSnapshotQueryLayer)),
295296
ProjectionCheckpointRepositoryLive,
296297
ProjectionPendingApprovalRepositoryLive,
297298
checkpointStoreLayer,
@@ -333,7 +334,9 @@ export const makeOrchestrationIntegrationHarness = (
333334
Layer.provideMerge(providerCommandReactorLayer),
334335
Layer.provideMerge(checkpointReactorLayer),
335336
);
336-
const layer = orchestrationReactorLayer.pipe(
337+
const layer = Layer.empty.pipe(
338+
Layer.provideMerge(runtimeServicesLayer),
339+
Layer.provideMerge(orchestrationReactorLayer),
337340
Layer.provide(persistenceLayer),
338341
Layer.provideMerge(ServerSettingsService.layerTest()),
339342
Layer.provideMerge(ServerConfig.layerTest(workspaceDir, rootDir)),

apps/server/src/server.ts

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,24 @@ const ReactorLayerLive = Layer.empty.pipe(
9999
Layer.provideMerge(RuntimeReceiptBusLive),
100100
);
101101

102-
const OrchestrationLayerLive = Layer.empty.pipe(
103-
Layer.provideMerge(OrchestrationProjectionSnapshotQueryLive),
104-
Layer.provideMerge(OrchestrationEngineLive),
105-
Layer.provideMerge(OrchestrationProjectionPipelineLive),
106-
Layer.provideMerge(OrchestrationEventStoreLive),
107-
Layer.provideMerge(OrchestrationCommandReceiptRepositoryLive),
102+
const OrchestrationEventInfrastructureLayerLive = Layer.mergeAll(
103+
OrchestrationEventStoreLive,
104+
OrchestrationCommandReceiptRepositoryLive,
105+
);
106+
107+
const OrchestrationProjectionPipelineLayerLive = OrchestrationProjectionPipelineLive.pipe(
108+
Layer.provide(OrchestrationEventStoreLive),
109+
);
110+
111+
const OrchestrationInfrastructureLayerLive = Layer.mergeAll(
112+
OrchestrationProjectionSnapshotQueryLive,
113+
OrchestrationEventInfrastructureLayerLive,
114+
OrchestrationProjectionPipelineLayerLive,
115+
);
116+
117+
const OrchestrationLayerLive = Layer.mergeAll(
118+
OrchestrationInfrastructureLayerLive,
119+
OrchestrationEngineLive.pipe(Layer.provide(OrchestrationInfrastructureLayerLive)),
108120
);
109121

110122
const CheckpointingLayerLive = Layer.empty.pipe(

0 commit comments

Comments
 (0)