Phase C — Application Architecture

The application components that realise the capabilities, the interfaces between them, and the two sequences that matter most: a generation run, and a runtime request with authorization compiled in.

C5 · Application component & communication diagramComponents by layer, with the interfaces that connect them

Four layers plus cross-cutting services. Blue edges are the generation path; pink edges are the runtime path; teal dashed edges are metadata flows. The only component permitted to touch production data is the query compiler, through the supergraph gateway.

EXPERIENCE GENERATION · AGENTS + SUPERVISOR KNOWLEDGE & POLICY RUNTIME · ONE GRAPH Requester portalsubmit · clarify · track runs Review workspacediff · policy report · preview App shell (React spec runtime)renders UI specs · registry components Registry & component UIslices · specs · component versions Intake serviceprose → UseCaseSpec Supervisor (state machine)typed events · budgets Scout servicesubgraph · cite-or-refuse Composer servicescontract · UI spec Verifier servicenine gates Sandbox runnersample DB · component build LLM gatewayprovider-agnostic · pinned deployments · budgets Catalog servicecards · join graph · hybrid index Policy serviceclassification · entitlements CrawlerDDL · comments · query logs Edge gatewayTLS · JWT · rate limits · WAF Supergraph gatewaypersisted documents only Schema registryslices · composition · versions Query compilerGraphQL → SQL + entitlements Response cacheentitlement-fingerprinted Proposal serviceproposed → approved → applied Systems of record3,000+ tables · replicas · owning systems' queues CROSS-CUTTING Identity provider (OIDC) · claims Trace & telemetry store (per use case) Secrets & key management Artifact store (runs · reports) Event bus (DDL, drift, publish) request · clarify evidence · approve / reject persisted op ids + JWT manage slices · components typed events · retries ≤2 · park search · expandJoins · getCard policy.lookup sdl.compose (dry run) golden · PII · build model calls publish slice + spec + release unit cards · joins · glossary · next catalog version metadata · DDL events row-scope predicates · column policies supergraph SDL execute(opId, args, claims) batched, scoped SQL proposal mutations
generation pathruntime pathmetadata / policy flow

C6 · Application interaction matrixProducer → consumer, and the interface between them

FromToInterfaceStyleContract / notes
Requester portalIntake servicesubmitRequest · answerClarificationGraphQL (platform's own)Returns UseCaseSpec or a clarifying question; run id for tracking
Intake serviceSupervisorspec.valid / spec.ambiguoustyped eventZod-validated; the supervisor rejects anything else
SupervisorScout · Composers · Verifierrun step (budget, inputs)typed command + event replyEvery reply is a typed artifact; prose cannot advance the machine
ScoutCatalog servicesearch · expandJoins · getCardinternal API (read-only)Pre-filtered by the spec's actors' entitlements; returns cards + join paths with ids
ComposersPolicy servicelookup(classification → policy)internal API (read-only)Policies applied to every classified field; verifier re-checks independently
ComposersSchema registrycompose(dryRun)registry APIComposition errors returned to the composer as a typed report
VerifierSandbox runnerrunGolden · scanPII · buildComponentjob APISample DB only; component builds use a locked dependency allow-list
VerifierSchema registry · Policy servicecomposition check · policy coverageregistry / internal APIDeterministic; report attached to the run
AgentsLLM gatewaycomplete(templateVersion, model tier, budget)internal APITier resolves to a pinned deployment; usage attributed to the run
SupervisorReview workspacereview bundle (spec, subgraph, diff, reports, preview)artifact store + UIDecision returned as an approved / rejected event with reviewer identity
SupervisorSchema registrypublish(slice, ops, spec, releaseUnit)registry APIOnly reachable after the approval event; write paths need their own approval
Schema registrySupergraph gatewaysupergraph SDL · persisted documentspull / push on publishBreaking-change detection blocks publish; last good version keeps serving
Business app shellEdge gatewayopId + variables + bearer tokenHTTPS (persisted operations)No query text leaves the browser; unknown ids rejected at the gateway
Supergraph gatewayQuery compilerexecute(op, args, claims)federation subgraph callClaims forwarded from the edge-validated token; never asserted by the caller
Query compilerPolicy servicepredicates(role) · columnPolicies(slice)internal API (cached)Row-scope templates composed into SQL; denied columns nulled in projection
Query compilerResponse cacheget / set (op, args, entitlement fp, catalog generation)cache APICannot serve across entitlement fingerprints; busts on drift
Query compilerSystems of recordbatched, scoped SQLDB driver / replicaRead-only credentials; cost ceiling enforced with actual arguments
Supergraph gatewayProposal serviceproposal mutationsfederation subgraph callCreates a proposal; the owning system applies after its own approval
CrawlerCatalog serviceupsert cards · joins · new versioninternal API + eventDiff emitted on the event bus → re-verification of affected use cases
All componentsTrace & telemetryspans with use-case id, run id, op idOpenTelemetryEvery compiled query logged with its predicate set

C7 · Sequence · generation runFrom a prose request to a published slice and spec

Dashed arrows are replies. The supervisor is the only participant that talks to everyone — and it only accepts typed events.

Requester Intake Supervisor Scout Catalog Composers Verifier Sandbox Reviewer Registry 1 request (prose + users) 2 clarifying question · answer 3 spec.valid (UseCaseSpec) 4 SCOUT (budget, catalog #N) 5 search · expandJoins (filtered) 6 cards + join paths (ids) 7 Subgraph (cited) · or ambiguity → 2 8 COMPOSE_CONTRACT (subgraph, policy slice, archetype templates) 9 SchemaSlice + PersistedOperations (dry-run composed) 10 COMPOSE_UI (slice, ops, registry manifest) 11 UISpec (+ custom-component requests) 12 VERIFY (all artifacts, catalog #N, policy version) 13 golden · PII · builds 14 results 15 GateReport: pass → 16 · fail → responsible composer (≤2) → else PARK 16 REVIEW (spec, subgraph, SDL diff, policy + gate reports, live preview on sample data) 17 approved (read paths) · approved (write path, Finance) · or rejected + notes → PARK 18 PUBLISH (slice, ops, spec, release unit) — unreachable without 17 19 composed · live · version pinned 20 published: route + release unit id

C8 · Sequence · runtime requestA screen loads, and a proposal is raised — with entitlements compiled into the SQL

The browser sends an operation id, never a query. Claims come from the token the edge validated. The compiler is the only participant that shapes SQL, and it shapes it before execution.

Spec runtime (browser) Edge gateway Supergraph gateway Query compiler Response cache System of record Proposal service Trace store 1 opId + variables + token 2 validate JWT · rate limit · WAF 3 opId + validated claims 4 resolve persisted documentunknown id → reject 5 execute(op, args, claims) 6 compile: predicates indenied → null · cost check 7 get(op, args, fp, gen) 8 miss 9 batched scoped SQL — WHERE territory_id = ANY($callerTerritories) 10 rows the caller could already open directly 11 set (fingerprinted) 12 log compiled query + predicate set + use-case id 13 data (denied fields = null) 14 response → grid renders 15 op:proposeCreditHold@v1 (reason) — via edge, same checks 16 create proposal (target finance.credit_hold, proposedBy, reason) 17 proposal id · status = proposed — the owning system applies it only after its approver acts