Skip to content

refactor(error): organize errors by epistemic category (B_i/I^B)#8

Merged
aWN4Y25pa2EK merged 1 commit into
mainfrom
feat/epistemic-error-taxonomy
Jan 21, 2026
Merged

refactor(error): organize errors by epistemic category (B_i/I^B)#8
aWN4Y25pa2EK merged 1 commit into
mainfrom
feat/epistemic-error-taxonomy

Conversation

@aWN4Y25pa2EK
Copy link
Copy Markdown
Member

Summary

Apply EAE Rust skill to error taxonomy for improved architecture robustness.

  • Reorganize M2MError variants into three epistemic groups
  • Add helper methods for error classification
  • Update CryptoError with consistent documentation

Epistemic Categories

B_i Falsified (Belief Proven Wrong)

Caller's assumption about validity was incorrect. These are "expected" errors.

  • SessionNotEstablished, InvalidMessage, Decompression, etc.
  • Handling: Validate inputs, don't retry without changes

I^B Materialized (Bounded Ignorance)

External state was unknown until runtime. Inherent uncertainty.

  • Network, Upstream, Io, Inference, etc.
  • Handling: Retry with backoff, circuit breakers, fallbacks

Security (Policy Violations)

Special category requiring explicit handling.

  • SecurityThreat, ContentBlocked
  • Handling: Do NOT retry, log for audit

New Helper Methods

impl M2MError {
    pub fn is_retryable(&self) -> bool { ... }
    pub fn is_security_error(&self) -> bool { ... }
    pub fn is_bounded_ignorance(&self) -> bool { ... }
    pub fn is_belief_falsified(&self) -> bool { ... }
}

Files Changed

  • src/error.rs - Major refactor with epistemic organization
  • src/codec/m2m/crypto/error.rs - Enhanced documentation

Testing

  • All 269 tests pass
  • Clippy clean
  • No API breaking changes (additive only)

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.
@aWN4Y25pa2EK aWN4Y25pa2EK merged commit 02e8c9e into main Jan 21, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant