rdev/docs/architecture/diagrams/sequence-command.mmd
jordan 72d16929ca feat: Implement hexagonal architecture with services, webhooks, queue, and telemetry
Major refactoring to hexagonal (ports & adapters) architecture:

- Add service layer (apikey_service, project_service) for business logic
- Add webhook system with dispatcher and delivery tracking
- Add command queue with priority-based processing
- Add rate limiting with sliding window algorithm
- Add audit logging for command execution
- Add OpenTelemetry integration (traces, metrics, spans)
- Add circuit breaker for fault tolerance
- Add cached repository wrapper for performance
- Add comprehensive validation package
- Add Kubernetes client integration for pod management
- Add database migrations (allowed_ips, audit_log, rate_limiting, queue, webhooks)
- Add network policy and PodDisruptionBudget for k8s
- Remove legacy executor and projects/registry packages
- Untrack secrets.yaml (now managed via envault)
- Add coverage.out to .gitignore
- Add e2e test infrastructure with docker-compose
- Add comprehensive documentation (API, architecture, operations, plans)
- Add golangci-lint config and pre-commit hook

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 19:57:46 -07:00

39 lines
884 B
Plaintext

---
title: Command Execution Sequence
---
sequenceDiagram
participant C as Client
participant H as Handler
participant S as Service
participant E as Executor
participant P as Pod
participant SM as StreamManager
C->>H: POST /projects/{id}/claude
H->>H: Validate request
H->>S: ExecuteClaude(req)
S->>S: Sanitize prompt
S->>E: Execute(cmd, podName, outputFn)
E->>P: kubectl exec
activate P
Note over C,SM: Client connects to SSE stream
C->>H: GET /projects/{id}/events?stream_id=xxx
H->>SM: Subscribe(streamID)
SM-->>C: event: connected
loop Output streaming
P-->>E: stdout/stderr line
E->>SM: Send("output", line)
SM-->>C: event: output
end
P-->>E: exit code
deactivate P
E->>SM: Send("complete", result)
SM-->>C: event: complete
C->>C: Close SSE connection