# `Continuum.Health`
[🔗](https://github.com/Yyeger/Continuum/blob/main/lib/continuum/health.ex#L1)

Read-only operational health reporting and explicitly fenced repairs.

`report/1` is the shared source for `mix continuum.health` and the Observer
health panel. It reports partition coverage, workflow registration drift,
active-run wait reasons, durable wake and timer lag, leases, activities, and
signal backlog.

`repair/3` is a dry run unless `execute: true` is passed. Mutating actions
compare the lease epoch/owner or activity attempt/owner observed by the
operator, so a stale repair cannot overwrite newer runtime authority.

# `repair_action`

```elixir
@type repair_action() ::
  :wake | :retry | :release_expired_lease | :requeue_activity | :mark_reviewed
```

# `degraded?`
*since 0.6.2* 

```elixir
@spec degraded?(map()) :: boolean()
```

Returns true when a health report contains an actionable degradation.

# `repair`
*since 0.6.2* 

```elixir
@spec repair(repair_action() | binary(), binary(), keyword()) ::
  {:ok, map()} | {:error, term()}
```

Plans or executes one operational repair.

Supported actions:

  * `:wake` — arm and route a run wake; requires `:lease_token`.
  * `:retry` — retry durable registration for a loaded workflow version.
  * `:release_expired_lease` — release only an expired run lease; requires
    `:lease_owner` and `:lease_token`.
  * `:requeue_activity` — requeue only an expired activity claim; requires
    `:lease_owner` and `:attempt`.
  * `:mark_reviewed` — acknowledge a finding fingerprint; requires
    `:finding_type` and `:fingerprint`.

Every action defaults to a dry run. Pass `execute: true` only after reviewing
the returned plan.

# `report`
*since 0.6.2* 

```elixir
@spec report(keyword()) :: {:ok, map()} | {:error, term()}
```

Builds an operational health report for a PostgreSQL-backed instance.

Options include `:instance` or `:repo`, `:partition_months` (default 3),
`:lost_wake_after_ms` (default 60 seconds), and `:limit` for candidate lists.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
