cadrumo.core.bucket_pointer module¶
Strict current-only record for the active-profile pointer.
The pointer is one durable, plaintext coordination record under the storage root. It names either a selected bucket or an explicit absence and carries the monotonic transition coordinate used by every pointer consumer. The record is not a profile manifest or a profile-lifecycle assertion: it only records the currently selected bucket.
- class BucketPointer(**data)[source]¶
Bases:
BaseModelOne strict active-profile selection and its durable transition revision.
selectionis deliberately explicit because TOML has no null scalar. A selected record carries exactly one bucket id; an absent record is the persisted tombstone written by clear. The physically absent initial file observes as an absent record at revision zero and is never accepted as an on-disk compatibility format.- Parameters:
- selection: Literal['absent', 'selected']¶
- bucket_id: BucketId | None¶
- transition_revision: int¶
- schema_version: Literal[2]¶
- classmethod absent(*, transition_revision)[source]¶
Construct the explicit absent-selection tombstone.
- Return type:
- Parameters:
transition_revision (int)
- classmethod selected(*, bucket_id, transition_revision)[source]¶
Construct one selected current-format record.
- Return type:
- Parameters:
- pointer_path(root)[source]¶
Return the active-profile record path beneath
root.- Return type:
Path- Parameters:
root (Path)
- read_pointer(root)[source]¶
Observe the optional selection and durable current coordinate once.
- Return type:
- Parameters:
root (Path)
- write_pointer(root, pointer)[source]¶
Atomically replace the one strict pointer record under its owner lock.
- Return type:
- Parameters:
root (Path)
pointer (BucketPointer)