Platform services
Full description: Read the full narrative
| Control | Verified detail | Source |
|---|---|---|
| Passwords | scrypt N=16384, r=8, p=1 (RFC 7914 family); no plaintext | server/utils/passwords.ts:8-10 |
| JWT | HS tokens, TTL 1 h prod / 1 d dev; startup refuses JWT_SECRET < 32 chars in prod; refresh only for unexpired tokens of existing users | server/middleware/auth.ts:8,257-281 server/index.ts:171-181 |
| Lockout | 10 failed attempts → 15 min lockout, HTTP 423 | server/middleware/auth.ts:9-10,65-73,151 |
| Bootstrap admin | requires ADMIN_BOOTSTRAP_PASSWORD ≥ 16 chars in prod | server/middleware/auth.ts:104-110 |
| Rate limits | login 5/15 min; public data 300/min/IP; agent 30/min; local-ask 20/min; in-process map store | server/index.ts:306,307,9167-9168 server/middleware/rateLimiter.ts:8-80 |
| Tenant isolation | closed table set (chats, monitor_rules, scheduled_tasks, profiles, feedback); no user input in SQL strings | server/middleware/tenantIsolation.ts:5-20 |
| Validation | zod: message ≤ 10k; ≤ 4 images ≤ 8 MB; ≤ 12 history × 4 KB; sandbox code ≤ 20k, timeout 1–120 s | server/middleware/validate.ts:3-43 |
| Errors | canonical {error:{code,message}}, stacks hidden in prod; 413 on body overflow | server/middleware/errorHandler.ts:23-40 |
| SSRF guard | validateOutboundUrl + allowlist at outbound fetch sites | server/utils/ssrfGuard.ts:module SECURITY.md |
| Audit | auditLog → audit_logs on sandbox exec, simulate, deletes | server/middleware/audit.ts:3-19 |
Code execution & jobs
| Subsystem | Verified detail | Source |
|---|---|---|
| Sandbox | Python/Node/Bash via sandboxManager + e2b cloud option; concurrency caps 3 local / 10 cloud | server/index.ts:8655-8658 |
| Lite simulation engines | simplified in-process surrogates in server/sandboxV2 — farsiteLite (cellular ROS), adcircLite (storm-surge SWE), wrfLite, hysplitLite (particle dispersion), fnoSurrogate (Fourier neural operator) — named after, not reimplementations of, the operational models; earlier docs implied the originals (corrected) | server/sandboxV2:module files |
| Job queue | SQLite job_queue; 10 concurrent; maxAttempts 3; recurring: materialized-view refresh 60 s, plugin scan 30 s, synthetic data 1 h, KG stats 10 min | server/queue/simple-queue.ts:22-60,1013+ server/index.ts:1006-1039 |
| Plugins | install from URL/GitHub/raw/zip; toggle/remove; loads isolated with failure logging | server/pluginManager.ts:module server/index.ts:941-942 |
| E2E/eval harness | AI-chat golden + e2e scripts; evals + prompt lab under server/ml and scripts/ | package.json:16-29 |
Observability
| Signal | Implementation | Source |
|---|---|---|
| Logs | pino JSON + correlationId; heap log 60 s | server/observability/logger.ts:6,33,53-64 |
| Metrics | prom-client: http totals/duration, SSE gauge, sandbox/cache/db/tool/omninet counters at /api/metrics | server/observability/metrics.ts:13-86 |
| Tracing/errors | in-house OpenTelemetry-style tracing init + Sentry opt-in via SENTRY_DSN | server/index.ts:14450-14457 |
| Health | /api/health (+ /ready, /live) with component checks — measured payload on Getting started | server/index.ts:375-381 |
| OpenAPI | spec at /api/openapi.json + docs UI /api/docs (generated from routes/openapi.ts) | server/routes/openapi.ts:module server/index.ts:494 |