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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// SPDX-License-Identifier: MIT OR Apache-2.0
/// Errors produced by anamnesis operations.
///
/// # Rust → Python exception mapping (frozen for the Phase 8 bindings)
///
/// The `PyO3` bindings expose each variant as a distinct, catchable Python
/// exception under a common base, so a multi-tenant host can answer (for
/// example) *413* for a budget breach, *400* for malformed input, and a flagged
/// security event for a hostile pickle — never a dead worker:
///
/// | `AnamnesisError` | Python exception |
/// |---|---|
/// | `Parse` | `ParseError` |
/// | `Unsupported` | `UnsupportedError` |
/// | `LimitExceeded` | `LimitExceededError` |
/// | `DisallowedGlobal` | `SecurityError` |
/// | `Io` | builtin `OSError` |
///
/// `ParseError` / `UnsupportedError` / `LimitExceededError` / `SecurityError`
/// all subclass a base `AnamnesisError(Exception)`. The wiring lands in Phase 8;
/// this table is the contract it implements.
// Note: as of Phase 6.12 the `.pth` / `.npz` parsers no longer call the `zip`
// crate at runtime (they use the vendored `crate::parse::zip` reader, which
// returns `AnamnesisError` directly), so there is no `From<zip::result::ZipError>`
// bridge. `zip` is a dev-dependency only (test fixtures + the differential
// oracle).
/// A convenience alias for `Result<T, AnamnesisError>`.
pub type Result<T> = Result;