Technical architecture documentation for the Ambient Code Platform.
The Ambient Code Platform follows a Kubernetes-native microservices architecture with Custom Resources, Operators, and Job-based execution.
User → Frontend → Backend API → K8s Operator → Runner Jobs → Claude Code CLI
- System Context - High-level system boundaries and external integrations
- Component Architecture - Individual component designs
- Data Flow - How data moves through the system
- Security Architecture - Authentication, authorization, and security patterns
Architecture Diagrams - Visual system representations
- Platform Architecture - Complete system diagram
- Component Structure - Component relationships
- Deployment Stack - Deployment topology
- Agentic Session Flow - Session lifecycle
- UX Feature Workflow - Multi-agent workflow
Purpose: Web interface for session management and monitoring
Key Features:
- Project and session CRUD operations
- Real-time WebSocket updates
- Repository browsing
- Multi-agent chat interface
Documentation: components/frontend/README.md
Purpose: REST API managing Kubernetes Custom Resources
Key Features:
- Project-scoped endpoints with multi-tenant isolation
- User token-based authentication
- Git operations (clone, fork, PR creation)
- WebSocket support for real-time updates
Documentation: components/backend/README.md
Purpose: Kubernetes controller watching Custom Resources
Key Features:
- Watches AgenticSession CRs and creates Jobs
- Monitors Job execution and updates CR status
- Handles timeouts and cleanup
- Manages runner pod lifecycle
Documentation: components/operator/README.md
Purpose: Job pod executing Claude Code CLI
Key Features:
- Claude Code SDK integration
- Multi-agent collaboration
- Workspace synchronization via PVC
- Anthropic API streaming
Documentation: components/runners/claude-code-runner/README.md
AgenticSession - Represents an AI execution session
- Spec: prompt, repos, interactive mode, timeout, model
- Status: phase, startTime, completionTime, results
ProjectSettings - Project-scoped configuration
- API keys, default models, timeout settings
- Namespace-isolated for multi-tenancy
RFEWorkflow - Request For Enhancement workflows
- 7-step agent council process
- Multi-agent collaboration
- Each project maps to a Kubernetes namespace
- RBAC enforces namespace-scoped access
- User tokens determine permissions
- No cross-project data access
- Authentication: OpenShift OAuth (production) or test tokens (dev)
- Authorization: User tokens with namespace-scoped RBAC
- Backend Pattern: Always use user-scoped K8s clients for operations
- Security: Token redaction, no service account fallback
See ADR-0002: User Token Authentication
ADR Directory - Why we made key technical decisions
| ADR | Title | Status |
|---|---|---|
| 0001 | Kubernetes-Native Architecture | Accepted |
| 0002 | User Token Authentication | Accepted |
| 0003 | Multi-Repo Support | Accepted |
| 0004 | Go Backend + Python Runner | Accepted |
| 0005 | Next.js + Shadcn + React Query | Accepted |
Format: We follow the ADR template for all architectural decisions.
- User submits session via web UI
- Frontend sends POST to
/api/projects/:project/agentic-sessions - Backend validates user token and creates
AgenticSessionCR - Operator watches CR, creates Kubernetes Job
- Job runs Claude Code runner pod
- Runner executes Claude Code CLI, streams results
- Operator monitors Job, updates CR status
- Frontend displays real-time updates via WebSocket
User Input → Frontend (Next.js)
↓
Backend API (Go) → User Token Validation → RBAC Check
↓
Kubernetes API → AgenticSession CR created
↓
Operator (Go) → Watches CR → Creates Job
↓
Runner Pod (Python) → Executes Claude Code → Streams events
↓
Operator → Updates CR Status
↓
Backend → WebSocket → Frontend → User sees results
- OpenShift OAuth (production) - Cluster-based identity
- User Tokens - Bearer tokens for API authentication
- Service Accounts - Limited to CR writes and token minting
- Namespace-scoped RBAC - Users only see their authorized projects
- User-scoped K8s clients - All API operations use user credentials
- No privilege escalation - Backend never falls back to service account
- Unit Tests - Component logic testing (Go, TypeScript)
- Contract Tests - API contract validation (Go)
- Integration Tests - End-to-end with real K8s (Go)
- E2E Tests - User journey testing with Cypress (Kind cluster)
- Design Documents - Feature design proposals
- Proposals - Technical proposals
When proposing architectural changes:
- Check existing ADRs - Understand current decisions
- Draft ADR - Use template
- Discuss - GitHub Discussions or issue
- Review - Get feedback from maintainers
- Implement - Code + tests + documentation
- Update - Mark ADR as accepted, update relevant docs
Questions? Open a GitHub Discussion