13 lines
445 B
Python
13 lines
445 B
Python
"""Per-run context — exposes the active run_id to code deep in the call stack
|
|
without threading it through every signature.
|
|
|
|
Set by the runtime at run entry; read by Analyses and helper functions so they
|
|
can publish trace events without needing the run_id passed in explicitly.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from contextvars import ContextVar
|
|
|
|
current_run_id: ContextVar[str | None] = ContextVar("nvi.current_run_id", default=None)
|