diff --git a/src/audit.py b/src/audit.py index 6880973..882d969 100644 --- a/src/audit.py +++ b/src/audit.py @@ -55,17 +55,19 @@ _LOG_PATH: Path | None = None _SESSION_ID: str | None = None _SESSION_STARTED: bool = False -# RESTORED kill switch — the async-writer redesign still triggers the -# blank-pages symptom on the user's machine despite no synchronous -# file I/O on the request path. Cause is not yet identified; keep all -# log_* calls as no-ops by default while we diagnose. +# Kill switch — held off by default now that the blank-pages symptom +# is traced to the audit_log_path/_session_id deadlock fixed in +# a8ff8f4. End-to-end validation in session cf2ebbd5 (2026-05-19) +# wrote session/upload/analyze/nav/session-end events with no +# regression. Flip back to ``True`` if the symptom recurs; the env +# vars below stay as escape hatches. # -# Diagnostic overrides for an instrumented run (DO NOT set in prod): -# DATATOOLS_AUDIT_ENABLED=1 — bypass _DISABLED for one session +# Env-var overrides (still wired): +# DATATOOLS_AUDIT_ENABLED=1 — force-on even if _DISABLED is True # DATATOOLS_AUDIT_TRACE=1 — print "[audit] ..." lines to stderr # DATATOOLS_AUDIT_PROBE=... — bisect the producer path. Values: # full (default) | noop | no-events | no-page-open | no-session-start -_DISABLED: bool = True +_DISABLED: bool = False _ENABLE_OVERRIDE: bool = os.environ.get("DATATOOLS_AUDIT_ENABLED") == "1" _TRACE: bool = os.environ.get("DATATOOLS_AUDIT_TRACE") == "1" _PROBE: str = os.environ.get("DATATOOLS_AUDIT_PROBE", "full").lower()