Administrator Documentation — Deployment and Operations
Overview
Sovereign OS platform administration guide. Covers deployment, configuration, operations, and maintenance.
Deployment
Full Stack Deployment
# Start SurrealDB (persistent)
surreal start --user root --pass root --bind 127.0.0.1:8000 rocksdb:/workspace/scratch/surreal-data
# Deploy core strata (s00-s90)
scripts/deploy-truth-graph.ps1
# Deploy agent BFF
cd apps/agent-bff && DEV_SKIP_AUTH=1 SURREAL_URL=http://127.0.0.1:8000 node src/index.js
# Deploy truth BFF
cd apps/truth-bff && NODE_ENV=development DEV_SKIP_AUTH=1 TRUTH_GRAPH_SKIP_TRANSIT_TRAIL=1 PORT=3031 SURREAL_URL=http://127.0.0.1:8000 SURREAL_NS=africa SURREAL_DB=community_os node dist/index.js
# Start sovereign console
cd apps/sovereign-console && npm run dev
SDK Deployment
# Build SDK types
cd packages/sovereign-sdk && npx tsc --noEmit
# SDK is header-only — just include the TypeScript source
# No build step required beyond type checking
Compliance Gateway (requires --profile compliance)
docker compose -f docker/compose.microservices.yml --profile compliance build compliance-camel
docker compose -f docker/compose.microservices.yml --profile compliance up -d compliance-camel
curl http://localhost:8181/q/health
Configuration
Environment Variables
Agent BFF
DEV_SKIP_AUTH=1— bypass authentication (development only)SURREAL_URL=http://127.0.0.1:8000— SurrealDB endpointSURREAL_NS=africa— SurrealDB namespaceSURREAL_DB=community_os— SurrealDB database
Truth BFF
NODE_ENV=developmentDEV_SKIP_AUTH=1— bypass authenticationTRUTH_GRAPH_SKIP_TRANSIT_TRAIL=1— bypass signed transit trail guardTRUTH_GRAPH_SKIP_VAULT_GUARD=1— bypass vault guardPORT=3031— HTTP portSURREAL_URL=http://127.0.0.1:8000SURREAL_NS=africaSURREAL_DB=community_os
Sovereign Console
VITE_API_URL=http://127.0.0.1:3051— API base URLVITE_AGENT_BFF_URL=http://127.0.0.1:3030— Agent BFF URL
SurrealDB Seeds
Schema files deployed via surreal import:
database/schema/strata/s00_truth_graph_core.surqlthrough s90_kscaa_coredatabase/schema/strata/s135_user_presence.surqldatabase/schema/strata/s141_canonical_teams.surqldatabase/schema/strata/s143_mobile_agents.surqldatabase/schema/strata/s144_org_affiliations.surqldatabase/schema/strata/s145_canonical_organization.surqldatabase/schema/strata/s146_security_essentials.surqldatabase/schema/strata/s147_notification_delivery.surqldatabase/schema/strata/s148_file_attachments.surqldatabase/schema/strata/s150_entity_lifecycle_events.surqldatabase/schema/strata/s230_app_permissions.surqldatabase/schema/strata/s231_app_permission_events.surqldatabase/schema/strata/s232_secret_governance.surql
Operations
Health Checks
# Agent BFF health
curl http://127.0.0.1:3030/health
# Truth BFF health
curl http://127.0.0.1:3031/health
# SurrealDB status
surreal sql --query "SELECT * FROM health"
Common Issues
- EADDRINUSE on truth-bff port 3031
- Stop any existing truth-bff server
- Verify
PORTenv var isn't conflicting - Check
X-Vault-Scopeheader for mutations
- SurrealDB connection failures
- Verify
SURREAL_URLreaches the correct host - Ensure
rocksdb:/workspace/scratch/surreal-datapath exists - Check NS/DB settings match deployment
- Auth bypass not working
- Ensure
DEV_SKIP_AUTH=1is set - Send
Authorization: Bearer dev_<username>for manual auth - Verify Keycloak is not intercepting requests
Logs and Monitoring
- Agent BFF logs appear in console output
- Truth BFF:
npm run devshows vitest test results - SurrealDB:
surreal sqlfor queryable logs - NATS/JetStream: monitor via NATS management client
Backup and Recovery
- SurrealDB data:
rocksdb:/workspace/scratch/surreal-datadirectory - Export critical data via
surreal exportbefore major changes - Keep
database/seeds/directory under version control - Regular Gap Analysis Validation — Cross-Document Gap Audit reviews
AGENTS.md Mandate Compliance
Critical (must satisfy)
- ✅ Zero bespoke tables — all entities map to
claim,truth_node,truth_edge,resource,integration_entity - ✅ Declarative-first — business lookups in Camel YAML routes, Kestra workflows, NATS KV buckets
- ✅ No silent fallbacks — infrastructure errors propagate as 502/503/422, never synthétic "OPTIMAL"/"APPROVED" defaults
- ✅ No synthetic adapter payloads — no hardcoded coordinates, supplier IDs, or org IDs
- ✅ No un-production-ready hardcoded card/metric values — all UI values from live API responses
High (should satisfy)
- ✅ No bespoke schema changes — reuse existing primitives (claims, truth_nodes, fsm_binding, nats_outbox, etc.)
- ✅ Events over polling — NATS JetStream events for cross-system communication
- ✅ Prefer TypeScript over JavaScript —
.ts/.tsxextensions, leverage typechain - ✅ Avoid polling patterns — use NATS JetStream events,
nats_outbox→ publish → consumer - ✅ Auth callout JWT crafting —
audat root level, noissuer_accountin NATS nested obj
Medium (good to satisfy)
- ✅ Same DB isolation —
community_osshared by GRSE/Portfolio and hardened_mission - ✅
is_portfolioguard in provisioning functions - ✅
sharing_policyas single source of truth - ✅ Inherited capabilities via
fn::create_containment - ✅ Claims as fundamental primitive
Low (nice to satisfy)
- ✅ Background work uses events, not polling —
nats_outbox→ NATS publish → consumer - ✅ New governed capability PRs follow playbook checklist
- ✅ TypeScript preferred over JavaScript
- ✅ Seeds adapted for SCHEMAFULL resource table
Troubleshooting Guide
| Symptom | Cause | Fix |
|---|---|---|
EADDRINUSE on port 3031 | Another process on 3031 | lsof -i :3031 → kill; restart dev server cwd corrected to apps/truth-bff |
| Blank SPA page | Stray re; token in WorkflowDesignerPage.tsx | Remove the errant token; fixed in code |
\u2022 in password placeholder | Cosmetic CSS issue | Not a mount blocker; fix via branding CSS |
Cache-Control: public, immutable on JS bundles | Browser serves stale patched bundles | Entrypoint entrypoint.sh rewrites to no-cache, must-revalidate |
| Keycloak login redirect loop | KC_HOSTNAME=127.0.0.1:8081 double port | Use KC_HOSTNAME=host.docker.internal + KC_HOSTNAME_PORT=8081 |
422 Validation failed for environmentId should not be empty | JWT environmentId is null | Patched community.auth.service.js to fall back to member's environment; set environmentId in MongoDB members docs |
ECONNREFUSED 127.0.0.1:6379 in kutuma-ws | REDIS_HOST=localhost inside container | Set REDIS_HOST=kutuma-redis; recreate container with correct env |
Novu blueprint 401 from cloud | SPA calls dev.api.novu.co without creds | Leave as-is; external cloud call harmless; set REACT_APP_BLUEPRINTS_API_URL for self-hosted |