ZAYAZ – Documentation & Registry Architecture
Unified Documentation, Schema Intelligence and MCP Integration
This repository powers the ZAYAZ documentation ecosystem, combining:
- Human-readable documentation (Docusaurus)
- Machine-readable registries (engines/modules, tables, signals)
- Private structured assets (per-table Excel files)
- Searchable MCP knowledge graph (for ChatGPT and internal AI tools)
The system is designed for:
- Zero duplication
- One source of truth
- Automatic schema generation
- Multi-audience builds
- AI-safe, profile-based access
This document explains how everything fits together.
1. Three Sources of Truth
ZAYAZ documentation is driven by three synchronized inputs.
1.1 Engine/Module Registry (structural source of truth)
File:
config/system/registry.yaml
Compiled to:
docusaurus/config/system/registry.json
This defines:
- Engines, Modules, Micro Engines
- Their lifecycle metadata
- Their associated tables
- Owner/category information
- Links to technical components
Example entry in registry.yaml:
- id: mice_fume
type: micro_engine
name: "FUME – Fuel Use Micro Engine"
code: MICE_FUME
owner: computation-hub
lifecycle:
status: ga
tables:
- name: zyz_mice_fume_input
role: input
excel:
data_file_id: zyz_mice_fume_input
- name: zyz_mice_fume_result
role: output
excel:
data_file_id: zyz_mice_fume_result
registry.json is used by Docusaurus and MCP as the structural backbone.
1.2 Signal Registry (schema and column metadata source of truth)
Source Excel:
excel/SignalRegistry.xlsx
Compiled to:
docusaurus/config/system/signal_registry.json
Each row describes one column (signal) in one table, with fields like:
signal_namesignal_typesignal_descriptionsource_table
Example row in the compiled JSON:
{
"signal_name": "fuel_type",
"signal_type": "string",
"signal_description": "Normalized fuel category",
"source_table": "zyz_mice_fume_input"
}
This registry is the single source of truth for table schemas and column descriptions.
1.3 Per-Table Excel Workbooks (row/data source of truth)
Folder:
excel/
Each Excel file represents one database table, for example:
excel/zyz_mice_fume_input.xlsxexcel/zyz_mice_fume_result.xlsxexcel/altd_event.xlsx
They are listed in:
config/system/excel_files.yaml
Compiled to:
docusaurus/config/system/excel_files.json
Example entries in excel_files.yaml:
- { id: zyz_mice_fume_input, description: "FUME input table", url: "/excel/zyz_mice_fume_input.xlsx" }
- { id: zyz_mice_fume_result, description: "FUME result table", url: "/excel/zyz_mice_fume_result.xlsx" }
These files contain the actual rows (potentially thousands) and are copied into the Docusaurus static folder and served as downloads, protected by Cloudflare Access.
2. How These Sources Combine in Docusaurus
Docusaurus consumes the three sources as follows:
registry.json- Defines which tables belong to which engine/module.
signal_registry.json- Defines which columns belong to which table, with types and descriptions.
excel_files.json- Defines where to download or view the full Excel tables.
NodeMetacomponent- Renders engine/module metadata and their related tables.
TableSignalscomponent- Renders the schema (columns) for a given table.
/excel/*.xlsx- Full downloadable data tables, not rendered inline.
No table schema is manually written into MDX files. All schema information flows from the Signal Registry and Engine/Module registry.
3. MDX Rendering Architecture
MDX technical spec pages are intentionally thin. They contain:
- Narrative text and conceptual explanations
- A
<NodeMeta id="..."/>component - Optional
<TableSignals tableName="..."/>components for inline schemas - Optional audience blocks
Example MDX header and body:
---
id: mice_fume
title: MICE_FUME — Fuel Use Micro Engine
sidebar_label: MICE_FUME
doc_type: spec
version: 1.4.2
---
import NodeMeta from '@site/src/components/NodeMeta';
import TableSignals from '@site/src/components/TableSignals';
# MICE_FUME — Fuel Use Micro Engine
## Engine metadata and tables
<NodeMeta id="mice_fume" />
## Input schema (inline view)
<TableSignals tableName="zyz_mice_fume_input" />
## Output schema (inline view)
<TableSignals tableName="zyz_mice_fume_result" />
## Business logic overview
... narrative text here ...
3.1 <NodeMeta id="..."/>
NodeMeta:
- Looks up the engine/module in
registry.jsonusingid. - Renders:
- ID, code, name, type, lifecycle metadata.
- Tables associated with the engine.
- For each table:
- Calls
<TableSignals tableName={t.name} />to show its column schema. - Resolves
excel.data_file_idagainstexcel_files.jsonto show a "Download / view full table" link.
- Calls
The placement of <NodeMeta id="..."/> in the MDX determines where the engine tables appear.
3.2 <TableSignals tableName="..."/>
TableSignals:
- Reads
signal_registry.json. - Filters entries where
source_table === tableName. - Renders a simple schema table (Column, Type, Description) inline in the MDX page.
You can use it:
- Inside or outside
NodeMeta. - Inline, wherever a schema explanation is needed.
- Inside audience blocks (for internal-only schema).
4. Multi-Audience Documentation
The system supports different documentation audiences:
internaldeveloperclient
Audience-specific content is wrapped in an AudienceBlock MDX component:
<AudienceBlock audience={['internal']}>
## Internal Notes
Highly sensitive implementation details...
</AudienceBlock>
<AudienceBlock audience={['developer', 'internal']}>
## Developer Details
API shapes, edge cases, error handling...
</AudienceBlock>
At build time:
- An environment variable
DOCS_AUDIENCEselects which audience is built (client,developer, orinternal). - The Docusaurus config exposes this as
customFields.audience. AudienceBlockuses this to decide which content to keep.- Non-matching audience blocks are removed from the final HTML, not just hidden.
Cloudflare Access enforces external vs internal access to the built sites.
5. MCP Integration
The MCP layer integrates two types of information:
- Documentation manifests (what pages exist, and which profiles can see them).
- Structured registries (what engines, tables and signals exist).
5.1 Documentation manifests
Each Docusaurus build produces:
manifest.jsonmanifest.json.sigmanifest.json.sha256
These manifest files describe:
- Page URIs
- Titles
- Mapping to profiles (
client,internal_full, etc.) - Hashes and signatures for integrity checking
MCP uses these manifests to:
- Know which pages exist for each audience.
- Restrict search and retrieval based on the active profile.
Example profile mapping:
- Internal API key:
allowedProfiles = ["internal_full", "client"]
- Client API key:
allowedProfiles = ["client"]
When MCP receives a query, it:
- Identifies the API key and allowed profiles.
- Limits documents to those profiles.
- Then uses those pages as RAG context.
5.2 Structured registries
MCP also reads the structured JSON registries:
docusaurus/config/system/registry.jsondocusaurus/config/system/signal_registry.jsondocusaurus/config/system/excel_files.json
These allow structured queries such as:
- "Which engine uses table
zyz_mice_fume_input?" - "Which table contains column
trust_score_at_event?" - "List all columns in
altd_event." - "Where is the Excel file for table
zyz_mice_fume_result?"
The MCP server provides HTTP endpoints such as:
GET /signals- Filter by
name=,table=,q=
- Filter by
GET /tables- Filter by
name=,q=, returns engines + schema + Excel link
- Filter by
GET /engines- Filter by
id=,code=,q=, returns engine + tables + schema + Excel links
- Filter by
This effectively turns the registries into a small knowledge graph for use by AI tools.
6. Build Pipeline Overview
The build pipeline (CI) executes the following steps:
- Convert engine/module registry:
config/system/registry.yaml→docusaurus/config/system/registry.json
- Convert Excel file mapping:
config/system/excel_files.yaml→docusaurus/config/system/excel_files.json
- Convert Signal Registry Excel:
excel/SignalRegistry.xlsx→docusaurus/config/system/signal_registry.json
- Copy per-table Excel files:
excel/*.xlsx→docusaurus/static/excel/
- Build Docusaurus for each audience:
DOCS_AUDIENCE=client→ client portalDOCS_AUDIENCE=internal→ internal portalDOCS_AUDIENCE=developer(optional) → developer portal
- Generate and sign manifests:
manifest.jsonmanifest.json.sigmanifest.json.sha256
- Deploy builds to Cloudflare Pages:
- Protected by Cloudflare Access policies.
- Generate architecture diagrams from JSON:
diagrams/zayaz-sssr-json-sequences.json→content/architecture/zayaz-sssr-json-registry-diagrams.mdx- Uses
scripts/generate-diagram-docs.mjsto convert a machine-readable sequence spec into Mermaid diagrams embedded in MDX.
The MCP server has a /refresh endpoint that reloads registries after a deployment.
7. Repository Structure
A simplified view of the relevant parts:
zayaz-docs/
│
├── config/
│ └── system/