Repository navigation
Forward Development Plan
Canonical source:
docs/FORWARD_DEVELOPMENT_PLAN.md— this page is rendered from it on every publish; edit the source.
Date: 2026-04-07 Baseline: Full-lifecycle audit score 7.0/10 Goal: Raise to 9.0/10 — production-ready for staged public rollout
ClawAI is a self-hosted AI orchestration platform that routes prompts to the best model (local Ollama or 5 cloud providers), assembles context from memory + files + conversation history, and provides full routing transparency. It serves technical teams who need privacy-aware, multi-model AI with persistent context.
Current state: Strong foundation (8/10 backend, 8/10 frontend), weak in operational hardening (6/10 testing, 6/10 reliability).
To reach 9/10: Need streaming, E2E tests, circuit breakers, memory/file trust indicators, and onboarding.
Every gap from the audit, converted to implementable work with priority, effort, and acceptance criteria.
| # | Gap | Root Cause | Fix | Effort | Acceptance Criteria |
|---|---|---|---|---|---|
| 1 | No E2E tests | Playwright installed but empty | Write 5 critical flow tests: login→chat→response, upload→attach→grounded answer, model selector→verify provider, memory→verify influence, admin→role change | 3 days | All 5 pass in CI |
| 2 | No memory influence indicator | Frontend doesn't show which memories were used | Add "Informed by N memories" badge on assistant messages. Backend: include memory count in message.completed event. Frontend: display in MessageBubble | 1 day | Badge visible when memories injected |
| 3 | No file attribution indicator | Files influence answers invisibly | Add "Grounded in: filename.pdf" tag on messages. Backend: include fileIds in context metadata. Frontend: display file badges | 1 day | File names visible when files used |
| 4 | No onboarding wizard | New users see blank dashboard | Create first-run experience: detect empty state, show step-by-step guide (pull model, create thread, send message) | 2 days | First-time user completes guided flow |
| # | Gap | Fix | Effort | Acceptance |
|---|---|---|---|---|
| 5 | No TLS/HTTPS | Add self-signed cert for dev, Let's Encrypt for prod. Update Nginx config with SSL block. Add NGINX_SSL_CERT/KEY env vars | 1 day | HTTPS works on port 443 |
| 6 | No circuit breaker | Add opossum circuit breaker wrapping all inter-service HTTP calls in chat-service, routing-service, memory-service | 2 days | Circuit opens after 5 failures, closes after 30s |
| 7 | No real streaming | Replace polling with SSE token streaming. Update ChatExecutionManager to use stream:true. Pipe chunks through SSE controller. Frontend: EventSource with incremental render | 3 days | User sees tokens appear one by one |
| 8 | No vector embeddings for files | Add pgvector embedding column to FileChunk. Generate embeddings via Ollama embedding model. Add semantic search endpoint. Wire into ContextAssemblyManager | 3 days | Only relevant chunks injected (not all) |
| 9 | Health cache staleness | Add TTL to health cache entries (5 min). Add periodic refresh via setInterval. Add health re-validation before publishing message.routed | 1 day | Stale entries auto-expire |
| 10 | No integration tests in CI | Add docker-compose-based integration test job. Spin up PG+Mongo+RabbitMQ. Run cross-service flow tests | 2 days | CI runs integration tests on PR |
| # | Gap | Fix | Effort |
|---|---|---|---|
| 11 | Memory contradiction detection | Before storing extracted memory, check for conflicting existing memories of same type. Flag or replace | 2 days |
| 12 | Memory expiration | Add expiresAt field to MemoryRecord. Cron job or TTL to disable old memories |
1 day |
| 13 | Export functionality | Add export endpoints: thread as JSON/Markdown, memories as JSON, audit logs as CSV | 2 days |
| 14 | Keyboard shortcuts | Add cmd+k search, cmd+n new thread, cmd+enter send | 1 day |
| 15 | Tests for 0-test services | Add unit tests for client-logs-service and server-logs-service | 2 days |
| 16 | Model existence validation | After routing decision, verify model exists in connector's model catalog before execution | 1 day |
| # | Gap | Fix | Effort |
|---|---|---|---|
| 17 | Multi-tenant/org support | Add Organization model, scope all data by orgId | 5 days |
| 18 | Billing/usage quotas | Add quota enforcement based on usage ledger | 3 days |
| 19 | OpenTelemetry distributed tracing | Add OTel SDK, propagate spans across services | 3 days |
| 20 | Background job queue (BullMQ) | Move file processing + memory extraction to async jobs | 3 days |
| 21 | Load testing | k6 or Artillery scripts for critical endpoints | 2 days |
| 22 | Database consolidation | Merge 7 PG instances into 1-2 with schema isolation | 3 days |
| Module | Current (7.0) | Target (9.0) | Gap | Priority |
|---|---|---|---|---|
| Chat | 9/10 | 10/10 | Streaming, keyboard shortcuts | T1 |
| Routing | 8/10 | 9/10 | Health TTL, model validation, post-decision check | T1 |
| Memory | 7/10 | 9/10 | Influence indicators, contradiction, expiration | T0+T2 |
| Files | 6/10 | 9/10 | Embeddings, semantic search, attribution | T0+T1 |
| Context Assembly | 8/10 | 9/10 | Already solid, needs semantic file retrieval | T1 |
| Connectors | 9/10 | 9/10 | Done | — |
| Auth/RBAC | 9/10 | 9/10 | Done (add TLS) | T1 |
| Audit/Usage | 8/10 | 9/10 | Add export | T2 |
| Observability | 8/10 | 9/10 | Add distributed tracing | T3 |
| Docker/Install | 9/10 | 10/10 | Done | — |
| Frontend | 8/10 | 9/10 | Streaming, indicators, onboarding | T0+T1 |
| Testing | 6/10 | 9/10 | E2E, integration, load | T0+T1 |
| Security | 7/10 | 9/10 | TLS, circuit breaker | T1 |
| Reliability | 6/10 | 9/10 | DLQ (done), circuit breaker, health TTL | T1 |
- Day 1-2: E2E tests (5 critical flows)
- Day 2: Memory influence indicator + file attribution indicator
- Day 3-4: Onboarding wizard
- Day 4: Update all docs, .env, install scripts
- Day 1: TLS/HTTPS in Nginx
- Day 1-2: Circuit breaker for inter-service calls
- Day 2-3: Health cache TTL + refresh
- Day 3-5: Real token-by-token SSE streaming
- Day 1-3: Vector embeddings + semantic file search
- Day 3-4: Integration tests in CI
- Day 5: Model existence validation post-routing
- Day 1-2: Memory contradiction detection + expiration
- Day 2-3: Export functionality
- Day 3: Keyboard shortcuts
- Day 4-5: Tests for 0-test services
Total estimated: 4 weeks for a solo developer, 2 weeks for a 2-person team.
- Add: client-logs-service (~20 tests), server-logs-service (~20 tests)
- Add: ContextAssemblyManager tests, MemoryExtractionManager tests
- Target: 400+ tests
- Login → create thread → send message → verify response arrives
- Upload file → attach to message → verify grounded response
- Select specific model → send message → verify provider badge
- Create memory → send message → verify memory influence indicator
- Change routing policy → send message → verify policy applied
- message.created → routing → message.routed → execution → message.completed
- File upload → chunk → retrieve via internal endpoint
- Memory extraction → store → retrieve in next context assembly
- Connector health check → health cache update → routing decision
- 100 concurrent users sending messages
- 50 file uploads simultaneously
- Routing under all-providers-healthy vs degraded scenarios
- 5 E2E tests passing in CI
- Memory influence indicator visible
- File attribution indicator visible
- Onboarding wizard functional
- All services healthy
- 0 lint errors, 0 typecheck errors
- 350+ unit tests passing
- TLS/HTTPS enabled
- Circuit breakers on all inter-service calls
- Real SSE streaming
- Vector embeddings for files
- Integration tests in CI
- Health cache with TTL
- Model existence validation
- 400+ unit tests + 5 E2E + integration suite
- Load test baseline established
- Architecture: Clean microservice boundaries, event-driven, service-level data ownership
- Routing: 7 modes + Ollama-assisted AUTO + policy overrides — genuinely differentiated
- Context Assembly: Real pipeline with 4 sources, token budgeting, priority ordering
- Transparency: Users can see provider, model, confidence, reasons for every message
- Security: 9 layers (JWT, RBAC, rate limiting, Helmet, Zod, Prisma, encryption, redaction, CORS)
- DevX: Automated install, 563-line CLAUDE.md, Docker orchestration, hot reload
- i18n: 9 languages with RTL — unusual for an AI platform
- Documentation: 14 architecture docs, 200+ KB — exceptional for this stage
- Memory influence invisible — users don't know memories affect answers (trust gap)
- File attribution invisible — users don't know files affect answers (trust gap)
- No E2E tests — can't prove critical flows work (confidence gap)
- No onboarding — new users face blank dashboard (adoption gap)
- Real streaming — transform UX from "wait and see" to "watch it think"
- Semantic file search — make file grounding intelligent, not brute-force
- Circuit breakers — prevent cascading failures
- TLS — minimum for any non-local deployment
- Multi-tenant/org support (enterprise feature, not needed for initial users)
- Billing/quotas (premature — focus on adoption first)
- OpenTelemetry (X-Request-ID is sufficient for now)
- Database consolidation (7 PG instances work fine at current scale)
ClawAI is a serious product, not an experiment. The architecture is sound, the feature set is comprehensive, and the routing intelligence is genuinely differentiated. The path from 7.0 to 9.0 is clear and achievable in 4 weeks.
The single most important thing to do next is make the invisible visible — show users which memories and files influenced each answer. This is the difference between "technically works" and "users trust it."
Trajectory: Strong. Recommendation: Execute Tier 0 this week, ship beta.
ClawAI Wiki · source-controlled under wiki/ · generated/mirrored from the current repository knowledge layer.
ClawAI Wiki
Product
- Product-Vision
- Flagship-Features
- Business-Overview
- Requirements-Register
- Drift-Log
- Runtime-Managed-Connector-Providers
- Threads
- ADR-Index
Architecture
- System-at-a-Glance
- Architecture-Map
- System-Architecture
- Message-Flow
- End-to-End-Data-Flow
- Routing-Engine
- Event-Bus
- Security-Architecture
Platform
- Backend-Services
- Frontend-Architecture
- Shared-Packages
- Database-Reference
- API-Reference
- Provider-Catalog
- Memory-and-Context-Architecture
- File-Support-Architecture
- Research-and-Web-Crawling
Runtime & Ops
- Docker-Guide
- Nginx-Reference
- CI-CD-Pipeline
- Logging-and-Observability
- Operational-Runbooks
- Troubleshooting
Quality
Engineering OS
- AI-Native-Engineering-OS
- Generated-Manifests
- Rules-Catalog
- Skills-Catalog
- Context-Layer
- Engineering-Memory
- Tooling-and-Automation
- Scripts-and-Operations
- ESLint-and-Architecture-Enforcement
- Extended-Work-Skills
Agents
Reference