Compile in
Ingest adapters
An adapter compiles a source format into blocks.v1. That is its entire job. It never writes the wiki, never builds packages, never talks to agents — the graph is the only door into the system, which is what keeps every source honest.
Adapter registry
| Adapter | Input | Status | Owner |
|---|---|---|---|
scan | Repo workspace (components, CSS vars, exports) | ✅ Reference | BlockSmith |
markdown | Paste / upload .md | ✅ Reference | BlockSmith |
governance | Wiki finalize (rules, roles, do/don't) | ✅ Reference | BlockSmith |
storybook | storybook-static (index.json / stories.json) | ✅ Reference | BlockSmith |
figma | Figma export JSON | ⬜ Open | — |
tokens-studio | Tokens Studio JSON | ⬜ Open | — |
agent-template | CLAUDE.md / AGENTS.md chunks | ⬜ Research | — |
The adapter contract
| # | Every adapter MUST |
|---|---|
| 1 | Output a BlocksmithGraphV1 (standalone) or blocks for recordIngest() (registry mode) |
| 2 | Compute contentHash with the canonical algorithm — golden vectors must reproduce |
| 3 | Pass protocol:conformance for its output (incl. verifyHashes) |
| 4 | Never write wiki or Pulse directly — blocks.v1 is the only door |
| 5 | Ingest as partial when contributing alongside a primary scan — never stale blocks it doesn't own |
| 6 | Surface disagreement as conflict — same id, different source, different content; a human resolves in the wiki |
Reference: the Storybook adapter
# from a static Storybook build (storybook build) npm run ingest:storybook -- ./storybook-static --doc upload:my-app.md # components: 2 · graph sha256:… # registry → upload:my-app.md: 1 created, 0 bumped, 1 conflicts # ⚠ conflicts (resolve in wiki Pipeline): component:button # or emit a standalone graph, no registry: npm run ingest:storybook -- ./storybook-static --graph-only --out graph.json
The interesting line is the conflict: the repo scan already owns component:button with different content, so the Storybook version lands as a red card in the Pipeline staging lane — both truths preserved, a human picks. Source: src/lib/ingest/storybook.ts (~150 lines — that's the weekend-project bar for an adapter).
Listing requirement: an adapter gets a row in this registry when its output passes the conformance suite and its conflict behavior is demonstrated. Open a PR with your adapter + fixtures.