ETS-backed store for online learned semantic-cache examples.
Owns the public named tables holding mutable online rows and their per-agent
monotonic revisions. Table names are part of the operational contract: this
module's own name is the online table and Learned.Revisions holds the
counters, both created through the supervised semantic-cache owner.
Summary
Functions
Advances the agent's online revision counter.
Deletes every online row of one agent.
Deletes one online row.
Fetches one online row, or nil.
Finds the agent's online row with the given normalized text, or nil.
Fetches an editable online row, distinguishing read-only and missing ids.
Stores or replaces one online row under its agent and id.
Returns the monotonic in-memory revision of an agent's online examples.
Returns the agent's online rows visible under the cacheable rules.
Functions
@spec bump_revision(module()) :: non_neg_integer()
Advances the agent's online revision counter.
@spec clear_rows(module()) :: :ok
Deletes every online row of one agent.
Deletes one online row.
@spec fetch(module(), String.t()) :: Spectre.Router.SemanticCache.Learned.row() | nil
Fetches one online row, or nil.
@spec find_by_normalized(module(), String.t()) :: Spectre.Router.SemanticCache.Learned.row() | nil
Finds the agent's online row with the given normalized text, or nil.
@spec mutable_row(module(), String.t(), keyword()) :: {:ok, Spectre.Router.SemanticCache.Learned.row()} | {:error, term()}
Fetches an editable online row, distinguishing read-only and missing ids.
@spec put_row( Spectre.Router.SemanticCache.Learned.row(), keyword() ) :: :ok
Stores or replaces one online row under its agent and id.
@spec revision(module()) :: non_neg_integer()
Returns the monotonic in-memory revision of an agent's online examples.
@spec rows( module(), keyword() ) :: [Spectre.Router.SemanticCache.Learned.row()]
Returns the agent's online rows visible under the cacheable rules.