# `Mailglass.Installer.Doctor`
[🔗](https://github.com/szTheory/mailglass/blob/v2.7.0/lib/mailglass/installer/doctor.ex#L1)

Static webhook-wiring check for the host app's endpoint.

Reads `endpoint.ex` off disk (via `File.read!`) and checks whether the
Mailglass `CachingBodyReader` body reader is wired. No app boot, no runtime
reflection — the scan runs inside the install-fixture harness in CI.

## Exit-code mapping (three-state)

  * `summary.cannot_diagnose > 0` — endpoint.ex missing / app not detectable → exit 2
  * `summary.fail > 0`            — CachingBodyReader absent → exit 1
  * else                          — wired correctly → exit 0

## Usage

    Mailglass.Installer.Doctor.run([])
    # => %{summary: %{pass: 1, warn: 0, fail: 0, cannot_diagnose: 0}, findings: [...]}

# `finding`

```elixir
@type finding() :: %{
  check: atom(),
  status: :pass | :warn | :fail,
  title: String.t(),
  observed: String.t(),
  remediation: String.t(),
  evidence: map()
}
```

# `result`

```elixir
@type result() :: %{summary: map(), findings: [finding()]}
```

# `run`

```elixir
@spec run(keyword()) :: result()
```

Runs the static endpoint-wiring scan and returns a result map.

Options are accepted for API symmetry with the inbound doctor but are not
currently used — the scan is static and unconditional.

---

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