# `ExGAM.Interop`
[🔗](https://github.com/elchemista/ex_gam/blob/0.1.0/lib/ex_gam/interop.ex#L1)

Portable exchange boundary between independently governed Domains.

An envelope carries only a Candidate and its Evidence closure. It cannot
carry a Mandate, Decision, Act, Grant or execution capability. Receiving an
envelope therefore does not import authority: the destination application's
authenticated ingress decides how to attest the message as local Evidence,
and every resulting proposal is evaluated under a local Mandate.

Transport authentication, signatures, peer identity and label mapping remain
adapter concerns. `inbound/2` only verifies canonical shape, content identity,
destination binding and a self-contained Evidence lineage.

# `contents`

```elixir
@type contents() :: %{
  ref: String.t(),
  source_domain_ref: String.t(),
  destination_domain_ref: String.t(),
  candidate: ExGAM.Candidate.t(),
  evidence: [ExGAM.Evidence.t()]
}
```

Validated, capability-free contents of an inbound envelope.

# `envelope`

```elixir
@type envelope() :: %{required(String.t()) =&gt; term()}
```

Canonical string-keyed value suitable for transport or an Evidence payload.

# `inbound`

```elixir
@spec inbound(envelope(), String.t()) :: {:ok, contents()} | {:error, term()}
```

Validates an inbound envelope for the exact destination Domain.

# `outbound`

```elixir
@spec outbound(
  String.t(),
  String.t(),
  ExGAM.Candidate.t() | map() | keyword(),
  [ExGAM.Evidence.t() | map() | keyword()]
) :: {:ok, envelope()} | {:error, term()}
```

Builds a content-addressed outbound Candidate + Evidence envelope.

---

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