Skip to main content

Architecture Decision Records (ADRs)

"Each tool to its purpose" β€” No one-size-fits-all

This directory contains architectural decisions for STOA Platform.


ADR Index​

Core Architecture​

#TitleStatus
003Monorepo Architecture β€” Multi-Service Polyglot (Amended by ADR-073)βœ…
004Gateway Adapter Pattern β€” Multi-Gateway Orchestrationβœ…
005Event-Driven Architecture β€” Kafka Topics Designβœ…
006Tool Registry Architecture β€” 7-Module Designβœ…
035Gateway Adapter Pattern β€” Multi-Gateway Orchestrationβœ…
045stoa.yaml Declarative API Specificationβœ…

Platform & Infrastructure​

#TitleStatus
001Third-Party API Exposure Strategy β€” Public API Facadeβœ…
002stoactl CLI DesignπŸ“‹
007GitOps with Argo CDβœ…
025Gateway Resilience β€” Anti-Zombie Node PatternπŸ“‹
031CI/CD Reusable Workflow Architectureβœ…
040Born GitOps β€” Multi-Environment Promotion Architectureβœ…
043Kafka β†’ MCP Event Bridge ArchitectureπŸ“‹
059Simplified Deployment Architecture β€” Single Path via SSEβœ…
064Controller Framework β€” Keep Ad-Hoc Python Workers, Defer Kopf and Go (Amended by ADR-073)βœ…

Security & Compliance​

#TitleStatus
011API Security Mode Selection β€” mTLS / OAuth2 / Hybridβœ…
015Token Optimization ArchitectureπŸ“‹
018Security Hardening P0 β€” Team Coca Pentestβœ…
026Multi-IAM Federation Pattern β€” Zero User Storage (Superseded by ADR-074)πŸ”„
027X.509 Header Authenticationβœ…
028RFC 8705 Certificate Bindingβœ…
029mTLS Certificate Lifecycleβœ…
039Rust Gateway mTLS Cert-Bound Tokensβœ…
044MCP OAuth 2.1 Gateway Proxy Architectureβœ…
054RBAC Taxonomy v2 β€” Persona Roles & Display Namesβœ…
056FAPI 2.0 Security Architectureβœ…
074Tenant Model β€” One Realm, Tenant Groups, tenant_id Claimβœ…
075Secrets Backend β€” OpenBao Through the Vault APIβœ…
077Postgres Row-Level Security for Tenant Isolation (Proposed, reserved β€” stoa#3282)πŸ“‹

MCP & AI Gateway​

#TitleStatus
012MCP Tools Architecture β€” RBAC & Multi-Tenant Governanceβœ…
020Runtime Data Governanceβœ…
021UAC-Driven ObservabilityπŸ“‹
022UAC Tenant Architectureβœ…
023Zero Blind Spot Observabilityβœ…
024Unified Gateway Architecture β€” 4 Deployment Modesβœ…
046MCP Federation ArchitectureπŸ“‹
047MCP Skills System β€” Context InjectionπŸ“‹
048Integrated Chat Agent ArchitectureπŸ“‹
051Lazy MCP Discovery with Cache-First Patternβœ…
066STOA Token Compression (STC) β€” Lossless Response Compression for LLM Agentsβœ…
067UAC as LLM-Optimized Executable ContractπŸ“‹

Performance & Observability​

#TitleStatus
008Semantic Response Caching β€” pgvector Strategyβœ…
009Error Snapshots β€” Time-Travel Debuggingβœ…
049Enterprise AI-Native Gateway Benchmarkβœ…
050Guardrails V2 β€” Token Budget State Managementβœ…
052Benchmark OpenSearch Persistence & LLM Routingβœ…
053LLM Cost-Aware Routingβœ…
068Audit Log Actor and Resource Viewsβœ…

Gateway & Deployment​

#TitleStatus
034Python to Rust Migration Strategy (Superseded by ADR-073)πŸ”„
036Gateway Auto-Registration β€” Zero-Config Onboardingβœ…
037Deployment Modes β€” Sovereign First Strategyβœ…
038Sidecar Deployment on VM InfrastructureπŸ“‹
057Product Lineup β€” STOA Gateway, STOA Link, STOA Connect (Amended by ADR-073)βœ…
058Pingora Integration β€” Embedded Connection Pool (Superseded by ADR-073)πŸ”„
070Gateway Fail-Closed Postureβœ…
073Adopt Envoy as the STOA Data Planeβœ…

Frontend & UX​

#TitleStatus
032Response Transformation β€” Pluggable Adaptersβœ…
033Shared UI Components β€” Theme Abstractionβœ…
055Portal/Console Governance β€” Clear Separation of Concernsβœ…
060AI-Verified UI Testing Framework β€” 4-Layer Validationβœ…

Business & Strategy​

#TitleStatus
019Business Model & Moat Strategyβœ…
041Plugin Architecture β€” Community Core vs Enterprise Extensionsβœ…

Developer Experience & AI Workflow​

#TitleStatus
030AI-Native Context Management Architecture (Partially Superseded by ADR-062)βœ…
061Council Multi-Stage Review Systemβœ…
062CLAUDE.md Hierarchy Replaces .claude/rules/βœ…
063SDD Level 1 + stoa-impact MCP Knowledge Agentβœ…
065STOA PR Guardian β€” Advisory AI Review on GitHub Actionsβœ…

Planned ADRs​

#TitlePriority
010Blockchain Decision β€” Digital Euro 2027+Low
013Idempotency & Saga Patterns β€” Exactly-Once for B2BMedium
014Delivery Guardrails β€” Canary & SLO Auto-FreezeMedium
016Release Engineering β€” Git Workflow & VersioningHigh
017Kafka/Redpanda Internal-Only β€” Zero External ExposureMedium

Legend: βœ… Accepted Β· πŸ“‹ Draft/Proposed Β· πŸ”„ Superseded

Technology Choices Overview​

CategorySTOA ChoiceAlternativesRationale
MessagingRedpanda (Kafka API)RabbitMQ, NATSEvent sourcing, replay, internal-only
DatabasePostgreSQLMySQL, MongoDBACID, JSONB, shared schema + tenant_id (ADR-074)
AuthKeycloak (stoa realm)Auth0, OktaSelf-hosted, single realm + tenant groups (ADR-074)
ObservabilityPrometheus + Grafana + OpenSearch + TempoDatadog, ELKOpen source, K8s-native, OTLP
GitOpsArgoCDFlux, JenkinsUI, multi-cluster (ADR-007)
On-Site Agent & xDSSTOA Link (stoa-connect, Go)Custom pushOutbound SSE, gateway adapters & loopback mTLS ADS (ADR-057, ADR-059)
Data Plane (target)Upstream Envoy + STOA external servicesCustom Rust/Pingora proxyBattle-tested L4/L7 proxy + ext_authz / MCP services (ADR-073)
Data Plane (current)STOA Gateway (Rust/Tokio/axum)Python prototypeProduction / Maintenance + ExtAuthzService gRPC (ADR-073)
SearchOpenSearchElasticsearchApache 2.0, AWS-free
SecretsOpenBao (Vault API)HashiCorp Vault, InfisicalMPL 2.0, audit included, Vault API kept (ADR-075)

Guiding Principles​

PrincipleApplication
Open Source firstAvoid lock-in, contribute upstream
K8s-nativeOperators, CRDs, GitOps
Right tool for the jobEnvoy for L4/L7 proxy, Rust for authz/MCP, PostgreSQL for ACID
Self-hosted possibleNo mandatory SaaS dependency
Permissive licenseApache 2.0, MIT β€” avoid GPL, SSPL
Cloud-agnosticNo mandatory managed service

ADR Template​

Use the template below to create new ADRs.

# ADR-XXX: [Title]

## Metadata
| Field | Value |
|-------|-------|
| **Status** | πŸ“‹ Draft / βœ… Accepted / ❌ Rejected / πŸ”„ Superseded |
| **Date** | YYYY-MM-DD |
| **Linear** | [CAB-XXX](link) |

## Context
[Why is this decision needed?]

## Decision
[What was decided?]

## Consequences
### Positive
### Negative
### Mitigations

## References

Cookies and privacy

With your permission, we use cookies to measure visits and understand navigation to improve the site.

Learn more

Google Analytics measures visits and useful clicks. Microsoft Clarity provides masked interaction replays. No advertising use. Your choice is saved for six months. You can change or withdraw it at any time using the β€œCookies” button.

Read the audience measurement details