refactor(error): organize errors by epistemic category (B_i/I^B)#8
Merged
Conversation
Apply EAE Rust skill to error taxonomy for improved architecture robustness: - Reorganize M2MError variants into three groups: - B_i Falsified: Caller's belief proven wrong (validation errors) - I^B Materialized: Bounded ignorance (network, RNG, I/O) - Security: Policy violations (special handling required) - Add helper methods for error classification: - is_retryable(): I^B errors are retryable, B_i errors are not - is_security_error(): Security threats require special handling - is_bounded_ignorance() / is_belief_falsified(): Epistemic queries - Update CryptoError with consistent epistemic documentation - Add comprehensive module docs explaining the taxonomy and usage This improves maintainability by making failure modes explicit and helping developers understand appropriate error handling strategies.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Apply EAE Rust skill to error taxonomy for improved architecture robustness.
M2MErrorvariants into three epistemic groupsCryptoErrorwith consistent documentationEpistemic Categories
B_i Falsified (Belief Proven Wrong)
Caller's assumption about validity was incorrect. These are "expected" errors.
SessionNotEstablished,InvalidMessage,Decompression, etc.I^B Materialized (Bounded Ignorance)
External state was unknown until runtime. Inherent uncertainty.
Network,Upstream,Io,Inference, etc.Security (Policy Violations)
Special category requiring explicit handling.
SecurityThreat,ContentBlockedNew Helper Methods
Files Changed
src/error.rs- Major refactor with epistemic organizationsrc/codec/m2m/crypto/error.rs- Enhanced documentationTesting