9.8 KiB
Software Requirements Specification (SRS): The Sentinel Quantum Dynamics Engine & Active Pipeline
Updated: April 2, 2026 Status: Current truth after code implementation and AWS/NVMe deployment recovery
1. Purpose
The Sentinel is the biometric and engagement intelligence module inside Project Velocity. It combines local perception capture, broker-facing live session controls, scene-aware biometric scoring, trackable asset notifications, and automated lead enrichment into one operational pipeline.
The current implementation is no longer a purely planned architecture. The backend, frontend session flow, PostgreSQL schema, CCTV ingestion path, scene upload path, notification center, and test harness all exist in the repository. The live backend deployment has also been rebuilt on the AWS NVMe-backed node.
2. Current Architectural Truth
The architecture now operates as four cooperating layers:
-
Perception Layer MediaPipe Face Landmarker runs in the frontend via
app/src/hooks/useMediapipeFaceLandmarker.ts. The browser captures webcam frames locally and emits compact blend-shape packets rather than raw video. -
Application Layer FastAPI runs from
backend/main.py. It exposes Sentinel WebSocket endpoints, Vault endpoints, Scenes upload endpoints, CCTV ingestion endpoints, and authentication. -
Data Layer PostgreSQL is the system of record. The core schema is in
backend/db/schema.sqlandbackend/db/schema_addendum.sql. Session, CCTV, vault, consent, scene maps, and omnichannel logs are persisted here. -
Reasoning Layer NemoClaw prompt logic is implemented in
backend/services/nemoclaw_client.py. The current production-truth inference path is NVIDIA-hosted OpenAI-compatible chat completions, not local Ollama. OpenShell and Ollama still exist on the node as related runtime infrastructure, but the FastAPI backend currently uses NVIDIA as the primary scoring path.
3. Current Runtime Topology
AWS node public IP as of April 2, 2026: 54.152.236.10
Ports:
22SSH443nginx TLS reverse proxy127.0.0.1:8001FastAPI/Uvicorn backend127.0.0.1:5432PostgreSQL8080OpenShell gateway / NemoClaw gateway bootstrap target11434local Ollama runtime
Storage and runtime paths:
- Backend release root:
/opt/dlami/nvme/velocity/current - Backend environment file:
/opt/dlami/nvme/velocity/env - Backend virtualenv:
/opt/dlami/nvme/velocity/venv - Backend TLS cert/key:
/opt/dlami/nvme/velocity/tls/velocity.crtand/opt/dlami/nvme/velocity/tls/velocity.key - Prompt directory:
/opt/dlami/nvme/nemoclaw/prompts - PostgreSQL data directory:
/opt/dlami/nvme/pgdata/14/velocity - Asset directory:
/opt/dlami/nvme/assets - Marketing-video directory:
/opt/dlami/nvme/assets/videos - Marketing-video catalog:
/opt/dlami/nvme/assets/videos/catalog.json
Systemd units:
velocity-backend.servicepostgresql@14-velocity.servicenginxnemoclaw-velocity.service
4. Frontend Truth
Implemented frontend components:
-
app/src/components/modules/Sentinel.tsxProvides the Sentinel subtab structure withOverviewandLive Session. -
app/src/components/modules/sentinel/SentinelLiveSession.tsxImplements the live workflow with:select-video -> select-mode -> select-lead -> session -> summaryIt now also includes scene CSV upload in the video-management flow, searchable assigned-mode lead selection, and hover-preview marketing video cards sourced from the backend catalog. -
app/src/components/modules/sentinel/PerceptionPlayer.tsxPlays the video, opens webcam capture, emits biometric packets every 500ms, receives QD updates, and closes the session through the backend on video end. -
app/src/components/layout/NotificationCenter.tsxDisplays live notifications from the backend for vault opens, QD spikes, and lead-tagging events. -
app/src/hooks/useVelocitySocket.tsUses the correct backend WebSocket namespace:/api/sentinel/ws/notifications/api/sentinel/ws/perception
5. Backend Truth
Implemented backend routers:
-
backend/routers/sentinel.pyHandles:/api/sentinel/ws/notifications/api/sentinel/ws/perception/api/sentinel/consent/api/sentinel/session/complete/api/sentinel/tag-lead/api/sentinel/qd-score/{lead_id} -
backend/routers/vault.pyHandles trackable asset delivery andWS_ASSET_OPENEDbroadcast. -
backend/routers/scenes.pyHandles:POST /api/scenes/uploadGET /api/scenes/{video_asset_id} -
backend/routers/videos.pyHandles:GET /api/videos/marketingReturns catalog-driven or directory-scanned marketing videos for the live-session picker. -
backend/routers/cctv.pyHandles:POST /api/cctv/eventPOST /api/cctv/finalize-auto-mode
Implemented backend services:
-
backend/services/nemoclaw_client.pyNVIDIA API primary inference client, scene-aware QD scoring, lead tagging, CCTV visitor profiling, and malformed JSON recovery. -
backend/services/auto_mode_matcher.pyPost-session matching for auto mode using plate history, tag overlap, and fallback auto-lead creation. -
backend/db/pool.pyasyncpg connection pool for FastAPI.
6. Database Truth
The following tables are part of the current truth:
users_and_rolesleads_intelligencevelocity_vault_assetsomnichannel_logsconsent_logvideo_scene_mapsperception_sessionscctv_events
The addendum schema is no longer optional planning material. It is part of the required production schema.
6A. Marketing Video Asset Truth
The Sentinel live-session picker is no longer hardcoded to mock cards. The current truth is:
- The frontend requests
GET /api/videos/marketing - The backend reads
/opt/dlami/nvme/assets/videos/catalog.jsonwhen present - The backend falls back to recursive video discovery inside
/opt/dlami/nvme/assets/videos - The selected asset is streamed through
/assets/videos/<file> - The four current walkthrough assets are:
eden-devprayag.mp4sugam-prakriti.mp4atri-aqua.mp4atri-surya-toron.mp4
This matters because adding more walkthrough assets is now a backend-content operation, not a frontend rebuild requirement.
7. NemoClaw / Reasoning Truth
The original plan assumed local agent-contained reasoning through OpenShell plus local Ollama. That is no longer the active scoring path.
Current truth:
- The backend client uses NVIDIA-hosted OpenAI-compatible completions as primary inference.
- Current primary model:
nvidia/nemotron-3-super-120b-a12b - Current fallback model:
nvidia/llama-3.3-nemotron-super-49b-v1 - Local Ollama remains installed on
11434but is not the active backend primary. - OpenShell gateway remains present on
8080and is bootstrapped bynemoclaw-velocity.service.
Reason for this change:
- The local Ollama path was not reliably producing the strict JSON contract needed for QD scoring.
- The NVIDIA path is OpenAI-compatible and easier to integrate directly from FastAPI.
- The NVIDIA path is now what the code and live environment are configured to use.
8. Milestone Truth
Milestone 1: Complete Database schema, auth dependencies, store/types, and live PostgreSQL deployment exist.
Milestone 2: Complete Vault generation, notification ingestion, and frontend notification center are implemented.
Milestone 3: Complete Perception pipeline frontend, live session flow, and packet emission are implemented.
Milestone 4: Complete NemoClaw prompt system and backend scoring/tagging routes are implemented. The inference truth changed from local Ollama-first planning to NVIDIA-primary production use.
Milestone 5: Code complete, operational feed integration still pending
CCTV router, OCR bridge script, and auto-mode matcher exist. What remains is wiring a real ONVIF/RTSP/OCR producer into /api/cctv/event.
Milestone 6: Complete Scene upload backend, scene lookup, frontend upload UI, and scene-aware packet correlation are implemented.
Milestone 7: Complete NVMe-backed backend deployment, env file, PostgreSQL, systemd, nginx TLS, and prompt placement are in place.
Milestone 8: Complete at repo test level, still desirable to run a broker-facing live acceptance pass Backend pytest tests and frontend Playwright tests exist and pass locally.
9. Known Risks
-
NVIDIA model JSON consistency The NVIDIA model is reachable and active, but it does not always honor strict JSON perfectly for the full QD prompt. The client now includes malformed-response recovery, but this remains the main live inference risk.
-
Dynamic public IP churn The node public IP changed during execution. The system still needs either an Elastic IP or a stable DNS record.
-
Self-signed TLS nginx currently serves TLS, but a trusted certificate path is still preferable for production rollout.
-
External CCTV source not yet hard-connected The ingest API exists, but a real external bridge process still needs to be pointed at it in production.
-
Video catalog hygiene If operators copy MP4s to NVMe without updating
catalog.json, the fallback scan will keep the assets visible, but broker-facing order and labels may become inconsistent.
10. Acceptance Criteria
The Sentinel is considered aligned with current truth when all of the following hold:
https://54.152.236.10/healthreturns backend statusok- PostgreSQL is live on NVMe and all eight tables exist
velocity-backend.serviceis activenginxis active on443nemoclaw-velocity.serviceis activePOST /api/scenes/uploadaccepts a valid CSVPOST /api/cctv/eventpersists a CCTV eventPOST /api/sentinel/session/completefinalizes assigned or auto sessionsGET /api/videos/marketingreturns the current marketing-video catalog- Live QD updates are visible in the frontend through the Sentinel WebSocket path
- Playwright tests and backend tests pass
11. Appendices
Related documents:
velocity_status_report.mdnemoclaw_setup_truth.mdThe Sentinel Bibel.md