1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! 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.
/// Whether `SKI_DEBUG` is set (any value, including empty).
/// Print `ski: {context}: {err}` to stderr iff `SKI_DEBUG` is set. No-op
/// otherwise. `context` should read as a fragment ("hook decide failed").