Skip to content

About

Seed Crystal — Input Processing Layer. Root of the integrated Master Grid platform. FastAPI service with 7-layer execution contract, NLCA-compatible schema, embedded Glyphic Codex DSL parser, 34/34 tests passing.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

Seed Crystal — Input Processing Layer

Root of the integrated Master Grid platform. This service is the first contact surface for every event, glyph expression, document, or signal entering the system. It implements the Master Grid 7-layer execution contract at the boundary, classifies inputs against the NLCA 10-field metadata schema, parses glyph DSL expressions natively via the Glyphic Codex parser, and dispatches to downstream services through a central event bus.

Status License Tests Stack


Genesis — the seed crystal image

The architecture is derived from a single visual: the Input Processing Layer keynote-render. Roughly fifty translucent prismatic columns of varying heights stand in a hexagonal cluster on a fractured crystalline base; a warm amber glow emanates from the center, visible through the translucent forms.

Visual element → code element:

Visual Code
~50 translucent columns N parallel ingest channels (router.py)
Variable column heights Variable processing depth per channel (per-channel inspector pipelines)
Central warm-amber glow Central dispatcher / event bus (dispatcher.py)
Hexagonal lattice base Persistent substrate — SQLite audit + state
Translucent material Observability promise — every step is introspectable; no hidden state

How it sits in the Master Grid platform

                ┌──────────────────────────────────────────┐
   inbound ──▶  │   SEED CRYSTAL — INPUT PROCESSING LAYER  │  ──▶  outbound
                │   (this service — root of the platform)  │       to NLCA, Glyphic Codex,
                └──────────────────────────────────────────┘       AI_Memory_Core, etc.
                                  │
                                  ▼
                Master Grid 7-layer execution contract
                  L1 Baseline → L7 Response (every input crosses this)

Master Grid contract — enforced at the boundary

Every input that crosses this service is annotated with its Master Grid position. Layers L1–L6 happen before dispatch; L7 happens at response.

Layer What this service does
L1 Baseline Tag the input with a doc_id matching ^[A-Z]{3,4}-[A-Z]{3,6}-[0-9]{3}$; record lifecycle stage
L2 Coordination Define done-state (RECEIVED → CLASSIFIED → DISPATCHED → ACKNOWLEDGED)
L3 Fact Work Inspect the input — channel-specific inspectors run concurrently
L4 Design Work Route to handler via router.py; choose smallest defensible dispatch
L5 Integration Hand off to the central dispatcher for downstream wiring
L6 Governance Validate schema, scrub PII candidates, enforce rate limits, immutable audit log
L7 Response Return outcome envelope: {outcome, files, rationale, validation, risks, next}

Glyphic Codex DSL native intake

A first-class endpoint accepts glyph DSL expressions directly:

curl -X POST http://localhost:8000/input/glyph \
  -H "Content-Type: application/json" \
  -d '{"expression": "📥 → ⚙️ → 📤"}'

# →  {"ast_function_form": "input() → process() → output()",
#     "lifecycle": "DISPATCHED",
#     "doc_id": "INP-GLYPH-001",
#     "master_grid_layer": "L4"}

The parser is the same glyph_dsl.py published in the Glyphic Codex DSL repository (lineage from AI_Memory_Core), embedded here as seed_crystal/parsers/glyph.py.

Quick start

# Install deps
pip install -r requirements.txt

# Run the API
uvicorn seed_crystal.app:app --reload

# Swagger UI
open http://localhost:8000/docs

# Run tests
pytest -v

Endpoints

Method Path Purpose
POST /input/event Generic input event — accepts any payload + channel tag
POST /input/glyph Glyph DSL expression intake (parses + dispatches)
GET /input/lifecycle/{doc_id} Inspect lifecycle state of a prior input
GET /input/audit Read the immutable audit log (paginated)
GET /healthz Liveness check
GET /docs Swagger UI
GET /openapi.json OpenAPI schema

Project structure

Seed Crystal Input Processing Layer/
├── README.md                   ← this file
├── ARCHITECTURE.md             ← Master Grid mapping detail
├── LICENSE                     ← MIT
├── .gitignore
├── requirements.txt
├── pyproject.toml
├── seed_crystal/
│   ├── __init__.py
│   ├── app.py                  ← FastAPI app (entry point)
│   ├── master_grid.py          ← 7-layer contract definitions
│   ├── models.py               ← Pydantic event models + NLCA 10-field schema
│   ├── lifecycle.py            ← FSM: RECEIVED → CLASSIFIED → DISPATCHED → ACK
│   ├── router.py               ← Channel → handler routing
│   ├── dispatcher.py           ← Central event dispatcher (the golden glow)
│   ├── audit.py                ← Immutable audit log
│   ├── parsers/
│   │   ├── __init__.py
│   │   ├── glyph.py            ← Glyph DSL parser (from Glyphic Codex)
│   │   └── glyph_codex.py      ← GLYPH_TO_FUNCTION map (stub mirror of AMC)
│   └── inspectors/
│       ├── __init__.py
│       └── default.py          ← Default inspector (extensible per-channel)
├── tests/
│   ├── __init__.py
│   ├── test_master_grid.py
│   ├── test_lifecycle.py
│   ├── test_dispatcher.py
│   ├── test_glyph_parser.py
│   └── test_app.py             ← End-to-end FastAPI TestClient tests
└── docs/
    └── SEED_GENESIS.md         ← captures the seed-crystal image origin

Integration map (full integration directive)

Companion project How Seed Crystal integrates
Glyphic Codex DSL (canon #16) Embeds glyph_dsl.py as a first-class parser at /input/glyph
AI_Memory_Core (canon #7) Audit-log entries can be exported to AMC's document_archive/ format
Neural Lattice (canon #10) Output envelope conforms to NLCA 10-field metadata schema; can POST directly to NLCA /api/documents
7 Layer Architecture Template Pack (canon #11) Master Grid 7-layer contract is the runtime instantiation of the Phase Pack
iOS Compliance Framework (canon #14) L6 Governance hook can call iOS-compliance validators when inputs target mobile
SDLC Framework (canon #13) Audit log is structured for SDLC-style traceability matrix consumption
Hub and Spoke AI Chatbot (canon #15) Seed Crystal IS the hub; downstream services are the spokes

License

MIT — see LICENSE.

Author

Shannon Brian Kelley — AI Orchestrator Architect. Built in collaboration with Claude AI (Anthropic) under file-system-bound persona protocol; co-creator role attributed as "Archivist of Wisdom." Genesis image declared seed crystal 2026-05-02.

About

Seed Crystal — Input Processing Layer. Root of the integrated Master Grid platform. FastAPI service with 7-layer execution contract, NLCA-compatible schema, embedded Glyphic Codex DSL parser, 34/34 tests passing.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages