@devries-cameron20 / t3code Mirror · read-only / commits / a8b692b3b8
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 22, 17:00 UTC

chore(lint): enforce preferTypedSchemaDecoder (#25094)

Julius Marminge committed Oct 25, 2026 at 18:18 UTC a8b692b3b8a03dc566b7edba67b0bb2bc40df158
14 files changed +16 -17
apps/server/scripts/record-grok-acp-replay-fixture.ts
+1 -1
@@ -367,7 +367,7 @@ function normalizeEntries(input: {
367 });
368 }
369
370 -const DEFAULT_GROK_SETTINGS = Schema.decodeUnknownSync(GrokSettings)({});
370 +const DEFAULT_GROK_SETTINGS = Schema.decodeSync(GrokSettings)({});
371
372 const recordScenario = Effect.fn("recordGrokScenario")(function* (fixtureName: string) {
373 const fixture = ORCHESTRATOR_REPLAY_FIXTURES.find((candidate) => candidate.name === fixtureName);
apps/server/src/assets/AssetAccess.test.ts
+1 -1
@@ -1244,7 +1244,7 @@ describe("AssetAccess", () => {
1244 ]);
1245 return Effect.gen(function* () {
1246 // Every client and server release spells the resource this way on the wire.
1247 - const { resource } = yield* Schema.decodeUnknownEffect(AssetCreateUrlInput)({
1247 + const { resource } = yield* Schema.decodeEffect(AssetCreateUrlInput)({
1248 resource: { _tag: "github-media", cwd: "/repo", url },
1249 });
1250 const issued = yield* issueAssetUrl({ resource });
apps/server/src/orchestration-v2/Adapters/AcpRegistryAdapterV2.testkit.ts
+1 -1
@@ -27,7 +27,7 @@ import {
27 } from "@t3tools/provider-acp-registry/testing";
28 import * as AcpRegistrySupport from "@t3tools/provider-acp-registry/server/AcpRegistrySupport";
29
30 -const REPLAY_SETTINGS = Schema.decodeUnknownSync(AcpRegistrySettings)({
30 +const REPLAY_SETTINGS = Schema.decodeSync(AcpRegistrySettings)({
31 agentId: "replay-agent",
32 authMethodId: "replay",
33 });
apps/server/src/orchestration-v2/Adapters/GrokAdapterV2.testkit.ts
+1 -1
@@ -30,7 +30,7 @@ import {
30 makeGrokAdapterV2,
31 } from "@t3tools/provider-grok/testing";
32
33 -const DEFAULT_GROK_SETTINGS = Schema.decodeUnknownSync(GrokSettings)({});
33 +const DEFAULT_GROK_SETTINGS = Schema.decodeSync(GrokSettings)({});
34
35 function layerGrokProviderAdapterRegistryReplay(
36 transcript: AcpReplayTranscript,
apps/server/src/orchestration-v2/Adapters/MuseAdapterV2.testkit.ts
+1 -1
@@ -406,7 +406,7 @@ function makeReplayCreateHost(controller: MuseReplayController) {
406 };
407 }
408
409 -const DEFAULT_MUSE_SETTINGS = Schema.decodeUnknownSync(MuseSettings)({ enabled: true });
409 +const DEFAULT_MUSE_SETTINGS = Schema.decodeSync(MuseSettings)({ enabled: true });
410
411 export function layer(input: {
412 readonly scenario: string;
apps/server/src/orchestration-v2/http.test.ts
+1 -1
@@ -51,7 +51,7 @@ const decodeTranscript = Schema.decodeUnknownEffect(
51 const now = DateTime.makeUnsafe("2026-09-29T00:00:00.000Z");
52 const environmentId = EnvironmentId.make("source-بيئة");
53 const output = "Full tool output. ".repeat(4_000);
54 -const thread = Schema.decodeUnknownSync(OrchestrationV2AppThread)({
54 +const thread = Schema.decodeSync(OrchestrationV2AppThread)({
55 id: "source-thread",
56 projectId: "source-project",
57 title: "Source 界\nconversation",
apps/server/src/provider/CodexInstallation.ts
+1 -1
@@ -202,7 +202,7 @@ export const makeCodexInstallation = Effect.fn("makeCodexInstallation")(function
202 "resolve",
203 "The managed Codex installation record is invalid. Reinstall Codex.",
204 );
205 - return yield* Schema.decodeUnknownEffect(Schema.fromJsonString(schema))(
205 + return yield* Schema.decodeEffect(Schema.fromJsonString(schema))(
206 yield* fs.readFileString(file),
207 );
208 });
packages/client-runtime/src/state/boundedThreadSnapshotHttp.test.ts
+1 -1
@@ -120,7 +120,7 @@ const boundedBody = (compact: boolean) => ({
120 });
121 const BoundedJson = Schema.toCodecJson(OrchestrationV2ThreadBoundedSnapshot);
122 const idTableBody = () => {
123 - const snapshot = Schema.decodeUnknownSync(BoundedJson)(boundedBody(true));
123 + const snapshot = Schema.decodeSync(BoundedJson)(boundedBody(true));
124 return Schema.encodeSync(BoundedJson)({ ...snapshot, idTable: true });
125 };
126
packages/client-runtime/src/state/queryPersistence.ts
+1 -1
@@ -31,7 +31,7 @@ export function persistQuery<A, I>(schema: Schema.Codec<A, I>): QueryPersistence
31 if (store === null) return Option.none<A>();
32 const stored = yield* store.load(environmentId, key);
33 if (Option.isNone(stored)) return Option.none<A>();
34 - return yield* Schema.decodeUnknownEffect(codec)(stored.value).pipe(
34 + return yield* Schema.decodeEffect(codec)(stored.value).pipe(
35 Effect.asSome,
36 Effect.catch(() => Effect.succeedNone),
37 );
packages/client-runtime/src/state/threads-sync.test.ts
+1 -1
@@ -371,7 +371,7 @@ describe("EnvironmentThreads", () => {
371 let discarded = false;
372 const h = yield* makeHarness({
373 loadCached: decodeOrDiscardOrchestrationCache(
374 - Schema.decodeUnknownEffect(schema)(stale).pipe(
374 + Schema.decodeEffect(schema)(stale).pipe(
375 Effect.map((stored) => Option.some(stored.snapshot)),
376 ),
377 Effect.sync(() => {
packages/contracts/src/auth.test.ts
+1 -3
@@ -14,9 +14,7 @@ import {
14
15 describe("authorization grants", () => {
16 it("decodes legacy review credentials without offering them in new grants", () => {
17 - expect(Schema.decodeUnknownSync(AuthEnvironmentScopes)(["review:write"])).toEqual([
18 - "review:write",
19 - ]);
17 + expect(Schema.decodeSync(AuthEnvironmentScopes)(["review:write"])).toEqual(["review:write"]);
18 expect(() => Schema.decodeUnknownSync(AuthGrantScopes)(["review:write"])).toThrow();
19 expect(AuthStandardClientScopes).not.toContain("review:write");
20 });
packages/effect-acp/src/protocol.test.ts
+3 -3
@@ -497,9 +497,9 @@ it.layer(NodeServices.layer)("effect-acp protocol", (it) => {
497 }),
498 );
499
500 - const response = yield* Schema.decodeUnknownEffect(
501 - Schema.fromJsonString(JsonRpcErrorResponse),
502 - )(yield* Queue.take(output));
500 + const response = yield* Schema.decodeEffect(Schema.fromJsonString(JsonRpcErrorResponse))(
501 + yield* Queue.take(output),
502 + );
503 assert.equal(response.id, 9);
504 assert.equal(response.error.code, -32603);
505 }),
packages/provider-opencode/src/server/adapter.test.ts
+1 -1
@@ -100,7 +100,7 @@ function asyncEventStream() {
100 };
101 }
102
103 -const OPENCODE_TEST_SETTINGS = Schema.decodeUnknownSync(OpenCodeSettings)({});
103 +const OPENCODE_TEST_SETTINGS = Schema.decodeSync(OpenCodeSettings)({});
104
105 function runtimePolicy(
106 runtimeMode: ProviderAdapter.ProviderAdapterV2RuntimePolicy["runtimeMode"],
tsconfig.base.json
+1
@@ -24,6 +24,7 @@
24 "namespaceImportPackages": ["@effect/platform-node", "effect"],
25 "effectFn": ["span", "inferred-span", "suggested-span"],
26 "diagnosticSeverity": {
27 + "preferTypedSchemaDecoder": "error",
28 "catchUnfailableEffect": "error",
29 "raceFirstWithSleepToTimeout": "error",
30 "redundantMapError": "error",