Skip to content

symfonic.memory.warnings

warnings

Custom warning types for the symfonic memory subsystem.

Mirrors the symfonic.agent.warnings module shape -- a new module is scoped here under symfonic.memory rather than reusing the agent module because the layers themselves live in symfonic.memory.layers.*; importing symfonic.agent.warnings from a memory layer would invert the dependency direction.

MultiScopeIgnoredWarning

Bases: UserWarning

Emitted when a TenantScope carries inherits_from but the queried layer does not honour multi-scope retrieval.

Only the :class:~symfonic.memory.layers.procedural.layer.ProceduralLayer honours :attr:TenantScope.inherits_from. The :class:~symfonic.memory.layers.semantic.SemanticLayer, :class:~symfonic.memory.layers.episodic.EpisodicLayer, :class:~symfonic.memory.layers.working.WorkingLayer, and :class:~symfonic.memory.layers.prospective.ProspectiveLayer IGNORE the field by design -- see docs/concepts/procedural-shadow-inheritance.md for the design rationale (inheritance is not coherent on episodic event streams, session-scoped working memory, tenant-bound semantic facts, or bulk-empty prospective triggers).

Consequence: queries against non-procedural layers return ONLY the primary scope's results; entries in inherited scopes are NOT merged.

The warning fires once per (layer-instance, tenant_id, sub_tenant_id) triple per process. This is the right signal-to-noise ratio: adopters who pass a multi-scope scope ONLY to procedural never see the warning; adopters who route a multi-scope scope through every layer see exactly one warning per non-procedural layer per tenant.

To silence this warning once you understand the design constraint::

import warnings
from symfonic.memory.warnings import MultiScopeIgnoredWarning
warnings.filterwarnings("ignore", category=MultiScopeIgnoredWarning)

See docs/concepts/procedural-shadow-inheritance.md for the design rationale.