# `ExGAM.Duty.Derive.Facts`
[🔗](https://github.com/elchemista/ex_gam/blob/0.1.0/lib/ex_gam/duty/derive/facts.ex#L1)

Read-only input prepared for pure Duty derivation.

Governed records stay as their decoded structs. Ledger position and
acquisition time stay in `ExGAM.Domain.Event.Metadata`, where replay put
them. This avoids manufacturing a second, map-shaped representation of an
Act, Evidence or Outcome merely to attach metadata.

Each governed collection keeps the projection's single keyed representation;
derivation traverses those maps directly instead of allocating parallel lists
or retaining derived indexes beside their source. This view is disposable and
carries no authority: the append-only ledger remains the source of truth and
`ExGAM.GovernedAct.State` remains the complete replay projection.

# `t`

```elixir
@type t() :: %ExGAM.Duty.Derive.Facts{
  acts: %{optional(String.t()) =&gt; ExGAM.Act.t()},
  attempts: %{optional(String.t()) =&gt; ExGAM.Attempt.t()},
  availability: {non_neg_integer(), MapSet.t(String.t())} | nil,
  duties: %{optional(term()) =&gt; ExGAM.Duty.t()},
  erasures: %{optional(String.t()) =&gt; ExGAM.Erasure.t()},
  event_metadata: %{optional(String.t()) =&gt; ExGAM.Domain.Event.Metadata.t()},
  evidence: %{optional(String.t()) =&gt; ExGAM.Evidence.t()},
  mandates: %{optional(String.t()) =&gt; ExGAM.Mandate.t()},
  outcomes: %{optional(String.t()) =&gt; ExGAM.Outcome.t()},
  presentations: %{optional(String.t()) =&gt; ExGAM.Presentation.t()},
  scopes: %{optional(String.t()) =&gt; ExGAM.Scope.Opening.t()},
  sources: %{optional(atom()) =&gt; [term()]}
}
```

# `available_at?`

```elixir
@spec available_at?(t(), String.t(), integer()) :: boolean()
```

Returns whether a fact was durably available at the given trusted time.

# `available_evidence`

```elixir
@spec available_evidence(t(), integer()) :: [ExGAM.Evidence.t()]
```

Returns Evidence durably present and not erased at trusted `time`.

# `evidence_through`

```elixir
@spec evidence_through(t(), non_neg_integer()) :: [ExGAM.Evidence.t()]
```

Returns Evidence durably known in the ledger prefix ending at `revision`.

# `from_state`

```elixir
@spec from_state(ExGAM.GovernedAct.State.t()) :: t()
```

Builds the minimal indexed view used by the Duty algebra.

# `later_evidence`

```elixir
@spec later_evidence(t(), ExGAM.Evidence.t(), non_neg_integer(), integer()) ::
  {:ok, ExGAM.Domain.Event.Metadata.t()} | :error
```

Returns metadata when Evidence was recorded after a revision and no later than `time`.

# `metadata`

```elixir
@spec metadata(t(), String.t()) ::
  {:ok, ExGAM.Domain.Event.Metadata.t()} | {:error, :missing_event_metadata}
```

Looks up trusted ledger metadata for a typed record identity.

# `recorded_through?`

```elixir
@spec recorded_through?(t(), String.t(), non_neg_integer()) :: boolean()
```

Returns whether a fact was durably known at the given ledger revision.

# `records_through`

```elixir
@spec records_through(t(), Enumerable.t(), non_neg_integer()) :: [struct()]
```

Filters typed records to the ledger prefix ending at `revision`.

---

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