> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bossmode.ing/llms.txt
> Use this file to discover all available pages before exploring further.

# Governance

> Live KPI tiles, eval harness, connector health checks, team hierarchy, and role-based access control — the full governance layer for a multi-operator deployment.

## Live KPI dashboard

The `/dashboard/metrics` page shows the numbers that matter at a glance: revenue this week, packets executed, approvals pending, cost last 7 days, and eval pass rate. Six tiles. A 30-day sparkline for each. Auto-refreshes every 60 seconds.

```bash theme={null}
GET /api/pro/kpi
```

The Convex query `kpi.getSnapshot(teamId?)` aggregates across existing tables — revenue events, execution work packets, approval requests, consigliere actions, and the audit dashboard — in under 500 ms on a mid-sized tenant. Pass a `teamId` to scope the snapshot to a single team.

<img src="https://mintlify.s3.us-west-1.amazonaws.com/bossmode/agent-deployer/images/kpi-dashboard.png" alt="KPI metrics dashboard" />

## Eval harness

Before you push a standing order change to production, run an eval. The eval harness executes a named test suite against the change and returns a structured pass/fail report.

Three eval kinds ship out of the box:

| Kind                           | What it checks                                                              |
| ------------------------------ | --------------------------------------------------------------------------- |
| `standing_order_safety`        | Blast-radius overrides, missing approval gates, runaway budget instructions |
| `workflow_candidate_soundness` | Leverage score, multipliers, and rationale are internally consistent        |
| `skill_definition_syntax`      | Shared skill JSON/markdown schema is valid                                  |

```bash theme={null}
POST /api/pro/evals/run
{
  "name": "Pricing order safety check",
  "targetEntityType": "standing_order",
  "targetEntityId": "so_abc123"
}
```

Results land in the `evalRuns` table with `score`, `passed`, and `findings`. The `/dashboard/evals` page lists every run with a one-click re-run button.

<img src="https://mintlify.s3.us-west-1.amazonaws.com/bossmode/agent-deployer/images/evals.png" alt="Eval harness view" />

## Connector health

The `/dashboard/connectors` page shows a status pill for every connected system: green (healthy), yellow (degraded), or red (failing). A health check action runs on cron and logs results to the `connectorHealthChecks` table.

No new connectors are registered through this surface — it reflects the state of your existing `agentConnections` records. Use it as your operational status board.

## Teams and RBAC

Group operators into teams with scoped permissions. A Marketing team sees only Marketing standing orders and packets; Finance sees only Finance. Isolation is enforced at the Convex mutation level via `lib/rbac.ts`.

Four roles are available: `owner`, `admin`, `operator`, `viewer`. Every new mutation in the Agent Deployer platform calls `assertRole` before writing.

```bash theme={null}
POST /api/pro/teams                   # Create team
POST /api/pro/teams/:id/members       # Invite member
DELETE /api/pro/teams/:id/members/:uid  # Remove member
```

The `/dashboard/teams` page lists teams, members, and pending invites. Only `owner` and `admin` roles can create teams or manage membership.

## Role-specific console

The dashboard top bar includes a role selector that filters the visible modules to what each role actually acts on:

| View      | Modules shown                               |
| --------- | ------------------------------------------- |
| `boss`    | Metrics, approvals, family report, roadmap  |
| `capo`    | Work packets, signals, their team's context |
| `auditor` | Eval runs, connector health, audit feed     |

View preference persists in `localStorage` and the URL param `?view=boss|capo|auditor`. Configure which modules appear in each view in `lib/dashboard-views.ts`.
