Architecture
Spandrel has three phases: compile, store, serve.
- Compile — walk a directory tree of markdown files, parse frontmatter, resolve hierarchy and links, produce a graph of nodes and edges.
- Store — write the compiled graph to a backend. In-memory for local dev, Postgres for production. Any backend that satisfies the GraphStore interface works.
- Serve — expose the graph through one or more wire surfaces, all gated by a single Access Policy. MCP and REST are peer wire surfaces; CLI wires them together. Web UIs and other consumers ride on top of these.
All wire surfaces — MCP, REST, CLI, web UIs — call the same Access Policy before serializing a response or performing a write. One policy, one enforcement point, one set of rules.