# ADR-012: Node/edge attribute schemas are Module entries, not Type.Any() ## Status Accepted ## Context At the DB storage layer, node/edge attribute schemas are arbitrary JSON Schema blobs (`Type.Unknown()`). But at the application layer, graph type definitions should have full type safety for their attribute schemas. ## Decision At the application layer, node and edge attribute schemas are named Module entries with full type safety (`CallGraph.CallNode`, not `schema: Type.Any()`). At the DB storage layer, the meta-schemas (`NodeType`, `EdgeType`) still have `schema: Type.Unknown()` because the DB stores arbitrary JSON Schema blobs. The repository layer maps between the two: Module entries are the application-level validation, the DB is the persistence layer. ## Consequences - Compile-time type safety for graph type definitions - Runtime validation via `Value.Check(Module.EntryName, data)` - DB layer remains generic — any JSON Schema blob is accepted for storage - Validation boundary is the repository layer, not the database ## References - [metagraph-module.md](../metagraph-module.md)