diff --git a/apps/server/scripts/record-grok-acp-replay-fixture.ts b/apps/server/scripts/record-grok-acp-replay-fixture.ts index a085c9e86c81f..d0036e2ca6423 100644 --- a/apps/server/scripts/record-grok-acp-replay-fixture.ts +++ b/apps/server/scripts/record-grok-acp-replay-fixture.ts @@ -367,7 +367,7 @@ function normalizeEntries(input: { }); } -const DEFAULT_GROK_SETTINGS = Schema.decodeUnknownSync(GrokSettings)({}); +const DEFAULT_GROK_SETTINGS = Schema.decodeSync(GrokSettings)({}); const recordScenario = Effect.fn("recordGrokScenario")(function* (fixtureName: string) { const fixture = ORCHESTRATOR_REPLAY_FIXTURES.find((candidate) => candidate.name === fixtureName); diff --git a/apps/server/src/assets/AssetAccess.test.ts b/apps/server/src/assets/AssetAccess.test.ts index dec93f2ea19c6..cc36317899e16 100644 --- a/apps/server/src/assets/AssetAccess.test.ts +++ b/apps/server/src/assets/AssetAccess.test.ts @@ -1244,7 +1244,7 @@ describe("AssetAccess", () => { ]); return Effect.gen(function* () { // Every client and server release spells the resource this way on the wire. - const { resource } = yield* Schema.decodeUnknownEffect(AssetCreateUrlInput)({ + const { resource } = yield* Schema.decodeEffect(AssetCreateUrlInput)({ resource: { _tag: "github-media", cwd: "/repo", url }, }); const issued = yield* issueAssetUrl({ resource }); diff --git a/apps/server/src/orchestration-v2/Adapters/AcpRegistryAdapterV2.testkit.ts b/apps/server/src/orchestration-v2/Adapters/AcpRegistryAdapterV2.testkit.ts index fb4c93aba7ddc..2e5d9e4058da1 100644 --- a/apps/server/src/orchestration-v2/Adapters/AcpRegistryAdapterV2.testkit.ts +++ b/apps/server/src/orchestration-v2/Adapters/AcpRegistryAdapterV2.testkit.ts @@ -27,7 +27,7 @@ import { } from "@t3tools/provider-acp-registry/testing"; import * as AcpRegistrySupport from "@t3tools/provider-acp-registry/server/AcpRegistrySupport"; -const REPLAY_SETTINGS = Schema.decodeUnknownSync(AcpRegistrySettings)({ +const REPLAY_SETTINGS = Schema.decodeSync(AcpRegistrySettings)({ agentId: "replay-agent", authMethodId: "replay", }); diff --git a/apps/server/src/orchestration-v2/Adapters/GrokAdapterV2.testkit.ts b/apps/server/src/orchestration-v2/Adapters/GrokAdapterV2.testkit.ts index e3ec361c77428..9b4483561ce0a 100644 --- a/apps/server/src/orchestration-v2/Adapters/GrokAdapterV2.testkit.ts +++ b/apps/server/src/orchestration-v2/Adapters/GrokAdapterV2.testkit.ts @@ -30,7 +30,7 @@ import { makeGrokAdapterV2, } from "@t3tools/provider-grok/testing"; -const DEFAULT_GROK_SETTINGS = Schema.decodeUnknownSync(GrokSettings)({}); +const DEFAULT_GROK_SETTINGS = Schema.decodeSync(GrokSettings)({}); function layerGrokProviderAdapterRegistryReplay( transcript: AcpReplayTranscript, diff --git a/apps/server/src/orchestration-v2/Adapters/MuseAdapterV2.testkit.ts b/apps/server/src/orchestration-v2/Adapters/MuseAdapterV2.testkit.ts index aeedce64deb47..55576ea5f362a 100644 --- a/apps/server/src/orchestration-v2/Adapters/MuseAdapterV2.testkit.ts +++ b/apps/server/src/orchestration-v2/Adapters/MuseAdapterV2.testkit.ts @@ -406,7 +406,7 @@ function makeReplayCreateHost(controller: MuseReplayController) { }; } -const DEFAULT_MUSE_SETTINGS = Schema.decodeUnknownSync(MuseSettings)({ enabled: true }); +const DEFAULT_MUSE_SETTINGS = Schema.decodeSync(MuseSettings)({ enabled: true }); export function layer(input: { readonly scenario: string; diff --git a/apps/server/src/orchestration-v2/http.test.ts b/apps/server/src/orchestration-v2/http.test.ts index 76dd8575797d7..570d34468d37a 100644 --- a/apps/server/src/orchestration-v2/http.test.ts +++ b/apps/server/src/orchestration-v2/http.test.ts @@ -51,7 +51,7 @@ const decodeTranscript = Schema.decodeUnknownEffect( const now = DateTime.makeUnsafe("2026-09-29T00:00:00.000Z"); const environmentId = EnvironmentId.make("source-بيئة"); const output = "Full tool output. ".repeat(4_000); -const thread = Schema.decodeUnknownSync(OrchestrationV2AppThread)({ +const thread = Schema.decodeSync(OrchestrationV2AppThread)({ id: "source-thread", projectId: "source-project", title: "Source 界\nconversation", diff --git a/apps/server/src/provider/CodexInstallation.ts b/apps/server/src/provider/CodexInstallation.ts index 669cbc6c8e2f0..758eb406f1b54 100644 --- a/apps/server/src/provider/CodexInstallation.ts +++ b/apps/server/src/provider/CodexInstallation.ts @@ -202,7 +202,7 @@ export const makeCodexInstallation = Effect.fn("makeCodexInstallation")(function "resolve", "The managed Codex installation record is invalid. Reinstall Codex.", ); - return yield* Schema.decodeUnknownEffect(Schema.fromJsonString(schema))( + return yield* Schema.decodeEffect(Schema.fromJsonString(schema))( yield* fs.readFileString(file), ); }); diff --git a/packages/client-runtime/src/state/boundedThreadSnapshotHttp.test.ts b/packages/client-runtime/src/state/boundedThreadSnapshotHttp.test.ts index c4b52fd8d3ed0..50fb1d33c3ff6 100644 --- a/packages/client-runtime/src/state/boundedThreadSnapshotHttp.test.ts +++ b/packages/client-runtime/src/state/boundedThreadSnapshotHttp.test.ts @@ -120,7 +120,7 @@ const boundedBody = (compact: boolean) => ({ }); const BoundedJson = Schema.toCodecJson(OrchestrationV2ThreadBoundedSnapshot); const idTableBody = () => { - const snapshot = Schema.decodeUnknownSync(BoundedJson)(boundedBody(true)); + const snapshot = Schema.decodeSync(BoundedJson)(boundedBody(true)); return Schema.encodeSync(BoundedJson)({ ...snapshot, idTable: true }); }; diff --git a/packages/client-runtime/src/state/queryPersistence.ts b/packages/client-runtime/src/state/queryPersistence.ts index a6241a81fabbb..cbab9e02b104b 100644 --- a/packages/client-runtime/src/state/queryPersistence.ts +++ b/packages/client-runtime/src/state/queryPersistence.ts @@ -31,7 +31,7 @@ export function persistQuery(schema: Schema.Codec): QueryPersistence if (store === null) return Option.none(); const stored = yield* store.load(environmentId, key); if (Option.isNone(stored)) return Option.none(); - return yield* Schema.decodeUnknownEffect(codec)(stored.value).pipe( + return yield* Schema.decodeEffect(codec)(stored.value).pipe( Effect.asSome, Effect.catch(() => Effect.succeedNone), ); diff --git a/packages/client-runtime/src/state/threads-sync.test.ts b/packages/client-runtime/src/state/threads-sync.test.ts index fb35c55ab009a..44e746bee1d9f 100644 --- a/packages/client-runtime/src/state/threads-sync.test.ts +++ b/packages/client-runtime/src/state/threads-sync.test.ts @@ -371,7 +371,7 @@ describe("EnvironmentThreads", () => { let discarded = false; const h = yield* makeHarness({ loadCached: decodeOrDiscardOrchestrationCache( - Schema.decodeUnknownEffect(schema)(stale).pipe( + Schema.decodeEffect(schema)(stale).pipe( Effect.map((stored) => Option.some(stored.snapshot)), ), Effect.sync(() => { diff --git a/packages/contracts/src/auth.test.ts b/packages/contracts/src/auth.test.ts index 2d441dc0f06d4..81c481fae7100 100644 --- a/packages/contracts/src/auth.test.ts +++ b/packages/contracts/src/auth.test.ts @@ -14,9 +14,7 @@ import { describe("authorization grants", () => { it("decodes legacy review credentials without offering them in new grants", () => { - expect(Schema.decodeUnknownSync(AuthEnvironmentScopes)(["review:write"])).toEqual([ - "review:write", - ]); + expect(Schema.decodeSync(AuthEnvironmentScopes)(["review:write"])).toEqual(["review:write"]); expect(() => Schema.decodeUnknownSync(AuthGrantScopes)(["review:write"])).toThrow(); expect(AuthStandardClientScopes).not.toContain("review:write"); }); diff --git a/packages/effect-acp/src/protocol.test.ts b/packages/effect-acp/src/protocol.test.ts index 78a2250b5e6ba..2ee7347537fb6 100644 --- a/packages/effect-acp/src/protocol.test.ts +++ b/packages/effect-acp/src/protocol.test.ts @@ -497,9 +497,9 @@ it.layer(NodeServices.layer)("effect-acp protocol", (it) => { }), ); - const response = yield* Schema.decodeUnknownEffect( - Schema.fromJsonString(JsonRpcErrorResponse), - )(yield* Queue.take(output)); + const response = yield* Schema.decodeEffect(Schema.fromJsonString(JsonRpcErrorResponse))( + yield* Queue.take(output), + ); assert.equal(response.id, 9); assert.equal(response.error.code, -32603); }), diff --git a/packages/provider-opencode/src/server/adapter.test.ts b/packages/provider-opencode/src/server/adapter.test.ts index bc80db9d09cf0..685317fe2a8a8 100644 --- a/packages/provider-opencode/src/server/adapter.test.ts +++ b/packages/provider-opencode/src/server/adapter.test.ts @@ -100,7 +100,7 @@ function asyncEventStream() { }; } -const OPENCODE_TEST_SETTINGS = Schema.decodeUnknownSync(OpenCodeSettings)({}); +const OPENCODE_TEST_SETTINGS = Schema.decodeSync(OpenCodeSettings)({}); function runtimePolicy( runtimeMode: ProviderAdapter.ProviderAdapterV2RuntimePolicy["runtimeMode"], diff --git a/tsconfig.base.json b/tsconfig.base.json index 1d34c48ffcda3..1dfdbd6634245 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -24,6 +24,7 @@ "namespaceImportPackages": ["@effect/platform-node", "effect"], "effectFn": ["span", "inferred-span", "suggested-span"], "diagnosticSeverity": { + "preferTypedSchemaDecoder": "error", "catchUnfailableEffect": "error", "raceFirstWithSleepToTimeout": "error", "redundantMapError": "error",