symfonic.capabilities.memory.operation_receipt¶
operation_receipt ¶
Public identity and reconciliation contract for durable memory operations.
An operation ID belongs to the caller and must survive a process restart. The caller persists the operation ID, verb, full scope and content digest before mutation. The intent digest binds that ID to a verb and complete kind-aware scope. COMMITTED confirms only the exact receipt; UNKNOWN never authorizes replay. This phase does not resolve UNKNOWN to ABORTED or provide a retry path. Selected Mongo publication is separate from the still-closed Agent admission.
MemoryOperation
dataclass
¶
MemoryOperation(operation_id: str, verb: MemoryOperationVerb, scope: MemoryScope, intent: Mapping[str, Any])
Caller-stable identity retaining only an immutable selected manifest.
Source code in src/symfonic/capabilities/memory/operation_receipt.py
from_intent
classmethod
¶
from_intent(operation_id: str, verb: MemoryOperationVerb, scope: MemoryScope, intent: Mapping[str, Any]) -> MemoryOperation
Build the same identity from equivalent canonical intent mappings.
Source code in src/symfonic/capabilities/memory/operation_receipt.py
restore
classmethod
¶
restore(operation_id: str, verb: MemoryOperationVerb, scope: MemoryScope, content_digest: str) -> MemoryOperation
Rebuild a persisted identity for reconciliation, without body replay.
The caller must persist these fields before attempting the mutation. Rebinding the content digest to the supplied verb and full scope keeps a restored identity from claiming another child scope's receipt.
Source code in src/symfonic/capabilities/memory/operation_receipt.py
MemoryOperationOutcome ¶
Bases: StrEnum
A positive exact receipt, or a result that cannot authorize replay.
MemoryOperationOutcomeUnknown ¶
Bases: MemoryContractError
The caller must reconcile this exact identity; no body retry is safe.
Source code in src/symfonic/capabilities/memory/operation_receipt.py
MemoryOperationReconcilerPort ¶
Bases: Protocol
Read-only outcome check; it never reserves an ID or replays a body.
MemoryOperationVerb ¶
Bases: StrEnum
Reserved mutation families; values alone admit no lifecycle route.
require_operation ¶
require_operation(operation: MemoryOperation | None, verb: MemoryOperationVerb, scope: MemoryScope) -> MemoryOperation
Require the caller's exact persisted identity before mutation I/O.
Source code in src/symfonic/capabilities/memory/operation_receipt.py
validate_transaction_operation ¶
validate_transaction_operation(domain: Any, operation: MemoryOperation | None, verb: MemoryOperationVerb, scope: MemoryScope) -> bool
Validate receipt identity before any cycle or lifecycle body runs.