Skip to main content

agrag.common.data_models.cutover_job.CutoverJob

Bases: DataPoint

Crash-recoverable state for one add/update/delete_document call.

Attributes:

  • document_key (str) – The document this job mutates. Unique among non-terminal jobs (enforced by a graph constraint plus lease fencing, not the constraint alone).
  • verb (Literal['add', 'update', 'delete_document']) – Which public method created this job.
  • status (CutoverJobStatus) – Current phase, see CutoverJobStatus.
  • affected_entity_ids (list[UUID]) – The snapshot taken before any pending write began. The only entities that pruning can remove.
  • component_seed_ids (list[UUID]) – One member id per match component the job rebuilt, recorded at commit. The cleanup phase rebuilds each component's resolved entity from these, in addition to pruning, so a resumed job can replace the resolved entity the commit left in place.
  • lease_token (UUID) – Current lease holder's fencing token.
  • lease_expires_at (datetime) – When the current lease expires.

Functions:

affected_entity_ids​

affected_entity_ids: list[UUID] = Field(default_factory=list)

component_seed_ids​

component_seed_ids: list[UUID] = Field(default_factory=list)

created_at​

created_at: datetime = Field(default_factory=lambda: datetime.now(UTC))

document_key​

document_key: str

id​

id: UUID

lease_expires_at​

lease_expires_at: datetime

lease_token​

lease_token: UUID

metadata​

metadata: dict[str, Any] = Field(default_factory=dict)

status​

status: CutoverJobStatus

to_node_record​

to_node_record() -> NodeRecord

Return this job as a graph write record.

verb​

verb: Literal['add', 'update', 'delete_document']