fix: make production panic controls falsifiable - #176
Conversation
7d3cf4b to
b6b13d1
Compare
There was a problem hiding this comment.
Configure merge blocking · Maintainers can dismiss this review.
|
Note Automatic reviews are paused because your trial's included automatic processing has been used for this period. Upgrade now, or comment "Gitar review" to run a review anytime. Code Review 👍 Approved with suggestions 0 resolved / 2 findingsRefactors Rust production panic-surface analysis to correctly flag unwrap and panic calls while excluding test and benchmark paths. Consider addressing brittle byte-matching for
💡 Edge Case: should_panic stripping keys on attribute alone, enabling evasion📄 src/assail/analyzer.rs:1679-1693
💡 Quality: should_panic/cfg matching is brittle to attribute whitespace/variants📄 src/assail/analyzer.rs:1686 📄 src/assail/analyzer.rs:1552 📄 src/assail/analyzer.rs:1609-1611 The byte matchers require the exact literals 🤖 Prompt for agentsOptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Important Your trial ends in 1 day — upgrade now to keep code review, CI analysis, auto-apply, custom automations, and more. Was this helpful? React with 👍 / 👎 | Gitar |
|
Note Automatic reviews are paused because your trial's included automatic processing has been used for this period. Upgrade now, or comment "Gitar review" to run a review anytime. Code Review 👍 Approved with suggestions 0 resolved / 2 findingsRefactors Rust production panic-surface analysis to correctly flag unwrap and panic calls while excluding test and benchmark paths. Consider addressing brittle byte-matching for
💡 Edge Case: should_panic stripping keys on attribute alone, enabling evasion📄 src/assail/analyzer.rs:1679-1693
💡 Quality: should_panic/cfg matching is brittle to attribute whitespace/variants📄 src/assail/analyzer.rs:1686 📄 src/assail/analyzer.rs:1552 📄 src/assail/analyzer.rs:1609-1611 The byte matchers require the exact literals 🤖 Prompt for agentsOptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Important Your trial ends in 1 day — upgrade now to keep code review, CI analysis, auto-apply, custom automations, and more. Was this helpful? React with 👍 / 👎 | Gitar |
What changed
panic!()or.unwrap()aPanicPathfinding;tests/,benches/,#[cfg(test)]functions/modules,#[should_panic]bodies, andbuild.rsfrom the production panic surface;.unwrap()is protected by aResultboundary;Why
Issue #171's original zero-finding criterion could pass both a correct exclusion and an exclusion that accidentally hid production code. The previous analyzer also counted explicit panic sites without emitting a finding, required more than five unwrap/expect calls, and suppressed unwrap findings based only on the presence of unwraps in a Rust file.
The new fixture proves all three directions: one production explicit panic is visible, one production
None::<()>.unwrap()is visible, and test/benchmark/#[should_panic]/build.rspanic code produces zero active findings.Validation
cargo testpasses all library, integration, end-to-end, readiness, and doc tests (381 library tests passed; 3 regression tests remain intentionally ignored).Closes #171.