ADR 0008: @arachnejs/schema — Standard Schema DSL
- Status: Accepted
- Date: 2026-09-28
- Deciders: Arachne core
Context #
README promises “one schema, many outputs” (DB, forms, admin, OpenAPI, search).
@arachnejs/config already ships a thin Standard Schema–compatible DSL for boot
config (ADR 0004) and must stay free of a @arachnejs/schema dependency.
Decision #
@arachnejs/schemaowns the rich application schema DSL:string,number,boolean,literal,enum,object,array,optional,nullable,defaulted,union, plusparse/safeParseandInfer<S>helpers.- Schemas implement Standard Schema V1 (
~standard.validate). - Config keeps its own thin
c.*DSL for bootstrap; apps migrate domain models tos.*from@arachnejs/schema. - Downstream packages (
db,forms,table,admin, OpenAPI) consume Standard Schema values — not a proprietary AST — so third-party schemas (zod, valibot, arktype) remain usable where they expose~standard.
Alternatives considered #
- Promote config’s
cinto schema and re-export — couples boot config to the broader framework; rejected. - zod as the only public API — rejected; Standard Schema is the contract.
Consequences #
- New packages register
schemaedges inboundaries.json(already present). - MCP surface: validate-via-spec tool + README resource (ADR 0007).