fix: unbreak rust-ci Test job (clippy 1.95 + missing fields)#38
Merged
Conversation
`cargo clippy --all-targets --all-features -- -D warnings` and `cargo test` were both red on main: * clippy 1.95.0 surfaced new lints across lib/tests/bench: unnecessary_map_or, manual_range_contains, unnecessary_sort_by, needless_range_loop, type_complexity, new_without_default, redundant_closure, redundant_pattern_matching, useless_vec, len_zero, const_is_empty, format_in_format_args. * `criterion::black_box` is deprecated in favour of `std::hint::black_box`. * `tests/panll_tests.rs` + `tests/report_tests.rs` constructed `CrashReport` without the (non-default) `schema_version` field that was added in v2.5; `benches/scan_bench.rs` constructed `ProgramStatistics` without `safe_unwrap_calls`. All edits are semantic identities: sort_by → sort_by_key + Reverse, needless range-loop → enumerate-over-iter, fn-pointer column → type alias, MitigationRegistry::new() → Default impl forwarding, `(200..300).contains(&status)` for HTTP status check, `is_some_and` in place of `map_or(false, ...)`, etc. The `tests/seam_contract_tests.rs` fmt collapses on lines 433/490 overlap with PR #36 (same fix) — second to land will be a no-op. Estate guardrail: no Python, no PMPL-1.0, signed commit, MSRV-safe identities only (no new API surface, no feature changes). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
🔍 Hypatia Security ScanFindings: 49 issues detected
View findings[
{
"reason": "Action hyperpolymath/standards/.github/workflows/governance-reusable.yml@main needs attention",
"type": "unpinned_action",
"file": "governance.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Nickel file missing SPDX-License-Identifier header (1 occurrences, CWE-1104)",
"type": "ncl_missing_spdx",
"file": "/home/runner/work/panic-attack/panic-attack/reports/panic-attack-20260211180017.ncl",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
},
{
"reason": "expect() in hot path (2 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/panic-attack/panic-attack/src/attestation/chain.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
},
{
"reason": "unwrap_or(0) with dangerous default (1 occurrences, CWE-754)",
"type": "unwrap_dangerous_default",
"file": "/home/runner/work/panic-attack/panic-attack/src/attestation/evidence.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "critical"
},
{
"reason": "unwrap_or(0) with dangerous default (1 occurrences, CWE-754)",
"type": "unwrap_dangerous_default",
"file": "/home/runner/work/panic-attack/panic-attack/src/ambush/mod.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "critical"
},
{
"reason": "unwrap_or(0) with dangerous default (3 occurrences, CWE-754)",
"type": "unwrap_dangerous_default",
"file": "/home/runner/work/panic-attack/panic-attack/src/kanren/strategy.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "critical"
},
{
"reason": "unwrap_or(0) with dangerous default (3 occurrences, CWE-754)",
"type": "unwrap_dangerous_default",
"file": "/home/runner/work/panic-attack/panic-attack/src/axial/mod.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "critical"
},
{
"reason": "expect() in hot path (4 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/panic-attack/panic-attack/src/assail/analyzer.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
},
{
"reason": "unwrap() without prior check -- DoS via panic (4 occurrences, CWE-754)",
"type": "unwrap_without_check",
"file": "/home/runner/work/panic-attack/panic-attack/benches/scan_bench.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "high"
},
{
"reason": "expect() in hot path (2 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/panic-attack/panic-attack/benches/scan_bench.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
}
]Powered by Hypatia Neurosymbolic CI/CD Intelligence |
🔍 Hypatia Security ScanFindings: 49 issues detected
View findings[
{
"reason": "Action hyperpolymath/standards/.github/workflows/governance-reusable.yml@main needs attention",
"type": "unpinned_action",
"file": "governance.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Nickel file missing SPDX-License-Identifier header (1 occurrences, CWE-1104)",
"type": "ncl_missing_spdx",
"file": "/home/runner/work/panic-attack/panic-attack/reports/panic-attack-20260211180017.ncl",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
},
{
"reason": "expect() in hot path (2 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/panic-attack/panic-attack/src/attestation/chain.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
},
{
"reason": "unwrap_or(0) with dangerous default (1 occurrences, CWE-754)",
"type": "unwrap_dangerous_default",
"file": "/home/runner/work/panic-attack/panic-attack/src/attestation/evidence.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "critical"
},
{
"reason": "unwrap_or(0) with dangerous default (1 occurrences, CWE-754)",
"type": "unwrap_dangerous_default",
"file": "/home/runner/work/panic-attack/panic-attack/src/ambush/mod.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "critical"
},
{
"reason": "unwrap_or(0) with dangerous default (3 occurrences, CWE-754)",
"type": "unwrap_dangerous_default",
"file": "/home/runner/work/panic-attack/panic-attack/src/kanren/strategy.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "critical"
},
{
"reason": "unwrap_or(0) with dangerous default (3 occurrences, CWE-754)",
"type": "unwrap_dangerous_default",
"file": "/home/runner/work/panic-attack/panic-attack/src/axial/mod.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "critical"
},
{
"reason": "expect() in hot path (4 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/panic-attack/panic-attack/src/assail/analyzer.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
},
{
"reason": "unwrap() without prior check -- DoS via panic (4 occurrences, CWE-754)",
"type": "unwrap_without_check",
"file": "/home/runner/work/panic-attack/panic-attack/benches/scan_bench.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "high"
},
{
"reason": "expect() in hot path (2 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/panic-attack/panic-attack/benches/scan_bench.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
}
]Powered by Hypatia Neurosymbolic CI/CD Intelligence |
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
cargo clippy --all-targets --all-features -- -D warningsandcargo testwere both red onmainafter the toolchain rolled to Rust 1.95.0 and two struct fields (CrashReport::schema_version,ProgramStatistics::safe_unwrap_calls) were added in v2.5.0 without updating every test/bench literal.This PR unblocks the
Testjob inrust-cireusable.Lib clippy fixes (5 sites)
src/assemblyline.rs:435unnecessary_sort_bysort_by_key(|r| Reverse(...))src/bridge/lockfile.rs:23type_complexitytype LockfileParser = fn(&Path) -> Result<...>src/bridge/registry.rs:71new_without_defaultimpl Default for MitigationRegistryforwarding tonew()src/mass_panic/imaging.rs:201unnecessary_sort_bysort_by_key(|c| Reverse(...))src/storage/mod.rs:586needless_range_loopfor (attempt, delay) in delays.iter().enumerate()Plus 9 lints already auto-fixed by
cargo clippy --fix(unnecessary_map_or,manual_range_contains,format_in_format_args,single_component_path_imports) acrosssrc/assail/analyzer.rs,src/bridge/{lockfile,reachability}.rs,src/main.rs,src/storage/mod.rs,tests/seam_contract_tests.rs.Test/bench fixes (6 sites)
tests/panll_tests.rs:222— addCrashReport.schema_versionfieldtests/report_tests.rs:62— sametests/panll_tests.rs:247—map_or(false, ..)→is_some_and(..)tests/aspect_tests.rs:230—|path| f(path)→f(redundant closure)tests/property_tests.rs:137—if let Some(_) = ..→.is_some()tests/property_tests.rs:260—vec![..]→[..](useless_vec)tests/property_tests.rs:325— replaced tautological!is_empty()on const withchars().count() > 0(still exercises unicode-iteration smoke check)benches/scan_bench.rs:8/221—criterion::black_box→std::hint::black_box(deprecated); addsafe_unwrap_calls: 0toProgramStatisticsliteralOverlap with PR #36
The
tests/seam_contract_tests.rs:433/490fmt collapses overlap with PR #36 (identical fix). Whichever lands second will be a no-op merge.Test plan
cargo clippy --all-targets --all-features -- -D warningscleancargo fmt --checkcleancargo test --all-features --no-fail-fast— all suites green (218+218+... pass)🤖 Generated with Claude Code