Errors
Use native Result for recoverable failures and ? for propagation.
Typed outcomes
Why
Invalid user input is an expected outcome. A panic hides that contract and can terminate unrelated work.
Rules
MUST returnResult<Content, Failure>for fallible domain operations.[review]
MUST classify failures with enums or another typed contract.[review]
MUST propagate Results with?, matching, or Result combinators.[review]
MUST keep authoredpanic!,unwrap,expect,todo!, andunimplemented!out of production application paths.[review]
MUST preserve contextual causes at resource boundaries.[review]
MUST avoid usingcatch_unwindas recoverable application control flow.[review]
MUST treat ordinary external failures through the external API's Result contract.[review]
MAY use assertions and unchecked fixture extraction in tests when failure should fail that test.[review]
Example
[review]
Failure-path tests establish the return contract. Configure Clippy restrictions for panics and unchecked extraction; the compiler alone does not ban them.
Enforcement
Failure-path tests establish the return contract. Configure Clippy restrictions for panics and unchecked extraction; the compiler alone does not ban them.