UpsQuad — Agent Ecosystem: Component Onboarding Guide
Audience: a new engineer joining any part of the backend. This is the master map — read it first, then dive into the focused KTs (e.g. Governed MCP & the Team Gateway).
Goal: know what every component does, where it lives, and — the whole point — what is real vs stubbed vs dev-only vs parked, verified against the code, not the wiki.
Status legend used throughout: 🟢 LIVE (merged, in the prod code path) · 🟡 STUBBED (placeholder / present but not final) · 🔵 DEV-ONLY (only wired for beta-dev/docker) · 🟠 PENDING/PARKED (designed and/or coded but gated off / blocked).
How to read each component: What it does · Key files · Status · Stubs/gaps in it · Upstreams (who calls it) · Downstreams (what it drives) · Edge stubs. Trust the Status and Stubs rows — every one below was re-checked at file:line against origin/main.
Changelog since 2026-07-06 (imported from Knowledge-Base Google Doc)
The base of this guide was the founder's living component doc (KB Doc, ~2026-07-06). This revision re-verified every Status/Stubs claim against origin/main at 9858af5f (2026-07-24). What changed:
| # | Claim in the 2026-07-06 base | Now | Evidence / driver |
|---|---|---|---|
| 1 | ❌ langgraph worker's Context-Engine client is a stub (context/client.py returns system_prompt="", no channel) — "the single biggest looks-wired-isn't edge" | 🟢 CLOSED — client is REAL. Both runtimes now call the live Context Engine over Connect-HTTP (AssembleContext/ValidatePrompt/IngestEvent), fail-open with an integrity_check_skipped audit on error. langgraph turns are no longer knowledge-blind. | services/agent-worker/src/agent_worker/context/client.py (rewritten, #2030/#2031, transport Option C founder-approved 2026-07-23; dev bypass sequencing #2034); wired at graph/nodes.py:161,250 |
| 2 | ❌ L4 persona assembly empty → prompt_builder emits "[No agent persona configured]" | 🟡 STILL STUBBED (confirmed). No production writer inserts an L4 row into immutable_layers; prompt_builder.go:124 still emits the placeholder. Persona reaches the model on claude_sdk via snapshot.persona; on langgraph the model now gets real L1–L3 + RAG context but still no L4 persona. | internal/context/assembly/prompt_builder.go:124; no INSERT INTO immutable_layers for L4 in prod code; initializer.go:459 only reads L4 |
| 3 | MCP tool execution = dev, via ContextForge services/mcp-proxy plugin chain | 🟠→🟢 Re-platformed. ContextForge removed (services/mcp-proxy gone, #1909/#1912); governed MCP is now the Go edge Team Gateway PEP (internal/gateway/mcpproxy) per ADR-0024, with an egress/SSRF guard per ADR-0025. Ships feature-OFF (MCP_GATEWAY_ENABLED default false); prod parked on #1864. | internal/gateway/mcpproxy/{dispatch,edge_policy}.go; internal/mcp/egress/*; ADR-0024/0025 |
| 4 | Guardrail turn-boundary re-pin LIVE | 🟢 Confirmed unchanged. | internal/runtime/server/lifecycle_repin.go, internal/context/guardrail/resolver.go, autoloop/repin.go |
| 5 | Decision-receipts + governed approvals LIVE | 🟢 Confirmed. Receipt emit/verify pipeline present. | internal/governance/receipt_emit.go, internal/governance/receiptverify/verify.go, cmd/verify-receipt |
| 6 | T4 autonomy LIVE on dev, founder-gated for prod | 🟢 Confirmed. EnableAutonomousLoop is off by default. | internal/runtime/server/grpc.go:400 ("Off by default"), internal/runtime/autoloop/*; gate #1422 |
| 7 | External-agent connect (BYO) + /oauth/token | 🟢 NEW since base. DB trust-table + client-credentials mint; prod parked on #1864. | internal/agent/external_service.go, internal/auth/oauth/*, mig 155_external_agent_clients |
Schema advanced from the base's ~mig 126 to mig 168. New ADRs since base: ADR-0023 (workflow substrate), ADR-0024 (MCP governance canonical surfaces), ADR-0025 (MCP egress / private upstreams).
Architecture
The original hand-drawn PNG (
Arch_June29_2026.png) still lives in the Knowledge-Base Google Doc. The dead Drive link has been replaced by the numbered, colour-coded Mermaid diagram below, which is the maintained source of truth.
Colour key: 🔵 blue = client surface / agent runtime · 🟢 green = context engine · 🟡 amber = governance / LLM egress · 🟣 purple = MCP team gateway PEP · 🔴 red = egress/SSRF + upstream · ⚪ grey = data stores.
Walkthrough (numbers match the diagram)
- User turn. The SPA (or the per-user Quad surface) calls
SendMessageover Connect to the context-engine /rpc gateway. - Proxy. The /rpc gateway proxies
LifecycleService(andOrgUnitService/ModelRegistryService) through to the Orchestrator. - Step dispatch. The orchestrator authenticates, checks budget/security, fetches BYOK keys, and dials the Agent Worker via
ExecuteStep(gRPC mTLS). - Context assembly. The worker calls the Context Engine
AssembleContext+ValidatePromptover Connect-HTTP — now a real call on both runtimes (was a stub on langgraph pre-#2030). - Governance. Pre-LLM and per-tool
Checkcalls hit the embedded Governance PDP (fail-closed). - LLM.
call_llmgoes to the AI Gateway (BYOK / budget) or Ollama. - Tools.
tools/callcarries a Hop-A JWT to the Team Gateway edge PEP at/mcp/team/{unit}. - Edge gates → forward. The PEP runs ordered fail-closed gates, rewrites to the raw tool, and forwards through the egress guard.
- Egress. Only allowlisted/pinned hosts are reachable; private IPs and SSRF sinks are denied.
- Autonomy. For T4 sessions the orchestrator's autoloop drives successive steps and parks in-step interrupts against the approval backend.
- Audit. Every verdict / receipt / LLM+tool call is appended to Postgres — the audit-as-source-control tenet.
Components
1. Orchestrator — Go core (agent-orchestrator)
| What it does | The outer authority. LifecycleService.SendMessage: auth → budget → security → fetch BYOK keys → dial worker → relay events → audit. Hosts the governance PDP, the two coordinators (peer/workflow + delegation/subagent), the RelayWaiter (live-bubbling), the model registry, and the Go-side autonomous PlanLoop (T4). |
| Key files | cmd/agent-orchestrator/main.go · internal/runtime/server/{grpc,lifecycle_*,child_dispatch,relay_waiter,lifecycle_repin,lifecycle_observer}.go · internal/runtime/autoloop/{loop,driver,plan,terminator,interrupt,repin}.go |
| Status | 🟢 LIVE — single-agent turns, agent→agent delegation, and the orchestrator-side autonomous PlanLoop run end-to-end. In-step interrupts park via approval.Service + PauseManager and resume on RecordDecision. Per-agent runtime selection (langgraph | claude_sdk) is plumbed here (ADR-0020). |
| Stubs / gaps in it | 🔵 T4 is DEV-ONLY by default — EnableAutonomousLoop is off (grpc.go:400); prod enablement is founder-gated (#1422). The deep-autonomy driver lives here (internal/runtime/autoloop), not in the worker — the worker only supplies PLAN-step decomposition. |
| Upstreams | context-engine /rpc gateway (proxies LifecycleService from the SPA/Quad); the user via SendMessage. |
| Downstreams | agent-worker (ExecuteStep, gRPC mTLS) · governance.Engine (embedded PDP) · approval.Service + PauseManager · Postgres (sessions, audit, policies) · coordinators dispatch child sessions · Team Gateway mints the Hop-A JWT per ExecuteStep. |
| Edge stubs | The worker it drives now does get real context on both runtimes (see #3) — the base's "langgraph runs with empty system prompts" edge is closed. The one residual is L4 persona (see #2/#8). |