MasteryMade · Platform PRD

PRD 11: 6-SILO Reconciliation + API Gateway

PRD 11 of 12 Depends: PRD 1, 3
Parent: Master Registry v1.0 — Section 16 · Owner: Lane A + B (coordination)

11.1 Purpose

Map each existing MasteryOS SILO to the new universal architecture. Define shared Supabase schema both tracks build against. The registry is the seam — neither track touches the other's code.

11.2 SILO-by-SILO Migration

SILO 1: Core Engine → Dynamic prompt routing

Current: Hardcoded prompt routing with expert config files. Target: Module 9 retrieval patterns drive routing. Meta-index replaces static config.

Sumit: Refactor prompt routing to accept dynamic templates. Jason: Meta-index + retrieval patterns available via API.

Contract: silo1-to-extraction
Input: { entity_id, user_query, user_state }
Output: { response_text, ui_directives, next_state }

SILO 2: Strategic Operations → No major changes

Add hidden admin plan for testing. Add LLM token tracking per user for usage-based pricing. Sumit only.

SILO 3: MCP/Skills → Registry-driven discovery

Current: Hardcoded skill list. Target: SELECT * FROM services WHERE status='active'. Skill loading reads MANUAL.md instead of SKILL.md. New skills auto-appear when registered.

Contract: silo3-to-registry
Input: { skill_name, action: "discover|invoke|list" }
Output: { skill_manifest, result }

SILO 4: User Experience → Agent-first (PRD 7)

Biggest change. Static sidebar replaced. Chat stays as one channel among many. UI elements generated dynamically by agent response.

Contract: silo4-to-agent-core
Input: { user_id, expert_id, message, channel: "web|telegram|voice" }
Output: { response_text, ui_directives:[{type,content}], follow_ups, state_updates }

SILO 5: Knowledge → Consumer of universal ingest

Current expert_chunks evolves to PRD 4 schema. RAG retrieval adds gate scoping (PRD 2). Content flows through gate/ingest/suggest pipeline before reaching clone. Embedding model alignment: both tracks use text-embedding-3-small.

Contract: silo5-to-ingest
Input: { entity_id, query_embedding, gate, limit }
Output: { chunks: [{text, module, score}] }

SILO 6: Interface Layer → API gateway

Routes to both Sumit's endpoints and Jason's Forge services. Skills exposed as REST endpoints from registry. NowPage HC page integration. Auth: MasteryOS tokens for customers, service tokens for internal.

Gateway routing:
/api/expert/*     → silo1 (Sumit)
/api/admin/*      → silo2 (Sumit)
/api/skills/*     → silo3 → registry (shared)
/api/ingest/*     → forge service (Jason)
/api/research/*   → forge service (Jason)

11.3 Shared Supabase Schema Agreement

TableWritesReadsDefined in
servicesBothBothPRD 1
entitiesBothBothPRD 1
contractsBoth (agreed jointly)BothPRD 1
contentJason (ingest)Sumit (SILO 5)PRD 3
expert_extractionsJason (pipeline)Sumit (SILO 1)PRD 4
expert_chunksJason (pipeline)Sumit (SILO 5 RAG)PRD 4
suggested_edgesJason (suggest engine)Sumit (cross-gate)PRD 2
sessionsJason (logger)BothPRD 10
usersSumitJason (dynamic experience)Existing
subscriptionsSumitJason (gating)Existing

11.4 Code Merge Strategy

Sumit: main branch of MasteryOS repo. Jason's agents: separate repos per service. Services communicate via API contracts, not shared code. Shared dependency: Supabase schema (tracked in shared migrations repo). Claude Code: Sumit on MasteryOS codebase, Jason on service repos. No cross-editing.

11.5 Acceptance Criteria

MASTERYMADE — PRD 11 of 12

Dominia Facta. Build what compounds.