# `Choreo.Domain.Analysis`
[🔗](https://github.com/code-shoily/choreo/blob/v0.14.1/lib/choreo/domain/analysis.ex#L1)

Audit and analysis rules for `Choreo.Domain` diagrams.

Validates Event Storming graphs against logical rules:
1. Commands must target an Aggregate or Workflow.
2. Events must be emitted by an Aggregate, Workflow, or External System.
3. Events must not be dead-ends (they should trigger a Policy, Read Model, or Actor).
4. Policies must trigger a Command.

# `ubiquitous_language`

```elixir
@spec ubiquitous_language(Choreo.Domain.t()) :: String.t()
```

Generates a Markdown-formatted table representing the Ubiquitous Language (glossary)
extracted from all nodes, aggregates, events, and types defined in the domain.

# `validate`

```elixir
@spec validate(Choreo.Domain.t()) :: [{:error | :warning, String.t()}]
```

Runs semantic validation rules against a domain model.

Returns a list of `{severity, message}` tuples for cross-module composability.

Severity levels:
  * `:error` — structural issues (missing targets, missing causes)
  * `:warning` — soft semantic checks (dead-ends, passive actors)

This is the cross-module validation entry point. It is equivalent to
`warnings/1`, which is kept as a domain-specific alias.

# `warnings`

```elixir
@spec warnings(Choreo.Domain.t()) :: [{:error | :warning, String.t()}]
```

Runs semantic audit rules against a domain model.

---

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