# eadmin2/jarvis_ai — AlpLab Radar Static Code Audit

- Ring: `watch`
- Category: `agents`
- Overall score: `3.3/5`
- Implementation check: `verified`
- Maturity: `dormant`
- Audited commit: `88998de8369e` (read-only; nothing from the repository was executed)
- Reviewed at: 2026-12-01T20:26:55Z
- Repository: https://github.com/eadmin2/jarvis_ai
- Radar entry: https://radar.alplab.co/#repo/eadmin2/jarvis_ai
- License: `MIT`
- Tags: `voice-assistant`, `hermes-agent`, `websockets`, `speech-to-text`, `hud`, `self-hosted`

## Summary

A self-hosted FastAPI voice pipeline that streams browser/PTT microphone audio over WebSocket through local faster-whisper STT, the Hermes Agent Sessions API (SSE), and streaming ElevenLabs TTS, fronted by a single-file HUD with live captions, stop/barge-in, approval cards, and agent-summoned holographic media panels via a bundled Hermes plugin.

## Implementation Check

Every core README claim maps to working code I read — partials in server.py `_maybe_schedule_partial`, stop/barge-in in `_cancel_active_turn`+`interrupt_note`, approvals in `post_approval`, panels in `/api/summon`+hud `summonPanel`, redaction in `SECRET_RES`/`_clean_for_tts`, GPU sidecar in worker/stt_server.py — only the optional worker_stats agent is broken as shipped.

## When to Use

Use if you already run Hermes Agent (v0.16-era API server) and want a polished LAN-only voice + HUD front-end on a Mac; do not use it internet-facing, on non-Hermes agent stacks, or where you need CI-backed reliability.

## Sub-scores

| Dimension | Score |
|---|---|
| quality | 4.0/5 |
| usability | 3.0/5 |
| reliability | 2.5/5 |
| security | 3.0/5 |
| integration | 4.0/5 |

## Code Evidence

server/server.py: `HermesAPI.chat_stream_events`/`_parse_sse` consumes the Hermes Sessions SSE stream (run.started, assistant.delta, tool.started, approval, run.completed usage); `VoicePipelineServer.stream_response_audio` sentence-splits and streams ElevenLabs PCM (`tts_chunks_sync`) while generation continues; `_cancel_active_turn` implements barge-in with `interrupt_note` plus remote `stop_run`; `SECRET_RES`/`_clean_for_tts` redact key-shaped strings before cloud TTS; `api_auth_middleware` gates `/api/*` on the JARVIS_HUD_TOKEN, `_ws_allowed` enforces Origin+cookie for browser WS, and `hermes_proxy`/`_proxy_allowed` is a strict path allowlist that injects the bearer key server-side. server/hud/index.html: `summonPanel` renders media panels with an 8s dedupe, `playChunk` carries the odd leftover byte across arbitrary frame splits, `showApproval` sends allow/deny over the WS, and an AudioWorklet (`pcm16k`) box-filter downsamples to 16 kHz int16. worker/stt_server.py: token-checked `/stt` with large-v3-turbo on CUDA; server.py `_remote_stt` falls back to local Whisper on failure. hermes-plugin/hud_display/tools.py: `hud_display` requires http(s) src and posts to `/api/summon`. client/client.py: real push-to-talk and openWakeWord loops with graceful device/error handling. server/scripts/ws_e2e_test.py: a genuine WS e2e harness (streams a WAV, asserts 16k mono, prints events/latency).

## Issues Found

worker/worker_stats.py:45 uses `os.environ.get` but the file never imports `os` (imports are json/subprocess/http.server/psutil) — every GET /stats request raises NameError, so the advertised remote-worker Machines stats are broken as shipped. server/hud/index.html `summonPanel` interpolates agent-supplied `title` and `src` into innerHTML without HTML-escaping (only `encodeURI` on src, and `embedURL` returns it raw), so a prompt-injected agent could inject attributes/script into the authenticated HUD page via /api/summon. Token checks in server.py `_request_authed`/`_ws_allowed` use `==` rather than constant-time comparison (minor on LAN).

## Key Risks

Requires a running Hermes Agent API server (loopback :8642) plus an ElevenLabs key; heavily macOS-centric (launchd plists, `say` in jarvis-smoke.sh, port-443 wildcard-bind note), Linux explicitly untested. No lockfiles/requirements files, no CI, and the only test is a manual e2e script needing the full stack — core path has no automated coverage. Nothing was executed in this review; latency and Hermes-API compatibility (v0.16 event names) are unverified. Auth is silently disabled if JARVIS_HUD_TOKEN is unset, and the plain-WS port 8765 is unauthenticated by design for native LAN clients.

## Reviewed Files

- `README.md`
- `docs/ARCHITECTURE.md`
- `docs/SETUP.md`
- `server/server.py`
- `server/hud/index.html`
- `server/config/server.example.yaml`
- `server/scripts/ws_e2e_test.py`
- `server/scripts/make-certs.sh`
- `server/scripts/jarvis-smoke.sh`
- `server/scripts/jarvis-health.sh`
- `client/client.py`
- `worker/stt_server.py`
- `worker/worker_stats.py`
- `hermes-plugin/hud_display/__init__.py`
- `hermes-plugin/hud_display/plugin.yaml`
- `hermes-plugin/hud_display/schemas.py`
- `hermes-plugin/hud_display/tools.py`
- `launchd/com.jarvis.voice.plist`
