Minga.Editing.Completion.Index (Minga v0.1.0)

Copy Markdown View Source

Provider-aware normalized completion index with bounded deterministic snapshots.

Summary

Functions

Returns all indexed items in deterministic order for compatibility callers.

Returns an empty completion index.

Finds one exact stable item identity.

Builds an index from candidates grouped by their provider identity.

Replaces one provider batch after collapsing true provider-local duplicates.

Returns a bounded deterministic semantic snapshot without building a full match list.

Returns a bounded snapshot that retains a matching selected identity across reranking.

Updates one exact stable item identity while preserving index ownership.

Types

t()

@type t() :: %Minga.Editing.Completion.Index{
  providers: %{
    required(Minga.Editing.Completion.Item.provider_id()) =>
      Minga.Editing.Completion.Index.Provider.t()
  },
  total_count: non_neg_integer()
}

Functions

all_items(index)

@spec all_items(t()) :: [Minga.Editing.Completion.Item.t()]

Returns all indexed items in deterministic order for compatibility callers.

empty()

@spec empty() :: t()

Returns an empty completion index.

find_item(index, item_id)

@spec find_item(t(), Minga.Editing.Completion.Item.id() | nil) ::
  Minga.Editing.Completion.Item.t() | nil

Finds one exact stable item identity.

from_items(items)

@spec from_items([Minga.Editing.Completion.Item.t()]) :: t()

Builds an index from candidates grouped by their provider identity.

put_provider(index, provider_id, items, incomplete?)

Replaces one provider batch after collapsing true provider-local duplicates.

snapshot(index, query, limit \\ 200)

Returns a bounded deterministic semantic snapshot without building a full match list.

snapshot(index, query, limit, selected_item_id)

Returns a bounded snapshot that retains a matching selected identity across reranking.

update_item(index, item_id, update)

Updates one exact stable item identity while preserving index ownership.