Skip to content

symfonic.capabilities.memory.activation_layers

activation_layers

Keep the builtin spreading activation inside the turn's layer set (CORE-97).

The seed gate admits only RetrievalPolicy.effective_layers(query), the enabled layers narrowed by the query's own. A neighbour skips that gate, so an unbounded walk returned a disabled layer through any edge from an enabled one, in the recall and in the activation log that events and candidate capture read.

The builtin walk is bounded at its association source, so it never traverses an edge into an excluded layer: nothing outside the set takes a node-cap slot or is reached through one. A custom activation is not told the set and is returned unchanged.

LayerBoundAssociations dataclass

LayerBoundAssociations(source: AssociationSource, layers: frozenset[MemoryLayer])

An association source that never offers an edge out of layers.

bound_to

bound_to(activation: Any, layers: frozenset[MemoryLayer]) -> Any

activation walking only layers; a custom walk is returned as is.

Source code in src/symfonic/capabilities/memory/activation_layers.py
def bound_to(activation: Any, layers: frozenset[MemoryLayer]) -> Any:
    """``activation`` walking only ``layers``; a custom walk is returned as is."""
    if type(activation) is not SpreadingActivation:
        return activation
    return replace(activation, source=LayerBoundAssociations(activation.source, layers))