Architecture

Target architecture and authority

The plane boundaries, authority lattice, and deployment profiles that guide current implementation work.
Proposed Ledger class: design-intent
Verified 2026-10-21Target contract; only the locally evidenced subset is running

This page describes the target architecture, not the current deployment. It exists to keep implementation work aligned with the authority boundaries in engineering/architecture-v2. For what is actually running, read Status and evidence.

Planes, not just services

The target separates five concerns so a dependency failure or model output cannot quietly become authority.

PlaneOwnsMust not do
EnforcementVerified principal propagation, deterministic authorization, policy epoch, capability admission, reservations, rate/concurrency, bounded context calls, provider selection, streaming, final allow/denyExtract memory, run deep PII, render operator views, or treat classifier output as permission
Context and memorySessions/checkpoints, typed memory, retrieval, PII/quarantine, embeddings, context compilation, provenance-bearing manifestsWiden visibility, promote a candidate into policy, or authorize a provider call
ProviderImmutable deployment identities, adapters, capability manifests, tokenizer/pricing metadata, streaming normalization, usage reconciliation, retries, breakersAuthorize a tenant or override a reservation
Evidence and controlCanonical configuration, policy/directive lifecycle, provider registry, reservations, operation state, deletion state, transactional outbox, artifact metadata, recoveryTreat ClickHouse, Redis, queues, or OTel as the sole authority
Operator and MCPManagement API, Console/BFF, narrow authenticated MCP toolsWrite databases directly, become an OAuth identity provider, or let UI state grant authority
Diagram
Rendering diagram

The current codebase implements parts of this map: the Go proxy is the enforcement edge today, the Python memory service owns memory writes and reads, and the management API owns some control-plane routes. The target adds explicit contracts between them; it does not mean every plane is independently deployable.

Authority lattice

The target ordering is:

verified principal → policy snapshot → capability admission → reservation
→ authorized context → provider/tool execution → evidence/reconciliation

A downstream layer cannot manufacture authority an upstream layer did not grant. This is stricter than ordinary service layering:

  • A valid bearer token is necessary but not sufficient; the selected agent must match any token binding.
  • A retrieval score, cache hit, model confidence, memory body, tool description, or provider response is data, not permission.
  • Missing, stale, contradictory, or unavailable security state denies or returns a typed dependency failure. It never becomes an empty allow.
  • A run identifier is lineage and correlation only. Reusing or forging a run does not carry authority.

The proposed PrincipalContext and RunEnvelope contracts formalize this, but neither is a repo-wide runtime contract today. See ADR-0084.

Canonical ownership

Store or componentCanonical roleNot authoritative for
PostgreSQLTenants, policy, provider registry, reservations, operations, lifecycle, outboxApproximate search ranking
RedisNamespaced cache, bounded counters and leases, hot projectionDurable auth, billing, audit, deletion truth
pgvector and full-text searchSearch projectionsVisibility or semantic truth
ClickHouseTenant-filtered analytics and evidence projectionSole audit authority
Object storageClassified large or redacted artifacts; immutable model artifactsAn undeclared source of truth
Queue/Celery/streamsDelivery transportExactly-once effects without idempotent handling
OpenTelemetryExport and correlationDurable audit ledger
Browser/ConsolePresentation and API clientPolicy or direct storage access

Two consequences matter operationally:

  1. Projections must be rebuildable or explicitly marked otherwise. A cache or index cannot be the only copy of a deletion or authorization decision.
  2. Tombstones suppress reads immediately. Physical purge is asynchronous; a delayed projection must not resurrect the row.

Trust-boundary matrix

BoundaryVerified authority sourceCaller-controlled selectorsRequired failure behavior
HTTP to proxyAuthService validation plus enforcement policyAgent, project, session, resource IDsDeny or typed 503 before downstream work
Proxy to contextServer-bound principal contextContext selectors onlyReject mismatch or unavailable verifier; no permissive fallback
Worker jobAuthenticated operation/run envelopeJob payload referencesRevalidate tenant, resource, and policy before mutation
MCPResource-server principal plus tool registry/policyTool arguments and resource IDsDeny before memory or effect call; avoid existence leaks
EvidenceServer-generated operation/event envelopeNone for authority fieldsReject unscoped or unredacted payloads before persistence

The first row is implemented locally through the proxy's token and agent checks. The rest are target contracts or narrow local slices, not universal enforcement.

Deployment profiles

ProfileIntended useWhat acceptance means
Development ComposeLocal contributor workflowConvenience. No availability, recovery, or hosted claim.
Single-node self-hostedSmall controlled installationDocumented backup, resource, dependency, and operator limits.
HA productionHosted or engineered productionNamed owners, recovery drills, SLO evidence, isolation proof, and incident ownership.

Evidence must name the profile. A feature accepted in Compose is not automatically accepted in HA production. The Helm chart in infra/helm/ibex-harness is render/lint scaffolding with sentinel images; it is not a deployable production topology.

Current versus target

CapabilityLocal current stateTarget contract
Principal propagationAuthService validation plus proxy agent checksSigned PrincipalContext across protected boundaries
Policy authoritySigned snapshots in selected proxy pathsImmutable snapshot with epoch, digest, freshness, and deny semantics everywhere
IdempotencyDurable PostgreSQL ledger for registered slicesPer-operation scope, canonical body hash, replay/conflict semantics
Budget reservationDurable hard-cap holds in a bounded pathAtomic admission and reconciliation with no double-spend
Memory lifecycleTyped rows, tombstones, revision fences, provisional forgetProvenance ledger with deletion certificates and projection fencing
EvidencePostgreSQL outbox plus default-off relayDurable-before-ack where required, production sink, recovery proof
Operator readsMounted D1/D2 metadata slicesVersioned support surface with hosted identity, origin, and retention evidence

What this page does not claim

  • No repo-wide PrincipalContext, RunEnvelope, or policy snapshot is enforced today.
  • No atomic reservation or exactly-once billing claim is supported.
  • No production ClickHouse sink, hosted recovery, or HA topology is accepted.
  • No model classifier or advisory service can authorize, delete, or widen scope.
  • No current latency number is a hosted SLO.