Skip to main content
Version: latest

agrag.candidates.patch.candidate_patch

candidate_patch(graph_store:GraphStore, schema:GraphSchema, *, ids:Sequence[UUID] | None = None, now:datetime | None = None) -> SchemaPatch

Build a patch from approved candidate records in the graph.

When ids is omitted, all approved candidates are selected. Supplied ids are loaded, then non-approved records and records with unresolved endpoints are excluded from the planned patch.

Parameters:

  • graph_store (GraphStore) – Store containing candidates and endpoint entities.
  • schema (GraphSchema) – Current schema used to plan additions.
  • ids (Sequence[UUID] | None) – Candidate ids to consider, or all approved ids when omitted.
  • now (datetime | None) – Patch creation time, or the current UTC time when omitted.

Returns:

  • SchemaPatch – Deterministic patch based on the selected approved records.