Phase D — Technology Architecture
The platform stack (TypeScript end-to-end), the environments and what each is allowed to hold, a reference cloud deployment with a local-first equivalent, and the technology standards catalog with cost notes.
D1 · Platform decompositionLayers and the technology that realises each
Presentationone React app, many specs
API & gatewayone supergraph, persisted documents only
Generationtyped agents, deterministic supervisor
Knowledge & policythe RAG substrate
Datasystems of record and the platform's own
Verification & deliverygates in CI, not in a wiki
Security & observabilitycross-cutting
D2 · Environments & locationsWhere each component runs, and which data classes each environment may hold
The data rule is the environment rule: generation and verification never run where production data lives; production runs nothing that generates.
Development
Local-first, Docker Compose.
Runs- All services, single node
- Scaled sample DB (synthetic)
- Hive registry container
- Any LLM provider (pinned)
Synthetic only.
PurposeBuild the reference implementation; run every gate locally.
Sandbox (generation)
Where agents and gates run.
Runs- Intake · supervisor · Scout · composers · verifier
- Sandbox runner (golden tests, PII scan, component builds)
- Catalog + policy services
- Sample sandbox DB
Catalog metadata, masked profiles, synthetic sample data. No production rows.
PurposeProduce and verify artifacts.
Staging (review & preview)
Where humans look before publish.
Runs- Review workspace
- Preview runtime against the sample sandbox
- Registry (candidate versions)
Synthetic sample data; candidate artifacts.
PurposeApprove release units; rehearse composition.
Production (runtime)
Where business users are served.
Runs- Edge gateway · supergraph gateway
- Query compiler · proposal subgraph
- Spec runtime (static) · component remotes
- Response cache · trace store
- Crawler (metadata read only)
Production data via compiled, scoped SQL only.
PurposeServe approved release units; emit drift events.
D3 · Networked computing / deployment diagramReference Azure deployment — with the local-first equivalent underneath
D4 · Technology standards catalogChoices, version policy, alternatives, and what drives cost
| Concern | Standard / choice | Version policy | Alternatives considered | Cost driver & control |
|---|---|---|---|---|
| Language & runtime | TypeScript end-to-end on Node.js | LTS Node; strict TS; single toolchain | .NET/HotChocolate stack (production-proven elsewhere); Python agents | One toolchain lowers build/ops cost; skills readily available |
| Agent orchestration | XState supervisor + typed agents (Zod) | State machine definitions versioned with the release unit | LangGraph.js; agent frameworks | Budgets enforced in the machine: steps, tokens, wall-clock, cost per run |
| LLM access | LLM gateway; Azure OpenAI and Anthropic Claude behind one interface | Pinned deployments; upgrade = a dated release | Direct SDK calls per service | Model spend per use case attributed by run id; small models for intake, larger for composition |
| Catalog store | PostgreSQL + pgvector + full-text + adjacency tables | Catalog schema versioned; embeddings re-run only on changed cards | Azure AI Search (adapter provided); dedicated vector DB | Embeddings once per catalog version; cheap queries; scale-out by read replicas |
| GraphQL | Federation v2 subgraphs (Yoga); Hive registry + gateway; persisted documents | Composition in CI; breaking-change detection blocks publish | Apollo Router/Studio; schema stitching | Gateway compute is flat; per-slice composition keeps CI seconds-long |
| Query compilation | Custom compiler on Kysely | Compiler version part of the release unit | Hasura-style engines; ORM resolvers | Cost ceilings with actual args; batching; entitlement-fingerprinted cache |
| Front end | Vite + React + TanStack + urql; Module Federation for reviewed remotes | Spec DSL versioned; runtime supports N-1 spec versions | Next.js; generated apps per use case | Static hosting; marginal cost of a screen is a JSON file |
| Sandbox | Isolated worker containers; locked dependency allow-list; synthetic DB | Allow-list reviewed quarterly | Serverless functions | Ephemeral jobs; scale to zero |
| Identity | OIDC (Entra ID); claims validated at the edge; forwarded, never asserted | Claim schema versioned with policy | Custom auth | Existing tenant; no new cost |
| Observability | OpenTelemetry → Azure Monitor / App Insights (Grafana locally) | Span attributes: use-case id, run id, op id, release unit | Vendor APM | Sampling on runtime traffic; full traces on generation runs |
| Infrastructure | Azure Container Apps, Postgres Flexible Server, Redis, Blob, Key Vault, Event Grid/Service Bus; Bicep/Terraform; Docker Compose locally | IaC in repo; environments promoted by pipeline | AKS (when scale demands); other clouds via containers | Scale-to-zero for generation; runtime sized by traffic; replicas for SoR reads |
| Systems of record (reference impl) | PostgreSQL, public sample scaled to ≥3,000 tables with synthetic data | Generator versioned; pathologies injected deliberately | SQL Server adapter next | Containers locally; Flexible Server in cloud |