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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
//! Unified error taxonomy and logbook registry for Kinetic.
//!
//! All errors in Kinetic follow a domain-specific hierarchy designed to prevent
//! raw OS error leakage, enforce RFC 7807 problem details URIs, and supply clean
//! user-facing messages.
//!
//! ## Kinetic Error Taxonomy Architecture
//!
//! Every specialized domain error (e.g. [`ResolutionError`], [`PublishError`], [`RegistrationError`])
//! provides a rich metadata interface:
//!
//! 1. **Stable Protocol Code**: Unique string code (e.g. `KIN-RES-001`, `KIN-PUB-003`, `KIN-REG-005`).
//! 2. **RFC 7807 Type URI**: Web specification URI for standard error documentation.
//! 3. **Retryability Flag** ([`is_retryable`](ResolutionError::is_retryable)): Indicates if clients should retry.
//! 4. **Severity Classifier** ([`Severity`]): Directs logging and alert levels (`Info`, `Warning`, `Error`, `Critical`).
//! 5. **User Message** ([`user_message`](ResolutionError::user_message)): Clean, non-technical explanation for UIs.
//! 6. **Developer Details** ([`details`](ResolutionError::details)): Structured JSON payload for API extractors.
//!
//! ## Error Code Namespaces
//!
//! | Prefix | Error Type | Domain |
//! |---|---|---|
//! | `KIN-RES-NNN` | [`ResolutionError`] | DHT name resolution |
//! | `KIN-PUB-NNN` | [`PublishError`] | DHT record publishing |
//! | `KIN-REG-NNN` | [`RegistrationError`] | Name registration flow |
//! | `KIN-VDF-NNN` | `VdfError` | VDF engine operations |
//! | `KIN-GOV-NNN` | `GovernanceError` | Council governance |
//! | `KIN-DNS-NNN` | `DnsError` | DNS zone parsing |
//! | `KIN-DRA-NNN` | `DrandError` | Drand beacon |
//! | `KIN-IDN-NNN` | `IdentityError` | Node identity keys |
//! | `KIN-NAM-NNN` | `NamesError` | Name validation |
//! | `KIN-STO-NNN` | `StorageError` | Sled storage engine |
//! | `KIN-NET-NNN` | `NetworkClientError` + `KineticStoreError` | P2P network client and store layer |
use Error;
/// DHT record rejection and resolution/publish/registration error types.
/// DNS Zone parsing and validation error types.
/// Drand Quicknet kyn acquisition and verification error types.
/// Council governance and parameter-update error types.
/// Node identity and seed phrase error types.
/// Name validation error types (`KIN-NAM-NNN`).
/// libp2p network client error types.
/// Sled storage engine error types.
/// chiavdf Verifiable Delay Function error types.
pub use ;
pub use DnsError;
pub use DrandError;
pub use GovernanceError;
pub use IdentityError;
pub use NamesError;
pub use NetworkClientError;
pub use StorageError;
pub use ;
/// Top-level error type for core Kinetic protocol operations.
///
/// Encapsulates all subsystem errors into a single unified enum used across
/// core kernel API boundaries. Subsystem-specific errors should be used directly
/// inside their respective modules; this type is for cross-cutting operations
/// that span multiple domains.
///
/// # Protocol Context
///
/// This is the "catch-all" error type at kernel boundaries. Callers in `kinetic-daemon`
/// and `kinetic-network` that cross subsystem lines use this type. For richer context
/// (error codes, retryability, user messages), prefer the domain-specific error types.
// ─── Severity ─────────────────────────────────────────────────────────────────
/// Alert and logging severity level for a Kinetic error.
///
/// Every domain error type implements a `severity()` method returning one of
/// these variants. The severity drives log level selection in
/// `KineticStoreError::log_warning` and alert routing in monitoring pipelines.
///
/// # Operational Meaning
///
/// | Variant | Log Level | Action Required |
/// |---|---|---|
/// | `Info` | `tracing::info!` | Normal protocol outcome; no action needed |
/// | `Warning` | `tracing::warn!` | Transient or expected condition; monitor |
/// | `Error` | `tracing::error!` | Unexpected failure; investigate |
/// | `Critical` | `tracing::error!` | Security or liveness threat; page on-call |
///
///