# `Spectre.GAM.Attempt.Executor`
[🔗](https://github.com/elchemista/spectre/blob/0.4.0/lib/spectre/gam/attempt/executor.ex#L1)

Executes one already-committed governed Act.

Implementations are Zone X adapters. They receive no authority to alter the
Act; `capability` is the short-lived host handle released only after the
corresponding Attempt has been committed.

Results cross back into the governed record layer, so they contain only
validated `Spectre.GAM.Evidence` and an opaque, non-empty `details_ref`. Raw
provider replies, exceptions, credentials and reusable bearer material are
not valid result metadata. Evidence may be empty only for an ambiguous result.

`use Spectre.GAM.Attempt.Executor, executor_ref: "executor:payments",
contract_ref: "contract:payments:v1"` declares the behaviour and overridable
identity callbacks. Both references are explicit. It supplies no `execute/4`
implementation, credentials, retry policy or Outcome classification.

# `observation`

```elixir
@type observation() :: %{
  evidence: Spectre.GAM.Evidence.t() | [Spectre.GAM.Evidence.t()],
  details_ref: String.t()
}
```

# `result`

```elixir
@type result() ::
  {:ok, observation()}
  | {:error, :failed, observation()}
  | {:error, :definitive_no_effect, observation()}
  | {:error, :ambiguous, observation()}
```

# `contract_ref`

```elixir
@callback contract_ref() :: String.t()
```

Returns the immutable contract revision implemented by this adapter.

# `execute`

```elixir
@callback execute(Spectre.GAM.Act.t(), Spectre.GAM.Attempt.t(), term(), keyword()) ::
  result()
```

# `executor_ref`

```elixir
@callback executor_ref() :: String.t()
```

Returns the stable executor identity accepted by this adapter.

# `evidence`

```elixir
@spec evidence(
  Spectre.GAM.Act.t(),
  Spectre.GAM.Attempt.t(),
  integer(),
  map() | keyword()
) ::
  {:ok, Spectre.GAM.Evidence.t()} | {:error, term()}
```

Builds executor-attested Evidence with the Act and Attempt bindings forced.

# `outcome_evidence`

```elixir
@spec outcome_evidence(
  Spectre.GAM.Act.t(),
  Spectre.GAM.Attempt.t(),
  Spectre.GAM.Outcome.status(),
  integer(),
  map() | keyword()
) :: {:ok, Spectre.GAM.Evidence.t()} | {:error, term()}
```

Builds a final Evidence attestation for one exact Outcome classification.

---

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