# Files changed · PR \#10275 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/pull/10275/diffs)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

[refactor\(server\): classify orchestration exports](https://git.cafe/pingdotgg/t3code/pull/10275.md)

Version: 3

Head commit: 1c4dfeec34410f080a13c3201fd45494fea2350b

Base commit: 52679c3a00274b06fd2cc2a4e678bfe1455cd870

Comparison base: 52679c3a00274b06fd2cc2a4e678bfe1455cd870

Showing up to 20 entries from this revision. If the pull request changes, reopen the first page before continuing.

## apps/server/src/orchestration/Errors.ts

Status: modified; +0; −23

```diff
@@ -126,13 +126,6 @@
   | OrchestrationCommandJsonParseError
   | OrchestrationCommandDecodeError;
 
-export function toOrchestrationCommandDecodeError(error: Schema.SchemaError) {
-  return new OrchestrationCommandDecodeError({
-    issue: SchemaIssue.makeFormatterDefault()(error.issue),
-    cause: error,
-  });
-}
-
 export function toProjectorDecodeError(eventType: string) {
   return (error: Schema.SchemaError): OrchestrationProjectorDecodeError =>
     new OrchestrationProjectorDecodeError({
@@ -141,19 +134,3 @@
       cause: error,
     });
 }
-
-export function toOrchestrationJsonParseError(cause: unknown) {
-  return new OrchestrationCommandJsonParseError({
-    detail: `Failed to parse orchestration command JSON`,
-    cause,
-  });
-}
-
-export function toListenerCallbackError(listener: "read-model" | "domain-event") {
-  return (cause: unknown): OrchestrationListenerCallbackError =>
-    new OrchestrationListenerCallbackError({
-      listener,
-      detail: `Failed to invoke orchestration ${listener} listener`,
-      cause,
-    });
-}
```

## apps/server/src/orchestration/LiveStreamBudget.ts

Status: modified; +2; −2

```diff
@@ -6,8 +6,8 @@
 import * as Scope from "effect/Scope";
 import * as Stream from "effect/Stream";
 
-export const LIVE_STREAM_MAX_ITEMS = 1_000;
-export const LIVE_STREAM_MAX_SERIALIZED_BYTES = 8 * 1024 * 1024;
+const LIVE_STREAM_MAX_ITEMS = 1_000;
+const LIVE_STREAM_MAX_SERIALIZED_BYTES = 8 * 1024 * 1024;
 
 export interface RetainedLiveItem<A> {
   readonly value: A;
```

## apps/server/src/orchestration/ThreadPullRequestReactor.ts

Status: modified; +1; −0

```diff
@@ -77,6 +77,7 @@
   );
 }
 
+/** @public Service construction is part of the canonical Effect module API. */
 export const make = Effect.gen(function* () {
   const engine = yield* OrchestrationEngine.OrchestrationEngineService;
   const snapshots = yield* ProjectionSnapshotQuery.ProjectionSnapshotQuery;
```

## apps/server/src/orchestration/ThreadSettlementPolicy.ts

Status: modified; +1; −1

```diff
@@ -8,7 +8,7 @@
 }
 
 const DAY_MS = 24 * 60 * 60 * 1_000;
-export const QUEUED_TURN_START_GRACE_MS = 2 * 60 * 1_000;
+const QUEUED_TURN_START_GRACE_MS = 2 * 60 * 1_000;
 
 function latestTimestamp(values: ReadonlyArray<string | null | undefined>): string | null {
   let latest: string | null = null;
```

## apps/server/src/orchestration/ThreadSettlementReactor.ts

Status: modified; +1; −0

```diff
@@ -32,6 +32,7 @@
   }
 >()("t3/orchestration/ThreadSettlementReactor") {}
 
+/** @public Service construction is part of the canonical Effect module API. */
 export const make = Effect.gen(function* () {
   const engine = yield* OrchestrationEngine.OrchestrationEngineService;
   const snapshots = yield* ProjectionSnapshotQuery.ProjectionSnapshotQuery;
```

## apps/server/src/orchestration/commandInvariants.ts

Status: modified; +1; −1

```diff
@@ -25,7 +25,7 @@
   return readModel.threads.find((thread) => thread.id === threadId);
 }
 
-export function findProjectById(
+function findProjectById(
   readModel: OrchestrationReadModel,
   projectId: ProjectId,
 ): OrchestrationProject | undefined {
```

## apps/server/src/orchestration/runtimeLayer.ts

Status: modified; +3; −3

```diff
@@ -8,16 +8,16 @@
 import * as ThreadBackgroundLiveness from "./ThreadBackgroundLiveness.ts";
 import * as ThreadPlanProgress from "./ThreadPlanProgress.ts";
 
-export const OrchestrationEventInfrastructureLayerLive = Layer.mergeAll(
+const OrchestrationEventInfrastructureLayerLive = Layer.mergeAll(
   OrchestrationEventStoreLive,
   OrchestrationCommandReceiptRepositoryLive,
 );
 
-export const OrchestrationProjectionPipelineLayerLive = OrchestrationProjectionPipelineLive.pipe(
+const OrchestrationProjectionPipelineLayerLive = OrchestrationProjectionPipelineLive.pipe(
   Layer.provide(OrchestrationEventStoreLive),
 );
 
+const OrchestrationInfrastructureLayerLive = Layer.mergeAll(
-export const OrchestrationInfrastructureLayerLive = Layer.mergeAll(
   OrchestrationProjectionSnapshotQueryLive,
   OrchestrationEventInfrastructureLayerLive,
   OrchestrationProjectionPipelineLayerLive,
```
