mixle.experimental.typed_runtime.graph_memory module¶
Partitioned, version-checked, bounded cache for revisitable context graphs.
- class CachedGraphPartition(partition, content_hash, graph_version, measured_token_count, boundary_edge_ids, pinned=False)[source]
Bases:
objectPartition content fingerprint captured at cache insertion.
- class GraphMemoryCache(*, maximum_tokens, maximum_partitions)[source]
Bases:
objectLRU partition cache bounded by both tokens and partition count.
- property resident_tokens: int
Total tokens in resident partitions.
- get(partition_id, graph)[source]
Return a current partition, dropping stale content fingerprints.
- Parameters:
partition_id (str)
graph (ContextGraph)
- Return type:
CachedGraphPartition | None
- put(partition, graph, *, pinned=False)[source]
Insert/refresh one partition and return evicted ids.
- prefetch(plan, graph, partition_ids)[source]
Load requested partitions in order under LRU bounds.
- class GraphPartition(partition_id, node_ids, token_count, source_ids)[source]
Bases:
objectBounded graph region and its source-locality metadata.
- Parameters:
- class GraphPartitionPlan(partitions, boundary_edge_ids)[source]
Bases:
objectComplete node ownership and cross-partition edge list.
- partition(partition_id)[source]
Return a partition by id.
- Parameters:
partition_id (str)
- Return type:
GraphPartition
- owner(node_id)[source]
Return the unique partition that owns a node.
- class GraphPrefetchReceipt(requested, loaded, evicted, resident_tokens, resident_before=None)[source]
Bases:
objectRequested, loaded, and evicted partition ids for one prefetch.
- Parameters:
- property eviction_claim_verified: bool
Whether this receipt’s eviction claim was checked against real residency.
A machine-readable verdict rather than an inference from a field being
None(MXR-080-0643).Falsemeans the receipt was built withoutresident_before, so its eviction list is an assertion nothing was able to test – the cache’s own producer always supplies it, so a receipt that reportsFalsedid not come from a prefetch.