4ceb3a5157
* feat: enforce precise timing output contract * fix: recognize package imports in fragment audit * test: make workflow stream contract formatting-independent * fix: preserve VedAstro evidence across async workflows * feat: enforce commercial technique truth contract * feat: add rectification technique receipt * feat: extend rectification event evidence * feat: score rectification arudha evidence * feat: gate high rigor rectification confirmation * feat: add controlled transit to rectification * feat: include d11 in rectification finance scoring * feat: add ashtakavarga rectification auxiliary * feat: show rectification technique receipt * feat: use verified shadbala components in rectification * fix: trace transitive script references in fragment audit * feat: run request-level rectification parity packet
25 lines
631 B
Python
25 lines
631 B
Python
"""Thread-local execution controls shared by every VedAstro import path."""
|
|
from __future__ import annotations
|
|
|
|
from contextlib import contextmanager
|
|
import contextvars
|
|
|
|
|
|
_TIMEOUT_OVERRIDE_SECONDS: contextvars.ContextVar[float | None] = contextvars.ContextVar(
|
|
"vedastro_timeout_override_seconds",
|
|
default=None,
|
|
)
|
|
|
|
|
|
def timeout_override_seconds() -> float | None:
|
|
return _TIMEOUT_OVERRIDE_SECONDS.get()
|
|
|
|
|
|
@contextmanager
|
|
def temporary_timeout_seconds(seconds: float):
|
|
token = _TIMEOUT_OVERRIDE_SECONDS.set(max(1.0, float(seconds)))
|
|
try:
|
|
yield
|
|
finally:
|
|
_TIMEOUT_OVERRIDE_SECONDS.reset(token)
|