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
56
57
58
59
60
61
//! Structured error type for the intelligence crate (T2.7 scaffold).
//!
//! Public API note: the crate's existing functions return
//! `anyhow::Result<T>` and that surface is **preserved** to avoid
//! rippling type changes across all callers (server, analyze, the
//! cold-window engine). [`IntelligenceError`] is exposed alongside
//! `anyhow::Error` for callers that want to match on specific
//! failure modes, e.g. retry on `GitHubApi { status: 502 .. }`.
//!
//! Internal call sites currently use `anyhow::bail!` for ergonomics.
//! Migration of those sites to construct [`IntelligenceError`]
//! variants is follow-up work; the conversion is automatic via the
//! `?` operator because `IntelligenceError` implements
//! `std::error::Error` and `anyhow::Error: From<E>`.
use PathBuf;
/// Errors that may arise from the intelligence crate.
///
/// Variants enumerate the *user-meaningful* failure modes, the
/// situations a caller might want to handle differently (retry,
/// fall back, surface to user) rather than just propagate.