# `Spectre.GAM.Duty`
[🔗](https://github.com/elchemista/spectre/blob/0.4.0/lib/spectre/gam/duty.ex#L1)

Durable normative debt derived from unresolved canonical facts.

`cause_key` is the idempotency key for materializing a required duty.  A
duty never expires by timer, restart or deployment.  A disposed projection
must point at the later Act that authorized its disposition; the original
cause and evidence remain unchanged. `conflict_refs` freezes both interested
principals and the causal Mandate reference so independence can be verified
from the ledger rather than inferred from the current configuration.

`Spectre.GAM.Duty.Derive` is the pure cause-family facade. Commit materializes
missing causes idempotently, while `GovernedAct.Transition.Duty` proves and
replays disposition. The record itself contains no scheduler or policy
callback.

# `class`

```elixir
@type class() ::
  :ambiguous_outcome
  | :contradicted_outcome
  | :disputed_evidence
  | :scope_promise_overdue
  | :erasure_reduces_verifiability
  | String.t()
```

# `t`

```elixir
@type t() :: %Spectre.GAM.Duty{
  accountable: String.t(),
  act_ref: String.t() | nil,
  attempt_ref: String.t() | nil,
  cause_key: term(),
  class: class(),
  closing_conditions: [term()],
  conflict_refs: [String.t()],
  containment: term(),
  disposition_act_ref: String.t() | nil,
  disposition_authority_refs: [String.t()],
  evidence_refs: [String.t()],
  mandate_ref: String.t() | nil,
  missing: [term()],
  opened_at: integer(),
  ref: String.t(),
  schema_version: 1,
  status: :open | :disposed,
  subjects: [String.t()]
}
```

# `canonical`

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

Returns the plain, string-keyed ledger representation.

# `content_ref`

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

Returns the stable reference derived only from the idempotent cause key.

# `digest`

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

Returns the stable digest of the complete duty projection.

# `from_canonical`

```elixir
@spec from_canonical(map()) :: {:ok, t()} | {:error, term()}
```

Restores a duty from its canonical map.

# `new`

```elixir
@spec new(map() | keyword() | t()) :: {:ok, t()} | {:error, term()}
```

Builds and validates a duty projection.

---

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