From 02cde95c51befcf2f5b86a9d61b10510e7ac0110 Mon Sep 17 00:00:00 2001 From: Erik Thorelli Date: Tue, 6 Oct 2026 11:55:12 -0700 Subject: [PATCH] chore(tsconfig): turn off the Schema-over-JSON diagnostic in test files Test files carried 219 exceptions to preferSchemaOverJson, mostly without a reason: fixtures and assertions read and write raw JSON on purpose. One override in tsconfig.base.json turns the rule off for *.test.ts(x), and those exceptions go. Source files and test helpers keep the rule, and tests keep every other diagnostic, including nodeBuiltinImport. --- .../features/cloud/linkEnvironment.test.ts | 2 - apps/server/src/cli/config.test.ts | 5 -- apps/server/src/cli/pair.test.ts | 1 - apps/server/src/cloud/bootService.test.ts | 4 -- apps/server/src/cloud/selfUpdate.test.ts | 1 - apps/server/src/device/SshDeviceHost.test.ts | 1 - .../server/src/device/sshDeviceScript.test.ts | 2 +- apps/server/src/git/GitManager.test.ts | 52 ----------------- apps/server/src/keybindings.test.ts | 1 - .../src/mcp/AcpMcpOverAcpBridge.test.ts | 1 - apps/server/src/mcp/AcpMcpStdioBridge.test.ts | 2 +- .../src/orchestration-v2/ProjectStore.test.ts | 1 - .../016_CanonicalizeModelSelections.test.ts | 7 --- .../provider/ClaudeCapabilitiesProbe.test.ts | 2 - .../src/provider/CodexChatGptAuth.test.ts | 2 +- .../src/provider/CodexChatGptModels.test.ts | 1 - apps/server/src/provider/GrokProvider.test.ts | 2 - .../provider/ProviderInstanceRegistry.test.ts | 2 - .../AzureDevOpsPullRequestCli.test.ts | 9 --- .../BitbucketPullRequestApi.test.ts | 16 ----- .../pullRequest/GitHubPullRequestCli.test.ts | 58 +------------------ .../pullRequest/GitLabPullRequestCli.test.ts | 40 +------------ .../pullRequest/githubStackActions.test.ts | 1 - apps/server/src/serverSettings.test.ts | 12 +--- apps/server/src/serviceLauncher.test.ts | 3 - .../src/sourceControl/AzureDevOpsCli.test.ts | 5 -- .../src/sourceControl/BitbucketApi.test.ts | 2 - .../src/sourceControl/GitHubCli.test.ts | 5 -- .../src/sourceControl/GitLabCli.test.ts | 13 +---- .../ClaudeTextGeneration.test.ts | 1 - apps/server/src/vcs/VcsProjectConfig.test.ts | 2 - apps/web/src/cloud/linkEnvironment.test.ts | 4 -- .../src/state/pullRequestDiffHttp.test.ts | 1 - tsconfig.base.json | 8 ++- 34 files changed, 17 insertions(+), 252 deletions(-) diff --git a/apps/mobile/src/features/cloud/linkEnvironment.test.ts b/apps/mobile/src/features/cloud/linkEnvironment.test.ts index a236663c9ea8..1e78f250ef4e 100644 --- a/apps/mobile/src/features/cloud/linkEnvironment.test.ts +++ b/apps/mobile/src/features/cloud/linkEnvironment.test.ts @@ -293,7 +293,6 @@ describe("mobile cloud link environment client", () => { const bodies: Array = []; const fetchMock = vi.fn((url: string | URL, init?: RequestInit) => { if (init?.body) { - // @effect-diagnostics-next-line preferSchemaOverJson:off bodies.push(JSON.parse(requestBodyText(init.body))); } if (String(url).endsWith("/v1/client/environment-link-challenges")) { @@ -348,7 +347,6 @@ describe("mobile cloud link environment client", () => { const bodies: Array> = []; const fetchMock = vi.fn((url: string | URL, init?: RequestInit) => { if (init?.body) { - // @effect-diagnostics-next-line preferSchemaOverJson:off bodies.push(JSON.parse(requestBodyText(init.body)) as Record); } if (String(url).endsWith("/v1/client/environment-link-challenges")) { diff --git a/apps/server/src/cli/config.test.ts b/apps/server/src/cli/config.test.ts index 17072a5e1c35..04f6c3ca7a8c 100644 --- a/apps/server/src/cli/config.test.ts +++ b/apps/server/src/cli/config.test.ts @@ -650,7 +650,6 @@ it.layer(NodeServices.layer)("cli config resolution", (it) => { yield* fs.makeDirectory(path.dirname(derivedPaths.settingsPath), { recursive: true }); yield* fs.writeFileString( derivedPaths.settingsPath, - // @effect-diagnostics-next-line preferSchemaOverJson:off `${JSON.stringify({ observability: { otlpTracesUrl: "http://localhost:4318/v1/traces", @@ -722,7 +721,6 @@ it.layer(NodeServices.layer)("cli config resolution", (it) => { yield* fs.makeDirectory(path.dirname(derivedPaths.settingsPath), { recursive: true }); yield* fs.writeFileString( derivedPaths.settingsPath, - // @effect-diagnostics-next-line preferSchemaOverJson:off `${JSON.stringify({ observability: { otlpTracesUrl: "http://localhost:4318/v1/traces", @@ -774,7 +772,6 @@ it.layer(NodeServices.layer)("cli config resolution", (it) => { yield* fs.makeDirectory(path.dirname(derivedPaths.settingsPath), { recursive: true }); yield* fs.writeFileString( derivedPaths.settingsPath, - // @effect-diagnostics-next-line preferSchemaOverJson:off `${JSON.stringify({ observability: { otlpTracesUrl: "http://localhost:4318/v1/traces", @@ -1073,7 +1070,6 @@ it.layer(NodeServices.layer)("cli config resolution", (it) => { yield* fs.makeDirectory(path.dirname(derivedPaths.settingsPath), { recursive: true }); yield* fs.writeFileString( derivedPaths.settingsPath, - // @effect-diagnostics-next-line preferSchemaOverJson:off `${JSON.stringify({ observability: { otlpLogsUrl: "http://settings:4318/v1/logs" } })}\n`, ); @@ -1145,7 +1141,6 @@ it.layer(NodeServices.layer)("cli config resolution", (it) => { yield* fs.makeDirectory(path.dirname(derivedPaths.settingsPath), { recursive: true }); yield* fs.writeFileString( derivedPaths.settingsPath, - // @effect-diagnostics-next-line preferSchemaOverJson:off `${JSON.stringify({ observability: { otlpLogsUrl: "http://settings:4318/v1/logs" } })}\n`, ); diff --git a/apps/server/src/cli/pair.test.ts b/apps/server/src/cli/pair.test.ts index 39fe8652ce61..77cd8f1f0bc9 100644 --- a/apps/server/src/cli/pair.test.ts +++ b/apps/server/src/cli/pair.test.ts @@ -173,7 +173,6 @@ describe("t3 pair", () => { const listed = yield* captureStdout( runCli(["auth", "pairing", "list", "--base-dir", baseDir, "--json"]), ); - // @effect-diagnostics-next-line preferSchemaOverJson:off - CLI JSON output is decoded as a presentation DTO. const credentials = JSON.parse(listed) as ReadonlyArray<{ readonly label?: string }>; assert.equal(credentials.length, 1); assert.equal(credentials[0]?.label, "t3 pair"); diff --git a/apps/server/src/cloud/bootService.test.ts b/apps/server/src/cloud/bootService.test.ts index 4d8bae4377c4..85de4a7bd437 100644 --- a/apps/server/src/cloud/bootService.test.ts +++ b/apps/server/src/cloud/bootService.test.ts @@ -359,7 +359,6 @@ it.layer(NodeServices.layer)("boot service install", (it) => { current: true, installedVersion: "1.2.3", }); - // @effect-diagnostics-next-line preferSchemaOverJson:off - fixed launcher-owned test document. const pendingState = JSON.stringify({ protocol: SERVICE_LAUNCHER_PROTOCOL, activeVersion: "1.2.3", @@ -546,7 +545,6 @@ it.layer(NodeServices.layer)("boot service install", (it) => { Effect.gen(function* () { const { service, fs, statePath } = yield* makeHarness(); yield* service.install(); - // @effect-diagnostics-next-line preferSchemaOverJson:off - fixed launcher-owned test document. const pendingState = JSON.stringify({ protocol: SERVICE_LAUNCHER_PROTOCOL, activeVersion: "1.2.3", @@ -647,7 +645,6 @@ it.layer(NodeServices.layer)("boot service install", (it) => { Effect.gen(function* () { const { service, fs, statePath, commands } = yield* makeHarness(); yield* service.install(); - // @effect-diagnostics-next-line preferSchemaOverJson:off - fixed launcher-owned test document. const pendingState = JSON.stringify({ protocol: SERVICE_LAUNCHER_PROTOCOL - 1, activeVersion: "1.2.3", @@ -808,7 +805,6 @@ it.layer(NodeServices.layer)("boot service install", (it) => { const { service, fs, statePath, commands } = yield* makeHarness("darwin"); yield* service.install(); const plistPath = (yield* service.status).unitPath; - // @effect-diagnostics-next-line preferSchemaOverJson:off - fixed launcher-owned test document. const pendingState = JSON.stringify({ protocol: SERVICE_LAUNCHER_PROTOCOL - 1, activeVersion: "1.2.3", diff --git a/apps/server/src/cloud/selfUpdate.test.ts b/apps/server/src/cloud/selfUpdate.test.ts index 2ee84535470c..111b62c8a481 100644 --- a/apps/server/src/cloud/selfUpdate.test.ts +++ b/apps/server/src/cloud/selfUpdate.test.ts @@ -84,7 +84,6 @@ const makeHarness = Effect.fn("test.make_self_update_harness")(function* ( launcherProtocol: SERVICE_LAUNCHER_PROTOCOL, }; return { - // @effect-diagnostics-next-line preferSchemaOverJson:off - fake child-process stdout. stdout: JSON.stringify(result), stderr: "", code: ChildProcessSpawner.ExitCode(0), diff --git a/apps/server/src/device/SshDeviceHost.test.ts b/apps/server/src/device/SshDeviceHost.test.ts index f0d0a7ece0ae..871f66bae0d6 100644 --- a/apps/server/src/device/SshDeviceHost.test.ts +++ b/apps/server/src/device/SshDeviceHost.test.ts @@ -1,4 +1,3 @@ -// @effect-diagnostics preferSchemaOverJson:off - the external process fixture emits raw JSON over SSH stdout. import { expect, it } from "@effect/vitest"; import * as NodeServices from "@effect/platform-node/NodeServices"; import * as Net from "@t3tools/shared/Net"; diff --git a/apps/server/src/device/sshDeviceScript.test.ts b/apps/server/src/device/sshDeviceScript.test.ts index 8d9bc77d891c..f1f56c715e60 100644 --- a/apps/server/src/device/sshDeviceScript.test.ts +++ b/apps/server/src/device/sshDeviceScript.test.ts @@ -1,4 +1,4 @@ -// @effect-diagnostics nodeBuiltinImport:off globalFetchInEffect:off preferSchemaOverJson:off - verifies generated remote scripts using real shell and Node processes. +// @effect-diagnostics nodeBuiltinImport:off globalFetchInEffect:off - verifies generated remote scripts using real shell and Node processes. import * as Effect from "effect/Effect"; import { HostProcessPlatform } from "@t3tools/shared/hostProcess"; import { describe, expect, it } from "@effect/vitest"; diff --git a/apps/server/src/git/GitManager.test.ts b/apps/server/src/git/GitManager.test.ts index 43eaa08de53a..44202044e819 100644 --- a/apps/server/src/git/GitManager.test.ts +++ b/apps/server/src/git/GitManager.test.ts @@ -781,7 +781,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { const { manager } = yield* makeManager({ ghScenario: { prListSequence: [ - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { number: 13, @@ -826,7 +825,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { const { manager } = yield* makeManager({ ghScenario: { prListSequence: [ - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { number: 14, @@ -866,7 +864,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { const { manager } = yield* makeManager({ ghScenario: { prListSequence: [ - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { number: 0, @@ -919,7 +916,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { const { manager } = yield* makeManager({ ghScenario: { prListSequence: [ - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { number: 16, @@ -1033,7 +1029,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { }; const { manager, ghCalls } = yield* makeManager({ ghScenario: { - // @effect-diagnostics-next-line preferSchemaOverJson:off prListSequence: [JSON.stringify([existingPr]), JSON.stringify([existingPr])], }, }); @@ -1086,7 +1081,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { ghScenario: { prListSequence: [ // Fake gh returns raw JSON stdout, matching the CLI boundary under test. - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { number: 217, @@ -1129,7 +1123,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { prListSequence: [ "[]", // Fake gh returns raw JSON stdout, matching the CLI boundary under test. - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { number: 114, @@ -1235,7 +1228,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { ghScenario: { prListSequence: [ // Fake gh returns raw JSON stdout, matching the CLI boundary under test. - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { number: 216, @@ -1287,7 +1279,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { ghScenario: { // Fake gh returns raw JSON stdout, matching the CLI boundary under test. prListSequence: [ - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { number: 221, @@ -1338,7 +1329,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { ghScenario: { prListSequence: [ // Fake gh returns raw JSON stdout, matching the CLI boundary under test. - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { number: 217, @@ -1401,7 +1391,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { ghScenario: { prListByHeadSelector: { // Fake gh returns raw JSON stdout, matching the CLI boundary under test. - // @effect-diagnostics-next-line preferSchemaOverJson:off "feature/deleted-fork-branch": JSON.stringify([ { number: 218, @@ -1483,7 +1472,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { ghScenario: { prListSequence: [ // Fake gh returns raw JSON stdout, matching the CLI boundary under test. - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { number: 219, @@ -1536,7 +1524,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { ghScenario: { prListSequence: [ // Fake gh returns raw JSON stdout, matching the CLI boundary under test. - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { number: 220, @@ -1710,7 +1697,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { const { manager, ghCalls } = yield* makeManager({ ghScenario: { prListSequence: [ - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { number: 215, @@ -1759,7 +1745,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { const { manager, ghCalls } = yield* makeManager({ ghScenario: { prListSequence: [ - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { number: 214, @@ -1982,7 +1967,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { const { manager } = yield* makeManager({ ghScenario: { prListSequence: [ - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { number: 1661, @@ -2036,7 +2020,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { const { manager, ghCalls } = yield* makeManager({ ghScenario: { prListSequence: [ - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { number: 488, @@ -2102,7 +2085,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { const { manager, ghCalls } = yield* makeManager({ ghScenario: { prListByHeadSelector: { - // @effect-diagnostics-next-line preferSchemaOverJson:off main: JSON.stringify([ { number: 777, @@ -2178,7 +2160,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { const { manager, ghCalls } = yield* makeManager({ ghScenario: { prListByHeadSelector: { - // @effect-diagnostics-next-line preferSchemaOverJson:off "effect-atom": JSON.stringify([ { number: 1618, @@ -2190,7 +2171,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { updatedAt: "2026-03-01T10:00:00Z", }, ]), - // @effect-diagnostics-next-line preferSchemaOverJson:off "upstream/effect-atom": JSON.stringify([ { number: 1518, @@ -2241,7 +2221,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { const { manager } = yield* makeManager({ ghScenario: { prListSequence: [ - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { number: 22, @@ -2280,7 +2259,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { const { manager } = yield* makeManager({ ghScenario: { prListSequence: [ - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { number: 23, @@ -2316,7 +2294,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { const { manager, ghCalls } = yield* makeManager({ ghScenario: { prListSequence: [ - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { number: 54, @@ -2356,7 +2333,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { ghScenario: { prListByHeadSelector: { // Fake gh returns raw JSON stdout, matching the CLI boundary under test. - // @effect-diagnostics-next-line preferSchemaOverJson:off "feature/pushed-plain": JSON.stringify([ { number: 88, @@ -2411,7 +2387,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { ghScenario: { prListByHeadSelector: { // Fake gh returns raw JSON stdout, matching the CLI boundary under test. - // @effect-diagnostics-next-line preferSchemaOverJson:off "feature/fork-plain": JSON.stringify([ { number: 89, @@ -2467,7 +2442,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { ghScenario: { prListByHeadSelector: { // Fake gh returns raw JSON stdout, matching the CLI boundary under test. - // @effect-diagnostics-next-line preferSchemaOverJson:off "feature/fork-settle": JSON.stringify([ { number: 91, @@ -2515,7 +2489,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { ghScenario: { prListByHeadSelector: { // Fake gh returns raw JSON stdout, matching the CLI boundary under test. - // @effect-diagnostics-next-line preferSchemaOverJson:off "feature/sticky-plain": JSON.stringify([ { number: 90, @@ -2555,7 +2528,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { const { manager } = yield* makeManager({ ghScenario: { prListSequence: [ - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { number: 45, @@ -2690,7 +2662,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { }; const { manager } = yield* makeManager({ ghScenario: { - // @effect-diagnostics-next-line preferSchemaOverJson:off prListSequence: [JSON.stringify([existingPr])], failWith: new GitHubCli.GitHubCliUnavailableError({ command: "gh", @@ -2734,7 +2705,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { }; const { manager } = yield* makeManager({ ghScenario: { - // @effect-diagnostics-next-line preferSchemaOverJson:off prListSequence: [JSON.stringify([existingPr])], failWith: new GitHubCli.GitHubCliUnavailableError({ command: "gh", @@ -2783,7 +2753,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { }; const { manager } = yield* makeManager({ ghScenario: { - // @effect-diagnostics-next-line preferSchemaOverJson:off prListSequence: [JSON.stringify([existingPr])], failWith: new GitHubCli.GitHubCliUnavailableError({ command: "gh", @@ -2823,7 +2792,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { }; const { manager } = yield* makeManager({ ghScenario: { - // @effect-diagnostics-next-line preferSchemaOverJson:off prListSequence: [JSON.stringify([existingPr])], failWith: new GitHubCli.GitHubCliUnavailableError({ command: "gh", @@ -2866,7 +2834,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { }; const { manager } = yield* makeManager({ ghScenario: { - // @effect-diagnostics-next-line preferSchemaOverJson:off prListSequence: [JSON.stringify([existingPr])], failWith: new GitHubCli.GitHubCliUnavailableError({ command: "gh", @@ -3461,7 +3428,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { ghScenario: { prListSequence: [ "[]", - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { number: 77, @@ -3597,7 +3563,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { ghScenario: { prListSequence: [ "[]", - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { number: 303, @@ -3644,7 +3609,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { ghScenario: { prListSequence: [ "[]", - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { number: 404, @@ -3696,7 +3660,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { defaultBranch: "", prListSequence: [ "[]", - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { number: 505, @@ -3736,7 +3699,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { const { manager, ghCalls } = yield* makeManager({ ghScenario: { prListSequence: [ - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { number: 42, @@ -3790,7 +3752,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { const { manager, ghCalls } = yield* makeManager({ ghScenario: { prListSequence: [ - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { number: 142, @@ -3867,7 +3828,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { const { manager, ghCalls } = yield* makeManager({ ghScenario: { prListByHeadSelector: { - // @effect-diagnostics-next-line preferSchemaOverJson:off "effect-atom": JSON.stringify([ { number: 1618, @@ -3877,7 +3837,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { headRefName: "effect-atom", }, ]), - // @effect-diagnostics-next-line preferSchemaOverJson:off "upstream/effect-atom": JSON.stringify([ { number: 1518, @@ -3927,9 +3886,7 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { const { manager, ghCalls } = yield* makeManager({ ghScenario: { prListByHeadSelector: { - // @effect-diagnostics-next-line preferSchemaOverJson:off "t3code/pr-142/statemachine": JSON.stringify([]), - // @effect-diagnostics-next-line preferSchemaOverJson:off statemachine: JSON.stringify([ { number: 41, @@ -3995,7 +3952,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { const { manager, ghCalls } = yield* makeManager({ ghScenario: { prListByHeadSelector: { - // @effect-diagnostics-next-line preferSchemaOverJson:off statemachine: JSON.stringify([ { number: 142, @@ -4013,7 +3969,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { }, }, ]), - // @effect-diagnostics-next-line preferSchemaOverJson:off "t3code/pr-142/statemachine": JSON.stringify([]), }, }, @@ -4256,7 +4211,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { ghScenario: { prListSequence: [ "[]", - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { number: 88, @@ -4377,7 +4331,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { const { manager, ghCalls } = yield* makeManager({ ghScenario: { prListSequence: [ - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { number: 1661, @@ -4395,7 +4348,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { }, }, ]), - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { number: 188, @@ -4458,9 +4410,7 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { ghScenario: { prListSequenceByHeadSelector: { statemachine: [ - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([]), - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { number: 188, @@ -6076,9 +6026,7 @@ it.layer(layerGitManagerTest)("GitManager", (it) => { const { manager } = yield* makeManager({ ghScenario: { prListSequence: [ - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([]), - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { number: 201, diff --git a/apps/server/src/keybindings.test.ts b/apps/server/src/keybindings.test.ts index b0385cb029b5..f6eae9e6571c 100644 --- a/apps/server/src/keybindings.test.ts +++ b/apps/server/src/keybindings.test.ts @@ -219,7 +219,6 @@ it.layer(NodeServices.layer)("keybindings", (it) => { const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig; yield* fs.writeFileString( keybindingsConfigPath, - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { key: "mod+j", command: "terminal.toggle" }, { key: "mod+shift+d+o", command: "terminal.new" }, diff --git a/apps/server/src/mcp/AcpMcpOverAcpBridge.test.ts b/apps/server/src/mcp/AcpMcpOverAcpBridge.test.ts index e7e9ee78753c..a564a711a2f6 100644 --- a/apps/server/src/mcp/AcpMcpOverAcpBridge.test.ts +++ b/apps/server/src/mcp/AcpMcpOverAcpBridge.test.ts @@ -1,5 +1,4 @@ // The bridge intentionally treats MCP JSON-RPC messages as opaque JSON. -// @effect-diagnostics preferSchemaOverJson:off import { describe, expect, it } from "@effect/vitest"; import * as Effect from "effect/Effect"; import * as Fiber from "effect/Fiber"; diff --git a/apps/server/src/mcp/AcpMcpStdioBridge.test.ts b/apps/server/src/mcp/AcpMcpStdioBridge.test.ts index 654659151a8c..9cde2b880a7a 100644 --- a/apps/server/src/mcp/AcpMcpStdioBridge.test.ts +++ b/apps/server/src/mcp/AcpMcpStdioBridge.test.ts @@ -1,6 +1,6 @@ // The harness asserts raw JSON-RPC wire strings, mirroring the bridge's // schema-free passthrough. -// @effect-diagnostics nodeBuiltinImport:off globalTimers:off preferSchemaOverJson:off +// @effect-diagnostics nodeBuiltinImport:off globalTimers:off import * as NodeStream from "node:stream"; import { describe, expect, it } from "@effect/vitest"; diff --git a/apps/server/src/orchestration-v2/ProjectStore.test.ts b/apps/server/src/orchestration-v2/ProjectStore.test.ts index 23884a0ec54f..77cc0fda60e2 100644 --- a/apps/server/src/orchestration-v2/ProjectStore.test.ts +++ b/apps/server/src/orchestration-v2/ProjectStore.test.ts @@ -44,7 +44,6 @@ it.layer(ProjectStore.layer.pipe(Layer.provideMerge(SqlitePersistence.layerMemor FROM projection_projects WHERE project_id = ${projectId} `; - // @effect-diagnostics-next-line preferSchemaOverJson:off assert.strictEqual(rows[0]?.defaultModelSelection, JSON.stringify(modelSelection)); assert.deepStrictEqual( Option.getOrNull(yield* projects.get(projectId))?.defaultModelSelection, diff --git a/apps/server/src/persistence/Migrations/016_CanonicalizeModelSelections.test.ts b/apps/server/src/persistence/Migrations/016_CanonicalizeModelSelections.test.ts index 78624fa13709..9c20724c55d3 100644 --- a/apps/server/src/persistence/Migrations/016_CanonicalizeModelSelections.test.ts +++ b/apps/server/src/persistence/Migrations/016_CanonicalizeModelSelections.test.ts @@ -265,7 +265,6 @@ layer("016_CanonicalizeModelSelections", (it) => { FROM orchestration_events ORDER BY rowid ASC `; - // @effect-diagnostics-next-line preferSchemaOverJson:off assert.deepStrictEqual(JSON.parse(eventRows[0]!.payloadJson), { projectId: "project-1", title: "Project", @@ -281,7 +280,6 @@ layer("016_CanonicalizeModelSelections", (it) => { createdAt: "2026-01-01T00:00:00.000Z", updatedAt: "2026-01-01T00:00:00.000Z", }); - // @effect-diagnostics-next-line preferSchemaOverJson:off assert.deepStrictEqual(JSON.parse(eventRows[1]!.payloadJson), { projectId: "project-2", title: "Fallback Project", @@ -297,7 +295,6 @@ layer("016_CanonicalizeModelSelections", (it) => { createdAt: "2026-01-01T00:00:00.000Z", updatedAt: "2026-01-01T00:00:00.000Z", }); - // @effect-diagnostics-next-line preferSchemaOverJson:off assert.deepStrictEqual(JSON.parse(eventRows[2]!.payloadJson), { projectId: "project-3", title: "Null Model Project", @@ -307,7 +304,6 @@ layer("016_CanonicalizeModelSelections", (it) => { createdAt: "2026-01-01T00:00:00.000Z", updatedAt: "2026-01-01T00:00:00.000Z", }); - // @effect-diagnostics-next-line preferSchemaOverJson:off assert.deepStrictEqual(JSON.parse(eventRows[3]!.payloadJson), { threadId: "thread-1", projectId: "project-1", @@ -327,7 +323,6 @@ layer("016_CanonicalizeModelSelections", (it) => { createdAt: "2026-01-01T00:00:00.000Z", updatedAt: "2026-01-01T00:00:00.000Z", }); - // @effect-diagnostics-next-line preferSchemaOverJson:off assert.deepStrictEqual(JSON.parse(eventRows[4]!.payloadJson), { threadId: "thread-2", projectId: "project-1", @@ -346,7 +341,6 @@ layer("016_CanonicalizeModelSelections", (it) => { createdAt: "2026-01-01T00:00:00.000Z", updatedAt: "2026-01-01T00:00:00.000Z", }); - // @effect-diagnostics-next-line preferSchemaOverJson:off assert.deepStrictEqual(JSON.parse(eventRows[5]!.payloadJson), { threadId: "thread-1", turnId: "turn-1", @@ -360,7 +354,6 @@ layer("016_CanonicalizeModelSelections", (it) => { }, deliveryMode: "buffered", }); - // @effect-diagnostics-next-line preferSchemaOverJson:off assert.deepStrictEqual(JSON.parse(eventRows[6]!.payloadJson), { threadId: "thread-3", projectId: "project-1", diff --git a/apps/server/src/provider/ClaudeCapabilitiesProbe.test.ts b/apps/server/src/provider/ClaudeCapabilitiesProbe.test.ts index 8147a43b05a5..831df2d172ec 100644 --- a/apps/server/src/provider/ClaudeCapabilitiesProbe.test.ts +++ b/apps/server/src/provider/ClaudeCapabilitiesProbe.test.ts @@ -293,7 +293,6 @@ it.layer(NodeServices.layer)("Claude capability probe SDK boundary", (it) => { }, }); - // @effect-diagnostics-next-line preferSchemaOverJson:off const invocation = JSON.parse(yield* fs.readFileString(invocationPath)) as { readonly args: ReadonlyArray; readonly cwd: string; @@ -310,7 +309,6 @@ it.layer(NodeServices.layer)("Claude capability probe SDK boundary", (it) => { const settingsFlagIndex = invocation.args.indexOf("--settings"); assert.notEqual(settingsFlagIndex, -1); - // @effect-diagnostics-next-line preferSchemaOverJson:off const flagSettings = JSON.parse(invocation.args[settingsFlagIndex + 1] ?? "{}") as { readonly disableAllHooks?: boolean; }; diff --git a/apps/server/src/provider/CodexChatGptAuth.test.ts b/apps/server/src/provider/CodexChatGptAuth.test.ts index fc840d029b99..96465947b651 100644 --- a/apps/server/src/provider/CodexChatGptAuth.test.ts +++ b/apps/server/src/provider/CodexChatGptAuth.test.ts @@ -1,4 +1,4 @@ -// @effect-diagnostics nodeBuiltinImport:off globalFetchInEffect:off preferSchemaOverJson:off - Local mock OAuth server validates the browser callback boundary. +// @effect-diagnostics nodeBuiltinImport:off globalFetchInEffect:off - Local mock OAuth server validates the browser callback boundary. import * as NodeHttp from "node:http"; import * as NodeCrypto from "node:crypto"; import * as NodeServices from "@effect/platform-node/NodeServices"; diff --git a/apps/server/src/provider/CodexChatGptModels.test.ts b/apps/server/src/provider/CodexChatGptModels.test.ts index 736f1319d7f0..9533a3c64d00 100644 --- a/apps/server/src/provider/CodexChatGptModels.test.ts +++ b/apps/server/src/provider/CodexChatGptModels.test.ts @@ -1,4 +1,3 @@ -// @effect-diagnostics preferSchemaOverJson:off - Mock HTTP responses use JSON fixtures. import { assert, it } from "@effect/vitest"; import * as Effect from "effect/Effect"; import { HttpClient, HttpClientResponse } from "effect/http"; diff --git a/apps/server/src/provider/GrokProvider.test.ts b/apps/server/src/provider/GrokProvider.test.ts index 7a01812c6833..f77ee10465e2 100644 --- a/apps/server/src/provider/GrokProvider.test.ts +++ b/apps/server/src/provider/GrokProvider.test.ts @@ -380,7 +380,6 @@ it.layer(NodeServices.layer)("checkGrokProviderStatus", (it) => { directory: dir, name: "grok", source: [ - // @effect-diagnostics-next-line preferSchemaOverJson:off `process.stderr.write(${JSON.stringify(`${secretStderr}\n`)});`, "process.exit(2);", "", @@ -417,7 +416,6 @@ it.layer(NodeServices.layer)("checkGrokProviderStatus", (it) => { " process.exit(0);", "}", 'if (process.argv[2] === "models") {', - // @effect-diagnostics-next-line preferSchemaOverJson:off ` process.stdout.write(${JSON.stringify(input.modelsOutput)});`, " process.exit(0);", "}", diff --git a/apps/server/src/provider/ProviderInstanceRegistry.test.ts b/apps/server/src/provider/ProviderInstanceRegistry.test.ts index d78de9ecf44e..7a132b40fc88 100644 --- a/apps/server/src/provider/ProviderInstanceRegistry.test.ts +++ b/apps/server/src/provider/ProviderInstanceRegistry.test.ts @@ -172,7 +172,6 @@ const makeTildeProviderFixtures = Effect.fn( ); yield* fileSystem.writeFileString( codexScriptPath, - // @effect-diagnostics-next-line preferSchemaOverJson:off - fixed script document read by the external Codex mock peer. JSON.stringify({ rootThreadId: "probe-thread", notifications: [] }), ); yield* fileSystem.chmod(codexPath, 0o755); @@ -346,7 +345,6 @@ describe("ProviderInstanceRegistry — multi-instance codex slice", () => { const fixtures = yield* makeTildeProviderFixtures(); yield* fileSystem.writeFileString( fixtures.codexScriptPath, - // @effect-diagnostics-next-line preferSchemaOverJson:off - fixed script document read by the external Codex mock peer. JSON.stringify({ rootThreadId: "probe-thread", notifications: [], diff --git a/apps/server/src/pullRequest/AzureDevOpsPullRequestCli.test.ts b/apps/server/src/pullRequest/AzureDevOpsPullRequestCli.test.ts index a6824d8a0a13..be8354c6444c 100644 --- a/apps/server/src/pullRequest/AzureDevOpsPullRequestCli.test.ts +++ b/apps/server/src/pullRequest/AzureDevOpsPullRequestCli.test.ts @@ -228,7 +228,6 @@ layer("AzureDevOpsPullRequestCli.layer", (it) => { ...row, description: "x".repeat(10_000), })); - // @effect-diagnostics-next-line preferSchemaOverJson:off const response = JSON.stringify(rows); expect(Buffer.byteLength(response)).toBeGreaterThan(1_000_000); @@ -341,7 +340,6 @@ layer("AzureDevOpsPullRequestCli.layer", (it) => { .mockReturnValueOnce( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { pullRequestId: "malformed" }, pullRequestRows(1, 1)[0], @@ -434,7 +432,6 @@ layer("AzureDevOpsPullRequestCli.layer", (it) => { Effect.gen(function* () { // `--query user` unwraps the object, so the wrapper has to put it back. mockedExecute.mockReturnValueOnce( - // @effect-diagnostics-next-line preferSchemaOverJson:off Effect.succeed(output(JSON.stringify({ name: "bilal@acme.dev", type: "user" }))), ); const cli = yield* AzureDevOpsPullRequestCli.AzureDevOpsPullRequestCli; @@ -636,7 +633,6 @@ layer("AzureDevOpsPullRequestCli.layer", (it) => { .mockReturnValueOnce( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ pullRequestId: 42, title: "Add the page", @@ -653,7 +649,6 @@ layer("AzureDevOpsPullRequestCli.layer", (it) => { .mockReturnValueOnce( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ value: [ { @@ -674,7 +669,6 @@ layer("AzureDevOpsPullRequestCli.layer", (it) => { .mockReturnValueOnce( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ changeEntries: [ { changeType: "edit", item: { path: "/README.md", objectId: "8f80" } }, @@ -713,7 +707,6 @@ layer("AzureDevOpsPullRequestCli.layer", (it) => { // pull request read every time they checked whether a file had been pushed to. const pullRequest = Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ pullRequestId: 42, title: "Add the page", @@ -1219,7 +1212,6 @@ layer("AzureDevOpsPullRequestCli.layer", (it) => { mockedExecute.mockReturnValueOnce( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ value: [ { @@ -1374,7 +1366,6 @@ layer("AzureDevOpsPullRequestCli.layer", (it) => { Effect.succeed( output( // Well-formed, but with nothing to build a link from: not a decode failure. - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ pullRequestId: 42, title: "Add the page", diff --git a/apps/server/src/pullRequest/BitbucketPullRequestApi.test.ts b/apps/server/src/pullRequest/BitbucketPullRequestApi.test.ts index 49cdaa90f7d2..d614dd90a7e7 100644 --- a/apps/server/src/pullRequest/BitbucketPullRequestApi.test.ts +++ b/apps/server/src/pullRequest/BitbucketPullRequestApi.test.ts @@ -676,7 +676,6 @@ layer("BitbucketPullRequestApi.layer", (it) => { expect(call.method).toBe("PUT"); expect(call.url).toBe("/repositories/acme/web/pullrequests/7"); // Bitbucket's PUT is a partial update, so a field left out of the body is left as it was. - // @effect-diagnostics-next-line preferSchemaOverJson:off expect(JSON.parse(call.body ?? "")).toEqual({ title: "A new title" }); }), ); @@ -688,7 +687,6 @@ layer("BitbucketPullRequestApi.layer", (it) => { yield* api.updateChangeRequest({ repository: "acme/web", number: 7, body: "New body." }); - // @effect-diagnostics-next-line preferSchemaOverJson:off expect(JSON.parse(callAt(0).body ?? "")).toEqual({ description: "New body." }); }), ); @@ -705,7 +703,6 @@ layer("BitbucketPullRequestApi.layer", (it) => { body: "New body.", }); - // @effect-diagnostics-next-line preferSchemaOverJson:off expect(JSON.parse(callAt(0).body ?? "")).toEqual({ title: "A new title", description: "New body.", @@ -736,7 +733,6 @@ layer("BitbucketPullRequestApi.layer", (it) => { it.effect("fails the read when Bitbucket answers with something unreadable", () => Effect.gen(function* () { mockedRequest.mockReturnValueOnce( - // @effect-diagnostics-next-line preferSchemaOverJson:off Effect.succeed(response(JSON.stringify({ error: "nope" }))), ); const api = yield* BitbucketPullRequestApi.BitbucketPullRequestApi; @@ -769,7 +765,6 @@ layer("BitbucketPullRequestApi.layer", (it) => { it.effect("fails when the credentials belong to no named account", () => Effect.gen(function* () { - // @effect-diagnostics-next-line preferSchemaOverJson:off mockedRequest.mockReturnValueOnce(Effect.succeed(response(JSON.stringify({})))); const api = yield* BitbucketPullRequestApi.BitbucketPullRequestApi; @@ -784,7 +779,6 @@ layer("BitbucketPullRequestApi.layer", (it) => { mockedRequest.mockReturnValueOnce( Effect.succeed( response( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ next: "https://api.bitbucket.org/2.0/comments?page=2", values: [ @@ -805,7 +799,6 @@ layer("BitbucketPullRequestApi.layer", (it) => { response( // The reply arrives a page after the remark it answers, which is why the threads // are only assembled once every page is in hand. - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ values: [ { @@ -840,7 +833,6 @@ layer("BitbucketPullRequestApi.layer", (it) => { mockedRequest.mockReturnValue( Effect.succeed( response( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ next: "https://api.bitbucket.org/2.0/comments?page=2", values: [ @@ -868,7 +860,6 @@ layer("BitbucketPullRequestApi.layer", (it) => { mockedRequest.mockReturnValueOnce( Effect.succeed( response( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ values: [ { @@ -941,7 +932,6 @@ layer("BitbucketPullRequestApi.layer", (it) => { }); expect(callAt(0).url).toContain("/pullrequests/7/comments"); - // @effect-diagnostics-next-line preferSchemaOverJson:off expect(JSON.parse(callAt(0).body ?? "")).toEqual({ content: { raw: "why remove?" }, inline: { path: "src/a.ts", from: 12 }, @@ -988,7 +978,6 @@ layer("BitbucketPullRequestApi.layer", (it) => { body: "Fixed.", }); - // @effect-diagnostics-next-line preferSchemaOverJson:off expect(JSON.parse(callAt(0).body ?? "")).toEqual({ content: { raw: "Fixed." }, parent: { id: 10 }, @@ -1001,7 +990,6 @@ layer("BitbucketPullRequestApi.layer", (it) => { mockedRequest.mockReturnValue( Effect.succeed( response( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ values: [{ type: "repository_permission", permission: "read" }] }), ), ), @@ -1017,7 +1005,6 @@ layer("BitbucketPullRequestApi.layer", (it) => { it.effect("escapes a repository name before it goes inside a filter literal", () => Effect.gen(function* () { - // @effect-diagnostics-next-line preferSchemaOverJson:off mockedRequest.mockReturnValue(Effect.succeed(response(JSON.stringify({ values: [] })))); const api = yield* BitbucketPullRequestApi.BitbucketPullRequestApi; @@ -1075,7 +1062,6 @@ layer("BitbucketPullRequestApi.layer", (it) => { .mockReturnValueOnce( Effect.succeed( response( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ values: [{ user: bilal }, { user: octocat }, { user: hubot }] }), ), ), @@ -1113,7 +1099,6 @@ layer("BitbucketPullRequestApi.layer", (it) => { const call = callAt(1); expect(call.method).toBe("PUT"); expect(call.url).toBe("/repositories/acme/web/pullrequests/7"); - // @effect-diagnostics-next-line preferSchemaOverJson:off expect(JSON.parse(call.body ?? "")).toEqual({ reviewers: [{ uuid: "{octocat}" }, { uuid: "{hubot}" }], }); @@ -1136,7 +1121,6 @@ layer("BitbucketPullRequestApi.layer", (it) => { requested: false, }); - // @effect-diagnostics-next-line preferSchemaOverJson:off expect(JSON.parse(callAt(1).body ?? "")).toEqual({ reviewers: [{ uuid: "{octocat}" }] }); }), ); diff --git a/apps/server/src/pullRequest/GitHubPullRequestCli.test.ts b/apps/server/src/pullRequest/GitHubPullRequestCli.test.ts index 44730cf13350..5c26415b7302 100644 --- a/apps/server/src/pullRequest/GitHubPullRequestCli.test.ts +++ b/apps/server/src/pullRequest/GitHubPullRequestCli.test.ts @@ -479,7 +479,6 @@ layer("GitHubPullRequestCli.layer", (it) => { mockedExecute.mockReturnValueOnce( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ data: { s0: { pullRequest: node(7) }, s1: { pullRequest: node(8) } }, }), @@ -548,7 +547,6 @@ layer("GitHubPullRequestCli.layer", (it) => { mockedExecute.mockReturnValueOnce( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ data: { w0: { pullRequest: node(1) }, w1: { pullRequest: null } }, }), @@ -588,7 +586,6 @@ layer("GitHubPullRequestCli.layer", (it) => { .mockReturnValueOnce( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ number: 7, title: "Reuse the summary", @@ -648,7 +645,6 @@ layer("GitHubPullRequestCli.layer", (it) => { mockedExecute.mockReturnValueOnce( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { id: 42, @@ -707,12 +703,10 @@ layer("GitHubPullRequestCli.layer", (it) => { { number: 7, head: { ref: "feat/two", sha: "abc123" }, state: "open", merged_at: null }, ], }; - // @effect-diagnostics-next-line preferSchemaOverJson:off mockedExecute.mockReturnValueOnce(Effect.succeed(output(JSON.stringify([minimal])))); mockedExecute.mockReturnValueOnce( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ ...minimal, pull_requests: [{ ...minimal.pull_requests[0], title: "Second layer", draft: false }], @@ -2117,7 +2111,6 @@ layer("GitHubPullRequestCli.layer", (it) => { mockedExecute.mockReturnValueOnce( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off - canned gh GraphQL response. JSON.stringify({ data: { repository: { pullRequest: { id: "PR_7" } } }, }), @@ -2206,7 +2199,6 @@ layer("GitHubPullRequestCli.layer", (it) => { ), ); const heads = output( - // @effect-diagnostics-next-line preferSchemaOverJson:off - canned gh response. JSON.stringify([ { number: 7, @@ -2217,7 +2209,6 @@ layer("GitHubPullRequestCli.layer", (it) => { ]), ); const runs = output( - // @effect-diagnostics-next-line preferSchemaOverJson:off - canned gh response. JSON.stringify([ { databaseId: 10, workflowName: "build", url: "https://example.com/10" }, { databaseId: 11, workflowName: "test", url: "https://example.com/11" }, @@ -2331,14 +2322,7 @@ layer("GitHubPullRequestCli.layer", (it) => { [{ databaseId: 10, workflowName: "build", url: "https://example.com/10" }], coreResponse({ ...detail, headRefOid: "def456" }), ]) { - mockedExecute.mockReturnValueOnce( - Effect.succeed( - output( - // @effect-diagnostics-next-line preferSchemaOverJson:off - canned gh response. - JSON.stringify(value), - ), - ), - ); + mockedExecute.mockReturnValueOnce(Effect.succeed(output(JSON.stringify(value)))); } const cli = yield* GitHubPullRequestCli.GitHubPullRequestCli; @@ -2404,7 +2388,6 @@ layer("GitHubPullRequestCli.layer", (it) => { mockedExecute.mockReturnValueOnce( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off - canned gh response. JSON.stringify( [7, 8].map((number) => ({ number, @@ -2490,7 +2473,6 @@ layer("GitHubPullRequestCli.layer", (it) => { mockedExecute.mockReturnValueOnce( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off - canned gh response. JSON.stringify([ { number: 7, @@ -2505,7 +2487,6 @@ layer("GitHubPullRequestCli.layer", (it) => { mockedExecute.mockReturnValueOnce( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off - canned gh response. JSON.stringify(Array.from({ length: 1_001 }, (_, id) => ({ databaseId: id + 1 }))), ), ), @@ -2615,7 +2596,6 @@ layer("GitHubPullRequestCli.layer", (it) => { mockedExecute.mockReturnValueOnce( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ data: { repository: { pullRequest: { reviewThreads: { totalCount: 0, nodes: [] } } }, @@ -2996,7 +2976,6 @@ layer("GitHubPullRequestCli.layer", (it) => { mockedExecute.mockReturnValueOnce( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ data: { nodes: [{ login: "octocat", avatarUrl: "https://avatars/octocat" }], @@ -3131,7 +3110,6 @@ layer("GitHubPullRequestCli.layer", (it) => { ]); // One request, so nothing is on the pull request until the verdict is. assert.strictEqual(mockedExecute.mock.calls.length, 1); - // @effect-diagnostics-next-line preferSchemaOverJson:off expect(JSON.parse(callAt(0).stdin ?? "")).toEqual({ event: "APPROVE", body: "Looks right.", @@ -3162,7 +3140,6 @@ layer("GitHubPullRequestCli.layer", (it) => { "--input", "-", ]); - // @effect-diagnostics-next-line preferSchemaOverJson:off const request = JSON.parse(callAt(0).stdin ?? "") as { query: string; variables: Record; @@ -3206,7 +3183,6 @@ layer("GitHubPullRequestCli.layer", (it) => { mockedExecute.mockReturnValueOnce( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ data: { repository: { pullRequest: { id: "PR_kwDOA" } }, @@ -3235,7 +3211,6 @@ layer("GitHubPullRequestCli.layer", (it) => { expect(scopeCheck).toContain("name=web"); expect(scopeCheck).toContain("number=7"); expect(scopeCheck).toContain("subjectId=IC_1"); - // @effect-diagnostics-next-line preferSchemaOverJson:off const request = JSON.parse(callAt(1).stdin ?? "") as { query: string; variables: Record; @@ -3250,7 +3225,6 @@ layer("GitHubPullRequestCli.layer", (it) => { mockedExecute.mockReturnValueOnce( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ data: { repository: { pullRequest: { id: "PR_thisOne" } }, @@ -3286,10 +3260,7 @@ layer("GitHubPullRequestCli.layer", (it) => { Effect.gen(function* () { mockedExecute.mockReturnValueOnce( Effect.succeed( - output( - // @effect-diagnostics-next-line preferSchemaOverJson:off - JSON.stringify({ data: { repository: { pullRequest: { id: "PR_kwDOA" } } } }), - ), + output(JSON.stringify({ data: { repository: { pullRequest: { id: "PR_kwDOA" } } } })), ), ); mockedExecute.mockReturnValueOnce(Effect.succeed(output("{}"))); @@ -3310,7 +3281,6 @@ layer("GitHubPullRequestCli.layer", (it) => { expect(lookup).toContain("owner=acme"); expect(lookup).toContain("name=web"); expect(lookup).toContain("number=21"); - // @effect-diagnostics-next-line preferSchemaOverJson:off const request = JSON.parse(callAt(1).stdin ?? "") as { query: string; variables: Record; @@ -3325,7 +3295,6 @@ layer("GitHubPullRequestCli.layer", (it) => { mockedExecute.mockReturnValueOnce( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ data: { repository: { pullRequest: { id: "PR_kwDOA" } }, @@ -3348,7 +3317,6 @@ layer("GitHubPullRequestCli.layer", (it) => { reacted: false, }); - // @effect-diagnostics-next-line preferSchemaOverJson:off const request = JSON.parse(callAt(1).stdin ?? "") as { query: string }; expect(request.query).toContain("removeReaction("); }), @@ -3358,10 +3326,7 @@ layer("GitHubPullRequestCli.layer", (it) => { Effect.gen(function* () { mockedExecute.mockReturnValue( Effect.succeed( - output( - // @effect-diagnostics-next-line preferSchemaOverJson:off - JSON.stringify({ data: { repository: { pullRequest: { id: "PR_kwDOA" } } } }), - ), + output(JSON.stringify({ data: { repository: { pullRequest: { id: "PR_kwDOA" } } } })), ), ); const cli = yield* GitHubPullRequestCli.GitHubPullRequestCli; @@ -3401,7 +3366,6 @@ layer("GitHubPullRequestCli.layer", (it) => { mockedExecute.mockReturnValue( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ data: { repository: { pullRequest: { id: "PR_kwDOA" } }, @@ -3444,7 +3408,6 @@ layer("GitHubPullRequestCli.layer", (it) => { mockedExecute.mockReturnValueOnce( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ data: { repository: { pullRequest: { id: "PR_thisOne" } }, @@ -3518,7 +3481,6 @@ layer("GitHubPullRequestCli.layer", (it) => { mockedExecute.mockReturnValueOnce( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ author: { login: "octocat" }, comments: [], @@ -3937,7 +3899,6 @@ layer("GitHubPullRequestCli.layer", (it) => { mockedExecute.mockReturnValue( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ data: { repository: { @@ -3982,7 +3943,6 @@ layer("GitHubPullRequestCli.layer", (it) => { mockedExecute.mockReturnValue( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ data: { repository: { @@ -4034,7 +3994,6 @@ layer("GitHubPullRequestCli.layer", (it) => { mockedExecute.mockReturnValue( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ data: { repository: { @@ -4083,7 +4042,6 @@ layer("GitHubPullRequestCli.layer", (it) => { .mockReturnValueOnce( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ data: { repository: { @@ -4106,7 +4064,6 @@ layer("GitHubPullRequestCli.layer", (it) => { .mockReturnValueOnce( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ data: { repository: { @@ -4178,7 +4135,6 @@ layer("GitHubPullRequestCli.layer", (it) => { "--input", "-", ]); - // @effect-diagnostics-next-line preferSchemaOverJson:off expect(JSON.parse(call.stdin ?? "")).toEqual({ reviewers: ["octocat"], team_reviewers: ["reviewers"], @@ -4203,7 +4159,6 @@ layer("GitHubPullRequestCli.layer", (it) => { const call = callAt(0); expect(call.args).toContain("DELETE"); expect(call.args).toContain("repos/acme/web/pulls/7/requested_reviewers"); - // @effect-diagnostics-next-line preferSchemaOverJson:off expect(JSON.parse(call.stdin ?? "")).toEqual({ reviewers: ["octocat"], team_reviewers: [], @@ -4216,7 +4171,6 @@ layer("GitHubPullRequestCli.layer", (it) => { mockedExecute.mockReturnValue( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ data: { repository: { @@ -4280,7 +4234,6 @@ layer("GitHubPullRequestCli.layer", (it) => { "--input", "-", ]); - // @effect-diagnostics-next-line preferSchemaOverJson:off - asserting the raw gh request body. expect(JSON.parse(call.stdin ?? "")).toEqual({ labels: ["bug", "size:XL"] }); }), ); @@ -4363,7 +4316,6 @@ layer("GitHubPullRequestCli.layer", (it) => { mockedExecute.mockReturnValue( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ data: { repository: { @@ -4399,7 +4351,6 @@ layer("GitHubPullRequestCli.layer", (it) => { mockedExecute .mockReturnValueOnce( Effect.succeed( - // @effect-diagnostics-next-line preferSchemaOverJson:off output(JSON.stringify({ data: { repository: { pullRequest: { id: "PR_1" } } } })), ), ) @@ -4419,7 +4370,6 @@ layer("GitHubPullRequestCli.layer", (it) => { // One request to learn the pull request's node id, one for every press together. assert.strictEqual(mockedExecute.mock.calls.length, 2); - // @effect-diagnostics-next-line preferSchemaOverJson:off const sent = JSON.parse(callAt(1).stdin ?? "") as { query: string; variables: Record; @@ -4455,7 +4405,6 @@ layer("GitHubPullRequestCli.layer", (it) => { mockedExecute .mockReturnValueOnce( Effect.succeed( - // @effect-diagnostics-next-line preferSchemaOverJson:off output(JSON.stringify({ data: { repository: { pullRequest: { id: "PR_24" } } } })), ), ) @@ -4489,7 +4438,6 @@ layer("GitHubPullRequestCli.layer", (it) => { .mockReturnValueOnce(Effect.succeed(output('{"message":"not found"}'))) .mockReturnValueOnce( Effect.succeed( - // @effect-diagnostics-next-line preferSchemaOverJson:off output(JSON.stringify({ data: { repository: { pullRequest: { id: "PR_25" } } } })), ), ) diff --git a/apps/server/src/pullRequest/GitLabPullRequestCli.test.ts b/apps/server/src/pullRequest/GitLabPullRequestCli.test.ts index 76fb1059b91d..8fb1334de364 100644 --- a/apps/server/src/pullRequest/GitLabPullRequestCli.test.ts +++ b/apps/server/src/pullRequest/GitLabPullRequestCli.test.ts @@ -226,10 +226,8 @@ layer("GitLabPullRequestCli.layer", (it) => { it.effect("advances the cursor through malformed raw rows", () => Effect.gen(function* () { - // @effect-diagnostics-next-line preferSchemaOverJson:off const rows = JSON.parse(mergeRequests(2, 1)) as ReadonlyArray; mockedExecute.mockReturnValueOnce( - // @effect-diagnostics-next-line preferSchemaOverJson:off Effect.succeed(output(JSON.stringify([{ iid: "malformed" }, ...rows]))), ); const cli = yield* GitLabPullRequestCli.GitLabPullRequestCli; @@ -314,7 +312,6 @@ layer("GitLabPullRequestCli.layer", (it) => { Effect.gen(function* () { // Full pages of unusable rows: nothing is collected, so the collected-count bound never // trips and only the page bound can end the walk. - // @effect-diagnostics-next-line preferSchemaOverJson:off const unusable = JSON.stringify(Array.from({ length: 100 }, () => ({ iid: "nope" }))); mockedExecute.mockReturnValue(Effect.succeed(output(unusable))); const cli = yield* GitLabPullRequestCli.GitLabPullRequestCli; @@ -627,7 +624,6 @@ layer("GitLabPullRequestCli.layer", (it) => { it.effect("reports a commit with no parent as a structured error", () => Effect.gen(function* () { mockedExecute.mockReturnValueOnce( - // @effect-diagnostics-next-line preferSchemaOverJson:off Effect.succeed(output(JSON.stringify({ id: "a1b2c3d", parent_ids: [] }))), ); const cli = yield* GitLabPullRequestCli.GitLabPullRequestCli; @@ -654,7 +650,6 @@ layer("GitLabPullRequestCli.layer", (it) => { it.effect("expands a new file from a root commit without requiring a parent", () => Effect.gen(function* () { mockedExecute.mockReturnValueOnce( - // @effect-diagnostics-next-line preferSchemaOverJson:off Effect.succeed(output(JSON.stringify({ id: "a1b2c3d", parent_ids: [] }))), ); mockedExecute.mockReturnValueOnce(Effect.succeed(output("first contents\n"))); @@ -680,7 +675,6 @@ layer("GitLabPullRequestCli.layer", (it) => { mockedExecute.mockReturnValueOnce( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ diff_refs: { base_sha: "a1b2c3d", @@ -718,7 +712,6 @@ layer("GitLabPullRequestCli.layer", (it) => { mockedExecute.mockReturnValueOnce( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ diff_refs: { base_sha: "a1b2c3d", @@ -758,7 +751,6 @@ layer("GitLabPullRequestCli.layer", (it) => { mockedExecute.mockReturnValueOnce( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ diff_refs: { base_sha: "a1b2c3d", @@ -823,7 +815,6 @@ layer("GitLabPullRequestCli.layer", (it) => { it.effect("offers no squash when the project does not say it allows one", () => Effect.gen(function* () { mockedExecute.mockReturnValueOnce( - // @effect-diagnostics-next-line preferSchemaOverJson:off Effect.succeed(output(JSON.stringify({ merge_method: "merge" }))), ); const cli = yield* GitLabPullRequestCli.GitLabPullRequestCli; @@ -840,7 +831,6 @@ layer("GitLabPullRequestCli.layer", (it) => { it.effect("reads the project's merge settings as its merge capabilities", () => Effect.gen(function* () { mockedExecute.mockReturnValueOnce( - // @effect-diagnostics-next-line preferSchemaOverJson:off Effect.succeed(output(JSON.stringify({ merge_method: "ff", squash_option: "never" }))), ); const cli = yield* GitLabPullRequestCli.GitLabPullRequestCli; @@ -884,7 +874,6 @@ layer("GitLabPullRequestCli.layer", (it) => { it.effect("fails when the authenticated account has no username", () => Effect.gen(function* () { - // @effect-diagnostics-next-line preferSchemaOverJson:off mockedExecute.mockReturnValueOnce(Effect.succeed(output(JSON.stringify({ username: "" })))); const cli = yield* GitLabPullRequestCli.GitLabPullRequestCli; @@ -935,7 +924,6 @@ layer("GitLabPullRequestCli.layer", (it) => { mockedExecute.mockReturnValueOnce( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { id: "abc123", @@ -994,7 +982,6 @@ layer("GitLabPullRequestCli.layer", (it) => { mockedExecute.mockReturnValueOnce( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ iid: 7, title: "t", @@ -1030,7 +1017,6 @@ layer("GitLabPullRequestCli.layer", (it) => { // The diff revisions first, because a positioned comment cannot be placed without them. expect(argsOfCall(0)[1]).toContain("merge_requests/7"); expect(argsOfCall(1)[1]).toContain("/discussions"); - // @effect-diagnostics-next-line preferSchemaOverJson:off expect(JSON.parse(callAt(1).stdin ?? "")).toEqual({ body: "why remove?", position: { @@ -1086,7 +1072,6 @@ layer("GitLabPullRequestCli.layer", (it) => { expect(argsOfCall(0)).toContain("--method"); expect(argsOfCall(0)).toContain("PUT"); expect(argsOfCall(0)[1]).toContain("/discussions/abc123"); - // @effect-diagnostics-next-line preferSchemaOverJson:off expect(JSON.parse(callAt(0).stdin ?? "")).toEqual({ resolved: true }); }), ); @@ -1117,13 +1102,11 @@ layer("GitLabPullRequestCli.layer", (it) => { it.effect("removes an award by listing them and deleting the reader's own id", () => Effect.gen(function* () { mockedExecute.mockReturnValueOnce( - // @effect-diagnostics-next-line preferSchemaOverJson:off Effect.succeed(output(JSON.stringify({ username: "bilal" }))), ); mockedExecute.mockReturnValueOnce( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { id: 5, name: "thumbsup", user: { username: "bilal" } }, { id: 6, name: "thumbsup", user: { username: "julius" } }, @@ -1155,7 +1138,6 @@ layer("GitLabPullRequestCli.layer", (it) => { it.effect("does nothing when the reader has no award of that name to take back", () => Effect.gen(function* () { mockedExecute.mockReturnValueOnce( - // @effect-diagnostics-next-line preferSchemaOverJson:off Effect.succeed(output(JSON.stringify({ username: "bilal" }))), ); mockedExecute.mockReturnValueOnce(Effect.succeed(output("[]"))); @@ -1179,7 +1161,6 @@ layer("GitLabPullRequestCli.layer", (it) => { mockedExecute.mockReturnValueOnce( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ iid: 7, title: "t", @@ -1217,10 +1198,7 @@ layer("GitLabPullRequestCli.layer", (it) => { mockedExecute .mockReturnValueOnce(Effect.succeed(output(mergeRequestJson({ reviewers: [reviewer] })))) .mockReturnValueOnce( - Effect.succeed( - // @effect-diagnostics-next-line preferSchemaOverJson:off - output(JSON.stringify([author, reviewer, { id: 9, username: "hubot" }])), - ), + Effect.succeed(output(JSON.stringify([author, reviewer, { id: 9, username: "hubot" }]))), ); const cli = yield* GitLabPullRequestCli.GitLabPullRequestCli; @@ -1258,7 +1236,6 @@ layer("GitLabPullRequestCli.layer", (it) => { // GitLab replaces the whole set, so the reviewer already on the merge request has to be // sent back with the new one or the request would take them off it. expect(argsOfCall(1)).toContain("PUT"); - // @effect-diagnostics-next-line preferSchemaOverJson:off expect(JSON.parse(callAt(1).stdin ?? "")).toEqual({ reviewer_ids: [5, 9] }); }), ); @@ -1282,7 +1259,6 @@ layer("GitLabPullRequestCli.layer", (it) => { requested: false, }); - // @effect-diagnostics-next-line preferSchemaOverJson:off expect(JSON.parse(callAt(1).stdin ?? "")).toEqual({ reviewer_ids: [5] }); }), ); @@ -1303,7 +1279,6 @@ layer("GitLabPullRequestCli.layer", (it) => { }); // Sending it as a number would rewrite the reviewer set around something nobody chose. - // @effect-diagnostics-next-line preferSchemaOverJson:off expect(JSON.parse(callAt(1).stdin ?? "")).toEqual({ reviewer_ids: [5] }); }), ); @@ -1330,7 +1305,6 @@ layer("GitLabPullRequestCli.layer", (it) => { "--header", "Content-Type: application/json", ]); - // @effect-diagnostics-next-line preferSchemaOverJson:off expect(JSON.parse(callAt(0).stdin ?? "")).toEqual({ title: "A better title" }); }), ); @@ -1348,7 +1322,6 @@ layer("GitLabPullRequestCli.layer", (it) => { }); // A title sent as an empty string would wipe the one the merge request already has. - // @effect-diagnostics-next-line preferSchemaOverJson:off expect(JSON.parse(callAt(0).stdin ?? "")).toEqual({ description: "What this changes." }); }), ); @@ -1367,7 +1340,6 @@ layer("GitLabPullRequestCli.layer", (it) => { }); assert.strictEqual(mockedExecute.mock.calls.length, 1); - // @effect-diagnostics-next-line preferSchemaOverJson:off expect(JSON.parse(callAt(0).stdin ?? "")).toEqual({ title: "A better title", description: "What this changes.", @@ -1407,7 +1379,6 @@ layer("GitLabPullRequestCli.layer", (it) => { mockedExecute.mockReturnValueOnce( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ iid: 7, title: "t", @@ -1424,7 +1395,6 @@ layer("GitLabPullRequestCli.layer", (it) => { mockedExecute.mockReturnValueOnce( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ data: { project: { repository: { blobs: { nodes: [{ path: "src/a.ts", oid: "aaa" }] } } }, @@ -1449,7 +1419,6 @@ layer("GitLabPullRequestCli.layer", (it) => { ["src/gone.ts", ""], ]); // The head the reader is looking at, not whatever the source branch has moved on to. - // @effect-diagnostics-next-line preferSchemaOverJson:off const body: unknown = JSON.parse(callAt(1).stdin ?? "{}"); expect(body).toMatchObject({ variables: { fullPath: "acme/web", ref: "head", paths: ["src/a.ts", "src/gone.ts"] }, @@ -1462,7 +1431,6 @@ layer("GitLabPullRequestCli.layer", (it) => { mockedExecute.mockReturnValueOnce( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ iid: 7, title: "t", @@ -1480,10 +1448,7 @@ layer("GitLabPullRequestCli.layer", (it) => { // these files, and reading it that way would report every file the reader has cleared as // changed on nothing worse than a permission. mockedExecute.mockReturnValueOnce( - Effect.succeed( - // @effect-diagnostics-next-line preferSchemaOverJson:off - output(JSON.stringify({ data: { project: null } })), - ), + Effect.succeed(output(JSON.stringify({ data: { project: null } }))), ); const cli = yield* GitLabPullRequestCli.GitLabPullRequestCli; @@ -1520,7 +1485,6 @@ layer("GitLabPullRequestCli.layer", (it) => { mockedExecute.mockReturnValueOnce( Effect.succeed( output( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ iid: 7, title: "t", diff --git a/apps/server/src/pullRequest/githubStackActions.test.ts b/apps/server/src/pullRequest/githubStackActions.test.ts index 61ad7da3c7b0..da981f0023e8 100644 --- a/apps/server/src/pullRequest/githubStackActions.test.ts +++ b/apps/server/src/pullRequest/githubStackActions.test.ts @@ -79,7 +79,6 @@ function fake(responses: readonly unknown[]) { if (value === undefined) throw new Error("Unexpected GitHub request"); return { exitCode: ChildProcessSpawner.ExitCode(0), - // @effect-diagnostics-next-line preferSchemaOverJson:off stdout: JSON.stringify(value), stderr: "", stdoutTruncated: false, diff --git a/apps/server/src/serverSettings.test.ts b/apps/server/src/serverSettings.test.ts index 4376d5d7ea69..f569603ddbeb 100644 --- a/apps/server/src/serverSettings.test.ts +++ b/apps/server/src/serverSettings.test.ts @@ -578,7 +578,6 @@ it.layer(NodeServices.layer)("server settings", (it) => { const change = Option.getOrUndefined(yield* Stream.runHead(changes)); const raw = yield* fileSystem.readFileString(serverConfig.settingsPath); // Inspect raw persisted JSON before schema decoding can apply defaults. - // @effect-diagnostics-next-line preferSchemaOverJson:off const persisted = JSON.parse(raw) as Record; assert.strictEqual(next.sidebarAutoSettleAfterDays, null); @@ -759,7 +758,6 @@ it.layer(NodeServices.layer)("server settings", (it) => { const raw = yield* fileSystem.readFileString(serverConfig.settingsPath); assert.deepEqual( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.parse(raw).sourceControlWriterModelSelection, sourceControlWriterModelSelection, ); @@ -1046,7 +1044,6 @@ it.layer(NodeServices.layer)("server settings", (it) => { assert.isFalse(settings.providers.grok.enabled); const raw = yield* fileSystem.readFileString(serverConfig.settingsPath); - // @effect-diagnostics-next-line preferSchemaOverJson:off assert.isFalse(JSON.parse(raw).providers.grok.enabled); }).pipe(Effect.provide(layerServerSettings())), ); @@ -1067,7 +1064,6 @@ it.layer(NodeServices.layer)("server settings", (it) => { yield* serverSettings.updateSettings({ addProjectBaseDirectory: "~/Development" }); const raw = yield* fileSystem.readFileString(serverConfig.settingsPath); - // @effect-diagnostics-next-line preferSchemaOverJson:off const persisted = JSON.parse(raw); assert.isTrue(persisted.providers.cursor.enabled); assert.isTrue(persisted.providers.grok.enabled); @@ -1104,7 +1100,6 @@ it.layer(NodeServices.layer)("server settings", (it) => { assert.isFalse(resolveProviderInstanceEnabled(grok)); const raw = yield* fileSystem.readFileString(serverConfig.settingsPath); - // @effect-diagnostics-next-line preferSchemaOverJson:off const persisted = JSON.parse(raw); assert.isFalse(persisted.providers.cursor.enabled); assert.isFalse(persisted.providers.grok.enabled); @@ -1288,7 +1283,6 @@ it.layer(NodeServices.layer)("server settings", (it) => { assert.equal(next.providers.codex.binaryPath, "/opt/homebrew/bin/codex"); const raw = yield* fileSystem.readFileString(serverConfig.settingsPath); - // @effect-diagnostics-next-line preferSchemaOverJson:off assert.deepEqual(JSON.parse(raw), { addProjectBaseDirectory: "~/Development", observability: { @@ -1506,7 +1500,6 @@ it.layer(NodeServices.layer)("server settings", (it) => { const raw = yield* fileSystem.readFileString(serverConfig.settingsPath); assert.notInclude(raw, "sk-or-secret"); - // @effect-diagnostics-next-line preferSchemaOverJson:off assert.deepEqual(JSON.parse(raw).providerInstances.codex_personal.environment, [ { name: "OPENROUTER_API_KEY", @@ -1944,10 +1937,7 @@ it.layer(NodeServices.layer)("server settings", (it) => { projectSettingsOverrides: { [legacyProject]: null }, }); const raw = yield* fileSystem.readFileString(serverConfig.settingsPath); - const persisted = yield* decodeServerSettings( - // @effect-diagnostics-next-line preferSchemaOverJson:off - JSON.parse(raw), - ); + const persisted = yield* decodeServerSettings(JSON.parse(raw)); assert.isTrue(persisted.projectSettingsFolded); assert.isUndefined(persisted.projectSettingsOverrides[legacyProject]); }).pipe(Effect.provide(layerServerSettings())), diff --git a/apps/server/src/serviceLauncher.test.ts b/apps/server/src/serviceLauncher.test.ts index 30b239f3e47f..df2ab9e9cd06 100644 --- a/apps/server/src/serviceLauncher.test.ts +++ b/apps/server/src/serviceLauncher.test.ts @@ -198,7 +198,6 @@ it.layer(NodeServices.layer)("service state persistence", (it) => { const databasePath = path.join(root, "userdata", "state.sqlite"); yield* fs.makeDirectory(path.dirname(databasePath), { recursive: true }); yield* fs.writeFileString(databasePath, "before trial"); - // @effect-diagnostics-next-line preferSchemaOverJson:off - embeds a path in fake child source. const encodedDatabasePath = JSON.stringify(databasePath); const childSource = ` const context = JSON.parse(process.env.T3_SERVICE_LAUNCHER_CONTEXT); @@ -252,7 +251,6 @@ if (context.update?.status === "pending") { const databasePath = path.join(root, "userdata", "state.sqlite"); yield* fs.makeDirectory(path.dirname(databasePath), { recursive: true }); yield* fs.writeFileString(databasePath, "before trial"); - // @effect-diagnostics-next-line preferSchemaOverJson:off - embeds a path in fake child source. const encodedDatabasePath = JSON.stringify(databasePath); const childSource = ` const context = JSON.parse(process.env.T3_SERVICE_LAUNCHER_CONTEXT); @@ -308,7 +306,6 @@ if (context.update?.status === "pending") { const original = "database before migration"; yield* fs.makeDirectory(path.dirname(databasePath), { recursive: true }); yield* fs.writeFileString(databasePath, original); - // @effect-diagnostics-next-line preferSchemaOverJson:off - embeds a path in fake child source. const encodedDatabasePath = JSON.stringify(databasePath); const childSource = ` import { writeFileSync } from "node:fs"; diff --git a/apps/server/src/sourceControl/AzureDevOpsCli.test.ts b/apps/server/src/sourceControl/AzureDevOpsCli.test.ts index 6ef0b35559fd..249397824609 100644 --- a/apps/server/src/sourceControl/AzureDevOpsCli.test.ts +++ b/apps/server/src/sourceControl/AzureDevOpsCli.test.ts @@ -39,7 +39,6 @@ describe("AzureDevOpsCli.layer", () => { mockRun.mockReturnValueOnce( Effect.succeed( processOutput( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ pullRequestId: 42, title: "Add Azure provider", @@ -97,7 +96,6 @@ describe("AzureDevOpsCli.layer", () => { mockRun.mockReturnValueOnce( Effect.succeed( processOutput( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ pullRequestId: 863, title: "Fix Azure link", @@ -134,7 +132,6 @@ describe("AzureDevOpsCli.layer", () => { mockRun.mockReturnValueOnce( Effect.succeed( processOutput( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { pullRequestId: 7, @@ -195,7 +192,6 @@ describe("AzureDevOpsCli.layer", () => { mockRun.mockReturnValueOnce( Effect.succeed( processOutput( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ name: "repo", webUrl: "https://dev.azure.com/acme/project/_git/repo", @@ -228,7 +224,6 @@ describe("AzureDevOpsCli.layer", () => { mockRun.mockReturnValueOnce( Effect.succeed( processOutput( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ name: "repo", webUrl: "https://dev.azure.com/acme/project/_git/repo", diff --git a/apps/server/src/sourceControl/BitbucketApi.test.ts b/apps/server/src/sourceControl/BitbucketApi.test.ts index 2ea48c3fdc8c..352bfc60d970 100644 --- a/apps/server/src/sourceControl/BitbucketApi.test.ts +++ b/apps/server/src/sourceControl/BitbucketApi.test.ts @@ -541,7 +541,6 @@ it.effect("creates repositories through the Bitbucket REST API", () => { assert.ok(request); const rawBody = (request.body as { readonly body?: Uint8Array }).body; assert.ok(rawBody); - // @effect-diagnostics-next-line preferSchemaOverJson:off assert.deepStrictEqual(JSON.parse(new TextDecoder().decode(rawBody)), { scm: "git", is_private: true, @@ -577,7 +576,6 @@ it.effect("creates pull requests using the official REST payload shape", () => { assert.ok(request); const rawBody = (request.body as { readonly body?: Uint8Array }).body; assert.ok(rawBody); - // @effect-diagnostics-next-line preferSchemaOverJson:off assert.deepStrictEqual(JSON.parse(new TextDecoder().decode(rawBody)), { title: "Provider PR", description: "PR body", diff --git a/apps/server/src/sourceControl/GitHubCli.test.ts b/apps/server/src/sourceControl/GitHubCli.test.ts index 88c877605381..86525570a7df 100644 --- a/apps/server/src/sourceControl/GitHubCli.test.ts +++ b/apps/server/src/sourceControl/GitHubCli.test.ts @@ -572,7 +572,6 @@ describe("GitHubCli.layer", () => { mockRun.mockReturnValueOnce( Effect.succeed( processOutput( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ number: 42, title: "Add PR thread creation", @@ -637,7 +636,6 @@ describe("GitHubCli.layer", () => { mockRun.mockReturnValueOnce( Effect.succeed( processOutput( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ number: 42, title: " Add PR thread creation \n", @@ -685,7 +683,6 @@ describe("GitHubCli.layer", () => { mockRun.mockReturnValueOnce( Effect.succeed( processOutput( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { number: 0, @@ -741,7 +738,6 @@ describe("GitHubCli.layer", () => { mockRun.mockReturnValueOnce( Effect.succeed( processOutput( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { number: 2829, @@ -795,7 +791,6 @@ describe("GitHubCli.layer", () => { mockRun.mockReturnValueOnce( Effect.succeed( processOutput( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ nameWithOwner: "octocat/codething-mvp", url: "https://github.com/octocat/codething-mvp", diff --git a/apps/server/src/sourceControl/GitLabCli.test.ts b/apps/server/src/sourceControl/GitLabCli.test.ts index a87a32831098..5a10f13b8f8f 100644 --- a/apps/server/src/sourceControl/GitLabCli.test.ts +++ b/apps/server/src/sourceControl/GitLabCli.test.ts @@ -39,7 +39,6 @@ layer("GitLabCli.layer", (it) => { mockedRun.mockReturnValueOnce( Effect.succeed( processOutput( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ iid: 42, title: "Add MR thread creation", @@ -94,7 +93,6 @@ layer("GitLabCli.layer", (it) => { mockedRun.mockReturnValueOnce( Effect.succeed( processOutput( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify([ { iid: 0, @@ -163,7 +161,6 @@ layer("GitLabCli.layer", (it) => { mockedRun.mockReturnValueOnce( Effect.succeed( processOutput( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ path_with_namespace: "octocat/t3code", web_url: "https://gitlab.com/octocat/t3code", @@ -230,18 +227,10 @@ layer("GitLabCli.layer", (it) => { Effect.gen(function* () { mockedRun + .mockReturnValueOnce(Effect.succeed(processOutput(JSON.stringify({ id: 1234 })))) .mockReturnValueOnce( Effect.succeed( processOutput( - // @effect-diagnostics-next-line preferSchemaOverJson:off - JSON.stringify({ id: 1234 }), - ), - ), - ) - .mockReturnValueOnce( - Effect.succeed( - processOutput( - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ path_with_namespace: "octocat/t3code", web_url: "https://gitlab.com/octocat/t3code", diff --git a/apps/server/src/textGeneration/ClaudeTextGeneration.test.ts b/apps/server/src/textGeneration/ClaudeTextGeneration.test.ts index b373973b4944..0ee4b8763cfc 100644 --- a/apps/server/src/textGeneration/ClaudeTextGeneration.test.ts +++ b/apps/server/src/textGeneration/ClaudeTextGeneration.test.ts @@ -367,7 +367,6 @@ it.layer(layerClaudeTextGenerationTest)("ClaudeTextGeneration", (it) => { const claudeConfigDir = path.join(process.cwd(), ".claude-work-test"); return yield* withFakeClaudeEnv( { - // @effect-diagnostics-next-line preferSchemaOverJson:off output: JSON.stringify({ structured_output: { title: "Use Claude home", diff --git a/apps/server/src/vcs/VcsProjectConfig.test.ts b/apps/server/src/vcs/VcsProjectConfig.test.ts index f28d3eb51452..1c91cbadea8c 100644 --- a/apps/server/src/vcs/VcsProjectConfig.test.ts +++ b/apps/server/src/vcs/VcsProjectConfig.test.ts @@ -42,7 +42,6 @@ describe("VcsProjectConfig", () => { yield* fileSystem.makeDirectory(nested, { recursive: true }); yield* fileSystem.writeFileString( path.join(configDir, "vcs.json"), - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ vcs: { kind: "jj" } }), ); @@ -72,7 +71,6 @@ describe("VcsProjectConfig", () => { yield* fileSystem.makeDirectory(configDir, { recursive: true }); yield* fileSystem.writeFileString( path.join(configDir, "vcs.json"), - // @effect-diagnostics-next-line preferSchemaOverJson:off JSON.stringify({ vcs: { kind: "jj" } }), ); diff --git a/apps/web/src/cloud/linkEnvironment.test.ts b/apps/web/src/cloud/linkEnvironment.test.ts index cb775c26ff6a..dbcaacfa25a4 100644 --- a/apps/web/src/cloud/linkEnvironment.test.ts +++ b/apps/web/src/cloud/linkEnvironment.test.ts @@ -240,7 +240,6 @@ describe("web cloud link environment client", () => { "http://127.0.0.1:3000/api/connect/preferences", ); expect(fetchMock.mock.calls[0]?.[1]?.method).toBe("POST"); - // @effect-diagnostics-next-line preferSchemaOverJson:off expect(JSON.parse(bodyText(fetchMock.mock.calls[0]?.[1]?.body))).toEqual({ publishAgentActivity: true, }); @@ -290,7 +289,6 @@ describe("web cloud link environment client", () => { expect(String(fetchMock.mock.calls[1]?.[0])).toBe( "http://127.0.0.1:3000/api/connect/link-proof", ); - // @effect-diagnostics-next-line preferSchemaOverJson:off expect(JSON.parse(bodyText(fetchMock.mock.calls[1]?.[1]?.body))).toMatchObject({ challenge: "challenge", endpoint: { @@ -341,11 +339,9 @@ describe("web cloud link environment client", () => { }), ); - // @effect-diagnostics-next-line preferSchemaOverJson:off expect(JSON.parse(bodyText(fetchMock.mock.calls[0]?.[1]?.body))).toMatchObject({ managedTunnelsEnabled: false, }); - // @effect-diagnostics-next-line preferSchemaOverJson:off expect(JSON.parse(bodyText(fetchMock.mock.calls[1]?.[1]?.body))).toMatchObject({ endpoint: { providerKind: "manual" }, }); diff --git a/packages/client-runtime/src/state/pullRequestDiffHttp.test.ts b/packages/client-runtime/src/state/pullRequestDiffHttp.test.ts index b69aeaab3855..849553e89359 100644 --- a/packages/client-runtime/src/state/pullRequestDiffHttp.test.ts +++ b/packages/client-runtime/src/state/pullRequestDiffHttp.test.ts @@ -71,7 +71,6 @@ describe("fetchEnvironmentPullRequestDiff", () => { : ""; // The assertion deliberately inspects the serialized wire body rather than decoding a // domain value for use in application code. - // @effect-diagnostics-next-line preferSchemaOverJson:off expect(JSON.parse(body)).toEqual({ projectId: "project-1", repository: "owner/repository", diff --git a/tsconfig.base.json b/tsconfig.base.json index 61f331a128f9..f6914a8e1e6c 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -51,7 +51,13 @@ "globalFetch": "error", "globalFetchInEffect": "error", "schemaNumber": "off" - } + }, + "overrides": [ + { + "include": ["**/*.test.ts", "**/*.test.tsx"], + "options": { "diagnosticSeverity": { "preferSchemaOverJson": "off" } } + } + ] } ] }