Skip to content

symfonic.capabilities.prompting.layers

layers

The stratigraphic ladder: three layers, ordered by how often they change.

Stratigraphy is a volatility ordering, not a topic ordering. L0 holds the authored spine (instructions, boundaries) that changes when a deployment changes; L1 holds standing context stable for a session; L2 holds everything that moves per turn. Sorting by volatility is what makes a cached prefix possible at all: one per-turn token anywhere inside a cached region invalidates every region before it, so the layers exist to keep that token behind them.

The ladder is absolute. A contribution states its layer; it never states a position relative to another capability's contribution, which is the same rule the kernel's phase ladder applies to stages and for the same reason.

Layer

Bases: StrEnum

The three stratigraphic layers, most stable first.

is_volatile

is_volatile(layer: Layer) -> bool

True when content in layer may change between turns of one session.

Source code in src/symfonic/capabilities/prompting/layers.py
def is_volatile(layer: Layer) -> bool:
    """``True`` when content in ``layer`` may change between turns of one session."""
    return layer not in STABLE_LAYERS

layer_index

layer_index(layer: Layer) -> int

Position of layer on the ladder; lower renders earlier.

Source code in src/symfonic/capabilities/prompting/layers.py
def layer_index(layer: Layer) -> int:
    """Position of ``layer`` on the ladder; lower renders earlier."""
    return LAYER_LADDER.index(layer)