Skip to content

Commit d6dea3f

Browse files
authored
chore(core): clean up after ConfigPermission Effect Schema migration (#23749)
1 parent 0bcf734 commit d6dea3f

2 files changed

Lines changed: 3 additions & 15 deletions

File tree

packages/opencode/specs/effect/schema.md

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ creating a parallel schema source of truth.
9797

9898
## Escape hatches
9999

100-
The walker in `@/util/effect-zod` exposes three explicit escape hatches for
100+
The walker in `@/util/effect-zod` exposes two explicit escape hatches for
101101
cases the pure-Schema path cannot express. Each one stays in the codebase
102102
only as long as its upstream or local dependency requires it — inline
103103
comments document when each can be deleted.
@@ -109,19 +109,7 @@ Replaces the entire derivation with a hand-crafted zod schema. Used when:
109109
- the target carries external `$ref` metadata (e.g.
110110
`config/model-id.ts` points at `https://models.dev/...`)
111111
- the target is a zod-only schema that cannot yet be expressed as Schema
112-
(e.g. `ConfigAgent.Info`, `ConfigPermission.Info`, `Log.Level`)
113-
114-
### `ZodPreprocess` annotation
115-
116-
Wraps the derived zod schema with `z.preprocess(fn, inner)`. Used by
117-
`config/permission.ts` to inject `__originalKeys` before parsing, because
118-
`Schema.StructWithRest` canonicalises output (known fields first, catchall
119-
after) and destroys the user's original property order — which permission
120-
rule precedence depends on.
121-
122-
Tracked upstream as `effect:core/wlh553`: "Schema: add preserveInputOrder
123-
(or pre-parse hook) for open structs." Once that lands, `ZodPreprocess` and
124-
the `__originalKeys` hack can both be deleted.
112+
(e.g. `ConfigAgent.Info`, `Log.Level`)
125113

126114
### Local `DeepMutable<T>` in `config/config.ts`
127115

packages/opencode/src/config/agent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export * as ConfigAgent from "./agent"
33
import { Schema } from "effect"
44
import z from "zod"
55
import { Bus } from "@/bus"
6-
import { zod, ZodOverride } from "@/util/effect-zod"
6+
import { zod } from "@/util/effect-zod"
77
import { Log } from "../util"
88
import { NamedError } from "@opencode-ai/shared/util/error"
99
import { Glob } from "@opencode-ai/shared/util/glob"

0 commit comments

Comments
 (0)