The best way to control Claude Code, Codex and more from any computer or phone
refactor(server): classify orchestration exports (#10275)
Julius Marminge committed
Sep 8, 2026 at 01:11 UTC
0af04f1801ea75119c74fd406ced7da6c9c71721
7 files changed
+9
-30
apps/server/src/orchestration/Errors.ts
-23
@@ -126,13 +126,6 @@ export type OrchestrationEngineError =
126
| OrchestrationCommandJsonParseError
127
| OrchestrationCommandDecodeError;
128
129
-export function toOrchestrationCommandDecodeError(error: Schema.SchemaError) {
130
- return new OrchestrationCommandDecodeError({
131
- issue: SchemaIssue.makeFormatterDefault()(error.issue),
132
- cause: error,
133
- });
134
-}
135
-
129
export function toProjectorDecodeError(eventType: string) {
130
return (error: Schema.SchemaError): OrchestrationProjectorDecodeError =>
131
new OrchestrationProjectorDecodeError({
@@ -141,19 +134,3 @@ export function toProjectorDecodeError(eventType: string) {
134
cause: error,
135
});
136
}
144
-
145
-export function toOrchestrationJsonParseError(cause: unknown) {
146
- return new OrchestrationCommandJsonParseError({
147
- detail: `Failed to parse orchestration command JSON`,
148
- cause,
149
- });
150
-}
151
-
152
-export function toListenerCallbackError(listener: "read-model" | "domain-event") {
153
- return (cause: unknown): OrchestrationListenerCallbackError =>
154
- new OrchestrationListenerCallbackError({
155
- listener,
156
- detail: `Failed to invoke orchestration ${listener} listener`,
157
- cause,
158
- });
159
-}
apps/server/src/orchestration/LiveStreamBudget.ts
+2
-2
@@ -6,8 +6,8 @@ import * as Exit from "effect/Exit";
6
import * as Scope from "effect/Scope";
7
import * as Stream from "effect/Stream";
8
9
-export const LIVE_STREAM_MAX_ITEMS = 1_000;
10
-export const LIVE_STREAM_MAX_SERIALIZED_BYTES = 8 * 1024 * 1024;
9
+const LIVE_STREAM_MAX_ITEMS = 1_000;
10
+const LIVE_STREAM_MAX_SERIALIZED_BYTES = 8 * 1024 * 1024;
11
12
export interface RetainedLiveItem<A> {
13
readonly value: A;
apps/server/src/orchestration/ThreadPullRequestReactor.ts
+1
@@ -77,6 +77,7 @@ export function pullRequestMatchesProject(
77
);
78
}
79
80
+/** @public Service construction is part of the canonical Effect module API. */
81
export const make = Effect.gen(function* () {
82
const engine = yield* OrchestrationEngine.OrchestrationEngineService;
83
const snapshots = yield* ProjectionSnapshotQuery.ProjectionSnapshotQuery;
apps/server/src/orchestration/ThreadSettlementPolicy.ts
+1
-1
@@ -8,7 +8,7 @@ export interface SettlementPullRequest {
8
}
9
10
const DAY_MS = 24 * 60 * 60 * 1_000;
11
-export const QUEUED_TURN_START_GRACE_MS = 2 * 60 * 1_000;
11
+const QUEUED_TURN_START_GRACE_MS = 2 * 60 * 1_000;
12
13
function latestTimestamp(values: ReadonlyArray<string | null | undefined>): string | null {
14
let latest: string | null = null;
apps/server/src/orchestration/ThreadSettlementReactor.ts
+1
@@ -32,6 +32,7 @@ export class ThreadSettlementReactor extends Context.Service<
32
}
33
>()("t3/orchestration/ThreadSettlementReactor") {}
34
35
+/** @public Service construction is part of the canonical Effect module API. */
36
export const make = Effect.gen(function* () {
37
const engine = yield* OrchestrationEngine.OrchestrationEngineService;
38
const snapshots = yield* ProjectionSnapshotQuery.ProjectionSnapshotQuery;
apps/server/src/orchestration/commandInvariants.ts
+1
-1
@@ -25,7 +25,7 @@ function findThreadById(
25
return readModel.threads.find((thread) => thread.id === threadId);
26
}
27
28
-export function findProjectById(
28
+function findProjectById(
29
readModel: OrchestrationReadModel,
30
projectId: ProjectId,
31
): OrchestrationProject | undefined {
apps/server/src/orchestration/runtimeLayer.ts
+3
-3
@@ -8,16 +8,16 @@ import { OrchestrationProjectionSnapshotQueryLive } from "./Layers/ProjectionSna
8
import * as ThreadBackgroundLiveness from "./ThreadBackgroundLiveness.ts";
9
import * as ThreadPlanProgress from "./ThreadPlanProgress.ts";
10
11
-export const OrchestrationEventInfrastructureLayerLive = Layer.mergeAll(
11
+const OrchestrationEventInfrastructureLayerLive = Layer.mergeAll(
12
OrchestrationEventStoreLive,
13
OrchestrationCommandReceiptRepositoryLive,
14
);
15
16
-export const OrchestrationProjectionPipelineLayerLive = OrchestrationProjectionPipelineLive.pipe(
16
+const OrchestrationProjectionPipelineLayerLive = OrchestrationProjectionPipelineLive.pipe(
17
Layer.provide(OrchestrationEventStoreLive),
18
);
19
20
-export const OrchestrationInfrastructureLayerLive = Layer.mergeAll(
20
+const OrchestrationInfrastructureLayerLive = Layer.mergeAll(
21
OrchestrationProjectionSnapshotQueryLive,
22
OrchestrationEventInfrastructureLayerLive,
23
OrchestrationProjectionPipelineLayerLive,