Error-handling conventions for a Rust CLI/library. Use when defining, returning, wrapping, or reporting errors, or deciding an exit code. Library crates define a typed thiserror enum per domain (#[error] messages, #[source] chain, #[from] conversions) — no anyhow/eyre in a library; the binary reports with miette (fancy handler installed in main) and the CLI seam is the single place errors map to an exit code + stderr; rich user-facing errors derive Diagnostic with a stable code/help/labelled span backed by an `explain <code>` surface; adapter/transport errors stay credential-free and a boundary "not found" becomes a typed/empty result; never panic for an expected failure.