symfonic.capabilities.memory.storage_key¶
storage_key ¶
Versioned kind/ID storage keys; foundation only, no backend migration.
Wire grammar: symfonic.memory.storage/v1/(utf8hex:utf8hex/)+. Each complete level ends in "/", making an ancestor key a safe subtree prefix. Lowercase hex keeps all data delimiters out of the wire alphabet. In particular, keys contain no raw US, while every valid legacy TenantScope.scope_path does: even a root has a kind and ID separated by US. Thus the languages are disjoint, regardless of native-looking labels or punctuation in legacy fields.
This format does not infer kinds from v0/NULL rows, authorize their migration, or establish graph/vector persistence parity.
StorageScopeKey
dataclass
¶
Immutable v1 storage identity with exact root-first kind/ID levels.
Strings are preserved byte-for-byte as strict UTF-8 without normalization. NUL and lone surrogates are rejected at the persistence boundary. This conservative contract keeps decoded fields usable in text backends too.
subtree_prefix
property
¶
Complete-level prefix selecting self and descendants, never siblings.
Only compare against canonical v1 keys. The prefix contains no SQL LIKE wildcards; text backends still need exact/case-sensitive matching. This downward subtree selection differs from ancestor visibility.
ancestor_keys ¶
Exact membership list, root through self; excludes siblings and v0.
Use this list for ancestor visibility (e.g. equality/IN), never a partial string prefix. There is no inferred or empty universal root.
Source code in src/symfonic/capabilities/memory/storage_key.py
from_levels
classmethod
¶
Snapshot an iterable of immutable pairs without guessing kinds.
Source code in src/symfonic/capabilities/memory/storage_key.py
from_scope
classmethod
¶
Accept only validated native v1 scopes; refuse positional v0/NULL.
Source code in src/symfonic/capabilities/memory/storage_key.py
parse
classmethod
¶
Reject legacy, unknown versions, malformed UTF-8 and noncanonical wire.