docs(chord): the schema package is built

This commit is contained in:
Mario Zechner 2026-10-31 21:47:22 +00:00
parent fab2c5353e
commit 6d4b744363

View file

@ -2119,6 +2119,14 @@ validation and copies the v2 kernel added around Delta.
is deleting that subpath). Not omptype (its validator compiles with `new Function`; its 10.7k lines are mostly
ArkType's API). Open: which validator (measure `@cfworker/json-schema` and TypeBox against the official
JSON-Schema-Test-Suite and Chord's argument checks first), and moving `Type` out of pi-ai's main export.
**Built** (owner, 2026-10-31: "clone pi add the package, done"; pi `fab2c53`): `packages/schema`,
`@earendil-works/pi-schema`: `compile(schema, { draft, formats, schemas })` with `check` (narrowing) and `errors`
(JSON Pointer paths), Chord-style builders typed with `Static`, formats as the opt-in `./formats` entry, leaf and regex
checks shared through weak caches (GC-tested); its own closure-compiled validator, chosen after measuring
(`/tmp/schema-measure.md`, Radius 01m69x3dz2fsg9k1r33vde7hv6): 2,222 of 2,223 core suite tests (TypeBox 2,200,
cfworker 2,167, omptype 1,522), Chord checks at 0.95-1.3x TypeBox's compiled speed and the same with `new Function`
blocked, 7.9 MB for 3,200 distinct schemas (cfworker 7.6, TypeBox 54.7), 8.5 KB gzip. Still open: switching Chord v2
and pi-ai to it (`Type` out of pi-ai's main export), formats on by default in pi-ai.
- **A plugin's npm dependencies are bundled; external only by opt-in (owner, 2026-10-29: "explicit opt in + (a)"):**
a plugin's `dependencies` are installed into its own `node_modules` (`npm install --ignore-scripts`) and bundled into
each facet that imports them (host packages, its `peerDependencies`, stay external and are passed in). On Node a