Skip to content

ci: adopt fleet-standard CI (resolve clippy -D warnings + true MSRV 1.85) - #1

Merged
h4x0r merged 6 commits into
mainfrom
ci/add-standard-ci
Jul 27, 2026
Merged

ci: adopt fleet-standard CI (resolve clippy -D warnings + true MSRV 1.85)#1
h4x0r merged 6 commits into
mainfrom
ci/add-standard-ci

Conversation

@h4x0r

@h4x0r h4x0r commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Resolves two pre-existing blockers so exec-pe-forensic can adopt the fleet-standard CI, then adds ci.yml.

Blocker A — clippy -D warnings (clean)

  • Auto-fixed (cargo clippy --fix): cast_lossless (u32/u16 → From), manual_range_contains, redundant closures, single_char_pattern, collapsible_if, unused imports.
  • Root-cause rewrites: manual_checked_opschecked_div (anomalies.rs); manual_let_elselet...else (overlay.rs).
  • Dead-line removal: pe[0x56] = if is_dll { 0x22 | 0x20 } else { 0x22 } in a parser test helper — both branches equal 0x22 and the value is overwritten two lines later.
  • Fleet [workspace.lints.clippy] recipe: correctness/suspicious deny, unwrap_used/expect_used deny (this is an untrusted-input parser), plus the pragmatic allows (incl. too_many_lines, struct_excessive_bools, items_after_statements). Tests opt out via #![cfg_attr(test, allow(clippy::unwrap_used, clippy::expect_used))].

Blocker B — true MSRV

Declared rust-version was 1.80 but false: goblin 0.10 → scroll_derive 0.13.x is edition-2024 (needs 1.85). Set to 1.85 — the honest floor. Verified: cargo +1.85.0 build --all-features --locked passes; 1.84 fails on scroll_derive (feature edition2024 is required).

CI (.github/workflows/ci.yml)

SHA-pinned actions; Swatinem/rust-cache after each toolchain step in compiling jobs. Jobs: fmt, clippy (--all-targets --all-features -D warnings), test (ubuntu/macos/windows matrix, --all-features), check-msrv (1.85.0, --locked), coverage (cargo llvm-cov, advisory/continue-on-error, ~94% at adoption — TODO to make a hard gate at 100%), cargo-deny (bans/licenses/sources + advisories). vet.yml left untouched.

Local verification

  • clippy --all-targets --all-features -- -D warnings: clean
  • cargo fmt --check: clean
  • cargo test --all-features: 181 passed
  • cargo +1.85.0 build --all-features --locked: ok; 1.84 fails on scroll_derive
  • cargo deny check bans licenses sources: ok
  • line coverage: 94.08%

🤖 Generated with Claude Code

h4x0r and others added 6 commits July 27, 2026 08:17
Blocker A — clippy --all-targets --all-features -- -D warnings:
- Auto-fixed (cargo clippy --fix): cast_lossless (u32/u16 -> From),
  manual_range_contains, redundant closures, single_char_pattern,
  collapsible_if, unused imports.
- Root-cause: manual_checked_ops -> checked_div (anomalies.rs);
  manual_let_else -> let...else (overlay.rs).
- Removed a provably-dead no-op line in parser.rs test helper
  (pe[0x56] = if is_dll {0x22|0x20} else {0x22}; both branches == 0x22
  and overwritten two lines later).
- Fleet [workspace.lints.clippy] recipe: correctness/suspicious deny,
  unwrap_used/expect_used deny (parser keeps panic-free denies), and
  pragmatic allows (module_name_repetitions, must_use_candidate,
  missing_errors/panics_doc, cast_* , too_many_lines,
  struct_excessive_bools, items_after_statements).
- Tests opt out of the panic denies via
  #![cfg_attr(test, allow(clippy::unwrap_used, clippy::expect_used))].

Blocker B — true MSRV: goblin 0.10 -> scroll_derive 0.13.x is
edition-2024 (needs 1.85). Declared rust-version 1.80 was false;
set to 1.85 (1.84 fails on scroll_derive, 1.85 builds).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Jobs (SHA-pinned actions; Swatinem/rust-cache after each toolchain step
in compiling jobs): fmt (cargo fmt --check), clippy (--all-targets
--all-features -D warnings), test (ubuntu/macos/windows matrix,
--all-features), check-msrv (1.85.0, cargo build --all-features
--locked), coverage (cargo llvm-cov, advisory/continue-on-error with a
TODO -- ~94% at adoption), and cargo-deny (bans/licenses/sources +
advisories). vet.yml left untouched.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Cover the previously-untested production paths across the workspace with real,
behavior-validating tests:

exec-pe-core:
- strings::compute_entropy — empty/uniform/equiprobable/full-range distributions.
- parser — a section-bearing PE (section fields + overlay detection), a PE with
  no optional header (entry/base/checksum fall back to zero), and a CodeView
  IMAGE_DEBUG_DIRECTORY carrying an RSDS PDB path. All are hand-built PEs whose
  ground truth is derivable from the construction and parsed by goblin.
- rich_header — DanS found after a leading junk DWORD (scan-advance path) and a
  DanS-immediately-before-Rich header (empty-but-valid). The if-let None arm in
  the DanS scan is provably dead under the while-guard invariant, marked
  // cov:unreachable.
- canonical_finding_tests — every remaining PeAnomaly variant maps to its
  documented canonical Finding (severity/category/code/note/mitre/evidence).

exec-pe-analysis:
- anomalies — describe_anomaly for the virtual-only / large-ratio / TLS / overlay
  variants; split a short-circuiting Rich-header assertion so both arms run.
- overlay — assert the exact size substring the detector emits.

Flip the coverage CI job from advisory (continue-on-error) to the fleet hard
gate: fail on any uncovered production line (DA:n,0), honoring cov:unreachable.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
anyhow <1.0.103 has an unsoundness (UB) in Error::downcast_mut after
Error::context (memory-corruption). Patched in 1.0.103; bump to latest
1.0.104. Clears the cargo-deny advisories finding.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Follows the anyhow lock bump; keeps the existing safe-to-run exemption
posture at the patched version so cargo vet --locked passes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Remove continue-on-error from the advisories job so a real RustSec advisory blocks CI instead of being informational-only. Tradeoff accepted: an upstream advisory-db load failure can now gate, but surfacing genuine advisories (e.g. RUSTSEC-2026-0190 anyhow, already bumped on this branch) is the priority.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@h4x0r
h4x0r merged commit 1a58f2f into main Jul 27, 2026
12 checks passed
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