How it works
Zod checks the shape. EDcheck checks the meaning. The two layers work together.
You do not throw away your Zod schema. EDcheck does not replace it. It sits on top and asks: “does this make sense?”.
Two layers
| Layer | What it checks | Where it runs |
|---|---|---|
| Zod 4 | The shape: type, min, max, regex | Client and server |
| EDcheck | The meaning: does this look like a name? does the bio say something? | Server only |
EDcheck does not invent ed.string(). You keep using z.string() as usual.
What happens when you call safeParse
- 1
Zod checks the shape
If
fullNameis not a string, Zod rejects it. EDcheck does not spend an AI call on that field. - 2
EDcheck builds questions
Each
semantic()rule becomes a yes/no question (or a scale). They go together in one request per object. - 3
The AI answers with a probability
It does not claim absolute truth. It says how sure it is. EDcheck maps that to pass, warning, or fail.
- 4
You get a result
success,data, andissues. You use that to show errors on the form.
Client and server
The Zod schema can live in a shared folder. The client uses it for fast checks (empty input, too short, and so on).
The server imports that same schema, attaches EDcheck rules, and does the real validation. Nobody can skip the filter from the browser.
Pass, warning, or fail
- Pass: no issue is created. The field is fine.
- Warning: there is an issue, but
successcan staytrue. - Fail: there is an issue. If severity is
error,successbecomesfalse.
success is false only when some issue has severity: "error". A warning does not block the submit unless your app treats it as an error.
Arrays are not supported yet
If a field is an array (z.array(...)), define() rejects it. In this version EDcheck works with objects and single fields, not lists.