Skip to content

fix: unbreak rust-ci Test job (clippy 1.95 + missing fields)#38

Merged
hyperpolymath merged 2 commits into
mainfrom
fix/clippy-baseline-rot
May 26, 2026
Merged

fix: unbreak rust-ci Test job (clippy 1.95 + missing fields)#38
hyperpolymath merged 2 commits into
mainfrom
fix/clippy-baseline-rot

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Summary

cargo clippy --all-targets --all-features -- -D warnings and cargo test were both red on main after 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 Test job in rust-ci reusable.

Lib clippy fixes (5 sites)

File Lint Fix
src/assemblyline.rs:435 unnecessary_sort_by sort_by_key(|r| Reverse(...))
src/bridge/lockfile.rs:23 type_complexity type LockfileParser = fn(&Path) -> Result<...>
src/bridge/registry.rs:71 new_without_default impl Default for MitigationRegistry forwarding to new()
src/mass_panic/imaging.rs:201 unnecessary_sort_by sort_by_key(|c| Reverse(...))
src/storage/mod.rs:586 needless_range_loop for (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) across src/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 — add CrashReport.schema_version field
  • tests/report_tests.rs:62 — same
  • tests/panll_tests.rs:247map_or(false, ..)is_some_and(..)
  • tests/aspect_tests.rs:230|path| f(path)f (redundant closure)
  • tests/property_tests.rs:137if let Some(_) = ...is_some()
  • tests/property_tests.rs:260vec![..][..] (useless_vec)
  • tests/property_tests.rs:325 — replaced tautological !is_empty() on const with chars().count() > 0 (still exercises unicode-iteration smoke check)
  • benches/scan_bench.rs:8/221criterion::black_boxstd::hint::black_box (deprecated); add safe_unwrap_calls: 0 to ProgramStatistics literal

Overlap with PR #36

The tests/seam_contract_tests.rs:433/490 fmt 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 warnings clean
  • cargo fmt --check clean
  • cargo test --all-features --no-fail-fast — all suites green (218+218+... pass)
  • Signed commit, MPL-2.0 headers untouched
  • No semantic changes, no new API surface, no feature changes

🤖 Generated with Claude Code

`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>
@github-actions
Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 49 issues detected

Severity Count
🔴 Critical 4
🟠 High 16
🟡 Medium 29

⚠️ Action Required: Critical security issues found!

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

@hyperpolymath hyperpolymath enabled auto-merge (squash) May 26, 2026 08:34
@github-actions
Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 49 issues detected

Severity Count
🔴 Critical 4
🟠 High 16
🟡 Medium 29

⚠️ Action Required: Critical security issues found!

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

@hyperpolymath hyperpolymath merged commit a9b23d8 into main May 26, 2026
27 of 28 checks passed
@hyperpolymath hyperpolymath deleted the fix/clippy-baseline-rot branch May 26, 2026 08:36
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