Syntropy.RecommendationStore (syntropy v0.1.0)

Copy Markdown

Retains structural recommendations for Trust V1.

Summary

Types

recommendation()

@type recommendation() :: %{
  id: String.t(),
  node_id: String.t(),
  kind: String.t(),
  risk_level: String.t(),
  approval_required: boolean(),
  candidate_agent_ids: [String.t()],
  evidence: map(),
  status: String.t(),
  applied_agent_id: String.t() | nil,
  created_at: DateTime.t()
}

Functions

apply(recommendation_id, applied_agent_id)

@spec apply(String.t(), String.t()) :: {:ok, recommendation()} | {:error, term()}

approve(recommendation_id)

@spec approve(String.t()) :: {:ok, recommendation()} | {:error, term()}

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

get(recommendation_id)

@spec get(String.t()) :: recommendation() | nil

recent(limit \\ 100)

@spec recent(non_neg_integer()) :: [recommendation()]

record_pending(attrs)

@spec record_pending(map()) ::
  {:created, recommendation()}
  | {:existing, recommendation()}
  | {:error, term()}

reject(recommendation_id)

@spec reject(String.t()) :: {:ok, recommendation()} | {:error, term()}

reset()

@spec reset() :: :ok

start_link(opts \\ [])

@spec start_link(keyword()) :: GenServer.on_start()