# `MingaEditor.NativeIPC.OperationReceipt`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga_editor/native_ipc/operation_receipt.ex#L1)

Correlated result for one authenticated local client operation.

The receipt separates command admission, BEAM application, and the strongest
native readiness boundary that the affected consumer can prove. Receipt
lookup observes the original action and never resubmits it.

# `kind`

```elixir
@type kind() :: :focus_pane | :select_tab | :goto_location | :activate_picker_choice
```

# `outcome`

```elixir
@type outcome() ::
  :ready
  | :applied
  | :rejected
  | :presentation_failed
  | :hidden
  | :unavailable
  | :superseded
  | :app_replaced
  | :core_replaced
  | :indeterminate
```

# `phase`

```elixir
@type phase() :: :admitted | :applied | :terminal
```

# `t`

```elixir
@type t() :: %MingaEditor.NativeIPC.OperationReceipt{
  admitted_at_ms: integer(),
  app_instance_id: String.t(),
  application_revision: non_neg_integer() | nil,
  applied_at_ms: integer() | nil,
  core_instance_id: String.t(),
  detail: String.t() | nil,
  evidence: MingaEditor.NativeIPC.OperationReceipt.Evidence.t() | nil,
  kind: :open | kind(),
  last_visible: MingaEditor.NativeIPC.OperationReceipt.Evidence.t() | nil,
  operation_id: pos_integer(),
  outcome: outcome() | nil,
  phase: phase(),
  postcondition: :editor_visible_focused | :beam_applied,
  result_code: String.t() | nil,
  target: MingaEditor.NativeIPC.OperationReceipt.Target.t(),
  terminal_at_ms: integer() | nil
}
```

# `admit`

```elixir
@spec admit(
  String.t(),
  String.t(),
  pos_integer(),
  String.t(),
  non_neg_integer(),
  integer()
) :: t()
```

# `admit_operation`

```elixir
@spec admit_operation(
  String.t(),
  String.t(),
  pos_integer(),
  kind(),
  MingaEditor.NativeIPC.OperationReceipt.Target.t(),
  :editor_visible_focused | :beam_applied,
  integer()
) :: t()
```

Admits one typed semantic operation against an exact core-scoped target.

# `applied`

```elixir
@spec applied(
  t(),
  non_neg_integer(),
  non_neg_integer(),
  integer(),
  non_neg_integer() | nil
) :: t()
```

Records the exact BEAM target after the open operation applies.

# `finish`

```elixir
@spec finish(
  t(),
  outcome(),
  MingaEditor.NativeIPC.OperationReceipt.Evidence.t() | nil,
  MingaEditor.NativeIPC.OperationReceipt.Evidence.t() | nil,
  String.t() | nil,
  integer()
) :: t()
```

Moves a nonterminal receipt to one terminal result exactly once.

# `to_map`

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

Returns the stable public JSON representation used by the native helper.

---

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