# Observatory Dashboard

The Gamma Observatory is Orxaq's web dashboard — a self-contained HTML page served by a local HTTP server.

## Launching

```bash
orxaq serve
```

This starts a local server on `http://localhost:8741` and opens the dashboard in your default browser. Use `--port` to change the port:

```bash
orxaq serve --port 9000
```

## Features

The dashboard provides a read-only view of the Orxaq system:

- **DAG Visualization** — Force-directed graph rendered with D3.js. Nodes are colored by causal role (exogenous, mediator, outcome). Edges show causal mechanisms.
- **ECL Metrics** — Total expected credit loss, mean PD, and validation status displayed as bento tiles.
- **Stress Test** — Baseline vs. stressed PD with delta.
- **Fair Lending** — Protected attribute analysis with direct and indirect effect decomposition.
- **Validation** — D-separation test results with pass/fail status and violation count.
- **Audit Trail** — Scrollable table of audit log entries with timestamps, actors, and actions. Auto-refreshes every 10 seconds.

## Architecture

The dashboard is a single self-contained HTML file (`gamma.html`) with inline CSS and JavaScript. It loads D3.js from CDN. All data comes from the local API server via `fetch()` calls to `/api/*` endpoints.

This design (ADR-022) means:

- No build step, no npm, no bundler
- Works offline (except D3.js CDN)
- Single file to audit for security review
- Deploys anywhere a Python process can run

## API Endpoints

The server exposes 8 JSON endpoints:

| Endpoint | Description |
|----------|-------------|
| `/api/status` | DAG summary and audit entries |
| `/api/ontology` | Credit ontology entities and edges |
| `/api/ecl` | CECL expected credit loss |
| `/api/stress` | Stress test results |
| `/api/fairness` | Fair lending decomposition |
| `/api/discover` | Causal discovery results |
| `/api/validate` | D-separation validation |
| `/api/audit` | Audit log entries |

All endpoints return JSON with CORS headers enabled.
