cadrumo.adapters.persistence.operations.financial_operand_custody module¶
Durable filesystem custody checkpoints for transient financial operands.
The store holds one versioned checkpoint per wait and nothing more. Checkpoints are non-sensitive by construction - the operand contract keeps every amount out of the record - so this is an ordinary durable file rather than encrypted secure storage, which is the same posture the owner lease takes.
Every advance is a compare-and-swap under an exclusive lock. Two supervisor paths that both believe they should release one wait will both present the same predecessor; the first swap wins and the second is refused, so the buffer is cleared once.
- class OperationFinancialOperandCustodyFilesystemRepository(*, root=None, settings=None)[source]¶
Bases:
OperationFinancialOperandCustodyRepositoryOne durable checkpoint per wait, advanced only by compare-and-swap.
- Parameters:
root (Path | None)
settings (Settings | None)
- async read(interaction_id)[source]¶
Return the latest checkpoint for one wait, or
Noneif never opened.- Return type:
- Parameters:
interaction_id (str)
- async open(checkpoint)[source]¶
Record the opening checkpoint, refusing a wait that already exists.
- Return type:
- Parameters:
checkpoint (OperationFinancialOperandCustodyCheckpoint)
- async advance(predecessor, successor)[source]¶
Replace
predecessorwithsuccessoronly if it is still current.- Return type:
- Parameters:
predecessor (OperationFinancialOperandCustodyCheckpoint)
successor (OperationFinancialOperandCustodyCheckpoint)