Repo: OpenSIN-Code/Code-Swarm
PR: #25 Launch CEO Transformation Playbook and enhance production stability
Branch: product-market-review → main
Updated: 2026-05-03
Mode: Plan only. No issue closes until its acceptance gate is green.
| Item | State |
|---|---|
| PR state | Open |
| Mergeability | Mergeable / clean |
| Vercel preview | Ready |
| Changed files | 21 |
| Additions / deletions | +2567 / -804 |
| Main themes | API gateway, WebSockets, CLI UX, persistence, MkDocs docs, version correction |
| Issue | Theme | Current plan status |
|---|---|---|
| #9 | API Gateway, gRPC, OpenAPI, rate limiting | Validate implementation before close |
| #10 | Kubernetes, HPA, Istio, multi-tenancy | Separate infra gate required |
| #11 | Real-time WebSockets and streaming | Validate auth, limits, backpressure |
| #12 | CLI UX with Rich, progress, autocomplete | Validate API-backed CLI workflows |
| #13 | MkDocs, Swagger, tutorials, architecture | Validate strict docs build |
| #14 | RLHF/self-improvement loops | P2 implementation plan required |
| #19 | Hybrid memory with Qdrant + Neo4j | P2 implementation plan required |
Merge is blocked until all checks are green:
- No real secrets in repository files.
-
.env.examplecontains placeholders only. -
README.md,SECURITY.md, docs, comments, and scripts contain no API keys, JWTs, passwords, service keys, or full DB URLs. - All required runtime values exist only in Infisical and deployment environment variables.
- Any token/key previously exposed in chat, docs, commits, or examples is rotated.
-
gitleaks detectis clean. -
trufflehog git file://.is clean.
- README status table matches code and tests.
- No “GA”, “production-ready”, or “100% complete” claim without verified tests and deployment evidence.
- Version remains beta unless all P0/P1 acceptance gates are green.
- Docs label P2 work as planned, not implemented.
- Unit tests pass.
- Auth/security tests pass.
- WebSocket tests pass.
- CLI smoke tests pass against a running API.
-
mkdocs build --strictpasses. - Vercel preview smoke test passes.
- PR diff has no hardcoded IPs, hostnames, or secrets.
- Manual QA notes are posted on PR #25.
Runtime configuration must be read from environment variables. Values must not be committed.
| Variable | Required for | Source of truth |
|---|---|---|
DATABASE_URL |
API persistence | Infisical + deploy env |
REDIS_URL |
rate limit/cache/queues | Infisical + deploy env |
SUPABASE_URL |
Supabase client | Infisical + deploy env |
SUPABASE_ANON_KEY |
public Supabase client | Infisical + deploy env |
SUPABASE_SERVICE_KEY |
server-only Supabase access | Infisical + deploy env |
SIMONE_MCP_URL |
Simone-MCP bridge | Infisical + deploy env |
PRIMARY_MODEL |
default agent model | Infisical + deploy env |
VISION_MODEL |
vision/look_at model | Infisical + deploy env |
SECRET_KEY |
JWT/session signing | Infisical + deploy env |
ALLOWED_ORIGINS |
CORS | Infisical + deploy env |
ENVIRONMENT |
runtime safety mode | deploy env |
SENTRY_DSN |
error monitoring | Infisical + deploy env |
Expected model defaults:
PRIMARY_MODEL=fireworks-ai/minimax-m2.7VISION_MODEL=nvidia/nvidia/nemotron-3-nano-omni
Scope:
- FastAPI REST endpoints.
- gRPC integration.
- OpenAPI/Swagger visibility.
- Rate limiting on every sensitive endpoint.
Acceptance:
-
api/main.pyimports cleanly. - App starts locally with required env vars.
-
/healthreturns healthy. -
/docsexposes accurate OpenAPI. - Rate limit test proves throttling.
- No hardcoded Simone URL/IP.
Scope:
- Helm chart.
- HPA.
- Istio or documented service mesh path.
- Multi-tenant configuration.
Acceptance:
-
helm lintpasses. -
helm templaterenders manifests. - HPA references real metrics.
- Secrets are referenced via Kubernetes Secret or external secret provider, never inline.
- Deployment guide includes k3s/OCI path and rollback.
Scope:
- JWT-authenticated real-time agent/task streams.
- Per-user limits.
- Backpressure.
- Monitoring endpoint.
Acceptance:
- Connect without token is rejected.
- Connect with invalid token is rejected.
- Connect with valid token succeeds.
- Per-user connection limit works.
- Message rate limit works.
- Backpressure warning is observable.
- Disconnect cleanup removes connection state.
Scope:
- Rich tables.
- Progress spinners.
- Autocomplete support.
- API-backed commands.
- Human-readable errors.
Acceptance:
-
code-swarm --helprenders. -
code-swarm loginstores token securely. -
code-swarm agentsworks against API. -
code-swarm tasksworks against API. -
code-swarm create-agentvalidates inputs. -
code-swarm create-taskvalidates priority. - API unavailable path returns clear error.
Scope:
- MkDocs.
- Swagger/OpenAPI reference.
- Architecture guide.
- CLI guide.
- Vercel deployment guide.
Acceptance:
-
mkdocs build --strictpasses. - Docs do not expose secrets.
- Architecture diagrams match code.
- API docs match OpenAPI output.
- Deployment guide uses environment variables only.
- README links point to real files.
Scope:
- Feedback capture.
- Error analysis.
- Bayesian optimization loop.
Acceptance for planning phase:
- Design document exists.
- Data model for feedback is specified.
- Privacy/security constraints are specified.
- Implementation tickets are created.
Acceptance for implementation phase:
- Feedback events persist.
- Scoring pipeline has tests.
- Opt-out/deletion path exists.
Scope:
- Qdrant vector memory.
- Neo4j graph memory.
- Adapter interface.
- Retrieval policy.
Acceptance for planning phase:
- Architecture document exists.
- Adapter contracts are specified.
- Data retention and deletion are specified.
- Implementation tickets are created.
Acceptance for implementation phase:
- Qdrant adapter tests pass.
- Neo4j adapter tests pass.
- Hybrid retrieval tests pass.
- Failure fallback is documented and tested.
Run from repository root after checking out PR #25 branch.
python -m pip install -r requirements.txt
python -m pytest tests/unit -q
python -m pytest tests/unit/test_security.py -q
python -m pytest tests/unit/test_core.py -q
python -m compileall api auth cli db simone_mcp streaming swarm_pipeline
mkdocs build --strict -f docs/mkdocs.yml
gitleaks detect --source . --no-git
trufflehog filesystem . --no-updateRuntime smoke:
ENVIRONMENT=development \
SECRET_KEY=dev-only-local-secret \
ALLOWED_ORIGINS=http://localhost:3000,http://localhost:5173 \
SIMONE_MCP_URL=http://localhost:8234 \
PRIMARY_MODEL=fireworks-ai/minimax-m2.7 \
VISION_MODEL=nvidia/nvidia/nemotron-3-nano-omni \
uvicorn api.main:app --host 127.0.0.1 --port 8000Then verify:
curl -fsS http://127.0.0.1:8000/health
curl -fsS http://127.0.0.1:8000/docs
python -m cli.main health- Link Vercel project to
OpenSIN-Code/Code-Swarm. - Configure env vars via Vercel dashboard/API, sourced from Infisical.
- Deploy preview from PR #25.
- Run browser/API smoke on preview.
- Promote to production only after gates pass.
- Prometheus metrics endpoint documented and tested.
- Grafana dashboard JSON added or linked.
- Sentry DSN configured in deploy env.
- Alerts configured for error rate, latency, auth failure spikes, and websocket connection pressure.
- Runbook documents owner, severity, and rollback.
- Vercel previous deployment rollback documented.
- Database migration rollback documented.
- Feature flags or env toggles documented for WebSockets and persistence.
- Check out
product-market-review. - Rebase/merge latest
mainif required. - Run all verification commands.
- Review changed files for env-only config.
- Review docs for truthfulness and secret leaks.
- Validate Vercel preview.
- Post verification evidence to PR #25.
- Merge PR #25 only after all gates pass.
- Close issues only after their acceptance criteria are verified.
- Rotate exposed tokens/secrets and purge them from examples.
- Replace
.env.examplevalues with placeholders. - Run secret scans and fix findings.
- Run tests and docs strict build on PR #25.
- Add missing tests for WebSockets, rate limits, and CLI API flows.
- Convert #14 and #19 into concrete implementation tickets.
- Complete Vercel env setup from Infisical and run preview smoke.
This plan is complete when the file is committed or intentionally left as a working-tree plan update. Execution must stop after creating/updating this plan unless explicitly asked to continue.