Models / Diff Snapshot

DiffSnapshot

class teksi_hooks.models.diff_snapshot.DiffSnapshot(metadata, snapshot_id=<factory>, objects=<factory>, effects=<factory>)[source]

Immutable snapshot of semantic changes.

A snapshot may be reviewed hours or days after generation. Stored object metadata allows detection of stale snapshots when underlying database objects have changed.

Parameters:

Fields

metadata

Type: SnapshotMetadata

Snapshot creation metadata.

snapshot_id

Type: UUID

Stable identifier of this immutable snapshot. Persistence decisions must reference this identifier to prevent decisions from being applied to another snapshot.

objects

Type: tuple[SnapshotObject, ...]

Canonical objects referenced by the snapshot.

effects

Type: tuple[Effect, ...]

Canonical effects captured in the snapshot.

SnapshotMetadata

class teksi_hooks.models.diff_snapshot.SnapshotMetadata(created_at, source_model, source_class_id, source_object_id)[source]

Metadata describing the creation context of a diff snapshot.

Parameters:
  • created_at (datetime)

  • source_model (str)

  • source_class_id (str)

  • source_object_id (str)

Fields

created_at

Type: datetime

Timestamp when the snapshot was generated.

source_model

Type: str

Source model from which the snapshot was generated.

source_class_id

Type: str

Source class that initiated snapshot creation.

source_object_id

Type: str

Source object identifier that initiated snapshot creation.

SnapshotObject

class teksi_hooks.models.diff_snapshot.SnapshotObject(identity, last_modification)[source]

Canonical object referenced by a diff snapshot.

Parameters:

Fields

identity

Type: CanonicalObjectIdentity

Canonical identity of the referenced object.

last_modification

Type: datetime

Object last_modification value recorded when the snapshot was generated.

SnapshotValidationFinding

class teksi_hooks.models.diff_snapshot.SnapshotValidationFinding(identity: 'CanonicalObjectIdentity', state: 'SnapshotState')[source]
Parameters:

Fields

identity

Type: CanonicalObjectIdentity

Canonical identity of the referenced object.

state

Type: SnapshotState

Snapshot state (enumeration)