Skip to content

Adapters (L6/L7) ​

Adapters expose orchestration capabilities to clients (IDEs, assistants, services) via HTTP and MCP.

Contract alignment

  • Input: render_request.v0 (CEO β†’ ACS)
  • Output: render_context_reply.v0 (ACS β†’ CEO)
  • Provider-facing contracts remain internal; adapters never call providers directly.

Responsibilities

  • Validate inbound requests against v0 schemas
  • Enforce budgets (tokens_max, time_ms)
  • Propagate privacy_mode (allow|redact|block)
  • Surface retry/recovery hints from error.options[] as client-friendly signals
  • Emit minimal metrics (latency_ms, used_tokens if available)

Error handling

  • Logical errors are returned in reply.error (schema-aligned)
  • Transport errors map to HTTP status or MCP failure, but prefer schema-shaped bodies when possible

Related

  • Contracts: ../contracts/README.md
  • Retry/Recovery: ../orchestration/retry-actions.md
  • Metrics: ../orchestration/metrics.md

TOC

Contracts (v0.1) ​

Inputs

  • HTTP: POST /render with render_request.v0
  • MCP: call "render" with render_request.v0

Processing

  • Validate request schema; enforce budgets; propagate privacy_mode
  • Forward to orchestration (CEOβ†’ACS); map orchestration reply to adapter reply

Outputs

  • render_context_reply.v0 with fragments[], kv_policy, metrics, warnings|error

SLO / Targets

  • Adapter overhead p95 < 10ms; no token overruns; stable mapping for errors

Edge Cases

  • Invalid schema β†’ 400 with schema-shaped error
  • Timeouts from orchestration β†’ 504 (HTTP) / failure (MCP) + structured warning

Resilience & Observability ​

Resilience

  • Input size limits; per-client rate limits; circuit breaker on orchestration endpoint

Metrics

  • adapter_request_latency_ms
  • adapter_requests_total
  • adapter_budget_violations_total

Tracing

  • request_id and client_id propagated; spans for validationβ†’orchestrateβ†’respond

Privacy & Security ​

Controls

  • Enforce privacy_mode on reply transformation; strip sensitive fields from logs

Auth

  • HTTP: JWT/Bearer with scopes; MCP: negotiated session with capability checks

Audit

  • Minimal structured logs with correlation IDs and decision codes