Skip to content

symfonic.capabilities.memory.turn_lineage

turn_lineage

A kernel run's inherited erase admissions, proved before its turn reads.

A run inherits the captures of every run it was started inside: a delegated child, a task a tool spawned (also with an empty context), and a long-lived worker such a task became. The mutation fence re-proves them for each write; a turn's admission stage proves them before retrieval, so a run descending from a capture a forget has since covered refuses before its model, tools or writes, whatever scope it composes (CORE-199/194 owner rule).

ambient_fences

ambient_fences() -> tuple[Fence, ...]

Every capture of the running kernel run and the runs it descends from.

Source code in src/symfonic/capabilities/memory/turn_lineage.py
def ambient_fences() -> tuple[Fence, ...]:
    """Every capture of the running kernel run and the runs it descends from."""
    from symfonic.kernel.contracts.run_identity import current_run_lineage, run_ancestry

    lineage = current_run_lineage()
    return () if lineage is None else _fences(run_ancestry(lineage))

prove_ancestry async

prove_ancestry() -> None

Refuse unless every inherited capture is still exactly current.

Source code in src/symfonic/capabilities/memory/turn_lineage.py
async def prove_ancestry() -> None:
    """Refuse unless every inherited capture is still exactly current."""
    await _prove_all(ambient_fences())

prove_runs async

prove_runs(runs: tuple[Any, ...]) -> None

The kernel's run-start preflight: prove the captures of a run's ancestry.

Each fence is proved on its capturing composition's own pool, so a run composing no memory is held to the captures of the runs it descends from. A run naming a lineage it cannot prove refuses typed, before any fence: it may have lost a capture no fence here still records (CORE-194).

Source code in src/symfonic/capabilities/memory/turn_lineage.py
async def prove_runs(runs: tuple[Any, ...]) -> None:
    """The kernel's run-start preflight: prove the captures of a run's ancestry.

    Each fence is proved on its capturing composition's own pool, so a run
    composing no memory is held to the captures of the runs it descends from.
    A run naming a lineage it cannot prove refuses typed, before any fence:
    it may have lost a capture no fence here still records (CORE-194).
    """
    if any(run.unresolved for run in runs):
        raise MemoryContractError(UNRESOLVED)
    await _prove_all(_fences(runs))