Skip to content

style(fmt): unbreak rust-ci Test job (cargo fmt drift)#36

Merged
hyperpolymath merged 2 commits into
mainfrom
fix/fmt-drift
May 26, 2026
Merged

style(fmt): unbreak rust-ci Test job (cargo fmt drift)#36
hyperpolymath merged 2 commits into
mainfrom
fix/fmt-drift

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Summary

cargo fmt --check has been red on main since 2026-05-22, blocking the rust-ci Test job on every push. Two let-bindings in tests/seam_contract_tests.rs (lines 433 and 490) were wrapped onto two lines despite fitting on one.

Pure mechanical cargo fmt output — no semantic change.

Test plan

  • cargo fmt --check exits 0 locally
  • CI on PR: rust-ci Test job goes green

Out of scope

The Check MSRV (1.85.0) job is also red on main (eframe pulls in deps requiring rustc 1.92+) — that needs an MSRV bump or a downgrade decision, tracked separately.

🤖 Generated with Claude Code

…t_tests)

`cargo fmt --check` has been red on main since 2026-05-22 because two
let-bindings in tests/seam_contract_tests.rs (lines 433 and 490) were
wrapped onto two lines despite fitting on one. Pure mechanical `cargo
fmt` output — no semantic change.

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 added a commit that referenced this pull request May 26, 2026
## 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: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 with `chars().count() > 0` (still exercises unicode-iteration
smoke check)
- `benches/scan_bench.rs:8/221` — `criterion::black_box` →
`std::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

- [x] `cargo clippy --all-targets --all-features -- -D warnings` clean
- [x] `cargo fmt --check` clean
- [x] `cargo test --all-features --no-fail-fast` — all suites green
(218+218+... pass)
- [x] Signed commit, MPL-2.0 headers untouched
- [x] No semantic changes, no new API surface, no feature changes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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 09:05
@hyperpolymath hyperpolymath merged commit 8ac09d2 into main May 26, 2026
23 of 24 checks passed
@hyperpolymath hyperpolymath deleted the fix/fmt-drift branch May 26, 2026 09:09
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