Skip to main content

Module trace

Module trace 

Source
Expand description

Opt-in stderr diagnostics for the fail-open hot paths.

hook/observe/session-start swallow every error by design (README: “fail-open everywhere”) so a ranking problem never blocks a prompt. That contract has a cost: when injection silently stops, there is normally nothing to debug with — the hook just goes quiet forever with no trace of why. debug prints the swallowed error to stderr, but only when SKI_DEBUG is set, so the default (quiet) behavior is unchanged and a user who suspects something is wrong has a way to find out what.

Functions§

debug
Print ski: {context}: {err} to stderr iff SKI_DEBUG is set. No-op otherwise. context should read as a fragment (“hook decide failed”).
enabled
Whether SKI_DEBUG is set (any value, including empty).