Skip to content

symfonic.memory.storage_scope

storage_scope

Explicit native storage vocabulary; this does not enable any backend.

NativeStorageScope deliberately exposes only predicate inputs. It is not a TenantScope and does not emulate its path, namespace or positional flat fields. Legacy callers keep TenantScope and their existing v0 representation.

NativeStorageScope dataclass

NativeStorageScope(identity: StorageScopeKey)

Immutable v1 input for shared persistence predicates, with no v0 bridge.

identity_version property

identity_version: int

The native wire language is version one.

scope_path property

scope_path: str

Canonical v1 storage wire key, never the capability JSON path.

subtree_prefix property

subtree_prefix: str

The codec already terminates every complete level with a slash.

tenant_id property

tenant_id: str

Root ID for the backend's separate tenant column.

ancestor_prefix_paths

ancestor_prefix_paths() -> list[str]

Exact canonical ancestor keys, root through self.

Source code in src/symfonic/memory/storage_scope.py
def ancestor_prefix_paths(self) -> list[str]:
    """Exact canonical ancestor keys, root through self."""
    return self.identity.ancestor_keys()

from_scope classmethod

from_scope(scope: MemoryScope) -> NativeStorageScope

Accept explicit native kinds only, without inferring v0 identities.

Source code in src/symfonic/memory/storage_scope.py
@classmethod
def from_scope(cls, scope: MemoryScope) -> NativeStorageScope:
    """Accept explicit native kinds only, without inferring v0 identities."""
    from symfonic.capabilities.memory.storage_key import StorageScopeKey

    return cls(StorageScopeKey.from_scope(scope))