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
Architecture docs previously referenced the hub as the authoritative source
for call/identity specs. In reality, call protocol, identity, and access control
come from @alkdev/operations; call graph schemas from @alkdev/flowgraph; task
graph schemas from @alkdev/taskgraph; event transport from @alkdev/pubsub. The
hub is a consumer of @alkdev/storage, not the other way around.
Key changes:
- overview.md: add Ecosystem Integration section with dependency direction
diagram, What Comes From Where table, repo layer bridging pattern, and
circular dependency avoidance guidance
- overview.md: promote repo-layer vs operations-bridging from open question
to explicit decision (CRUD in storage, bridging in consumer)
- overview.md: add zero-ecosystem-dependency statement; fix taskgraph type
names (TaskGraphNodeAttributes, DependencyEdge)
- overview.md: fix terminology (hub is consumer, not authority)
- metagraph.md: add Ecosystem Context section; replace hub references with
correct ecosystem sources; fix GraphStatus/GraphBaseType enum
mischaracterization (C1); unify empty-array semantics with sqlite-host (C2);
clarify repo layer does NOT import operations (C3); add flowgraph canonical
schema note; add versioning cross-reference to graph_types table
- encrypted-data.md: reframe hub as provenance not authority; update What
Lives Where table; fix standalone table advice; update references
- sqlite-host.md: fix actors table description; unify empty-array semantics;
contextualize hub as reference consumer; add operations identity reference
The verbatim-module-syntax lint rule was correctly flagging that
GraphConfig is only used in a type position (typeof GraphConfig). Since
typeof resolves purely at the type level, import type works fine here
and is the correct form. No lint exclusion needed.
Also: deno fmt across all files (markdown line wrapping).