# Ship V1 — Fleet coverage pack (v1.2.x)

**DBAOps Sovereign™** — vertical slice: collector-ingested **backup**, **Always On**, **patch build**, **database inventory**, **SQL Agent job outcomes**, and **volume free space**, surfaced on the **Coverage** dashboard and in **Command Center** / **mobile** KPIs.

## What ships

| Area | Storage | Read API | Ingest |
|------|---------|----------|--------|
| Backup RPO | `backup.DatabaseBackupFact` | `GET /api/backup/summary` | `POST /api/ingest/fleet-facts` → `backup[]` |
| HADR | `hadr.AGReplicaFact` | `GET /api/hadr/replicas` | `hadr[]` |
| Patch / build | `patch.InstancePatchFact` | `GET /api/patch/status` (latest per instance) | `patch[]` |
| DB inventory | `inv.DatabaseInventoryFact` | `GET /api/inventory/databases` | `inventory[]` |
| Agent jobs | `ops.AgentJobRunFact` | `GET /api/jobs/recent` | `jobs[]` |
| Capacity | `cap.VolumeSpaceFact` | `GET /api/capacity/volumes` | `volumes[]` |

Each ingest row accepts **`serverId`** (GUID) or **`serverName`** (must match `ctl.Servers` after registration). Use **`X-Sovereign-Ingest-Key`** or operator JWT per `ingestAuth` middleware.

Aggregated KPIs: **`GET /api/overview`** → `coverage`; **`GET /api/mobile/summary`** → `cov` (`bkp`, `hdr`, `pth`, `vol`, `job`).

## Runbook

1. Apply schema: set `SOVEREIGN_DB_CONNECTION`, then `npm run migrate` from repo root.
2. Register instances (UI **Fleet**, or `POST /api/fleet/register` with Administrator JWT).
3. Collect + ingest (PowerShell):

```powershell
cd src\collectors
# JWT: sign in via POST /api/auth/login as Administrator, pass token below
.\DBAOps-Sovereign-Collector.ps1 `
  -ServerList "localhost" `
  -SovereignApi "http://localhost:3041" `
  -RegisterIfMissing -BearerToken "<paste-jwt>" `
  -SubmitTelemetry -SubmitFleetFacts `
  -IngestKey $env:SOVEREIGN_INGEST_KEY
```

Omit `-IngestKey` when the API has no ingest secret. **`-RegisterIfMissing`** requires **`-BearerToken`** (Admin role).

4. Open web **Coverage** and **Command Center** to verify KPIs and tables.

## Collector notes

- **RPO**: default log backup window **24h** for FULL/BULK recovery (`-RpoHoursDefault`).
- **HADR**: empty when instance is not in an availability group.
- **CU behind**: placeholder `0` until a build catalog / update feed is wired.
- **SQL Agent**: uses `msdb` `sysjobactivity` for the current agent session; permissions may limit visibility.

---

Powered by **RHOYLLE INNOVATION EMPIRE LLC**
