# `MingaEditor.State.OperationFeedback`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga_editor/state/operation_feedback.ex#L1)

Editor-global, bounded owner for identity-keyed asynchronous operation feedback.

Selection is deterministic: the newest active operation wins; when none are
active, the newest retained terminal operation wins. Starting another
operation for the same resource marks the older active operation stale.

# `t`

```elixir
@type t() :: %MingaEditor.State.OperationFeedback{
  limit: pos_integer(),
  next_id: pos_integer(),
  operations: %{
    optional(MingaEditor.State.Operation.id()) =&gt;
      MingaEditor.State.Operation.t()
  }
}
```

# `active?`

```elixir
@spec active?(t(), MingaEditor.State.Operation.id()) :: boolean()
```

Returns whether the correlated operation can still receive lifecycle updates.

# `cancel`

```elixir
@spec cancel(t(), MingaEditor.State.Operation.id(), String.t()) :: t()
```

Marks an active identity canceled.

# `dismiss`

```elixir
@spec dismiss(t(), MingaEditor.State.Operation.id()) :: t()
```

Dismisses one retained identity; a missing identity is an identity-safe no-op.

# `fetch`

```elixir
@spec fetch(t(), MingaEditor.State.Operation.id()) ::
  {:ok, MingaEditor.State.Operation.t()} | :error
```

Returns an operation by identity.

# `finish`

```elixir
@spec finish(
  t(),
  MingaEditor.State.Operation.id(),
  MingaEditor.State.Operation.terminal_status(),
  String.t()
) :: t()
```

Finishes an active identity with one of the semantic terminal statuses.

# `new`

```elixir
@spec new(pos_integer()) :: t()
```

Builds an empty feedback store with an explicit positive retention bound.

# `queued`

```elixir
@spec queued(t(), MingaEditor.State.Operation.id(), String.t(), integer(), integer()) ::
  {:ok, t()} | {:error, MingaEditor.State.OperationQueue.error()}
```

Applies a scheduler-authored queued transition if the identity is still active.

# `report_progress`

```elixir
@spec report_progress(t(), MingaEditor.State.Operation.id(), integer(), integer()) ::
  {:ok, t()} | {:error, MingaEditor.State.OperationProgress.error()}
```

Records validated domain progress if the identity is still active.

# `running`

```elixir
@spec running(t(), MingaEditor.State.Operation.id(), String.t()) :: t()
```

Applies a running transition if the identity is still active.

# `selected`

```elixir
@spec selected(t()) :: MingaEditor.State.Operation.t() | nil
```

Selects the newest active operation, otherwise the newest retained terminal operation.

# `size`

```elixir
@spec size(t()) :: non_neg_integer()
```

Returns the number of retained operations.

# `stale`

```elixir
@spec stale(t(), MingaEditor.State.Operation.id(), String.t()) :: t()
```

Marks an active identity stale.

# `start`

```elixir
@spec start(
  t(),
  MingaEditor.State.Operation.kind(),
  MingaEditor.State.Operation.resource(),
  String.t(),
  keyword()
) :: {t(), MingaEditor.State.Operation.t()}
```

Starts an operation and returns its updated store and monotonic wire identity.

# `timeout`

```elixir
@spec timeout(t(), MingaEditor.State.Operation.id(), String.t()) :: t()
```

Marks an active identity timed out.

---

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