MingaEditor.NativeIPC.OperationReceipt (Minga v0.1.0)

Copy Markdown View Source

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.

Summary

Functions

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

Records the exact BEAM target after the open operation applies.

Moves a nonterminal receipt to one terminal result exactly once.

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

Types

kind()

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

outcome()

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

phase()

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

t()

@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
}

Functions

admit(app_instance_id, core_instance_id, operation_id, path, token, now_ms)

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

admit_operation(app_instance_id, core_instance_id, operation_id, kind, target, postcondition, now_ms)

@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(receipt, window_id, revision, now_ms, presentation_token \\ nil)

@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(receipt, outcome, evidence, last_visible, detail, now_ms)

Moves a nonterminal receipt to one terminal result exactly once.

to_map(receipt)

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

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