Tested fix (same build). A barrel over the screen is covered only when it sits at a reviewed part-limited place (--ack [email protected], same tolerance and peak rule as a surface peak). The issue filter covers a current-barrel finding only where that per-connection screen produced a covered barrel record (net and point), so the existing test of an unmatched barrel finding still fails. The record prints as acknowledged peak: BATN 79.7 A/mm2 at (124.00, 110.00) barrel F.Cu-In1.Cu by --ack [email protected]. On the same board the screen also found a real problem the stock binary never reached, because it stops at the first net: a 0.3 mm GND via beside the shunt carried 5.4 A. It is now a via field.
--- /home/adom/project/adom_modules/adom/adom-aiflow/crates/aiflow-analyze/src/lib.rs 2026-11-06 15:30:51.000000000 -0600
+++ crates/aiflow-analyze/src/lib.rs 2026-11-10 01:24:02.967821930 -0600
@@ -467,8 +467,17 @@
return Err(format!("Fields {name} has an incomplete plated-connection solve"));
}
let actual=amps.unwrap().abs()/area.unwrap();
- if (actual-density.unwrap()).abs()>1e-8*actual.max(1.0) || actual>barrel_limit {
- return Err(format!("Fields {name} barrel density is inconsistent or exceeds {barrel_limit} A/mm2"));
+ if (actual-density.unwrap()).abs()>1e-8*actual.max(1.0) {
+ return Err(format!("Fields {name} barrel density is inconsistent"));
+ }
+ if actual>barrel_limit {
+ // issue #191: a barrel at a reviewed part-limited place (a machine contact's hole carries the
+ // conductor inserted through it) is covered by that place's acknowledgement, like a surface peak
+ let bp = current_acks::Point { net: name.clone(), at: (c["at"][0].as_f64().unwrap_or(f64::NAN), c["at"][1].as_f64().unwrap_or(f64::NAN)), layer: c["from"].as_str().unwrap_or("").to_string(), peak: actual };
+ match acks.iter().find(|a| current_acks::covers(a, &bp)) {
+ Some(a) => covered.push(json!({"net": name, "barrelJ": actual, "peakJ": actual, "layer": format!("barrel {}-{}", c["from"].as_str().unwrap_or("?"), c["to"].as_str().unwrap_or("?")), "at": [bp.at.0, bp.at.1], "from": c["from"], "to": c["to"], "ack": a["target"], "why": a["why"], "aiThread": a["aiThread"]})),
+ None => return Err(format!("Fields {name} barrel density exceeds {barrel_limit} A/mm2 ({actual:.1} A/mm2 at ({:.2}, {:.2}), {} to {}; a reviewed part-limited place takes `analyze current --ack {name}@REF.PAD --why ...`)", bp.at.0, bp.at.1, c["from"].as_str().unwrap_or("?"), c["to"].as_str().unwrap_or("?"))),
+ }
}
}
if value["currentModel"] == "resistive-branches" {
@@ -512,10 +521,14 @@
}
}
let issues=fields["issues"].as_array().ok_or("Fields report has no issues array")?;
- // a neck finding at an acknowledged point is the same reviewed peak; barrel findings never are
+ // a neck finding at an acknowledged point is the same reviewed peak
let acked_neck = |i: &Value| i["kind"]=="current-neck" && covered.iter().any(|c| c["net"]==i["net"]
&& i["at"][0].as_f64().zip(i["at"][1].as_f64()).is_some_and(|(x,y)| (x-c["at"][0].as_f64().unwrap_or(f64::NAN)).hypot(y-c["at"][1].as_f64().unwrap_or(f64::NAN)) <= current_acks::TOLERANCE_MM));
- let relevant: Vec<_>=issues.iter().filter(|i| if kind=="current" { (i["kind"]=="current-neck" && !acked_neck(i)) || i["kind"]=="current-barrel" } else { i["kind"]=="tab-rise" || i["kind"]=="thermal-vias" || (i["kind"]=="solid-uncoupled" && i["severity"]=="high") }).collect();
+ // issue #191: a barrel finding is covered only where the plated-connection screen above matched that very
+ // barrel to a reviewed part-limited place (a record with barrelJ at the same point, same net)
+ let acked_barrel = |i: &Value| i["kind"]=="current-barrel" && covered.iter().any(|c| c.get("barrelJ").is_some() && c["net"]==i["net"]
+ && i["at"][0].as_f64().zip(i["at"][1].as_f64()).is_some_and(|(x,y)| (x-c["at"][0].as_f64().unwrap_or(f64::NAN)).hypot(y-c["at"][1].as_f64().unwrap_or(f64::NAN)) <= current_acks::TOLERANCE_MM));
+ let relevant: Vec<_>=issues.iter().filter(|i| if kind=="current" { (i["kind"]=="current-neck" && !acked_neck(i)) || (i["kind"]=="current-barrel" && !acked_barrel(i)) } else { i["kind"]=="tab-rise" || i["kind"]=="thermal-vias" || (i["kind"]=="solid-uncoupled" && i["severity"]=="high") }).collect();
if !relevant.is_empty() { return Err(relevant.iter().map(|i|i["what"].as_str().unwrap_or("unresolved field finding")).collect::<Vec<_>>().join("; ")); }
Ok(covered)
}