Skip to content

Commit 25b02f4

Browse files
Enable stricter Effect LSP rules (#2596)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
1 parent 131234b commit 25b02f4

409 files changed

Lines changed: 3120 additions & 2111 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/desktop/src/backend/DesktopBackendManager.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import * as Schema from "effect/Schema";
1515
import * as Sink from "effect/Sink";
1616
import * as Scope from "effect/Scope";
1717
import * as Stream from "effect/Stream";
18-
import { TestClock } from "effect/testing";
18+
import * as TestClock from "effect/testing/TestClock";
1919
import { HttpClient, HttpClientRequest, HttpClientResponse } from "effect/unstable/http";
2020
import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
2121

apps/desktop/src/ssh/DesktopSshEnvironment.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type {
33
DesktopSshEnvironmentBootstrap,
44
DesktopSshEnvironmentTarget,
55
} from "@t3tools/contracts";
6-
import { type NetError, NetService } from "@t3tools/shared/Net";
6+
import * as NetService from "@t3tools/shared/Net";
77
import {
88
SshPasswordPrompt,
99
type SshPasswordPromptShape,
@@ -35,7 +35,7 @@ export type DesktopSshEnvironmentRuntimeServices =
3535
| FileSystem.FileSystem
3636
| Path.Path
3737
| HttpClient.HttpClient
38-
| NetService;
38+
| NetService.NetService;
3939

4040
export type DesktopSshEnvironmentOperationError =
4141
| SshCommandError
@@ -44,7 +44,7 @@ export type DesktopSshEnvironmentOperationError =
4444
| SshPairingError
4545
| SshReadinessError
4646
| SshPasswordPromptError
47-
| NetError;
47+
| NetService.NetError;
4848

4949
export type DesktopSshEnvironmentDiscoverError = SshHostDiscoveryError;
5050

apps/desktop/src/ssh/DesktopSshPasswordPrompts.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import * as Effect from "effect/Effect";
44
import * as Fiber from "effect/Fiber";
55
import * as Layer from "effect/Layer";
66
import * as Option from "effect/Option";
7-
import { TestClock } from "effect/testing";
7+
import * as TestClock from "effect/testing/TestClock";
88
import type * as Electron from "electron";
99

1010
import * as ElectronWindow from "../electron/ElectronWindow.ts";

apps/desktop/src/updates/DesktopUpdates.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import * as Effect from "effect/Effect";
88
import * as Fiber from "effect/Fiber";
99
import * as Layer from "effect/Layer";
1010
import * as Option from "effect/Option";
11-
import { TestClock } from "effect/testing";
11+
import * as TestClock from "effect/testing/TestClock";
1212

1313
import * as DesktopBackendManager from "../backend/DesktopBackendManager.ts";
1414
import * as DesktopConfig from "../app/DesktopConfig.ts";

apps/desktop/tsconfig.json

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,7 @@
33
"compilerOptions": {
44
"composite": true,
55
"types": ["node", "electron"],
6-
"lib": ["ESNext", "DOM", "esnext.disposable"],
7-
"plugins": [
8-
{
9-
"name": "@effect/language-service",
10-
"namespaceImportPackages": ["@effect/platform-node", "effect"],
11-
"diagnosticSeverity": {
12-
"importFromBarrel": "error",
13-
"anyUnknownInErrorContext": "error",
14-
"instanceOfSchema": "warning",
15-
"deterministicKeys": "warning"
16-
}
17-
}
18-
]
6+
"lib": ["ESNext", "DOM", "esnext.disposable"]
197
},
208
"include": ["src", "tsdown.config.ts"]
219
}

apps/server/integration/OrchestrationEngineHarness.integration.ts

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// @effect-diagnostics nodeBuiltinImport:off
12
import { execFileSync } from "node:child_process";
23

34
import * as NodeServices from "@effect/platform-node/NodeServices";
@@ -8,20 +9,18 @@ import {
89
type OrchestrationEvent,
910
type OrchestrationThread,
1011
} from "@t3tools/contracts";
11-
import {
12-
Effect,
13-
Exit,
14-
FileSystem,
15-
Layer,
16-
ManagedRuntime,
17-
Option,
18-
Path,
19-
Ref,
20-
Schedule,
21-
Schema,
22-
Scope,
23-
Stream,
24-
} from "effect";
12+
import * as Effect from "effect/Effect";
13+
import * as Exit from "effect/Exit";
14+
import * as FileSystem from "effect/FileSystem";
15+
import * as Layer from "effect/Layer";
16+
import * as ManagedRuntime from "effect/ManagedRuntime";
17+
import * as Option from "effect/Option";
18+
import * as Path from "effect/Path";
19+
import * as Ref from "effect/Ref";
20+
import * as Schedule from "effect/Schedule";
21+
import * as Schema from "effect/Schema";
22+
import * as Scope from "effect/Scope";
23+
import * as Stream from "effect/Stream";
2524

2625
import { CheckpointStoreLive } from "../src/checkpointing/Layers/CheckpointStore.ts";
2726
import { CheckpointStore } from "../src/checkpointing/Services/CheckpointStore.ts";

apps/server/integration/TestProviderAdapter.integration.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { randomUUID } from "node:crypto";
2-
31
import {
42
ApprovalRequestId,
53
EventId,
@@ -12,7 +10,10 @@ import {
1210
TurnId,
1311
ProviderDriverKind,
1412
} from "@t3tools/contracts";
15-
import { Effect, Queue, Stream } from "effect";
13+
import * as Effect from "effect/Effect";
14+
import * as Queue from "effect/Queue";
15+
import * as Random from "effect/Random";
16+
import * as Stream from "effect/Stream";
1617

1718
import {
1819
ProviderAdapterSessionNotFoundError,
@@ -202,7 +203,7 @@ interface MakeTestProviderAdapterHarnessOptions {
202203
}
203204

204205
function nowIso(): string {
205-
return new Date().toISOString();
206+
return "2026-01-01T00:00:00.000Z";
206207
}
207208

208209
function sessionNotFound(
@@ -308,10 +309,9 @@ export const makeTestProviderAdapterHarness = (options?: MakeTestProviderAdapter
308309
for (const fixtureEvent of response.events) {
309310
const rawEvent: Record<string, unknown> = {
310311
...(fixtureEvent as Record<string, unknown>),
311-
eventId: randomUUID(),
312+
eventId: yield* Random.nextUUIDv4,
312313
provider,
313314
sessionId: RuntimeSessionId.make(String(input.threadId)),
314-
createdAt: nowIso(),
315315
};
316316
rawEvent.threadId = state.snapshot.threadId;
317317
if (Object.hasOwn(rawEvent, "turnId")) {
@@ -366,7 +366,7 @@ export const makeTestProviderAdapterHarness = (options?: MakeTestProviderAdapter
366366
if (deferredTurnCompletedEvents.length === 0) {
367367
yield* emit({
368368
type: "turn.completed",
369-
eventId: EventId.make(randomUUID()),
369+
eventId: EventId.make(yield* Random.nextUUIDv4),
370370
provider,
371371
createdAt: nowIso(),
372372
threadId: state.snapshot.threadId,

apps/server/integration/orchestrationEngine.integration.test.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// @effect-diagnostics nodeBuiltinImport:off
12
import fs from "node:fs";
23
import path from "node:path";
34

@@ -17,7 +18,10 @@ import {
1718
ProviderInstanceId,
1819
} from "@t3tools/contracts";
1920
import { assert, it } from "@effect/vitest";
20-
import { Effect, Option, Schema } from "effect";
21+
import * as Clock from "effect/Clock";
22+
import * as Effect from "effect/Effect";
23+
import * as Option from "effect/Option";
24+
import * as Schema from "effect/Schema";
2125

2226
import type { TestTurnResponse } from "./TestProviderAdapter.integration.ts";
2327
import {
@@ -47,7 +51,7 @@ const CODEX_PROVIDER = ProviderDriverKind.make("codex");
4751
const CLAUDE_AGENT_PROVIDER = ProviderDriverKind.make("claudeAgent");
4852

4953
function nowIso() {
50-
return new Date().toISOString();
54+
return "2026-05-01T00:00:00.000Z";
5155
}
5256

5357
class IntegrationWaitTimeoutError extends Schema.TaggedErrorClass<IntegrationWaitTimeoutError>()(
@@ -64,14 +68,14 @@ function waitForSync<A>(
6468
timeoutMs = 10_000,
6569
): Effect.Effect<A, never> {
6670
return Effect.gen(function* () {
67-
const deadline = Date.now() + timeoutMs;
71+
const deadline = (yield* Clock.currentTimeMillis) + timeoutMs;
6872

6973
while (true) {
7074
const value = read();
7175
if (predicate(value)) {
7276
return value;
7377
}
74-
if (Date.now() >= deadline) {
78+
if ((yield* Clock.currentTimeMillis) >= deadline) {
7579
return yield* Effect.die(new IntegrationWaitTimeoutError({ description }));
7680
}
7781
yield* Effect.sleep(10);
@@ -156,6 +160,7 @@ const startTurn = (input: {
156160
readonly messageId: string;
157161
readonly text: string;
158162
readonly modelSelection?: ModelSelection;
163+
readonly createdAt?: string;
159164
}) =>
160165
input.harness.engine.dispatch({
161166
type: "thread.turn.start",
@@ -174,7 +179,7 @@ const startTurn = (input: {
174179
: {}),
175180
interactionMode: DEFAULT_PROVIDER_INTERACTION_MODE,
176181
runtimeMode: "approval-required",
177-
createdAt: nowIso(),
182+
createdAt: input.createdAt ?? nowIso(),
178183
});
179184

180185
it.live("runs a single turn end-to-end and persists checkpoint state in sqlite + git", () =>
@@ -755,6 +760,7 @@ it.live("reverts to an earlier checkpoint and trims checkpoint projections + git
755760
commandId: "cmd-turn-start-revert-1",
756761
messageId: "msg-user-revert-1",
757762
text: "First edit",
763+
createdAt: "2026-02-24T10:04:59.900Z",
758764
});
759765

760766
yield* harness.waitForThread(
@@ -813,6 +819,7 @@ it.live("reverts to an earlier checkpoint and trims checkpoint projections + git
813819
commandId: "cmd-turn-start-revert-2",
814820
messageId: "msg-user-revert-2",
815821
text: "Second edit",
822+
createdAt: "2026-02-24T10:05:00.900Z",
816823
});
817824

818825
yield* harness.waitForThread(

apps/server/integration/providerService.integration.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@ import { ProviderDriverKind, ProviderInstanceId, ThreadId } from "@t3tools/contr
33
import { DEFAULT_SERVER_SETTINGS } from "@t3tools/contracts/settings";
44
import * as NodeServices from "@effect/platform-node/NodeServices";
55
import { it, assert } from "@effect/vitest";
6-
import { Effect, FileSystem, Layer, Path, Queue, Stream } from "effect";
6+
import * as Effect from "effect/Effect";
7+
import * as FileSystem from "effect/FileSystem";
8+
import * as Layer from "effect/Layer";
9+
import * as Path from "effect/Path";
10+
import * as Queue from "effect/Queue";
11+
import * as Stream from "effect/Stream";
712

813
import { ProviderAdapterRegistry } from "../src/provider/Services/ProviderAdapterRegistry.ts";
914
import { makeAdapterRegistryMock } from "../src/provider/testUtils/providerAdapterRegistryMock.ts";

apps/server/scripts/acp-mock-agent.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env bun
2+
// @effect-diagnostics nodeBuiltinImport:off
23
import { appendFileSync } from "node:fs";
34

45
import * as Effect from "effect/Effect";

0 commit comments

Comments
 (0)