Graph type definitions as TypeBox Modules — the core architecture evolution
for @alkdev/storage. The SchemaBuilder is removed (no existing consumers),
replaced by direct TypeModule construction with Metagraph.Import() for
base attribute composition and Type.Composite() for node/edge type
specialization.
Key additions:
- metagraph-module.md: Module pattern, edge constraints as named entries,
SchemaBuilder equivalence, DB bridge contracts (moduleToDbSchema return
type, validateNode/validateEdge signatures), 10 design decisions (DD1-DD10)
- forward-look.md: pointer abstraction (ujsx ValuePointer analogy, JPATH
Module), dbtype table rendering relationship, ujsx as universal IR pipeline
Critical corrections from architecture review:
- Type.Composite uses IntersectEvaluated (intersection, not Object.assign
override) — overlapping keys with subtype relationships resolve correctly
- Type.Ref inside Type.Composite within a Module is verified working
- BaseNode/BaseEdge use Metagraph.Import() for same-package Modules (Option B),
not local re-declaration (no circular dep within same package)
- Edge constraints use Type.String() for node type name arrays (not Type.Ref) —
constraints contain names, not schemas