# `Obscura.Diagnostic`
[🔗](https://github.com/hfiguera/obscura/blob/v0.2.0/lib/obscura/diagnostic.ex#L1)

Structured, report-safe diagnostic returned by optional runtime setup paths.

Diagnostics keep a stable machine-readable code while giving callers an
actionable message and remediation. They never contain analyzed source text.

# `t`

```elixir
@type t() :: %Obscura.Diagnostic{
  asset: atom() | nil,
  backend: atom() | nil,
  cause: term(),
  code: atom(),
  component: atom() | nil,
  dependency: atom() | nil,
  message: String.t(),
  metadata: map(),
  path: String.t() | nil,
  profile: atom() | nil,
  remediation: String.t()
}
```

# `codes`

```elixir
@spec codes() :: [atom()]
```

Returns the stable diagnostic codes supported by public setup boundaries.

# `format`

```elixir
@spec format(t()) :: String.t()
```

Returns a concise human-readable diagnostic without rendering the nested cause.

# `new`

```elixir
@spec new(
  atom(),
  keyword()
) :: t()
```

Builds a diagnostic with a default remediation for the code.

# `normalize`

```elixir
@spec normalize(
  term(),
  keyword()
) :: t()
```

Converts common legacy reasons into a structured diagnostic.

# `remediation`

```elixir
@spec remediation(atom()) :: String.t()
```

Returns the default remediation for a diagnostic code.

# `to_map`

```elixir
@spec to_map(t()) :: map()
```

Converts a diagnostic to a JSON-safe map without path or nested-cause data.

---

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