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
40
41
42
43
44
//! Hook event handler adapter (issue #191, task-a).
//!
//! Thin command-surface module that reads the Claude Code JSON payload
//! from stdin, delegates to the `crate::hook` module (task-b), and
//! always exits 0 with empty stdout on any non-fatal failure.
//!
//! The hook path must never load the ONNX model.
use Read;
use ExitCode;
/// Read the full stdin payload and run the hook pipeline.
///
/// Always returns `ExitCode::SUCCESS` — the hook must never surface an
/// error to the agent mid-session (malformed stdin, DB lock, empty
/// extraction, unknown event all map to silent success).
///
/// # Errors
///
/// Returns `Err` only on catastrophic failure that the caller should
/// still map to exit 0.
// `config` reserved for task-b's DB path