symfonic.kernel.contracts.run_identity¶
run_identity ¶
Run lineage shared by the kernel and delegation capabilities.
Each execution owns a fresh run_id. Delegation preserves the root id and
names the immediate parent; it never reuses the parent's id for a child.
RunLineage ¶
RunLineage(run_id: str, parents: tuple[RunLineage, ...], *, unresolved: bool = False, loop: Any = None)
One kernel run's place among the runs it was started inside.
Issued only by the kernel's run lifecycle, never by binding an identity, so code that binds a hand-built identity keeps the lineage of the run it is executing in, and code that strips its context has none -- until it starts a run, which descends from the run that spawned its task. Holds its parents strongly and no identity: a descendant keeps every ancestor's lineage -- and state keyed weakly on it -- alive after the ancestor's identity is gone (CORE-199 review F4).
unresolved: the run, or a run it descends from, named a parent or
root that is not among its issued ancestors -- one that ended and was
released, or was never issued here. Its lineage cannot be proved, so an
erase fence holds it to every capture it may have lost (CORE-194).
memory: stamped by the kernel at run start from the compiled plan
(CORE-194). A run that touched memory marks every ancestor, monotonically,
so a durable root proof is never sealed above it.
loop: the event loop the run was issued on, weakly, or None. A
capture keyed on the run lives on stores bound to that loop, so a
descendant on another loop proves it there (run_admission).
Source code in src/symfonic/kernel/contracts/run_identity.py
note_memory ¶
Stamp this run; True reaches every ancestor and is never cleared.
Source code in src/symfonic/kernel/contracts/run_identity.py
bind_run_identity ¶
Bind one identity for exactly the invocation that owns it.
Source code in src/symfonic/kernel/contracts/run_identity.py
current_run_identity ¶
current_run_lineage ¶
live_run_identity ¶
The first identity bound under run_id while it is still alive.
push_run_identity ¶
Bind identity and return the token its lifecycle owner resets.
reset_run_identity ¶
Reset a token returned by :func:push_run_identity or the kernel's issue.
Source code in src/symfonic/kernel/contracts/run_identity.py
run_ancestry ¶
lineage and every run it descends from, each once.