Rule: All Schema.Class and Schema.TaggedClass instances MUST use .make() for construction. new ClassName(...) is NOT acceptable.
Implementation:
- Every Schema.Class and TaggedClass definition has
static make = this.makeUnsafeadded (135 classes across 61 files) - All call sites use
X.make({...})instead ofnew X({...}) - Only exception: standalone factory functions (
export const make = (args) => new XClass(args)) in fs path modules — these ARE the public.make()API and usenewinternally typescript/unbound-methodlint rule disabled — false positive onstatic make = this.makeUnsafepattern (135 instances)
bash tools/verify-no-new-schema-classes.shThis script diffs the PR branch against b22617f2 (pre-v4 base) and checks that no new SchemaClass(...) patterns exist in added lines. It covers all 135 Schema.Class/TaggedClass names across the monorepo.
$ bash tools/verify-no-new-schema-classes.sh
Checking PR diff for 'new <SchemaClass>(...)' violations...
Base commit: b22617f2
PASS: No 'new <SchemaClass>(...)' violations found in PR diff.
All Schema.Class/TaggedClass construction uses .make() as required.
cd /Users/jasonkuhrt/projects/jasonkuhrt/kitz-effect-v4
bash tools/verify-no-new-schema-classes.shCommit 861876ce — all 9/9 jobs pass:
| Job | Status |
|---|---|
| check-type | PASS |
| format | PASS |
| packages-types | PASS |
| packages-build | PASS |
| packages-test | PASS |
| packages-lint | PASS |
| api-model-style | PASS |
| publint | PASS |
| release-preview | PASS |
sch/union.ts: ChangedmemberSchema.make()tomemberSchema.makeUnsafe()(generic schema call, not class construction)- GitHub Issue #131: Created for follow-up migration to v4 native
TaggedUnion/toTaggedUnion - Migration memory updated:
project_effect_v4_migration.mdreflects current state - Merged main: Picked up
packages/oxlint-rules(PR #132), fixed v4 compat (Either→Result, Record, Union, parseJson→fromJsonString) - oxlint-rules: Updated
schema-parsing-contractrule to acceptS.Codec(v4) alongsideS.Schema(v3) - PR title: Updated to include
oxlint-rulesscope after main merge