docs: add schema-evolution.md — TypeBox Value.Diff/Patch/Cast for schema evolution

This commit is contained in:
2026-05-28 16:31:25 +00:00
parent 1e804b9174
commit 95e02f939d
3 changed files with 575 additions and 6 deletions

View File

@@ -244,6 +244,13 @@ design in [metagraph-module.md](./metagraph-module.md):
output is the same shape that a ujsx HostConfig would produce, but storage
doesn't need ujsx to create it. The alignment is structural, not dependent.
5. **Schemas-as-JSON enables `Value.Diff`/`Value.Patch`/`Value.Cast`**
because TypeBox Modules serialize to JSON Schema, the TypeBox value system
can operate on schemas themselves (diff to detect changes, patch to update
stored schemas, cast to migrate data). This is not possible if schemas are
opaque builder objects or Drizzle column definitions. See
[schema-evolution.md](./schema-evolution.md).
## References
- ujsx pointer system: `/workspace/@alkdev/ujsx/src/core/pointer.ts`
@@ -253,4 +260,5 @@ design in [metagraph-module.md](./metagraph-module.md):
- dbtype module: `/workspace/@alkdev/dbtype/docs/architecture/module.md`
- JPATH Module (JSONPath as TypeBox Module): `/workspace/research/typebox_research/ujsx/jpath.gen.ts`
- jsonpathly source: `/workspace/jsonpathly/`
- Module evolution spec: [metagraph-module.md](./metagraph-module.md)
- Module evolution spec: [metagraph-module.md](./metagraph-module.md)
- Schema evolution spec: [schema-evolution.md](./schema-evolution.md)