Keyra companion governance
The Companion Platform Reference Architecture
Implementation blueprint for services, schemas, runtimes, observability, and deployment.
THE COMPANION PLATFORM REFERENCE ARCHITECTURE
Definitive technical blueprint for implementing the Human Sovereignty Operating System
Instrument: The Companion Platform Reference Architecture
Function: Master implementation blueprint translating all twelve founding instruments into implementable platform architecture for engineers, architects, platform/infrastructure/product/security teams, government, telecom, and banking teams
Version: 1.0 (Reference Architecture)
Status: Subordinate to the Human Sovereignty Charter and all twelve prior founding instruments
Core constraint: Architecture follows sovereignty; human-first, local-first, trust-first, companion-first
Preamble
The Human Sovereignty Operating System is not a product roadmap. It is a constitutional and technical composition — twelve founding instruments that together define how humans, companions, digital twins, life graphs, families, organizations, agents, vaults, devices, marketplaces, and global trust infrastructure coexist under human authority. Engineers cannot implement sovereignty by accident. Architects cannot federate trust by improvisation. Platform teams cannot scale to billions of humans and hundreds of billions of agents without a reference architecture that translates rights into runtime behavior, persistence into storage models, and governance into enforceable service boundaries.
This document defines the Companion Platform Reference Architecture — the master implementation blueprint through which the Human Sovereignty Charter, Companion Charter, Life Operating System, Human Digital Twin Architecture, Life Graph Architecture, Family Trust Network, Organization Graph Enterprise Companion Framework, KAAI Standard, Trust Vault Architecture, Device Trust Mesh, Companion Marketplace & Agent Economy, and Global Trust Economy & Sovereign Network Framework become deployable platform architecture.
The Reference Architecture is written for Engineers, Architects, Platform Teams, Infrastructure Teams, Product Teams, Security Teams, Government Teams, Telecommunications Teams, and Banking Teams. It specifies layers, services, schemas, APIs, runtimes, deployment models, observability contracts, and implementation roadmaps. It does not replace founding instruments. It implements them.
Preamble — Historical Context
Digital platforms evolved as application silos. Each silo optimized for engagement, retention, and data accumulation. Identity became authentication. Authorization became role-based access control inside vendor boundaries. Memory became training data. Relationships became social graphs owned by platforms. Agents arrived as features without certificates, without revocation semantics, without audit chains rooted in human grants.
The result is architectural fragmentation incompatible with human sovereignty. A human who cannot export authorization graphs does not possess portability. A companion that cannot enforce vault-bound grants does not mediate sovereignty. An agent that cannot produce KAAI certificate chains is not accountable. A family that cannot partition child-safe scopes cannot govern. An enterprise that cannot separate organizational overlays from member human roots cannot comply. A bank that settles without authorization evidence pointers settles money without trust economy conformance. A government that accredits without federation bridges creates jurisdictional dead ends.
The Companion Platform Reference Architecture addresses fragmentation by defining a single implementable stack where constitutional constraints precede product features, local-first execution precedes cloud convenience, trust verification precedes transaction finalization, and companion mediation precedes direct agent access to human life data.
Preamble — Relationship to Founding Instruments
This Reference Architecture is subordinate to the Human Sovereignty Charter. When implementation choices appear to conflict with human sovereignty, human sovereignty prevails and platform implementations MUST be corrected.
This Reference Architecture translates the following twelve founding instruments into platform architecture:
| # | Instrument | Platform translation |
|---|---|---|
| 1 | Human Sovereignty Charter | Constitutional invariants enforced at every layer; human root authority in identity, authorization, and audit |
| 2 | Companion Charter | Companion layer as mandatory mediation for high-risk operations; duty-of-care runtime policies |
| 3 | Life Operating System | Domain-scoped policy engine; life domain routing; governance constraints in platform services |
| 4 | Human Digital Twin Architecture | Twin service boundaries; projection APIs; synchronization and conflict resolution |
| 5 | Life Graph Architecture | Graph storage, query, and mutation services; temporal and authorization semantics |
| 6 | Family Trust Network | Family partition services; guardian approval workflows; child-safe policy overlays |
| 7 | Organization Graph Enterprise Companion Framework | Enterprise overlay separation; member sovereignty preservation; compliance partitions |
| 8 | KAAI Standard | Agent runtime; certificate validation; registration, execution, auditing, revocation |
| 9 | Trust Vault Architecture | Vault service; encryption hierarchy; export ceremonies; partition governance |
| 10 | Device Trust Mesh | Device registry; presence verification; trust synchronization protocol |
| 11 | Companion Marketplace & Agent Economy | Marketplace services; certification; billing; settlement integrations |
| 12 | Global Trust Economy & Sovereign Network Framework | Federation gateways; trust settlement engine; cross-border interoperability |
No single layer owns the platform. The human owns the estate. The Reference Architecture composes services that persist, structure, mediate, authorize, and settle human digital life without capture.
Preamble — Normative Language
Throughout this document:
- MUST, MUST NOT, REQUIRED, and SHALL denote absolute requirements for Companion Platform conformance
- SHOULD and RECOMMENDED denote strong guidance with documented exceptions permitted only under human or institutional policy with audit
- MAY denotes optional capability
- Prohibited actions are void regardless of technical success; platform runtimes MUST reject them
Conformance is measured at four layers: constitutional (subordination to human authority), architectural (layer boundaries and service contracts), technical (APIs, schemas, encryption, federation), and operational (SLA, observability, incident response, disaster recovery).
Preamble — Standards Alignment
This Reference Architecture is written at institutional quality for enterprise architecture practice — aligned with TOGAF-style architecture domains (business, data, application, technology, security) while subordinating all views to human sovereignty rather than enterprise convenience alone. It meets enterprise architecture rigor for service boundaries, deployment topologies, and federation patterns, and PhD-level systems engineering depth for graph-SQL duality, cryptographic custody, multi-agent scale, and civilization-scale federation — without marketing or product language.
Preamble — Architectural Placement
The Companion Platform Reference Architecture sits between founding instruments (law and semantics) and deployable implementations (code and infrastructure):
┌──────────────────────────────────────────────────────────┐
│ Human Sovereignty Charter + 11 Founding Instruments │
├──────────────────────────────────────────────────────────┤
│ Companion Platform Reference Architecture (this doc) │
│ Layers · Services · Schemas · Runtimes · Deployment │
├──────────────────────────────────────────────────────────┤
│ Web · Flutter · APIs · Graph · SQL · Vault · Mesh │
├──────────────────────────────────────────────────────────┤
│ Cloud · Edge · Sovereign · Enterprise · Gov · Telco │
└──────────────────────────────────────────────────────────┘Applications and interfaces are replaceable. Authorization graphs, vault contents, graph topology, and audit chains are not — they belong to the human and persist across platform migration when export ceremonies execute.
Preamble — Scope of Support
The Companion Platform Reference Architecture supports:
| Domain | Entities |
|---|---|
| Humans | Sovereign grantors, owners, inspectors, revokers |
| Companions | Mediation layer, policy enforcement, human-facing orchestration |
| Digital Twins | Bounded projections with synchronization and provenance |
| Life Graphs | Multi-typed property graphs with temporal and authorization semantics |
| Families | Federated partitions, guardian structures, child-safe overlays |
| Organizations | Enterprise overlays subordinate to member human roots |
| Agents | KAAI-authorized executors with certificate chains and trust scores |
| Trust Vaults | Encrypted credential and artifact custody with export packs |
| Devices | Hardware-rooted identity, presence, trust mesh synchronization |
| Marketplace | Agent discovery, certification, commerce, settlement |
| Global Trust | Federation, registries, cross-border settlement, trust metrics |
| Banks | Authorization-attested settlement participants |
| Telcos | Subscriber trust overlays, eSIM provisioning, device binding |
| Governments | Accreditation overlays, lawful channels, sovereign deployment |
PART I — Architecture Principles
Section 1.01 — Human-First Architecture
Human-first architecture means every platform decision — schema design, API default, deployment topology, analytics pipeline, agent runtime gate — is evaluated against a single question: does this preserve, extend, or usurp human authority?
Implementations MUST:
Human-first architecture is not a UX preference. It is a runtime invariant. Services that bypass human-root validation for operational convenience are non-conformant.
Section 1.02 — Local-First Architecture
Local-first architecture means the authoritative replica of human digital life — vault secrets, graph projections, twin state, companion memory indices, device trust credentials — resides on devices the human controls, with federation for authorized synchronization rather than cloud custody as default.
Implementations MUST:
Local-first architecture integrates with Device Trust Mesh presence requirements. High-risk operations MAY require online device participation; they MUST NOT require surrender of local key custody.
Section 1.03 — Trust-First Architecture
Trust-first architecture means trust verification — authorization certificate validation, device presence attestation, trust score gates, certification level checks — precedes action execution, data disclosure, marketplace settlement, and federation bridge traversal.
Implementations MUST:
Trust-first architecture rejects the pattern of "authenticate then hope." Authentication establishes session; trust establishes grant fidelity.
Section 1.04 — Companion-First Architecture
Companion-first architecture means the Keyra Companion is the primary human-facing mediation layer for life operations — not a chat widget atop siloed backends. Companions orchestrate vault access, graph queries, twin projections, agent dispatch, family approvals, and marketplace negotiations under Companion Charter duty-of-care policies.
Implementations MUST:
Companion-first architecture does not mean companions hold root keys. Companions mediate; humans authorize; vaults persist.
Section 1.05 — Why Architecture Follows Sovereignty
Sovereignty is not implemented by policy documents alone. Sovereignty requires architecture that makes violation technically difficult and detectable. When architecture inverts — cloud-first custody, platform-root identity, agent-direct data access, engagement-optimized trust proxies — sovereignty becomes rhetorical.
The Companion Platform Reference Architecture inverts the default platform stack:
| Default platform pattern | Sovereign platform pattern |
|---|---|
| Cloud as source of truth | Human device vault as primary replica |
| Platform identity | Human-rooted identity with vault keys |
| OAuth scope accumulation | KAAI certificate chains with decay |
| Agent API keys | Agent ID + Authorization Certificate |
| Engagement scoring | Trust index from evidentiary inputs |
| Siloed app databases | Life Graph with exportable topology |
| Institutional CRM as person record | Human-owned graph with org overlays |
Architecture follows sovereignty because rights without enforceable structure are unenforceable. The twelve founding instruments define rights and semantics. This Reference Architecture defines enforceable structure.
Section 1.06 — Principle Enforcement Matrix
| Principle | Presentation layer | Service layer | Data layer | Operational layer |
|---|---|---|---|---|
| Human-first | Revocation UI, grant inspection | Authorization service validation | Human-root foreign keys | Audit to human-accessible logs |
| Local-first | Offline modes | Edge-sync protocol | Local vault replica | Conflict resolution SLA |
| Trust-first | Trust badges, cert display | KAAI runtime gates | Trust score tables | Revocation propagation metrics |
| Companion-first | Companion Home routing | Companion mediation API | Companion config vault partition | Companion analytics |
Section 1.07 — Scenario 1 — Architecture Rejects Silent Capture
A platform team proposes storing human vault master keys in cloud HSM with vendor-controlled recovery. The Reference Architecture evaluation:
The approved pattern: human-held root key on Keyra Key; cloud stores encrypted vault blobs only; recovery requires Device Trust Mesh quorum and human presence proof.
Section 1.08 — Document Map (All 20 Parts)
| Part | Subject |
|---|---|
| I | Architecture Principles |
| II | System Architecture |
| III | Front-End Architecture |
| IV | Flutter Architecture |
| V | Backend Architecture |
| VI | Graph Architecture |
| VII | SQL Architecture |
| VIII | Twin Architecture |
| IX | Trust Vault Architecture |
| X | KAAI Runtime |
| XI | Device Trust Mesh Runtime |
| XII | AI Architecture |
| XIII | Security Architecture |
| XIV | Marketplace Architecture |
| XV | Trust Settlement Architecture |
| XVI | Scalability Architecture |
| XVII | Observability |
| XVIII | Deployment Architecture |
| XIX | Disaster Recovery |
| XX | Reference Implementation |
PART II — System Architecture
Section 2.01 — Layered Architecture Overview
The Companion Platform implements a nine-layer reference model subordinate to constitutional instruments and superior to application silos:
┌─────────────────────────────────────────────────────────────────┐
│ L1 PRESENTATION LAYER │
│ Web domains · Flutter apps · Voice · Accessibility │
├─────────────────────────────────────────────────────────────────┤
│ L2 COMPANION LAYER │
│ Mediation · Policy · Orchestration · Duty of care │
├─────────────────────────────────────────────────────────────────┤
│ L3 AGENT LAYER (KAAI Runtime) │
│ Registration · Execution · Authorization · Audit │
├─────────────────────────────────────────────────────────────────┤
│ L4 TWIN LAYER │
│ Identity · Preference · Goal · Context · Memory projections │
├─────────────────────────────────────────────────────────────────┤
│ L5 GRAPH LAYER │
│ Life · Family · Organization · Trust · Authorization graphs │
├─────────────────────────────────────────────────────────────────┤
│ L6 VAULT LAYER │
│ Identity · Memory · Authorization · Legacy partitions │
├─────────────────────────────────────────────────────────────────┤
│ L7 TRUST LAYER │
│ Trust scores · Certification · Federation · Settlement refs │
├─────────────────────────────────────────────────────────────────┤
│ L8 AUTHORIZATION LAYER │
│ Grants · Certificates · Revocation · Scope validation │
├─────────────────────────────────────────────────────────────────┤
│ L9 INFRASTRUCTURE LAYER │
│ Compute · Storage · Network · Edge · Sovereign regions │
└─────────────────────────────────────────────────────────────────┘Layers MUST communicate through defined service APIs. Direct layer bypass — e.g., Presentation to Vault without Authorization validation — is prohibited for consequential operations.
Section 2.02 — Presentation Layer
The Presentation Layer delivers human-facing interfaces across web domains and Flutter applications. Responsibilities:
- Render human-inspectable views of grants, graph subgraphs, vault partition metadata, trust scores, and agent status
- Initiate authorization ceremonies (signing, approval, revocation)
- Localize and adapt accessibility per Life Operating System domain preferences
- MUST NOT embed business authorization logic — delegates to Companion and Authorization layers
Section 2.03 — Companion Layer
The Companion Layer implements Keyra Companion mediation per Companion Charter. Responsibilities:
- Orchestrate multi-service workflows (e.g., agent purchase → family approval → vault credential bind → marketplace settlement)
- Enforce Life Operating System domain policies
- Present comparative options to humans before consequential commits
- Maintain Companion session context with provenance references to graph and twin state
Section 2.04 — Agent Layer
The Agent Layer hosts KAAI Runtime per KAAI Standard. Responsibilities:
- Agent registration, certificate issuance, execution sandboxing
- Pre-execution Authorization Certificate validation
- Post-execution audit emission to vault and graph
- Trust score updates and revocation propagation hooks
Section 2.05 — Twin Layer
The Twin Layer implements Human Digital Twin projections. Responsibilities:
- Layered twin state: Identity, Relationship, Preference, Goal, Context, Decision, Memory, Prediction
- Synchronization between local and federated replicas
- Bounded projection APIs — agents receive projections, not raw vault
Section 2.06 — Graph Layer
The Graph Layer implements Life Graph Architecture and related graphs. Responsibilities:
- Multi-typed node and edge storage with temporal versioning
- Authorization-governed query and mutation
- Cross-graph references: Family, Organization, Trust, Authorization, Memory, Device, Agent
Section 2.07 — Vault Layer
The Vault Layer implements Trust Vault Architecture. Responsibilities:
- Encrypted artifact storage with partition hierarchy
- Key management integrations with Device Trust Mesh
- Export pack generation and import validation
- Access audit hash chaining
Section 2.08 — Trust Layer
The Trust Layer implements trust metrics, certification state, and federation references per Global Trust Economy. Responsibilities:
- Trust score computation inputs and history
- Certification level registry integrations
- Federation bridge routing for cross-border verification
- Settlement evidence pointer resolution
Section 2.09 — Authorization Layer
The Authorization Layer is the cross-cutting enforcement plane. Responsibilities:
- Grant storage and certificate chain validation
- Revocation registry and propagation
- Scope evaluation engine (data, financial, communication, family, enterprise, government)
- integrations point for all layers — every consequential API MUST pass Authorization Layer validation
Section 2.10 — Infrastructure Layer
The Infrastructure Layer provides compute, storage, networking, and regional deployment substrates. Responsibilities:
- Sovereign region isolation where policy requires
- Edge nodes for local-first sync
- Hardware security module integrations for institutional deployments
- Network policies enforcing zero-trust service mesh
Section 2.11 — Reference Request Flow
ASCII diagram — authorized agent action:
Human → Companion UI → Companion Service → Authorization Service (validate grant)
↓
KAAI Runtime (agent execute)
↓
Graph Service (read context) ← Vault Service (secrets by ref)
↓
Device Trust Mesh (presence if required)
↓
Audit → Vault + Graph + Trust LayerSection 2.12 — Layer Dependency Matrix
| Layer | Depends on | MUST NOT depend on |
|---|---|---|
| Presentation | Companion, Authorization | Vault direct |
| Companion | Authorization, Graph, Twin | Agent internal state |
| Agent | Authorization, Vault refs, Graph | Presentation session |
| Twin | Graph, Vault | Marketplace billing |
| Graph | Authorization, Vault refs | Agent runtime |
| Vault | Authorization, Device Trust | Marketplace |
| Trust | Authorization, Graph, Vault audit | Engagement analytics |
| Authorization | Vault keys, Device Trust | Application silos |
| Infrastructure | — | Business logic |
Section 2.13 — Scenario 2 — Cross-Layer Family Approval
A teenager requests agent installation with financial scope. Flow:
Human → authorizes → Agent edge with temporal boundsBypassing Companion for install would violate Companion-first architecture. Bypassing guardian validation would violate Family Trust Network conformance.
PART III — Front-End Architecture
Section 3.01 — Web Platform Domain Architecture
The Companion Platform web presence operates across six sovereign domains, each scoped to a life domain per Life Operating System:
| Domain | Purpose | Primary audience |
|---|---|---|
| companion.keyra.ie | Companion Home, chat, voice, life dashboard | Sovereign Humans |
| family.keyra.ie | Family network, guardian approvals, shared vaults | Families |
| work.keyra.ie | Organization graph, enterprise companion, work twin | Professionals, enterprises |
| trust.keyra.ie | Trust vault inspection, authorization center, audit | Security-conscious users |
| developers.keyra.ie | Agent SDK, KAAI registration, API docs, sandbox | Developers |
| market.keyra.ie | Agent discovery, certification, billing, settlement | Humans, publishers |
Each domain MUST share a common identity substrate (human-root session) while enforcing domain-scoped authorization. Cross-domain navigation MUST re-validate grants; session alone MUST NOT imply cross-domain scope.
Section 3.02 — Front-End Architecture Pattern
Web applications implement a modular monorepo front-end with:
Implementations SHOULD use progressive enhancement: core inspectability and revocation flows MUST work without WebAssembly or heavy client dependencies.
Section 3.03 — Routing Architecture
Routing follows domain-first, resource-second patterns:
companion.keyra.ie/home
companion.keyra.ie/chat/{conversationId}
companion.keyra.ie/voice
companion.keyra.ie/dashboard/{domain}
family.keyra.ie/network
family.keyra.ie/approvals/pending
work.keyra.ie/org/{orgId}/companion
trust.keyra.ie/vault/{partitionId}
trust.keyra.ie/authorizations/{grantId}
developers.keyra.ie/agents/register
market.keyra.ie/agents/{agentId}Route guards MUST invoke Authorization Service before rendering protected resources. Deep links MUST carry grant context tokens validated server-side.
Section 3.04 — State Management Architecture
Front-end state divides into four categories:
| State type | Storage | Sync | Example |
|---|---|---|---|
| Session | Memory + secure cookie | Server session | Auth tokens, human ID |
| UI | Local component state | None | Panel expansion |
| Domain | Redux/Zustand store | WebSocket + REST | Companion conversation |
| Sovereign | IndexedDB + Vault refs | CRDT or event sync | Offline grant cache |
Sovereign state MUST NOT store vault secrets in localStorage. IndexedDB entries MUST be encrypted with device-derived keys where offline cache is required.
Section 3.05 — Authentication Architecture
Web authentication implements human-root identity with:
Sessions MUST bind to device attestation where policy requires. Session tokens MUST be short-lived with refresh tied to presence re-verification for high-risk domains (trust.keyra.ie, market.keyra.ie financial flows).
Section 3.06 — Authorization Architecture (Front-End)
Front-end authorization is declarative and server-validated:
- UI components declare required scopes:
requiredScopes: ['vault.read.identity', 'graph.query.life'] - Authorization Service returns capability tokens for rendering
- Write operations invoke signing ceremonies — never silent POST
Prohibited: hiding controls without server enforcement. If a button is hidden client-side but API permits action, the implementation is non-conformant.
Section 3.07 — Localization Architecture
Localization MUST support:
- Unicode throughout; RTL layouts for Arabic, Hebrew, and related scripts
- Locale-aware date, number, currency formatting per human preference in Twin Preference layer
- Jurisdiction-aware legal copy for marketplace and trust domains without substituting human consent
- Accessibility strings separated from business logic
Section 3.08 — Accessibility Architecture
Accessibility conformance MUST target WCAG 2.2 AA minimum:
- Voice navigation integrations with Companion voice layer
- Screen reader announcements for authorization state changes and revocation confirmation
- Keyboard-complete flows for trust.keyra.ie ceremonies
- Reduced motion and high contrast themes per Life Operating System preferences
Section 3.09 — Scenario 3 — Cross-Domain Authorization
A user authenticated on companion.keyra.ie navigates to market.keyra.ie to purchase an agent. The shell detects domain change, requests market-scoped capability token, evaluates existing grants. Financial scope absent — Companion presents grant extension ceremony. User signs with Keyra Key. Authorization Service issues time-bounded market token. Purchase proceeds. Audit records cite grant extension ID.
PART IV — Flutter Architecture
Section 4.01 — Flutter as Primary Mobile Companion Shell
Flutter implements the primary mobile Companion experience — local-first, Device Trust Mesh-integrated, vault-adjacent. Flutter applications MUST operate as sovereign clients, not thin shells over platform-controlled WebViews for consequential operations.
Section 4.02 — Flutter Module Architecture
keyra_companion_app/
├── core/ # DI, routing, auth, localization
├── modules/
│ ├── companion_home/
│ ├── chat/
│ ├── voice/
│ ├── life_dashboard/
│ ├── trust_vault/
│ ├── permissions/
│ ├── agent_manager/
│ ├── family_network/
│ ├── device_mesh/
│ ├── authorization_center/
│ ├── memory_explorer/
│ ├── life_graph_explorer/
│ └── twin_explorer/
├── platform/ # iOS, Android, desktop bridges
└── sync/ # Local-first replication engineEach module MUST declare Authorization scopes in module_manifest.yaml. Modules MUST NOT access vault APIs without manifest-declared scopes validated at runtime.
Section 4.03 — Companion Home Module
Companion Home is the default entry surface:
- Life domain cards per Life Operating System
- Pending approvals, trust alerts, agent activity summary
- Quick actions: voice, chat, revoke all session grants (emergency)
- Local-first: renders from cached graph summary when offline
Section 4.04 — Chat Module
Chat integrates Companion intelligence layer with:
- Message provenance (human, companion, agent) visibly distinguished
- Agent messages MUST display Agent ID and certification badge
- Tool calls require inline authorization preview before execution
- Conversation memory references vault partitions — not raw storage in chat DB
Section 4.05 — Voice Module
Voice module implements on-device and hybrid speech:
- Wake word and push-to-talk configurable per human preference
- Voice commands map to Companion intents, not direct agent dispatch
- High-risk voice confirmations require secondary attestation (Keyra Key tap)
Section 4.06 — Life Dashboard Module
Dashboard aggregates authorized metrics across life domains:
- Health, wealth, travel, family, work widgets — each scoped by graph authorization
- Widget data fetched via Graph Service subgraph queries
- Drill-down routes to Life Graph Explorer with preserved scope context
Section 4.07 — Trust Vault Module
Vault module provides partition navigation and ceremonies:
- Biometric or Keyra Key gate for partition unlock
- Export pack initiation with progress and hash verification
- Access log viewer with authorization reference drill-down
- MUST use platform secure storage and Flutter platform channels for crypto operations
Section 4.08 — Permissions Module
Permissions module surfaces grant graph:
- Active grants by agent, organization, family member
- Scope timelines and decay schedules
- One-tap revocation with propagation status indicator
Section 4.09 — Agent Manager Module
Agent Manager lists installed KAAI agents:
- Certificate expiry, trust score trend, last action summary
- Install from marketplace with in-app grant ceremony
- Sandbox toggle for Experimental certification agents
Section 4.10 — Family Network Module
Family Network implements Family Trust Network UX:
- Member roster, guardian relationships, child profiles
- Approval queue for child agent and scope requests
- Family budget visualization linked to marketplace settlement
Section 4.11 — Device Mesh Module
Device Mesh module displays Device Trust Mesh state:
- Registered devices: phone, Keyra Key, watch, laptop, vehicle, home, enterprise
- Trust level per device, last sync, presence capability
- Device revocation and re-enrollment ceremonies
Section 4.12 — Authorization Center Module
Authorization Center consolidates signing workflows:
- Pending signatures, delegation chains, certificate renewal
- QR and NFC ceremonies for cross-device authorization
Section 4.13 — Memory Explorer Module
Memory Explorer navigates authorized memory partitions:
- Temporal timeline, full-text search within scope
- Deletion and retention policy controls per Life Operating System
- Provenance chain to agent or human origin
Section 4.14 — Life Graph Explorer Module
Graph Explorer renders interactive subgraphs:
- Force-directed or hierarchical layouts
- Edge type filters: trust, authorization, ownership, dependency
- Mutation requires write scope; read-only default
Section 4.15 — Twin Explorer Module
Twin Explorer displays Digital Twin layers:
- Layer tabs: Identity, Preference, Goal, Context, Decision, Memory, Prediction
- Projection diff view when twin diverges from human-directed corrections
- Sync status with conflict resolution UI
Section 4.16 — Flutter Platform Channels
Platform channels MUST implement:
| Channel | Responsibility |
|---|---|
| vault_crypto | Encrypt/decrypt, key derivation |
| device_trust | Attestation, presence, mesh sync |
| secure_enclave | Key storage, signing |
| biometrics | Local authentication |
| nfc_keyra | Keyra Key tap ceremonies |
Section 4.17 — Scenario 4 — Offline Revocation
Human loses network connectivity. Agent misbehaves. Human opens Agent Manager offline, initiates revocation. Local revocation record written to vault partition with monotonic clock. Device Trust Mesh queues propagation. On reconnect, Authorization Service processes revocation; KAAI Runtime invalidates certificates within SLA. Audit shows offline-initiated revocation with device timestamp and subsequent sync confirmation.
PART V — Backend Architecture
Section 5.01 — Service-Oriented Backend Model
The Companion Platform backend implements domain-bounded microservices with a unified API gateway and service mesh enforcing zero-trust mutual TLS. Services communicate via gRPC internally; external exposure via REST and GraphQL gateway per audience.
Section 5.02 — API Layer
The API Layer comprises:
| Gateway | Audience | Protocols |
|---|---|---|
| Public API Gateway | Developers, partners | REST, GraphQL, webhooks |
| Companion API Gateway | Web, Flutter clients | REST, WebSocket, SSE |
| Institutional Gateway | Banks, telcos, government | REST, ISO 20022 overlays, custom FHIR where applicable |
| Federation Gateway | Cross-border trust | Federation protocol, mTLS |
All gateways MUST terminate TLS 1.3+, validate Authorization Layer tokens, and emit distributed trace context.
Section 5.03 — Companion Service
Companion Service responsibilities:
- Session orchestration, conversation state, policy evaluation
- Mediation endpoints:
POST /companion/mediate/agent-action,POST /companion/mediate/marketplace-purchase - integrations with Life Operating System policy engine
- MUST NOT store vault secrets — references only
Section 5.04 — Agent Service
Agent Service wraps KAAI Runtime (see Part X):
- Registration, lifecycle, certificate management
- Execution dispatch to sandboxed runtimes
- Audit emission
Section 5.05 — Authorization Service
Authorization Service is the authoritative grant plane:
POST /authz/grants,POST /authz/revoke,GET /authz/validate- Certificate chain verification
- Revocation registry with propagation workers
- All other services MUST call validate before consequential operations
Section 5.06 — Trust Service
Trust Service manages:
- Trust score computation and history
- Certification level registry
- Federation bridge lookups
- integrations with Global Trust Economy indices
Section 5.07 — Vault Service
Vault Service manages:
- Partition metadata, blob storage orchestration
- Encrypted object store (client-side encryption default)
- Export pack assembly and import validation
- Access audit ingestion
Section 5.08 — Twin Service
Twin Service manages:
- Twin layer CRUD per Human Digital Twin Architecture
- Projection APIs for agents and companions
- Sync conflict resolution with human-merge priority
Section 5.09 — Graph Service
Graph Service manages:
- Life, Family, Organization, Trust, Authorization, Memory, Device, Agent graphs
- Cypher-like query language with authorization injection
- Temporal versioning and subgraph export
Section 5.10 — Marketplace Service
Marketplace Service manages:
- Agent catalog, certification status, publisher records
- Purchase flows, subscription billing integrations
- Settlement handoff to Trust Settlement Service
Section 5.11 — Settlement Service
Settlement Service manages:
- Trust transaction clearing, escrow, hold windows
- Cross-border settlement message routing
- Bank and telco rail integrations per Global Trust Economy
Section 5.12 — Service Boundary Rules
| Rule | Enforcement |
|---|---|
| No shared databases across bounded contexts | Separate schemas per service |
| Authorization validate on every write | API middleware + service mesh policy |
| Events over sync coupling | Kafka/NATS for domain events |
| Idempotent mutations | Idempotency keys on financial and grant APIs |
| Human-root foreign keys | SQL schemas reference sovereign_human_id |
Section 5.13 — Event Architecture
Domain events MUST include:
{
"event_id": "uuid",
"event_type": "authz.grant.created",
"sovereign_human_id": "uuid",
"authorization_ref": "grant-uuid",
"provenance": { "companion_session_id": "uuid", "device_id": "uuid" },
"audit_hash": "sha256",
"timestamp": "ISO8601"
}Consumers: Audit Service, Trust Service, Graph projection workers, Settlement Service.
Section 5.14 — Scenario 5 — Service Failure Isolation
Vault Service experiences outage. Companion Service MUST degrade gracefully: read-only graph and cached vault metadata available; write and agent execution requiring secrets MUST halt with human-visible error. Authorization Service remains available for revocation — revocations MUST queue for vault audit write when vault recovers. No silent fallback to unencrypted cache.
PART VI — Graph Architecture
Section 6.01 — Multi-Graph Platform Model
The Companion Platform implements eight graph domains unified under Graph Service with shared authorization and temporal semantics per Life Graph Architecture:
| Graph | Center node | Primary edges |
|---|---|---|
| Life Graph | Sovereign Human | relationships, ownership, goals, events |
| Family Graph | Family Trust Network | guardianship, approval, shared vault refs |
| Organization Graph | Organization | employment, role, compliance overlay |
| Trust Graph | Trust entities | trust scores, certification, decay |
| Authorization Graph | Grants | scope, delegation, revocation |
| Memory Graph | Memory artifacts | provenance, retention, partition ref |
| Device Graph | Devices | trust level, presence, binding |
| Agent Graph | KAAI agents | sponsorship, execution, accountability |
Section 6.02 — Graph Schema Primitives
All graphs share primitives:
Node {
id: UUID
type: enum
sovereign_human_id: UUID // root authority reference
properties: JSONB
valid_from: timestamp
valid_to: timestamp | null
provenance_ref: UUID
authorization_scope: scope_id
}
Edge {
id: UUID
type: enum
from_node_id: UUID
to_node_id: UUID
weight: float | null // trust graphs
properties: JSONB
valid_from: timestamp
valid_to: timestamp | null
provenance_ref: UUID
}Mutations MUST create new temporal versions; destructive delete prohibited for audit-relevant edges — use valid_to closure.
Section 6.03 — Life Graph Schema
Core Life Graph node types:
| Node type | Description |
|---|---|
| Human | Sovereign or related person |
| Organization | Institution with bounded overlay |
| Asset | Physical, digital, financial asset |
| Goal | Human-authorized objective |
| Event | Temporal life event |
| MemoryRef | Pointer to vault partition |
| Device | Device Trust Mesh member |
| Agent | KAAI agent reference |
Core edge types: knows, owns, committed_to, authorized, depends_on, member_of, guardian_of.
Section 6.04 — Family Graph Schema
Family Graph extends Life Graph with:
FamilyNetworksupernode linking membersguardian_ofedges with approval policy propertieschild_safe_scopeedges binding agent catalogs- Budget edges linking to marketplace settlement accounts
Child nodes MUST enforce guardian co-authorization on scope expansion.
Section 6.05 — Organization Graph Schema
Organization Graph implements Organization Graph Enterprise Companion Framework:
Organizationnode with compliance overlay propertiesemploysedges — employment does NOT transfer human rootenterprise_agent_fleetedges with department scopeenterprise_vault_partitionrefs subordinate to member vaults
Section 6.06 — Graph APIs
Graph Service exposes:
| Endpoint | Method | Purpose |
|---|---|---|