Overview
Severity: CRITICAL
Defect Class: Cloudflare 2025-11-18 outage class
Current Count: 326 unwrap() calls in production code
Target: 0 unwrap() calls
Background
The Cloudflare network outage on 2025-11-18 (3+ hour downtime) was caused by a single unwrap() panic in production code. This is a known Rust anti-pattern that can cause process termination without recovery.
PMAT rust-project-score identified 326 unwrap() calls in aprender's codebase.
Problem
// ❌ DANGEROUS: Can panic and crash the process
let value = some_option.unwrap();
// ✅ SAFE: Descriptive error message
let value = some_option.expect("Configuration must have value X");
// ✅ BETTER: Proper error handling
let value = some_option.ok_or_else(|| AprenderError::MissingValue)?;
Remediation Plan
Phase 1: Audit and Categorize (Week 1)
Phase 2: Enforce Policy (Week 1)
disallowed-methods = [
{ path = "core::option::Option::unwrap", reason = "Use expect() with descriptive message or proper error handling" },
{ path = "core::result::Result::unwrap", reason = "Use expect() with descriptive message or proper error handling" },
]
Phase 3: Fix Production Code (Weeks 2-4)
Phase 4: Verification (Week 4)
Success Criteria
Resources
Timeline
Start: Immediately
Target Completion: 4 weeks
Priority: P0 (Critical)
Assignee: Team
Estimated Effort: 40-60 hours
Overview
Severity: CRITICAL
Defect Class: Cloudflare 2025-11-18 outage class
Current Count: 326 unwrap() calls in production code
Target: 0 unwrap() calls
Background
The Cloudflare network outage on 2025-11-18 (3+ hour downtime) was caused by a single
unwrap()panic in production code. This is a known Rust anti-pattern that can cause process termination without recovery.PMAT rust-project-score identified 326 unwrap() calls in aprender's codebase.
Problem
Remediation Plan
Phase 1: Audit and Categorize (Week 1)
rg "\.unwrap\(\)" src/ --statsPhase 2: Enforce Policy (Week 1)
.clippy.toml:.pmat-gates.toml:max_unwraps = 0cargo clippy -- -D clippy::disallowed-methodsPhase 3: Fix Production Code (Weeks 2-4)
// SAFETY:commentsPhase 4: Verification (Week 4)
Success Criteria
Resources
pmat rust-project-score(shows unwrap count)Timeline
Start: Immediately
Target Completion: 4 weeks
Priority: P0 (Critical)
Assignee: Team
Estimated Effort: 40-60 hours