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
45
46
47
48
49
50
51
52
53
54
55
//! Tool-failure classification policy for the RSI feedback ledger.
//!
//! Not every tool call that returns `success = false` is a tool DEFECT worth
//! learning from. Many are expected, environmental, or user-driven outcomes:
//! a stale-hash mismatch the agent simply retries after re-reading; a
//! channel-send tool with no live bot connected; a user declining an
//! interactive prompt. Counting these as failures dragged tool success-rates
//! down and led the RSI to ban working built-in tools — e.g. escalating
//! `hashline_edit` to a "blanket DO NOT USE" over recoverable stale-hash
//! errors (#236).
//!
//! This module is the single place that decides whether a failed call is
//! *recoverable* (recorded, but kept OUT of the `tool_` success-rate
//! denominator) or a genuine failure.
/// Whether a failed tool call is a recoverable / environmental / user-driven
/// outcome rather than a tool defect.
///
/// Recoverable failures are still recorded in the ledger (under a non-`tool_`
/// event type) so they stay queryable, but they never count against the tool's
/// success rate and therefore never drive the RSI to disable a working tool.