System Architecture

The Five Planes of TELHAR

A decoupled architecture designed so that reasoning models cannot grant themselves permissions, alter policy, or execute external actions unverified.

Memory Plane PROVEN

Mnḗmē

Continuous context, temporal indexing, and belief state. Never a global truth or identity authority.

Qdrant · pgvector · DEK telhar:v1:memory-envelope
Cognitive Plane IMPLEMENTED

Praxis & ARK

Parses intent, formulates plans, and deliberates. Proposes actions, but holds zero intrinsic execution authority.

TLA+ · Planner · LLM Router telhar:v1:execution-plan
Policy Plane (PDP) IMPLEMENTED

Foedus

Policy Decision Point. Evaluates covenants and deterministic rules prior to any state mutation in the world.

OPA · Rego · Fail-Closed telhar:v1:policy-decision
Evidence Plane PROVEN

Explorator & Refuto

Protected external discovery and independent falsification harness. "An agent cannot be judge of its own execution."

SSRF Guard · Immutable Ledger telhar:v1:evidence-event
Experience Plane IMPLEMENTED

Experience Platform

Multimodal perceptual projection over a singular core. The modality is an adapter, not a reimplementation.

Web · Desktop · Mobile · TUI telhar:v1:projection-model
Singular Chokepoint • Gateway Effect Gate

The 7 Controls of the Effect Gate

No model or agent has direct connectivity to actuators, APIs, or filesystem effects. Every action proposal crosses the 7 controls deterministically, terminating at the first DENY verdict.

1. Auth / Token
2. Tenant RLS
3. Rate Limit
4. Foedus PDP
5. Plan Hash
6. ARK Capability
7. Idempotence

1. The Architectural Premise

In typical LLM wrappers and contemporary autonomous agent platforms, the language model functions simultaneously as reasoning engine, storage gateway, session coordinator, and tool dispatcher. If the model hallucinates or succumbs to prompt injection, the entire security boundary collapses.

TELHAR separates these responsibilities into distinct architectural planes with orthogonal lifecycles and strict contract boundaries. Cognition proposes plans; Policy dictates legality; the Effect Gate enforces execution; and Evidence records immutable proof.

2. The Five Planes in Detail

Memory Plane — Mnḗmē (ai/mneme)

Mnḗmē is not a generic vector database. It is a governed memory plane maintaining persistent personal context across surfaces. It supports temporal decay, semantic indexing via pgvector and Qdrant, KMS-backed Data Encryption Keys (DEK), and Row-Level Security (RLS) isolation.

Invariants: Memory ≠ Truth · Memory ≠ Identity Provider · Contract: telhar:v1:memory-envelope

Cognitive Plane — Praxis & ARK (Agent Runtime Kernel)

The cognitive plane handles natural language interpretation, task decomposition, context assembly, and plan generation. It operates under the Agent Runtime Kernel (ARK), a finite state machine whose termination and non-livelock invariants have been formally model-checked in TLA+ (TLC 1.8.0, 149 distinct states).

Invariants: Cognition ≠ Authority · Output is data, never permission · Contract: telhar:v1:execution-plan

Policy Plane — Foedus (security/foedus)

The sole Policy Decision Point (PDP) of the architecture. Written in TypeScript and Open Policy Agent (Rego), Foedus evaluates explicit tenant covenants. Any access or action not explicitly permitted is rejected by default (fail-closed).

Invariants: Single-PDP Authority · Fail-Closed by default · Contract: telhar:v1:policy-decision

Evidence & Assurance Plane — Explorator & Refuto

Replaces blind trust with empirical proof. Explorator discovers external intelligence through fail-closed network egress guards and verifiable source provenance. Refuto provides the independent assurance harness that ensures agents never judge their own work.

Invariants: Evidence ≠ Claim · Append-only verification ledger · Contract: telhar:v1:evidence-event

Experience Plane — Experience Platform (platform/experience)

A single decision core projecting onto multiple perceptual modalities: Web (Next 15), Desktop (Tauri 2), Mobile (React Native), and Terminal (Rust TUI). A modality is treated as an adapter, not a reimplementation of business logic.

Invariants: FF-PROJECTION-NO-REVEAL · Contract: telhar:v1:projection-model

3. The Singular Effect Gate (Gateway Chokepoint)

All side-effects on the outside world — file writes, API calls, process spawning, shell execution, or remote communications — must flow through the **Effect Gate** in `core/gateway`. The gate enforces 7 sequential controls:

  1. Authentication & Identity: Cryptographic verification of the calling principal token (RS256).
  2. Tenant Isolation: Validation of workspace boundary and tenant tenancy keys.
  3. Rate & Budget Limiting: Fail-closed token/cost ceilings. Overrun stops execution immediately.
  4. Policy PDP Evaluation: Synchronous Foedus OPA check. Non-ALLOW responses terminate the call.
  5. Approval Plan Binding: Verification of single-use hash (approvedSetHash) tied to the user turn.
  6. Capability Token Attenuation: Verification that the capability was derived in kernel without escalation.
  7. Idempotency Validation: Checking deduplication caches to prevent duplicate external side-effects.
Rule: Any failure at steps 1–7 results in an immediate fail-closed denial. No tool is executed on partial passes.

4. Ecosystem Topology: Multi-Plane Responsibility Matrix

6 Planes · 15 Bounded Contexts · Zero Drift

The TELHAR ecosystem rejects the superficial illusion of a monolithic AI pipeline. Across the active GitLab estate and live runtime clusters, every component executes within an airtight bounded context governed by single-ownership contracts, strictly enforced negative boundaries (what a component is forbidden from doing), and deterministic fail-stop invariants:

Plane I · Consensus, Ordering & Durable Evidence Byzantine Fault Tolerant Log
ai/concordia R13 Verified

Sans-I/O pure PBFT state machine (Replica::step) with $3f+1$ replicas and Ed25519 quorum certificates (⌊(n+f)/2⌋+1). Formal TLA+ specification in formal/PbftCore.tla.

Negative Boundary: No Merkle root calculations or public anchoring (exclusive to vestigium).
security/vestigium Transparency

Custody of cryptographic anchoring, Merkle inclusion proofs, and immutable evidence ledgers (telhar:v1:evidence-event).

Negative Boundary: Never decides sequence order (delegated to Concordia/Cursus).
ai/cursus Durable Fabric

Durable DAG execution engine with distributed sagas, OTEL step traces, and cryptographic fencing tokens (telhar:v1:durable-job).

Negative Boundary: Zero policy authority; executes pre-authorized deterministic graphs.
Plane II · Routing, Planning & Cognitive Formulae Deterministic Deliberation
ai/via (FFR) 20 Rust Crates

Frontier Fabric Router running natively on mk02 (:3200). Evaluates dynamic model scoring, latency budgets, and fallback matrices. Mints and signs telhar:v1:execution-plan (ExecutionPlanV1).

Negative Boundary (ADR-002): Strictly forbidden from bundling provider SDKs or dispatching LLM calls (via-providers permanently archived).
ai/carmen & contracts Schema Registry

Canonical prompt & cognitive formulae store over JSON-Schema (telhar:v1:prompt). Immutable monotonic versions with SHA-256 contentHash and URN resolution (urn:telhar:prompt:*).

Negative Boundary: Structural schema exclusion of scope='platform' (tenants cannot overwrite safety floor); zero direct LLM egress.
ai/praxis-api Agent Runtime

Autonomous agent orchestration runtime (:3001). Manages conversational turn-loops, intent decomposition, and tool execution state transitions.

Negative Boundary: Cannot self-authorize tool invocations; must delegate every action to Foedus/Gateway.
Plane III · Execution, Provider Chokepoint & Media Generation Physical Provider Edge
ai/executor Exclusive Chokepoint

Sole holder of external LLM credentials, provider SDKs, token meters, and circuit breakers (ART-10). Consumes telhar:v1:model-invocation-request from Gateway and emits authenticated telhar:v1:outcome (OutcomeReportV1).

Negative Boundary (Invariant ART-10): provider_sdk_sites_outside_executor: 0. No other service in the estate is permitted to hold provider keys or call upstream AI vendors.
ai/opus Async Microservice

Asynchronous media, document (docx/xlsx/pptx/pdf), and vectorial chart generation service (:3020). Backed by Fastify, BullMQ, Redis, and Temporal. Implements RFC 7240 (202 Accepted + jobId, SSE streaming at /cancel). Watermarking via C2PA Content Credentials and SynthID hooks.

Negative Boundary: Governed as an MCP Capability (generate_media); forbidden from direct provider bypass.
Plane IV · Continuous Memory & Protected Web Intelligence Sovereign Data Substrate
ai/mneme Rust Memory Core

Continuous memory substrate (:3130) fusing hybrid vector retrieval with BM25, KMS-backed envelope encryption (DEK/KEK), temporal contradiction detection, and tenant-isolated Row-Level Security (telhar:v1:memory-envelope).

Negative Boundary: Never stores unencrypted plaintext; possesses zero identity authority.
ai/explorator Egress Intelligence

Protected open-source web intelligence gatherer (:3120). Hardened with fail-closed SSRF filters tested against 133,000 IP ranges (RFC 1918, CGNAT, link-local, loopback). Emits verified telhar:v1:evidence-event.

Negative Boundary: Delivers raw gathered evidence; never decides truth (epistemic-core) and never acts as a PDP.
Plane V · Policy Decision, Governance Kernel & Identity Authority Zero-Trust Enforcement
security/foedus

Central Policy Decision Point (PDP, :3110) backed by Open Policy Agent (:3111). Evaluates deterministic OPA/Rego covenants (telhar:v1:policy-decision).

Boundary: Emits pure verdicts; never executes actions.
core/gateway

Rust Axum PEP (:3010). Enforces Effect Gate, validates SSO bearer once, and mints derive-once envelopes (telhar:v1:gateway-identity-envelope).

Boundary: Enforces verdicts; never authors policy.
core/agent-kernel (ARK)

Rust FSM safety kernel checked in TLA+ (149 states, 0 deadlocks). Imposes typed untrusted taint analysis on model outputs (telhar:v1:governed-tool-call).

Boundary: Rejects untrusted privilege escalation.
core/sso

Cryptographic identity authority (:3100). Implements OIDC 2.1 / PKCE, RFC 8693 token exchange, and RS256 JWKS rotation (telhar:v1:access-token-claims).

Boundary: Identity only; zero agent cognition.
Plane VI · Physical Perception & Sovereign Human Interaction Human Invariant Gate
ai/aesthesis 10 Rust Crates

Perceptual physics & optical materials engine translating abstract computational states into closed-form physical magnitudes (Fresnel/Schlick, Blinn-Phong, Beer-Lambert, dual-term directional shadows, and APCA-W3 contrast).

Boundary: Not decorative CSS; physical perceptual boundary. Dedicated Lab (94 Materials) →
product/telhar-cli & platform/experience Sovereign Surface

Human sovereign interaction surfaces: high-performance Rust TUI and multidevice Web. Enforces irrevocable cancellation authority (/v1/agent-runs/:runId/cancelar) over in-flight autonomous agent runs.

Negative Boundary: AI models hold exactly zero authority to prevent, delay, or negotiate human cancellation.

Perceptual Physics Boundary & Material Interface (ai/aesthesis)

10 Rust Engine Crates

In TELHAR, the interface is not a layer of decorative CSS. ai/aesthesis sits as an explicit architectural boundary between internal cognitive execution and human sensory perception, translating computational states into closed-form physical magnitudes:

1. Wave Optics Contract

Surfaces are governed by closed-form Fresnel reflectance (R(θ)), Blinn-Phong specular lobes (s = 2/α² - 2), and Beer-Lambert extinction (T = exp(-σ·d)).

2. Directional Shadow Engine

Orthogonal separation of dense contact occlusion (r_c ∈ [2,6]px) from soft ambient penumbras (r_p ∈ [16,48]px) unified by light vector θ = 118°.

3. APCA Dead-Band Gate

Strict exclusion of mid-luminance collision (L ∈ [0.44, 0.60]), guaranteeing |Lc| ≥ 60 body text contrast and CVD discrimination (ΔE ≥ 15.0).

Dedicated Aesthesis Laboratory & Physical Material Explorer Explore all 94 catalogued materials across 6 physical families with live optical sweeps, CVD matrix evaluation, and calibrated transients.
Explore Aesthesis Engine →

5. Agent Run Cancellation: Invariant of Human Authority

In TELHAR, human agency is an operational invariant, not an aspiration. When a person requests cancellation of an autonomous agent turn:

  • Authority: Only the sovereign person may initiate cancellation via authenticated HTTP (/v1/agent-runs/:runId/cancelar).
  • Zero Model Authority: The AI model has zero capacity to decide, delay, or prevent its own cancellation.
  • Deterministic Propagation: AgentRunService marks cancelRequestedAt idempotently and routes the order through the bridge gateway directly to telhar-cli (serve.rs).
  • Execution Fence: Any action currently in-flight finishes its bounded step, but no subsequent acts are dispatched. The run seals in immutable CANCELLED state.

6. Contract Authority & Canonical Schemas

TELHAR rejects implicit contracts and ad-hoc JSON payloads. The system is governed by 29 formal JSON Schemas located in contracts/schemas, versioned under strict SemVer and serialized deterministically per RFC-8785 (Canonical JSON).

7. Target Topology & Governance Enforcement

The 5–10 year target architecture (Document 11) is driven by radical consolidation: collapse to the real. The architecture enforces a single enforcement point without bypass ingress paths:

Cloudflare (TLS Ingress) → Gateway (Rust PEP · RS256/JWKS · Single Chokepoint) ↓ Foedus (PDP · OPA/Rego) + Praxis (API / Cognition) ↓ [Executor: Model Plane] · [Via: Routing & Budget] · [Mnḗmē: RLS Memory]

Identity & Token Invariants

Single IdP (core/sso), RS256/JWKS exclusively, zero HMAC/HS256 side-doors. Service-to-service communication relies on mTLS or signed service tokens.

Tenancy & Row-Level Security

Tenancy is not enforced by fragile manual WHERE clauses. Postgres Row-Level Security (RLS) acts as a cryptographic backstop under every query in Mnḗmē.