fix(security): audit — fix RUSTSEC vulns, clippy warnings, dead code (#769)

- Upgrade openssl to 0.10.78 (CVE-2026-41676), jsonwebtoken to 9.4
- Suppress unmaintained-only/no-CVE advisories in .cargo/audit.toml
  with per-entry rationale
- Fix all `cargo clippy --all-targets -- -D warnings` errors across
  35 crates: derivable_impls, needless_range_loop, map_or→is_some_and/
  is_none_or, await_holding_lock (drop MutexGuard before .await),
  ptr_arg (&mut Vec→&mut [T]), useless_conversion, approximate_constant
  (2.718→E, 3.14→PI), field_reassign_with_default, manual_inspect,
  useless_vec, lines_filter_map_ok, print_literal, dead_code
- Apply `cargo fmt --all`
- Pre-existing test failure in wifi-densepose-signal
  (test_estimate_occupancy_noise_only) is not introduced by this PR
This commit is contained in:
rUv
2026-05-23 05:36:13 -04:00
committed by GitHub
parent 1906876541
commit 004a63e82d
248 changed files with 13614 additions and 5872 deletions
+2 -2
View File
@@ -41,8 +41,8 @@ fn default_min_confidence() -> f32 {
impl CogConfig {
pub fn load(path: &Path) -> Result<Self, ConfigError> {
let raw = std::fs::read_to_string(path)
.map_err(|e| ConfigError::Read(path.to_path_buf(), e))?;
let raw =
std::fs::read_to_string(path).map_err(|e| ConfigError::Read(path.to_path_buf(), e))?;
let cfg: CogConfig =
serde_json::from_str(&raw).map_err(|e| ConfigError::Parse(path.to_path_buf(), e))?;
Ok(cfg)
+28 -4
View File
@@ -64,27 +64,51 @@ impl PoseNet {
56,
64,
3,
Conv1dConfig { padding: 1, stride: 1, dilation: 1, groups: 1, ..Default::default() },
Conv1dConfig {
padding: 1,
stride: 1,
dilation: 1,
groups: 1,
..Default::default()
},
enc.pp("c1"),
)?;
let c2 = candle_nn::conv1d(
64,
128,
3,
Conv1dConfig { padding: 2, stride: 1, dilation: 2, groups: 1, ..Default::default() },
Conv1dConfig {
padding: 2,
stride: 1,
dilation: 2,
groups: 1,
..Default::default()
},
enc.pp("c2"),
)?;
let c3 = candle_nn::conv1d(
128,
128,
3,
Conv1dConfig { padding: 4, stride: 1, dilation: 4, groups: 1, ..Default::default() },
Conv1dConfig {
padding: 4,
stride: 1,
dilation: 4,
groups: 1,
..Default::default()
},
enc.pp("c3"),
)?;
let fc1 = candle_nn::linear(128, 256, head.pp("fc1"))?;
let fc2 = candle_nn::linear(256, 34, head.pp("fc2"))?;
Ok(Self { c1, c2, c3, fc1, fc2 })
Ok(Self {
c1,
c2,
c3,
fc1,
fc2,
})
}
/// Forward pass: `[B, 56, 20]` -> `[B, 34]` in `[0, 1]`.
+2 -6
View File
@@ -89,14 +89,10 @@ fn cmd_manifest() -> Result<(), Box<dyn std::error::Error>> {
fn cmd_health() -> Result<(), Box<dyn std::error::Error>> {
let engine = InferenceEngine::new()?;
let synthetic = SyntheticInput::default();
let synthetic = SyntheticInput;
let out = engine.infer(&synthetic.as_window())?;
if out.is_finite() {
emit_event(&Event::health_ok(
COG_ID,
engine.backend(),
out.confidence,
));
emit_event(&Event::health_ok(COG_ID, engine.backend(), out.confidence));
Ok(())
} else {
Err("inference produced non-finite output".into())