symfonic.capabilities.memory.phases.deep_native_graph_port¶
deep_native_graph_port ¶
Required atomic mutation seam for native DEEP graph maintenance.
A concrete deployment adapter must stage these operations in the active cycle journal and replay them under the same transaction as its other writes. The existing node JSON patch and generic edge upsert do not satisfy this contract.
NativeGraphMutationPort ¶
Exact graph and journal binding plus two guarded operation contracts.
Source code in src/symfonic/capabilities/memory/phases/deep_native_graph_port.py
guarded_cooccurrence
async
¶
guarded_cooccurrence(scope: NativeStorageScope, source: Any, target: Any, source_version: OwnedNodeVersion, target_version: OwnedNodeVersion, *, weight: float, max_degree: int) -> bool
Atomically guard endpoints, owner, degree, then insert/reinforce edge.
Existing CO_OCCURRED edges may be reinforced when degree is full. Return false if the degree cap prevents staging a new edge. At replay, a full degree skips that edge; stale endpoints or owner changes abort the receipt transaction. Existing edges can be reinforced at full degree.
Source code in src/symfonic/capabilities/memory/phases/deep_native_graph_port.py
patch_importance
async
¶
patch_importance(scope: NativeStorageScope, node_id: Any, expected: OwnedNodeVersion, importance: float) -> bool
CAS exact owner, incarnation, revision; update only importance.