Skip to content

symfonic.memory.classification

classification

Atomic persisted category/subject identity, shared by readers and writers.

MemoryCategory

Bases: StrEnum

What a memory describes; distinct from its physical storage layer.

layer property

layer: str

The one storage layer licensed by this category.

classification_identity

classification_identity(properties: Mapping[str, Any], *, layer: Any = None) -> tuple[tuple[str, str] | None, str]

Never combine halves or accept conflicting compatibility spellings.

Source code in src/symfonic/memory/classification.py
def classification_identity(
    properties: Mapping[str, Any], *, layer: Any = None,
) -> tuple[tuple[str, str] | None, str]:
    """Never combine halves or accept conflicting compatibility spellings."""
    nested = properties.get("record_metadata")
    producer = nested if isinstance(nested, Mapping) else {}
    top, top_error = _part(properties, layer)
    inner, inner_error = _part(producer, layer)
    if top_error or inner_error:
        return None, top_error or inner_error
    if top is not None and inner is not None and top != inner:
        return None, "classification_conflict"
    return top or inner, ""