# Command Dashboard Real Operator Handoff to Existing Dashboards

Use after a sensitive command dashboard has a safe operator demo and runtime-configured legacy-link validator, but user testing shows the dashboard is still too passive because links to existing working dashboards are `not_configured`.

## Trigger

- User says the command dashboard opens but is not practically usable as an operator workspace.
- Settings shows Finance/AutoShorts/other existing dashboard links as `not_configured` even though those dashboards exist locally.
- Goal is link-only handoff, not more mock polish or new domain actions.

## Pattern

1. **Do not build feature illusions**
   - Do not add more placeholder cards/text as the main deliverable.
   - Do not add Approve/Reject, upload, render, publish, report-open, iframe, media preview, or raw-domain-data features.
   - Keep JARVIS/command dashboard as the handoff layer.

2. **Discover existing dashboards structurally**
   - Inspect README/package files/start scripts only.
   - Avoid opening runtime DBs, media folders, Health files, raw reports, or credentials.
   - Identify backend health endpoints and frontend dev commands.

3. **Create a dedicated handoff harness outside `make verify`**
   - Add `make handoff`, `make handoff-stop`, and `make smoke-operator-handoff`.
   - Start/stop scripts should live under `scripts/start-operator-handoff.sh`, `scripts/stop-operator-handoff.sh`, `scripts/smoke-operator-handoff.sh` or equivalent.
   - PID files and logs go only under ignored `.tmp/operator-handoff/`.
   - Do not kill foreign processes; if a port is occupied, select a free local/Tailnet-bound port and print it.

4. **Bind for operator access at runtime, not in code**
   - Derive Tailnet IP with `tailscale ip -4` when available; fallback to `127.0.0.1`.
   - Never hardcode Tailnet IPs or productive URLs in code/docs/tests.
   - Print actual URLs at startup so the user can test:
     - JARVIS Dashboard
     - JARVIS API
     - Finance Dashboard
     - AutoShorts/other dashboard
   - Use runtime env such as:
     - `JARVIS_DEMO_MODE=1`
     - `JARVIS_ACTIONS_ENABLED=0`
     - `JARVIS_ALLOW_TAILNET_LINKS=1`
     - `JARVIS_OPERATOR_DEMO_PROFILE=mixed_readonly_handoff`
     - `FINANCE_LEGACY_DASHBOARD_URL=http://<runtime-host>:<port>`
     - `AUTOSHORTS_LEGACY_DASHBOARD_URL=http://<runtime-host>:<port>`
     - `HEALTH_LEGACY_DASHBOARD_URL=` unless a safe Health status dashboard exists.

5. **Launch existing dashboards safely**
   - Start only local backends/frontends needed for UI handoff.
   - Use temp ignored DB/storage roots for demo-only systems if the backend needs a database.
   - Do not seed/POST/import unless the user explicitly requested it and it is safe.
   - For frontend CORS quirks, prefer a port/origin the existing backend already allowlists rather than patching another repo during the handoff phase.

6. **Make settings prove usefulness**
   - `/api/demo-info` may include only safe metadata:
     - `mode=mixed_readonly_handoff`
     - `actions_enabled=false`
     - module list
     - `runtime_access=optional_readonly`
     - `legacy_links.finance=configured|not_configured|blocked`
     - `legacy_links.autoshorts=configured|not_configured|blocked`
   - Never expose full URLs, ports, paths, or tokens in `/api/demo-info` or Settings.
   - The UI Settings page should show configured/not_configured/blocked, not raw links.

7. **Smoke the actual operator value**
   `make smoke-operator-handoff` should start a real handoff, then verify:
   - JARVIS frontend/API reachable.
   - Existing Finance/AutoShorts (or analogous) dashboard URLs reachable.
   - `/api/demo-info` reports configured links and `actions_enabled=false`.
   - Key JARVIS routes (`/finance`, `/autoshorts`, `/approvals`, `/reports`, `/settings`) reachable.
   - No iframes and no active Upload/Render/Publish/Approve buttons in the command dashboard shell.
   - API output has no secrets, local paths, media names, raw Health/Finance values, stack traces, or raw responses.
   - Stop services at smoke exit, but when starting the user-facing `make handoff`, leave them running until the user says to stop.

## Verification to report

Run and report real output:

```bash
make test-gateway
make dashboard-test
make dashboard-build
python3 scripts/verify-repo-safety.py
make verify
make smoke-operator-handoff
make handoff
curl -fsS http://<runtime-host>:<jarvis-port>
curl -fsS http://<runtime-host>:<finance-port>
curl -fsS http://<runtime-host>:<autoshorts-port>
```

Then commit/push and verify remote SHA. If GitHub Actions are not visible due `403`, say so; do not claim CI green.

## Pitfalls

- `demo_mock` with all links `not_configured` is not an operator handoff; it is only a technical demo.
- Tailscale Serve may require sudo/operator configuration; direct Tailnet-IP binding is an acceptable runtime workaround if documented and not hardcoded.
- Existing dashboards may expose their own action buttons; JARVIS must remain link-only and must not call their mutation APIs.
- Avoid using raw Tailnet/IP examples in committed tests; use reserved/synthetic Tailnet-range examples when testing validators.
