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:
metadata (SnapshotMetadata)
snapshot_id (UUID)
objects (tuple[SnapshotObject, ...])
effects (tuple[Effect, ...])
Fields
metadataType:
SnapshotMetadataSnapshot creation metadata.
snapshot_idType:
UUIDStable identifier of this immutable snapshot. Persistence decisions must reference this identifier to prevent decisions from being applied to another snapshot.
objectsType:
tuple[SnapshotObject, ...]Canonical objects referenced by the snapshot.
effectsType:
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_atType:
datetimeTimestamp when the snapshot was generated.
source_modelType:
strSource model from which the snapshot was generated.
source_class_idType:
strSource class that initiated snapshot creation.
source_object_idType:
strSource 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:
identity (CanonicalObjectIdentity)
last_modification (datetime)
Fields
identityType:
CanonicalObjectIdentityCanonical identity of the referenced object.
last_modificationType:
datetimeObject last_modification value recorded when the snapshot was generated.
SnapshotValidationFinding
- class teksi_hooks.models.diff_snapshot.SnapshotValidationFinding(identity: 'CanonicalObjectIdentity', state: 'SnapshotState')[source]
- Parameters:
identity (CanonicalObjectIdentity)
state (SnapshotState)
Fields
identityType:
CanonicalObjectIdentityCanonical identity of the referenced object.
stateType:
SnapshotStateSnapshot state (enumeration)