← Commit history
Cargo.lock+11−11
@@ -4,7 +4,7 @@ version = 4  [[package]] name = "adom-aiflow"-version = "0.2.141"+version = "0.2.142" dependencies = [  "aiflow-analyze",  "aiflow-board",@@ -28,7 +28,7 @@ dependencies = [  [[package]] name = "aiflow-analyze"-version = "0.2.141"+version = "0.2.142" dependencies = [  "aiflow-board",  "aiflow-sys",@@ -39,7 +39,7 @@ dependencies = [  [[package]] name = "aiflow-board"-version = "0.2.141"+version = "0.2.142" dependencies = [  "aiflow-sys",  "roxmltree",@@ -49,7 +49,7 @@ dependencies = [  [[package]] name = "aiflow-bridge"-version = "0.2.141"+version = "0.2.142" dependencies = [  "aiflow-board",  "aiflow-sys",@@ -59,7 +59,7 @@ dependencies = [  [[package]] name = "aiflow-copper"-version = "0.2.141"+version = "0.2.142" dependencies = [  "aiflow-board",  "aiflow-grid",@@ -70,7 +70,7 @@ dependencies = [  [[package]] name = "aiflow-grid"-version = "0.2.141"+version = "0.2.142" dependencies = [  "aiflow-board",  "serde",@@ -79,7 +79,7 @@ dependencies = [  [[package]] name = "aiflow-place"-version = "0.2.141"+version = "0.2.142" dependencies = [  "aiflow-board",  "aiflow-sys",@@ -89,7 +89,7 @@ dependencies = [  [[package]] name = "aiflow-pours"-version = "0.2.141"+version = "0.2.142" dependencies = [  "aiflow-board",  "aiflow-copper",@@ -100,7 +100,7 @@ dependencies = [  [[package]] name = "aiflow-router"-version = "0.2.141"+version = "0.2.142" dependencies = [  "aiflow-board",  "aiflow-grid",@@ -111,7 +111,7 @@ dependencies = [  [[package]] name = "aiflow-run"-version = "0.2.141"+version = "0.2.142" dependencies = [  "aiflow-sys",  "serde",@@ -120,7 +120,7 @@ dependencies = [  [[package]] name = "aiflow-sys"-version = "0.2.141"+version = "0.2.142" dependencies = [  "serde_json", ]
Cargo.toml+1−1
@@ -15,7 +15,7 @@ members = [ ]  [workspace.package]-version = "0.2.141"+version = "0.2.142" edition = "2021" license = "MIT" repository = "https://wiki.adom.inc/adom/adom-aiflow"
crates/adom-aiflow/src/converter.rs+20−2
@@ -125,6 +125,8 @@ pub fn hint_block(spec: &Value, c: &Calcs, refs: Option<(String, Option<String>,         .or_else(|| spec["switching"].as_object().and_then(|o| o.keys().next().cloned()))         .unwrap_or_else(|| "SW".into());     let (uref, lref, out_net, in_net) = match &refs { Some((_, u, l, o, i)) => (u.clone(), l.clone(), o.clone(), i.clone()), None => (None, None, None, None) };+    // adom-fields 0.10.19: name the converter's input outright when the board shows it (the switch part's VIN net)+    let known_in = in_net.clone();     let in_net = in_net.unwrap_or_else(|| "VIN".into());     let out_net = out_net.unwrap_or_else(|| "VOUT".into());     let num = |v: Option<f64>, what: &str| v.map(trim).unwrap_or_else(|| format!("\"<{what}>\""));@@ -134,10 +136,14 @@ pub fn hint_block(spec: &Value, c: &Calcs, refs: Option<(String, Option<String>,     let high = if c.topology.as_deref() == Some("boost") { vout } else { vin };     let fsw = spec["switching"][&sw]["freqHz"].as_f64().or(c.fsw_hz);     let q = |s: &str| json!(s).to_string();-    format!("\"voltages\": {{{}: {}, {}: {}}},\n\"sources\": {{{}: [{}], {}: [{}]}},\n\"switching\": {{{}: {{\"highV\": {}, \"lowV\": 0, \"freqHz\": {}, \"riseNs\": 8}}}}",+    let block = format!("\"voltages\": {{{}: {}, {}: {}}},\n\"sources\": {{{}: [{}], {}: [{}]}},\n\"switching\": {{{}: {{\"highV\": {}, \"lowV\": 0, \"freqHz\": {}, \"riseNs\": 8}}}}",         q(&in_net), num(vin, "VIN volts"), q(&out_net), num(vout, "VOUT volts"),         q(&out_net), q(lref.as_deref().unwrap_or("<the inductor, e.g. L1>")), q(&sw), q(uref.as_deref().unwrap_or("<the switch or regulator, e.g. U1>")),-        q(&sw), num(high, "input volts"), fsw.map(|f| format!("{}", f.round() as i64)).unwrap_or_else(|| "\"<fsw in Hz>\"".into()))+        q(&sw), num(high, "input volts"), fsw.map(|f| format!("{}", f.round() as i64)).unwrap_or_else(|| "\"<fsw in Hz>\"".into()));+    match known_in.filter(|_| spec["converter"]["inNet"].is_null()) {+        Some(n) => format!("{block},\n\"converter\": {{\"inNet\": {}}}", q(&n)),+        None => block,+    } }  pub const RISE_NOTE: &str = "riseNs 8 is adom-fields' default edge time, an estimate: replace it with the switch's rise time from the regulator's datasheet (it sets the EMC harmonics). Values in <...> were not in the spec or calcs.json: fill them from the design.";@@ -195,6 +201,18 @@ pub fn check(spec: &Value, calcs_v: Option<&Value>, fields: Option<&Value>, boar mod tests {     use super::*; +    #[test]+    fn the_converter_input_is_named_when_the_board_shows_it() {+        // adom-fields 0.10.19: converter.inNet names the input outright; only from the board, never a guess+        let c = Calcs::default();+        let shown = hint_block(&json!({}), &c, Some(("SW".into(), Some("U1".into()), Some("L1".into()), Some("VOUT".into()), Some("/VIN_48".into()))));+        assert!(shown.ends_with("\"converter\": {\"inNet\": \"/VIN_48\"}"), "{shown}");+        let unknown = hint_block(&json!({}), &c, Some(("SW".into(), Some("U1".into()), Some("L1".into()), Some("VOUT".into()), None)));+        assert!(!unknown.contains("inNet"), "{unknown}");+        let named = hint_block(&json!({"converter": {"inNet": "VIN"}}), &c, Some(("SW".into(), None, None, None, Some("VIN".into()))));+        assert!(!named.contains("inNet"), "the spec already names it: {named}");+    }+     fn calcs_fixture() -> Value {         json!({"brief": {"VIN_NOM": 12.0, "VIN_MAX": 16.0, "VOUT": 5.0}, "regulator": {"topology": "Synchronous buck", "fsw_kHz": 500},                "feedback": {"vout_nominal": 4.98}, "inductor": {"L_uH": 15}})
crates/adom-aiflow/src/fields_versions.rs+58
@@ -17,6 +17,9 @@ //!   fix but stamped 0.10.12; a note on such a solve is harmless.) //! - 0.10.15 (adom/adom-fields#38, PR 23 from King Silver): a `hot` SMD part whose pads are all on B.Cu had its watts //!   put into F.Cu and its tab read there. A two-sided board read about 30 % low, a single-sided one far too hot.+//! - 0.10.19 (adom/adom-fields#44, #45, Jinwon Kim): a capacitor is a ceramic only when one exists at its value and voltage+//!   rating (over 1.5x the largest ceramic at that rating it is electrolytic: 220 uF at 6.3 V, 100 at 16, 47 at 25, 22 at+//!   50, 4.7 at 100), and a converter's input is never a switch or bootstrap net even when spec voltages lists one. //! - 0.10.17 (adom/adom-fields#40, monrad): a CP_Radial_/CP_Axial_ capacitor, or any capacitor over 100 uF, was read as a //!   ceramic, which invented a hot-plug overshoot and the wrong PDN impedance. Other boards are byte-identical. use serde_json::Value;@@ -68,6 +71,22 @@ pub fn stale_notes(fields: &Value, spec: &Value, board: &Path) -> Vec<String> {             }         }     }+    // 0.10.19: a capacitor its own rating rules out as a ceramic, and a switch or bootstrap net taken as a converter input+    if solver < (0, 10, 19) {+        if let Some(b) = plan_board(board, &text) {+            let parts = rating_rules_out_ceramic(spec, &b);+            if !parts.is_empty() {+                out.push(format!("this Fields solve is adom-fields {}, before 0.10.19, which could read {} as ceramic although no ceramic exists at that value and voltage rating: the PDN and hot-plug findings for them may be wrong. Update adom-fields (adom-wiki pkg install adom/adom-fields) and analyze again", version_text(solver), parts.join(", ")));+            }+        }+        let switchy: Vec<String> = spec["voltages"].as_object().into_iter().flatten().map(|(k, _)| k.clone()).filter(|k| {+            let u = k.trim_start_matches('/').to_ascii_uppercase();+            spec["switchNodes"].as_array().is_some_and(|a| a.iter().any(|x| x.as_str() == Some(k.as_str()))) || u.starts_with("SW") || u.starts_with("BOOT") || u.starts_with("BST") || u.starts_with("PHASE") || u.starts_with("LX")+        }).collect();+        if !switchy.is_empty() && (spec["switchNodes"].as_array().is_some_and(|a| !a.is_empty()) || spec["switching"].is_object()) {+            out.push(format!("this Fields solve is adom-fields {}, before 0.10.19, which could take a switch or bootstrap net listed in spec voltages ({}) as the converter's input, so its conducted emissions and hot loop may be off. Update adom-fields and analyze again (0.10.19 never takes one as the input; spec `converter.inNet` names it outright)", version_text(solver), switchy.join(", ")));+        }+    }     // 0.10.17: a polarized (CP_Radial/CP_Axial) or 100 uF+ capacitor was read as a ceramic     if solver < (0, 10, 17) {         if let Some(b) = plan_board(board, &text) {@@ -107,6 +126,28 @@ pub fn ceramic_misread(spec: &Value, b: &aiflow_board::Board) -> Vec<String> {     out } +/// adom-fields 0.10.19: the capacitors whose Value names a voltage rating at which no ceramic of that capacitance exists+/// (over 1.5x the largest: 220 uF at 6.3 V, 100 uF at 16 V, 47 uF at 25 V, 22 uF at 50 V, 4.7 uF at 100 V), unless the+/// spec's `capacitors` names the part.+pub fn rating_rules_out_ceramic(spec: &Value, b: &aiflow_board::Board) -> Vec<String> {+    let largest = |v: f64| -> Option<f64> { [(6.3, 220.0), (16.0, 100.0), (25.0, 47.0), (50.0, 22.0), (100.0, 4.7)].iter().find(|(r, _)| v <= *r + 1e-9).map(|x| x.1).or(if v > 100.0 { Some(1.0) } else { None }) };+    let volts = |s: &str| -> Option<f64> {+        s.split(|c: char| c.is_whitespace() || c == '/' || c == ',' || c == '_').find_map(|w| {+            let w = w.trim();+            let n = w.strip_suffix('V').or_else(|| w.strip_suffix('v'))?;+            n.replace(['v', 'V'], ".").parse::<f64>().ok()+        })+    };+    let mut out: Vec<String> = b.footprints.iter().filter(|(r, fp)| {+        if !(r.starts_with('C') && r[1..].chars().next().is_some_and(|c| c.is_ascii_digit())) || spec["capacitors"].get(r.as_str()).is_some() { return false; }+        let Some(val) = footprint_value(b, fp) else { return false };+        let (Some(uf), Some(v)) = (crate::usb_power::parse_capacitance_uf(&val), volts(&val)) else { return false };+        largest(v).is_some_and(|max| uf > 1.5 * max)+    }).map(|(r, _)| r.clone()).collect();+    out.sort();+    out+}+ /// A footprint's Value property, if it has one. fn footprint_value(b: &aiflow_board::Board, fp: &aiflow_board::Footprint) -> Option<String> {     let block = b.text.get(fp.start..fp.end)?;@@ -311,6 +352,23 @@ mod tests {     }  +    /// adom-fields 0.10.19: a capacitor its rating rules out as a ceramic, and a switch net in spec voltages on a converter+    #[test]+    fn rated_electrolytics_and_switch_net_inputs_are_told_to_solve_again() {+        let fp = |r: &str, v: &str, x: f64| format!(r#"(footprint "Capacitor_SMD:C_1210_3225Metric" (layer "F.Cu") (at {x} 5) (property "Reference" "{r}") (property "Value" "{v}"))"#);+        let text = format!(r#"(kicad_pcb (gr_rect (start 0 0) (end 40 10) (layer "Edge.Cuts")) {} {} {})"#, fp("C30", "100uF 100V", 5.0), fp("C2", "22uF 25V", 15.0), fp("C3", "10uF 6.3V", 25.0));+        let p = tmp("rated.kicad_pcb", &text);+        let spec = json!({"switchNodes": ["SW1"], "voltages": {"VIN": 48, "SW1": 60, "BOOT1": 65}});+        let old = stale_notes(&json!({"inputIdentity": {"solverVersion": "0.10.18"}}), &spec, &p);+        assert!(old.iter().any(|n| n.contains("before 0.10.19") && n.contains("read C30 as ceramic")), "{old:?}");+        assert!(old.iter().any(|n| n.contains("(BOOT1, SW1)") || n.contains("(SW1, BOOT1)")), "{old:?}");+        assert!(stale_notes(&json!({"inputIdentity": {"solverVersion": "0.10.19"}}), &spec, &p).is_empty());+        // 22 uF at 25 V is a real ceramic; a part the spec names is left out+        assert!(!old.iter().any(|n| n.contains("C2,") || n.contains(" C2 ")));+        let named = stale_notes(&json!({"inputIdentity": {"solverVersion": "0.10.18"}}), &json!({"capacitors": {"C30": {"type": "electrolytic"}}}), &p);+        assert!(!named.iter().any(|n| n.contains("C30")), "{named:?}");+    }+     /// adom-fields 0.10.17: a polarized or 100 uF+ capacitor solved before it is told to solve again; a small ceramic is not,     /// and a part the spec's `capacitors` names is not.     #[test]
crates/adom-aiflow/src/main.rs+59−5
@@ -203,6 +203,8 @@ enum Cmd {     Rules { #[arg(value_parser = ["use", "install", "check", "list", "sync", "stackup"])] action: String, #[arg(long)] profile: Option<String>, #[arg(long)] board: Option<String>, /// replace an existing .kicad_dru     #[arg(long)] force: bool, /// copper layers (default: the profile's -<n>L suffix, else the board's copper layer count, else 2)     #[arg(long)] layers: Option<u32>,+    /// `rules use` / `rules stackup`: outer copper weight in ounces (2 binds 70 um outer copper and writes the 2 oz minimums into the rules)+    #[arg(long)] copper_oz: Option<u32>,     /// `rules use`: a named variant of the fab's pack on adom/pcb-design-rules (`<fab>-<n>L-<variant>`, e.g. circuit-forge-strict); the published pack when omitted     #[arg(long)] variant: Option<String>,     /// `rules use`: the human's own preferences, a JSON file {"silkMinTextHeight": {"mm": 0.6}, "minTraceWidth": {"mm": 0.2}}: kept in the spec (fab.preferences) and checked on the board as warnings that never block (not written into the KiCad rules, where a preference would replace the fab's limit). On an Altium board, minClearance, minTraceWidth, minHole and minHoleToHole raise the floors written into its rules, and a board rule already at or above a floor is left as it is@@ -7517,9 +7519,51 @@ fn main() {                 "reload" => {                     // issue #223: KiCad's own Revert over IPC after an offline edit, no prompt and no relaunch                     let sock = r.data["kicadIsolated"]["socketPath"].as_str().map(str::to_string);-                    let reply = br.call("kicad_reload_board", &aiflow_bridge::isolated::reload_args(&rb, sock.as_deref(), *discard));+                    // the macOS KiCad bridge (2.0.x) has no kicad_reload_board (issue #281, Jinwon Kim); AIFLOW_FORCE_RELOAD_FALLBACK=1+                    // runs the fallback on any desktop, for testing it where the verb exists+                    let reply = if env_on("AIFLOW_FORCE_RELOAD_FALLBACK") { json!({"success": false, "errorCode": "unknown_verb", "error": "kicad_reload_board skipped (AIFLOW_FORCE_RELOAD_FALLBACK=1)"}) }+                        else { br.call("kicad_reload_board", &aiflow_bridge::isolated::reload_args(&rb, sock.as_deref(), *discard)) };                     write_json(&dir.join("capture-reload.json"), &reply);                     use aiflow_bridge::isolated::Refusal;+                    if matches!(aiflow_bridge::isolated::reload_of(&reply), Err(Refusal::Unsupported(_))) {+                        // no reload verb: close the board's editor and open the file again (KiCad Bridge 1.1.14 finds the editor+                        // by its document whatever language KiCad runs in), the run's own isolated editor reopened isolated+                        let isolated = !r.data["kicadIsolated"].is_null();+                        // kicad_close_document never saves (KiCad's prompt is answered Discard): an editor with unsaved edits is+                        // refused here as kicad_reload_board refuses it, unless --discard; KiCad marks such a title with '*'+                        if !*discard {+                            let info = br.raw_call("kicad_window_info", &json!({}));+                            let d = info.get("data").cloned().unwrap_or(info.clone());+                            let stem = Path::new(&rb).file_stem().and_then(|s| s.to_str()).unwrap_or("").to_string();+                            let dirty = d["editors"].as_array().into_iter().flatten().filter_map(|w| w["title"].as_str())+                                .any(|t| t.trim_start().starts_with('*') && aiflow_bridge::eda::names_board(t.trim_start().trim_start_matches('*'), &stem));+                            if dirty { err(&format!("the editor of {rb} has unsaved edits, so it was not closed to reload it (this KiCad bridge has no kicad_reload_board, and closing discards them)"), &["Save them first (`adom-bridge kicad_save_board`), or `capture reload --discard` to drop them.".into()]); }+                        }+                        let closed = br.call("kicad_close_document", &json!({"path": rb}));+                        if let Err(f) = aiflow_bridge::isolated::done(&closed) {+                            err(&format!("this KiCad bridge has no kicad_reload_board, and closing the board to reopen it was refused: {f:?}"), &["Save or discard the editor's edits (`capture reload --discard` drops them), then `capture reload` again.".into()]);+                        }+                        let why = format!("aiflow capture reload: reopen {rb} after an offline edit (no kicad_reload_board on this KiCad bridge)");+                        let raise = screen_mode(&mut r).may_raise();+                        let how = if isolated {+                            let kv = r.data["kicadIsolated"]["kicadVersion"].as_str().map(str::to_string);+                            let iso = br.open_isolated(&rb, &why, raise, kv.as_deref()).unwrap_or_else(|f| err(&format!("the board was closed but did not reopen in an isolated editor: {f:?}"), &["`capture open --isolated` opens it again.".into()]));+                            std::env::set_var("ADOM_AIFLOW_KICAD_SOCKET", &iso.socket);+                            let kvv = r.data["kicadIsolated"]["kicadVersion"].clone();+                            r.data["kicadIsolated"] = iso.record(&rb, &now());+                            if !kvv.is_null() { r.data["kicadIsolated"]["kicadVersion"] = kvv; }+                            r.data["captures"].as_array_mut().unwrap().push(json!({"opened": now(), "hwnd": iso.hwnd, "window": iso.title, "isolated": true}));+                            format!("reopened in the run's own editor (pid {})", iso.pid.map(|p| p.to_string()).unwrap_or("?".into()))+                        } else {+                            let (hwnd, shown) = br.open_board(&rb, &why, raise).unwrap_or_else(|rep| err(&format!("the board was closed but did not reopen: {}", rep["error"].as_str().unwrap_or("?")), &["`capture open` opens it again.".into()]));+                            r.data["captures"].as_array_mut().unwrap().push(json!({"opened": now(), "hwnd": hwnd, "window": shown}));+                            format!("reopened ({shown})")+                        };+                        r.log("board-reload", json!({"fallback": "close-reopen", "isolated": isolated, "discard": *discard}));+                        r.save().unwrap();+                        ok(&format!("board reloaded from the file by closing and reopening it (this KiCad bridge has no kicad_reload_board); {how}"), &["Re-run the check that wanted the edit (`gate`, `measure`) so it reads the board as it is now.".into()]);+                        return;+                    }                     match aiflow_bridge::isolated::reload_of(&reply) {                         Ok(rl) => {                             r.log("board-reload", json!({"revision": rl.revision, "modelChanged": rl.model_changed, "editorMatchesFile": rl.matches_file, "discard": *discard}));@@ -8183,7 +8227,7 @@ fn main() {             if mode == "netlist" { hints.push("Run it again once the board is placed (`testplan check`): a test point under a part or out of tether reach is a gap again. finish runs it too.".into()); }             ok(&body, &hints);         }-        Cmd::Rules { action, profile, board, force, layers, variant, prefs, stackup, spec, altium_out } if action == "use" || action == "list" || action == "sync" || action == "stackup" => {+        Cmd::Rules { action, profile, board, force, layers, variant, prefs, stackup, spec, altium_out, copper_oz } if action == "use" || action == "list" || action == "sync" || action == "stackup" => {             if action == "sync" {                 let mut run = Run::open(&dir);                 if run.is_some() { thread(&cli); }@@ -8227,6 +8271,8 @@ fn main() {                 ok(&format!("synced {} electrical net class(es): {}; updated {}", plan.classes.len(), summary.join(", "), written.join(", ")), &hints);                 return;             }+            if let Some(oz) = copper_oz { if !matches!(oz, 1 | 2) { err(&format!("--copper-oz {oz}: 1 or 2 (ounces of outer copper)"), &[]); } }+            let two_oz = *copper_oz == Some(2);             if action == "stackup" {                 let mut run = Run::open(&dir);                 if run.is_some() { thread(&cli); }@@ -8241,6 +8287,7 @@ fn main() {                     None => profile.as_deref().and_then(|p| { let (b, l) = checks::split_profile(p); stackup_presets::default_for(&b, l.unwrap_or(asked_layers)) })                         .unwrap_or_else(|| err("pass --stackup <id> (or --profile <fab> --layers <n>)", &[format!("Available stackup presets:\n{}", stackup_presets::list_lines().join("\n"))])),                 };+                let preset: &'static stackup_presets::StackupPreset = if two_oz { Box::leak(Box::new(stackup_presets::with_outer_oz(preset, 2))) } else { preset };                 if !cb.is_empty() {                     if let Some(bl) = checks::board_copper_layers(&cb).filter(|&n| n != preset.layers) {                         err(&format!("stackup {} is {}L but {} has {bl} copper layers", preset.id, preset.layers, cb), &["Pick a stackup preset matching the board's copper layer count (`adom-aiflow impedance stackups`).".into()]);@@ -8313,6 +8360,8 @@ fn main() {             }             let body = text.clone();             let marked = format!("# adom-aiflow rules: {slug} {layers}L{} (from {page})\n{body}", variant.as_ref().map(|v| format!(" variant {v}")).unwrap_or_default());+            // issue #284: 2 oz outer copper raises the outer-layer minimums+            let marked = if two_oz { format!("{marked}{}", stackup_presets::two_oz_rules(&text)) } else { marked };             let rd = dir.join("rules"); let _ = std::fs::create_dir_all(&rd);             std::fs::write(rd.join(&file), &marked).unwrap_or_else(|e| err(&e.to_string(), &[]));             let mut placed = vec![rd.join(&file).display().to_string()];@@ -8371,6 +8420,10 @@ fn main() {                 }                 p             });+            // issue #284: 2 oz outer copper on the asked (or the fab's default) stackup+            let explicit_stackup: Option<&'static stackup_presets::StackupPreset> = if two_oz {+                explicit_stackup.or_else(|| stackup_presets::default_for(&slug, layers)).map(|p| &*Box::leak(Box::new(stackup_presets::with_outer_oz(p, 2))))+            } else { explicit_stackup };             let mut bound_stackup = explicit_stackup;             let mut stackup_note = String::new();             if let Some(sp) = r.data["spec"].as_str().map(str::to_string) {@@ -8408,9 +8461,10 @@ fn main() {             if let Some(preset) = explicit_stackup {                 if cb.ends_with(".kicad_pcb") && Path::new(&cb).is_file() {                     if let Ok(bt) = std::fs::read_to_string(&cb) {-                        if let Ok(next) = stackup_presets::apply_to_board_text(preset, &bt) {-                            let _ = std::fs::write(&cb, next);-                            stackup_note = format!("; stackup {} bound into spec and board", preset.id);+                        match stackup_presets::apply_to_board_text(preset, &bt) {+                            Ok(next) => { let _ = std::fs::write(&cb, next); stackup_note = format!("; stackup {} bound into spec and board", preset.id); }+                            // say why the board kept its own stackup instead of passing over it+                            Err(e) => stackup_note = format!("; stackup {} bound into spec, not into the board ({e}: fix that, then `rules stackup --stackup {}{}`)", preset.id, preset.id.split('+').next().unwrap_or(preset.id), if preset.id.contains("+2oz") { " --copper-oz 2" } else { "" }),                         }                     }                 }
crates/adom-aiflow/src/programming.rs+102
@@ -122,6 +122,71 @@ fn cable_usb_check(b: &Board, rec: &Value) -> Result<(), Vec<String>> {     if problems.is_empty() { Ok(()) } else { Err(problems) } } +/// Issue #276 (Fredrik Angell Moe): a classic ESP32 (no native USB), or any part with a UART bootloader, programmed the+/// usual dev-board way: USB connector -> an on-board USB-UART bridge (CH340, CP2102, FT232, ...) -> the target's UART,+/// often with DTR/RTS auto-reset into the bootloader. The record names the connector and its pads as for+/// usb-serial-jtag, plus `bridgeRef` (the bridge chip) and, optionally, `uartNets` {"TX", "RX"}. Checked on saved copper:+/// the connector's D+/D-/GND/VBUS pads carry four distinct nets, the bridge has pads on D+ and D-, and the bridge and the+/// target share the UART nets (the named ones, else at least two signal nets between them).+fn uart_bridge_check(b: &Board, rec: &Value) -> Result<(), Vec<String>> {+    let mut problems = Vec::new();+    let connector = rec["connector"].as_str().unwrap_or("");+    let target_ref = rec["targetRef"].as_str().unwrap_or("");+    let bridge = rec["bridgeRef"].as_str().unwrap_or("");+    if !b.footprints.contains_key(connector) || connector == target_ref || connector == bridge {+        problems.push("connector must name the board's USB connector footprint (not the target or the bridge)".into());+    }+    let target = rec["target"].as_str().unwrap_or("");+    if !targets(b).iter().any(|(r, m)| r == target_ref && m == target) {+        problems.push("targetRef/target must match the programmable part on the board".into());+    }+    if bridge.is_empty() || !b.footprints.contains_key(bridge) || bridge == target_ref {+        problems.push("bridgeRef must name the USB-UART bridge chip on the board (CH340, CP2102, FT232, ...)".into());+    }+    if rec["boot"].as_str().map_or(true, |x| x.trim().is_empty()) {+        problems.push("boot instructions missing (e.g. DTR/RTS auto-reset into the ROM bootloader, or hold BOOT and reset)".into());+    }+    let mut usb = std::collections::BTreeMap::new();+    for signal in ["D+", "D-", "GND", "VBUS"] {+        let pin = &rec["connectorPins"][signal];+        let net = pin["net"].as_str().unwrap_or("");+        let names = pin["pads"].as_array();+        if net.is_empty() || names.map_or(true, |a| a.is_empty()) { problems.push(format!("connectorPins.{signal} needs nonempty pads and net")); continue; }+        for name in names.unwrap() {+            let pad = name.as_str().unwrap_or("");+            if !b.pads.iter().any(|p| p.reference == connector && p.name == pad && p.net == net) {+                problems.push(format!("{signal}: {connector}.{pad} does not carry declared net {net}"));+            }+        }+        usb.insert(signal, net.to_string());+    }+    let mut distinct: Vec<&String> = usb.values().collect();+    distinct.sort(); distinct.dedup();+    if usb.len() == 4 && distinct.len() != 4 { problems.push("USB data, ground and VBUS must be four distinct nets".into()); }+    if !problems.is_empty() { return Err(problems); }+    let nets_of = |r: &str| -> std::collections::BTreeSet<String> { b.pads.iter().filter(|p| p.reference == r && !p.net.is_empty()).map(|p| p.net.clone()).collect() };+    let (bn, tn) = (nets_of(bridge), nets_of(target_ref));+    for signal in ["D+", "D-"] {+        if !bn.contains(&usb[signal]) { problems.push(format!("the bridge {bridge} has no pad on the connector's {signal} net {}", usb[signal])); }+    }+    match rec["uartNets"].as_object() {+        Some(u) => for k in ["TX", "RX"] {+            match u.get(k).and_then(|v| v.as_str()) {+                Some(net) if bn.contains(net) && tn.contains(net) => {}+                Some(net) => problems.push(format!("uartNets.{k} {net} does not join the bridge {bridge} and the target {target_ref}")),+                None => problems.push(format!("uartNets.{k} missing")),+            }+        },+        None => {+            // no names given: the bridge and the target must share at least two signal nets (TXD-RXD, RXD-TXD)+            let skip = |n: &str| { let u = n.to_ascii_uppercase(); usb.values().any(|x| x == n) || u.contains("GND") || u.starts_with("+") || u.contains("VCC") || u.contains("VDD") || u.contains("3V3") || u.contains("5V") };+            let shared: Vec<&String> = bn.intersection(&tn).filter(|n| !skip(n)).collect();+            if shared.len() < 2 { problems.push(format!("the bridge {bridge} and the target {target_ref} share {} signal net(s); a UART needs TX and RX (name them in uartNets if they pass through a resistor)", shared.len())); }+        }+    }+    if problems.is_empty() { Ok(()) } else { Err(problems) }+}+ /// The finish check (an open item, never a refusal): Ok when the board has no programmable part or its record is complete and every pin /// is reachable; Err(problems) otherwise. pub fn check(board_path: &str, b: &Board, spec: &Value) -> Result<(), Vec<String>> {@@ -242,6 +307,8 @@ fn pads_as_header(b: &Board, rec: &Value) -> Option<Value> {  fn check_one(b: &Board, rec: &Value) -> Result<(), Vec<String>> {     if rec["interface"] == "usb-serial-jtag" && rec["access"] == "usb-cable" { return cable_usb_check(b, rec); }+    // issue #276: UART boot through an on-board USB-UART bridge+    if rec["interface"] == "uart-boot" && matches!(rec["access"].as_str(), Some("usb-cable" | "usb-uart-bridge")) { return uart_bridge_check(b, rec); }     if rec["interface"] != "usb-serial-jtag" && matches!(rec["access"].as_str(), Some("tag-connect" | "cable" | "header")) {         if rec["connectorPins"].is_null() { if let Some(h) = pads_as_header(b, rec) { return tag_connect_check(b, &h); } }         return tag_connect_check(b, rec);@@ -455,6 +522,41 @@ mod tests {         assert_eq!(summary("/nonexistent/b.kicad_pcb", &b, &spec, &Ok(())), "programming: U1 STM32G431CBT6, interface swd with declared access checked");         assert!(summary("/nonexistent/b.kicad_pcb", &b, &spec, &Err(vec!["x".into()])).ends_with("1 problem(s) (the gate below)"));     }+    #[test]+    fn uart_boot_through_a_usb_uart_bridge_is_a_programming_path() {+        // issue #276: classic ESP32 (U1) <- CH340 (U3) <- USB-C (J1), auto-reset over DTR/RTS+        let txt = BOARD.replace("STM32G431CBT6", "ESP32-WROOM-32E");+        let txt = txt.replacen("(net 0 \"\")", "(net 0 \"\") (net 6 \"DP\") (net 7 \"DM\") (net 8 \"VBUS\") (net 9 \"ESP_TX\") (net 10 \"ESP_RX\")", 1);+        let at = txt.rfind(')').unwrap();+        let extra = r#"(footprint "Connector_USB:USB_C_Test" (layer "F.Cu") (at 10 10) (property "Reference" "J1")+            (pad "A6" smd rect (at 0 0) (size 1 1) (layers "F.Cu") (net 6 "DP")) (pad "A7" smd rect (at 1 0) (size 1 1) (layers "F.Cu") (net 7 "DM"))+            (pad "A1" smd rect (at 2 0) (size 1 1) (layers "F.Cu") (net 4 "GND")) (pad "A4" smd rect (at 3 0) (size 1 1) (layers "F.Cu") (net 8 "VBUS")))+            (footprint "Package_SO:SOIC-16" (layer "F.Cu") (at 20 10) (property "Reference" "U3") (property "Value" "CH340C")+            (pad "5" smd rect (at 0 0) (size 1 1) (layers "F.Cu") (net 6 "DP")) (pad "6" smd rect (at 1 0) (size 1 1) (layers "F.Cu") (net 7 "DM"))+            (pad "2" smd rect (at 2 0) (size 1 1) (layers "F.Cu") (net 10 "ESP_RX")) (pad "3" smd rect (at 3 0) (size 1 1) (layers "F.Cu") (net 9 "ESP_TX")))"#;+        let mut txt = format!("{}{}{}", &txt[..at], extra, &txt[at..]);+        // the target's UART0 pads on the same nets+        let u1 = txt.find("\"Reference\" \"U1\"").unwrap();+        let close = u1 + txt[u1..].find("(pad").unwrap();+        txt.insert_str(close, "(pad \"35\" smd rect (at 5 5) (size 1 1) (layers \"F.Cu\") (net 9 \"ESP_TX\")) (pad \"34\" smd rect (at 6 5) (size 1 1) (layers \"F.Cu\") (net 10 \"ESP_RX\")) ");+        let b = Board::from_text("/nonexistent/b.kicad_pcb", txt).unwrap();+        let mut spec = json!({"programming": {"interface": "uart-boot", "access": "usb-cable", "connector": "J1", "bridgeRef": "U3",+            "targetRef": "U1", "target": "ESP32-WROOM-32E", "boot": "DTR/RTS auto-reset into the ROM bootloader (Q1/Q2)",+            "connectorPins": {"D+": {"pads": ["A6"], "net": "DP"}, "D-": {"pads": ["A7"], "net": "DM"}, "GND": {"pads": ["A1"], "net": "GND"}, "VBUS": {"pads": ["A4"], "net": "VBUS"}}}});+        assert!(check("/nonexistent/b.kicad_pcb", &b, &spec).is_ok(), "{:?}", check("/nonexistent/b.kicad_pcb", &b, &spec));+        spec["programming"]["uartNets"] = json!({"TX": "ESP_TX", "RX": "ESP_RX"});+        assert!(check("/nonexistent/b.kicad_pcb", &b, &spec).is_ok());+        spec["programming"]["uartNets"] = json!({"TX": "ESP_TX", "RX": "DP"});+        assert!(check("/nonexistent/b.kicad_pcb", &b, &spec).unwrap_err().iter().any(|e| e.contains("uartNets.RX DP does not join")));+        spec["programming"].as_object_mut().unwrap().remove("uartNets");+        // no bridge named, or the bridge off the USB data lines+        spec["programming"]["bridgeRef"] = json!("U9");+        assert!(check("/nonexistent/b.kicad_pcb", &b, &spec).unwrap_err().iter().any(|e| e.contains("bridgeRef must name")));+        spec["programming"]["bridgeRef"] = json!("U3");+        spec["programming"]["boot"] = json!("");+        assert!(check("/nonexistent/b.kicad_pcb", &b, &spec).unwrap_err().iter().any(|e| e.contains("boot instructions")));+    }+     #[test]     fn usb_serial_jtag_cable_checks_real_connector_pins_and_target() {         let txt = BOARD.replace("STM32G431CBT6", "ESP32-S3-MINI-1U-N8");
crates/adom-aiflow/src/stackup_presets.rs+38
@@ -100,6 +100,36 @@ pub const PRESETS: &[StackupPreset] = &[     }, ]; +/// Issue #284 (RobInMaine): the preset with `oz` ounce outer copper (2 oz: 70 um on F.Cu and B.Cu), the inner layers and+/// dielectrics as published. JLCPCB publishes no separate 2 oz stackup table, so the impedance widths keep the 1 oz+/// dielectrics until the fab confirms them; the summary says so.+pub fn with_outer_oz(p: &StackupPreset, oz: u32) -> StackupPreset {+    let um = 35.0 * oz as f64;+    let n = p.copper_um.len();+    let cu: Vec<f64> = p.copper_um.iter().enumerate().map(|(i, v)| if i == 0 || i + 1 == n { um } else { *v }).collect();+    let id: &'static str = Box::leak(format!("{}+{oz}oz-outer", p.id).into_boxed_str());+    let summary: &'static str = Box::leak(format!("{} with {oz} oz ({um:.0} um) outer copper; dielectrics as published for 1 oz, so confirm impedance widths with the fab", p.summary).into_boxed_str());+    StackupPreset { id, copper_um: Box::leak(cu.into_boxed_slice()), summary, ..*p }+}++/// The 2 oz outer-copper minimums for the rules (track width, clearance, mm): the pack's own note when it states one+/// ("2 oz is 0.16 / 0.16 mm"), else JLCPCB's published 0.16 / 0.16 mm.+pub fn two_oz_minimums(pack: &str) -> (f64, f64, &'static str) {+    let re = regex_lite::Regex::new(r"(?i)2\s*oz[^0-9\n]{0,40}([0-9]+\.[0-9]+)\s*/\s*([0-9]+\.[0-9]+)\s*mm").unwrap();+    match re.captures(pack).and_then(|c| Some((c[1].parse::<f64>().ok()?, c[2].parse::<f64>().ok()?))) {+        Some((w, g)) => (w, g, "the pack's note"),+        None => (0.16, 0.16, "JLCPCB's capabilities page"),+    }+}++/// The rules block 2 oz outer copper adds to a pack.+pub fn two_oz_rules(pack: &str) -> String {+    let (w, g, from) = two_oz_minimums(pack);+    format!("\n# adom-aiflow: 2 oz outer copper (--copper-oz 2): minimum track and spacing {w} / {g} mm on the outer layers ({from})\n\+(rule \"2oz outer track width\"\n  (layer outer)\n  (condition \"A.Type == 'Track'\")\n  (constraint track_width (min {w}mm)))\n\n\+(rule \"2oz outer clearance\"\n  (layer outer)\n  (constraint clearance (min {g}mm)))\n")+}+ pub fn find(id: &str) -> Option<&'static StackupPreset> {     let q = id.trim();     PRESETS.iter().find(|p| p.id.eq_ignore_ascii_case(q))@@ -360,6 +390,13 @@ mod tests {         let p = find("jlc04161h-7628").expect("7628 preset");         assert_eq!(p.layers, 4);         assert_eq!(default_for("jlcpcb", 4).unwrap().id, "JLC04161H-7628");+        // issue #284: 2 oz outer copper on the published 4-layer stackup+        let two = with_outer_oz(find("JLC04161H-7628").unwrap(), 2);+        assert_eq!(two.copper_um, &[70.0, 15.2, 15.2, 70.0]);+        assert_eq!(two.id, "JLC04161H-7628+2oz-outer");+        assert_eq!(two_oz_minimums("# for 1-2 layers; 2 oz is 0.16 / 0.16 mm."), (0.16, 0.16, "the pack's note"));+        assert_eq!(two_oz_minimums("(rule \"x\")"), (0.16, 0.16, "JLCPCB's capabilities page"));+        assert!(two_oz_rules("").contains("(constraint clearance (min 0.16mm))") && two_oz_rules("").contains("(layer outer)"));         assert!(default_for("3rdPartyFab", 4).is_none(), "private fab rules must not ship generic stackups");         assert!(find("3rdPartyFab-4L").is_none());         let mut spec = json!({"impedanceTargets": {"USB": {"pair": ["USB_DP", "USB_DN"], "targetDiffOhms": 90}}});@@ -426,3 +463,4 @@ mod tests {     }  }+
docs/release-0.2.142.mdadded+22
@@ -0,0 +1,22 @@+# adom-aiflow 0.2.142++## UART boot through an on-board USB-UART bridge (#276, Fredrik Angell Moe)++A classic ESP32 (no native USB), or any part with a UART bootloader, is usually programmed through a USB connector and an on-board USB-UART bridge (CH340, CP2102, FT232), often with DTR/RTS auto-reset. `finish` could only close that with a deviation. The programming record now takes `"interface": "uart-boot", "access": "usb-cable"` with `connector`, `connectorPins` (D+, D-, GND, VBUS), `bridgeRef` (the bridge chip), `targetRef`, `target`, `boot` and, optionally, `uartNets` {"TX", "RX"}. Checked on saved copper: the connector's pads carry four distinct nets, the bridge sits on D+ and D-, and the bridge and the target share the UART nets (the named ones, else at least two signal nets).++## 2 oz outer copper on a JLCPCB stackup (#284, RobInMaine)++`rules use --profile jlcpcb --layers 4 --copper-oz 2` (and `rules stackup ... --copper-oz 2`) binds the fab's stackup (the one asked, else the default for the layer count) with 70 um outer copper into the spec and the board, and writes the 2 oz minimum outer track and spacing into the board's rules: the pack's own note when it states one (JLCPCB's 4-layer pack: 0.15 / 0.15 mm), else JLCPCB's published 0.16 / 0.16 mm. The dielectrics stay as published for 1 oz, so the impedance widths are to be confirmed with the fab. `rules use --stackup` now also says when the board's own stackup could not be written (and why) instead of passing over it.++## capture reload without kicad_reload_board++A KiCad bridge without `kicad_reload_board` (the macOS 2.0.x builds, issue #281) now reloads by closing the board's editor and opening the file again, in the run's own isolated editor when the run has one (KiCad Bridge 1.1.14 finds the editor whatever language KiCad runs in). Closing never saves, so an editor with unsaved edits is refused as a reload refuses it; `--discard` drops them. Tested on a Windows desktop with the fallback forced (`AIFLOW_FORCE_RELOAD_FALLBACK=1`); a macOS check is with the bridge's maintainer.++## adom-fields 0.10.19++- `analyze` names a solve made before 0.10.19 when the board has a capacitor whose own voltage rating rules out a ceramic (over 1.5x the largest ceramic at that rating, such as 100 uF at 100 V), or when spec `voltages` lists a switch or bootstrap net on a converter board: both read differently from 0.10.19.+- The converter spec fragment AI Flow suggests now names the converter's input outright (`"converter": {"inNet": ...}`) when the board shows it.++## AI Flow in Claude Desktop++The adom-aiflow skill says what the Claude Desktop build (0.2.131) does and does not do yet.
package.json+1−1
@@ -1,7 +1,7 @@ {   "slug": "adom-aiflow",   "type": "app",-  "version": "0.2.141",+  "version": "0.2.142",   "title": "AI Flow",   "description": "Adom's AI Flow: a tool to help the AI follow all of the steps it takes to build a board. One Rust binary with a crate per step (placement helpers, a grid router with Kelvin taps, pours with keepouts, KiCad's DRC gate, live landing through the KiCad Bridge, copper measurement, current and thermal analysis) and a finish line that refuses an unfinished board. Every command answers with hints for the AI; every turn, its thinking time and every rework loop go into run.jsonl, so Claude, Codex and any other engine are compared on the same flow. KiCad, Fusion 360 and Altium Designer today (the same steps and gates through each tool's bridge); Adom's own web apps next.",   "summary": "Adom's AI Flow: a tool to help the AI follow all of the steps it takes to build a board. The AI thinks its way from placement through routing, pours, current and thermal analysis to a delivered video; the binary does the fast, deterministic parts of every step, hands back hints, and keeps a ledger of every turn, every return to an earlier step, and the clock from the prompt to done.",
page.json+1−1
@@ -1,7 +1,7 @@ {   "slug": "adom-aiflow",   "type": "app",-  "version": "0.2.141",+  "version": "0.2.142",   "title": "AI Flow",   "description": "Adom's AI Flow: a tool to help the AI follow all of the steps it takes to build a board. One Rust binary with a crate per step (placement helpers, a grid router with Kelvin taps, pours with keepouts, KiCad's DRC gate, live landing through the KiCad Bridge, copper measurement, current and thermal analysis) and a finish line that refuses an unfinished board. Every command answers with hints for the AI; every turn, its thinking time and every rework loop go into run.jsonl, so Claude, Codex and any other engine are compared on the same flow. KiCad, Fusion 360 and Altium Designer today (the same steps and gates through each tool's bridge); Adom's own web apps next.",   "summary": "Adom's AI Flow: a tool to help the AI follow all of the steps it takes to build a board. The AI thinks its way from placement through routing, pours, current and thermal analysis to a delivered video; the binary does the fast, deterministic parts of every step, hands back hints, and keeps a ledger of every turn, every return to an earlier step, and the clock from the prompt to done.",
skills/adom-aiflow/SKILL.md+11
@@ -225,6 +225,9 @@ the library, simulation, current, thermal, fields and export, Fusion for everyth    `rules use --profile 3rdPartyFab [--layers 2] [--variant <name>] [--prefs <file>]` installs the KiCad    rules, loads the same pack into the open Fusion design and writes the choice into the spec. Tell the    human the rules in plain words. A set others should share goes on adom/pcb-design-rules as a profile.+   Heavier outer copper: `rules use --profile jlcpcb --layers 4 --copper-oz 2` binds the fab's stackup with 70 um+   outer copper (spec and board) and writes the pack's 2 oz minimum track and spacing (JLCPCB 0.15/0.15 mm on four+   layers) into the board's rules; the dielectrics stay as published, so confirm impedance widths with the fab. 3. **The circuit** (aiflow-circuit-design): datasheet math and values. 4. **The test plan** (skill aiflow-test-plan). Think through how the built board will be tested on the    probing workcell and write tests.json; `testplan check --tests tests.json --netlist <netlist.json>@@ -394,6 +397,14 @@ add a load only to get a solve.  The AI's time on a run is the sum of its sessions: one per human prompt, from the prompt to the AI's done, with idle gaps (over 15 min, no command running) cut out. The first prompt is `start --prompt-time`; every follow-up prompt is `prompt --text "..."` (`--at <time>` when you start late; `--rebaseline <board>` when the human's change moves the molecule interface: that board's fixed references become the baseline, in the same run, clock and ledger); the answer's end is `done --message "..."` (`deliver` is the done of the first task). Say `done` the moment an answer is complete, so nothing idle is charged; work after a done with no `prompt` mark is listed as an unmarked follow-up, one row per idle gap. The delivery number on the page is the AI time from the first prompt to `deliver`; follow-ups have their own rows. `sessions` prints the table. The per-step table and the video's run clock ("AI TIME, THIS RUN") count active seconds only. +## Reload after an offline edit++`capture reload` makes KiCad's editor match the board file after an edit made outside it (`kicad_reload_board`, KiCad's own Revert). A KiCad bridge without that verb (the macOS 2.0.x builds) gets the same result another way: AI Flow closes the board's editor and opens the file again, in the run's own isolated editor when the run has one. Closing never saves, so an editor with unsaved edits is refused as a reload refuses it; `capture reload --discard` drops them.++## AI Flow in Claude Desktop++AI Flow also runs inside Claude Desktop on the user's own computer, compiled to WebAssembly and carried by the Adom extension ([adom/adom-claude-extension](https://wiki.adom.inc/adom/adom-claude-extension)). There, commands that run a program (kicad-cli, adom-fields, adom-bridge) ask the extension's host to run them on the user's machine. What works: `start`, the checks (`gate`, `schematic check`, `part-check`, `dfa check`, `analyze`), and anything that needs only files and a native KiCad on that machine. Not there yet: the timeline dashboard; `measure` and `land` and every live editor step, which need Adom Bridge on the machine; and the Fusion and Altium lanes, whose scripts need `python3` there. In Claude Code (this Linux workspace) everything works as described in this skill.+ ## Landing is one at a time, on purpose  `place land` moves ONE PART per call and `land route` draws ONE TRACE per call (a net with several paths lands as several undo steps), each its own moment on camera, `--pause-ms` apart (600 by default). That is what makes the video show the board filling part by part and every trace being drawn, instead of an empty board that is suddenly full. It costs wall time: the ESC lands 122 parts and about 320 traces at roughly five seconds each, so budget half an hour for the routing landing and a few minutes for the placement. Never batch them to save time; the clip is the evidence. `--pause-ms 300` is the shortest pace the recorder still catches.
skills/aiflow-molecule/SKILL.md+1−1
@@ -202,6 +202,6 @@ Record it as `programming` in board-release.json beside the board (or `programmi {"interface": "swd", "pins": {"SWDIO": "J8", "SWCLK": "J9", "NRST": "J10", "GND": "J7"}, "target": "STM32G431CBT6", "boot": "BOOT0 low via R2; JP1 bridges for DFU"} ``` -`interface` is `swd` (SWDIO, SWCLK, NRST optional, GND), `uart-boot` (TX, RX, GND), `usb-dfu` (D+, D-, GND), `updi` (UPDI, GND), `avr-isp` (MISO, MOSI, SCK, RESET, GND: a classic megaAVR or tinyAVR on the 6-pin ISP header) or `jtag` (TCK, TMS, TDI, TDO, GND: a CPLD, an FPGA or an MCU's JTAG port); `pins` maps each interface signal to the reference that carries it; `target` is the MPN being programmed. A board programmed over its own USB connector instead (an ESP32-S3 or C3 with native USB Serial/JTAG) declares `"interface": "usb-serial-jtag", "access": "usb-cable"` with `connector` (the USB connector's reference), `targetRef` and `target` (the ESP32), `boot` (how to force download mode) and `connectorPins` mapping `D+`, `D-`, `GND` and `VBUS` to `{"pads": [...], "net": "..."}`; the check confirms those pads carry those four distinct nets, and no robot contacts are needed. `step schematic` and `step placement` print the Hint; `finish` lists it as an open item when a programmable part has no `programming` record, a required pin is missing, or a pin is not reachable (a machine contact, a labelled test pad or a cable header).+`interface` is `swd` (SWDIO, SWCLK, NRST optional, GND), `uart-boot` (TX, RX, GND), `usb-dfu` (D+, D-, GND), `updi` (UPDI, GND), `avr-isp` (MISO, MOSI, SCK, RESET, GND: a classic megaAVR or tinyAVR on the 6-pin ISP header) or `jtag` (TCK, TMS, TDI, TDO, GND: a CPLD, an FPGA or an MCU's JTAG port); `pins` maps each interface signal to the reference that carries it; `target` is the MPN being programmed. A board programmed over its own USB connector instead (an ESP32-S3 or C3 with native USB Serial/JTAG) declares `"interface": "usb-serial-jtag", "access": "usb-cable"` with `connector` (the USB connector's reference), `targetRef` and `target` (the ESP32), `boot` (how to force download mode) and `connectorPins` mapping `D+`, `D-`, `GND` and `VBUS` to `{"pads": [...], "net": "..."}`; the check confirms those pads carry those four distinct nets, and no robot contacts are needed. A part programmed over its UART through an on-board USB-UART bridge (a classic ESP32 behind a CH340 or CP2102, the usual dev-board path, often with DTR/RTS auto-reset) declares `"interface": "uart-boot", "access": "usb-cable"` with the same `connector` and `connectorPins`, plus `bridgeRef` (the bridge chip), `targetRef`, `target`, `boot` and, optionally, `uartNets` {"TX", "RX"}; the check confirms the connector's four nets, that the bridge sits on D+ and D-, and that the bridge and the target share the UART nets (the named ones, else at least two signal nets between them). `step schematic` and `step placement` print the Hint; `finish` lists it as an open item when a programmable part has no `programming` record, a required pin is missing, or a pin is not reachable (a machine contact, a labelled test pad or a cable header).  A board with several programmable parts (four MCUs, or an MCU beside an ESP32 on its own USB) records `programming` as a list, one record per interface, each naming the part(s) it programs with `targetRef` or `targetRefs` (their part number must be its `target`); `finish` lists a programmable part no record names as an open item. SWD over a Tag-Connect footprint (TC2030 / TC2050, or any project-library pad set made for a spring-pin cable: the pads and nets are the evidence, not the footprint's name) declares `"access": "tag-connect"` with `connector` (the Tag-Connect footprint), `targetRef`, `target` and `connectorPins` mapping `SWDIO`, `SWCLK`, `GND` and (when reset is wired) `NRST` to `{"pads": [...], "net": "..."}`; the check confirms the pads carry those nets and that the SWD nets reach the part, like the USB-cable record. A cable header (an STDC14 or ARM-10 SWD header for an ST-LINK or J-Link cable, a UART-boot or UPDI header) is the same record with `"access": "cable"` (or `"header"`): `connectorPins` maps that interface's signals (SWDIO, SWCLK, GND and optional NRST; TX, RX, GND; UPDI, GND), `targetRef` may be left out when the board has one programmable part, and `"pins": {"SWDIO": "J7.4", ...}` written as pads of one connector reads as the same header (each pad's net from the board).