← Commit history
Cargo.lock+10−10
@@ -4,7 +4,7 @@ version = 4  [[package]] name = "adom-aiflow"-version = "0.2.111"+version = "0.2.112" dependencies = [  "aiflow-analyze",  "aiflow-board",@@ -25,7 +25,7 @@ dependencies = [  [[package]] name = "aiflow-analyze"-version = "0.2.111"+version = "0.2.112" dependencies = [  "aiflow-board",  "serde",@@ -35,7 +35,7 @@ dependencies = [  [[package]] name = "aiflow-board"-version = "0.2.111"+version = "0.2.112" dependencies = [  "roxmltree",  "serde",@@ -44,7 +44,7 @@ dependencies = [  [[package]] name = "aiflow-bridge"-version = "0.2.111"+version = "0.2.112" dependencies = [  "aiflow-board",  "serde",@@ -53,7 +53,7 @@ dependencies = [  [[package]] name = "aiflow-copper"-version = "0.2.111"+version = "0.2.112" dependencies = [  "aiflow-board",  "aiflow-grid",@@ -63,7 +63,7 @@ dependencies = [  [[package]] name = "aiflow-grid"-version = "0.2.111"+version = "0.2.112" dependencies = [  "aiflow-board",  "serde",@@ -72,7 +72,7 @@ dependencies = [  [[package]] name = "aiflow-place"-version = "0.2.111"+version = "0.2.112" dependencies = [  "aiflow-board",  "serde",@@ -81,7 +81,7 @@ dependencies = [  [[package]] name = "aiflow-pours"-version = "0.2.111"+version = "0.2.112" dependencies = [  "aiflow-board",  "aiflow-copper",@@ -91,7 +91,7 @@ dependencies = [  [[package]] name = "aiflow-router"-version = "0.2.111"+version = "0.2.112" dependencies = [  "aiflow-board",  "aiflow-grid",@@ -102,7 +102,7 @@ dependencies = [  [[package]] name = "aiflow-run"-version = "0.2.111"+version = "0.2.112" dependencies = [  "serde",  "serde_json",
Cargo.toml+1−1
@@ -14,7 +14,7 @@ members = [ ]  [workspace.package]-version = "0.2.111"+version = "0.2.112" edition = "2021" license = "MIT" repository = "https://wiki.adom.inc/adom/adom-aiflow"
bin/adom-aiflow
⋯ 1 unchanged line ⋯
crates/adom-aiflow/src/checks.rs+57−10
@@ -130,19 +130,41 @@ pub fn compare_netlists(sch: &SchNetlist, b: &Board) -> Value {  // ----------------------------------------------------------------------------- molecule (#9) -/// Pad and drill of each Adom molecule footprint (Adom KiCad Library 1.2.3), by footprint name.+/// Pad and drill of each Adom molecule footprint, by footprint name. The drills are the current machine+/// hardware's (issue #251, Noah 2026-11-25: medium contact 0.87, large contact 2.75, large pin 3.6 mm;+/// the medium pin stays 1.2 mm); `legacy_drill` names the drill the earlier hardware had. pub fn molecule_part(lib: &str) -> Option<(&'static str, f64, f64)> {     // case-insensitive: Fusion writes package names upper-cased (MACHINEPINMEDIUMSHORT)     let name = lib.rsplit(':').next().unwrap_or(lib).to_ascii_lowercase();     match name.as_str() {         "machinepinmediumshort" | "machinepinmediumstandard" => Some(("pin", 1.6, 1.2)),-        "machinepinlargeshort" | "machinepinlargestandard" => Some(("pin", 5.2, 3.45)),-        "machinecontactmedium" => Some(("contact", 1.3, 0.78)),-        "machinecontactlarge" => Some(("contact", 4.4, 2.62)),+        "machinepinlargeshort" | "machinepinlargestandard" => Some(("pin", 5.2, 3.6)),+        "machinecontactmedium" => Some(("contact", 1.3, 0.87)),+        "machinecontactlarge" => Some(("contact", 4.4, 2.75)),         _ => None,     } } +/// Issue #251: the earlier hardware's drill for a current one (Adom KiCad Library 1.2.3 / 1.2.4 footprints+/// still carry it), accepted during the changeover.+pub fn legacy_drill(drill: f64) -> Option<f64> {+    [(0.87, 0.78), (2.75, 2.62), (3.6, 3.45)].into_iter().find(|(now, _)| (now - drill).abs() < 1e-9).map(|(_, was)| was)+}++/// Whether a drilled hole is the expected one: the current drill, or its legacy drill unless the spec+/// overrides the size (an override is exact).+fn drill_ok(d: f64, drill: f64, overridden: bool) -> bool {+    (d - drill).abs() <= 0.01 || (!overridden && legacy_drill(drill).is_some_and(|was| (d - was).abs() <= 0.01))+}++/// "0.87 mm drill (0.78 mm, the earlier hardware's, also accepted)"+fn drill_words(drill: f64, overridden: bool) -> String {+    match legacy_drill(drill).filter(|_| !overridden) {+        Some(was) => format!("{drill} mm drill ({was} mm, the earlier hardware's, also accepted)"),+        None => format!("{drill} mm drill"),+    }+}+ #[derive(Debug, Default)] pub struct Findings {     pub lines: Vec<String>,@@ -189,20 +211,21 @@ pub fn molecule_check_bom(b: &Board, spec: &Value, before: Option<&Board>, bom:     let grid = m["gridMm"].as_f64().unwrap_or(2.0);     let margin = m["edgeMarginMm"].as_f64().unwrap_or(2.0);     let pin_net = m["cornerPinsNet"].as_str().unwrap_or("GND").to_string();-    let hint_fp = "Use the Adom KiCad Library 1.2.3 footprints (lib/Molecule.pretty): MachinePinMediumShort 1.6 mm pad / 1.2 mm drill (or MachinePinLargeShort / LargeStandard 5.2 mm pad / 3.45 mm drill when the corner-pin class rule needs large pins) for MP1 to MP4, MachineContactMedium 1.3 mm pad / 0.78 mm drill for contacts (MachineContactLarge 4.4 mm pad / 2.62 mm drill for a power net over 3.5 A, which takes large corner pins); spec.molecule.pinPadMm / pinDrillMm / contactPadMm / contactDrillMm override the expected sizes (skill aiflow-molecule).";+    let hint_fp = "Use the Adom molecule footprints (MachinePin*, MachineContact*) drilled for the current machine hardware: MachinePinMediumShort 1.6 mm pad / 1.2 mm drill (or MachinePinLargeShort / LargeStandard 5.2 mm pad / 3.6 mm drill when the corner-pin class rule needs large pins) for MP1 to MP4, MachineContactMedium 1.3 mm pad / 0.87 mm drill for contacts (MachineContactLarge 4.4 mm pad / 2.75 mm drill for a power net over 3.5 A, which takes large corner pins). The earlier hardware's drills (0.78 / 2.62 / 3.45 mm, in the Adom KiCad Library 1.2.3 / 1.2.4 footprints) are still accepted during the changeover. spec.molecule.pinPadMm / pinDrillMm / contactPadMm / contactDrillMm override the expected sizes (skill aiflow-molecule).";     let pad_of = |r: &str| b.pads_of(r).into_iter().next().cloned();     let mut pins: BTreeMap<String, (f64, f64)> = BTreeMap::new();     for k in 1..=4 {         let r = format!("MP{k}");         let Some(fp) = b.footprints.get(&r) else { f.error(format!("{r} is missing: a molecule has four machine pins, counterclockwise seen from above: MP1 (front left), MP2 (back left), MP3 (back right), MP4 (front right)"), hint_fp); continue };         let Some((_, pad, drill)) = molecule_part(&fp.lib).filter(|p| p.0 == "pin") else { f.error(format!("{r} is {}, not a MachinePin footprint", fp.lib), hint_fp); continue };+        let over = m["pinDrillMm"].is_number();         let (pad, drill) = (m["pinPadMm"].as_f64().unwrap_or(pad), m["pinDrillMm"].as_f64().unwrap_or(drill));         match pad_of(&r) {             Some(p) => {                 let d = p.drill.unwrap_or(0.0);-                if (p.size.0 - pad).abs() > 0.01 || (p.size.1 - pad).abs() > 0.01 || (d - drill).abs() > 0.01 {-                    f.error(format!("{r} ({}) pad {:.2} x {:.2} mm, drill {d:.2} mm; expected {pad} mm pad, {drill} mm drill", fp.lib, p.size.0, p.size.1), hint_fp);-                } else { f.ok(format!("{r} {} at ({:.2}, {:.2}): {pad} mm pad, {drill} mm drill", fp.lib, fp.x, fp.y)); }+                if (p.size.0 - pad).abs() > 0.01 || (p.size.1 - pad).abs() > 0.01 || !drill_ok(d, drill, over) {+                    f.error(format!("{r} ({}) pad {:.2} x {:.2} mm, drill {d:.2} mm; expected {pad} mm pad, {}", fp.lib, p.size.0, p.size.1, drill_words(drill, over)), hint_fp);+                } else { f.ok(format!("{r} {} at ({:.2}, {:.2}): {pad} mm pad, {} mm drill", fp.lib, fp.x, fp.y, (d * 1000.0).round() / 1000.0)); }                 if !p.net.is_empty() && norm_net(&p.net) != norm_net(&pin_net) { f.warn(format!("{r} is on net {}; corner pins are {pin_net}", p.net), "Corner machine pins are mechanical first and tie to GND (spec.molecule.cornerPinsNet names another net)."); }             }             None => f.error(format!("{r} ({}) has no copper pad", fp.lib), hint_fp),@@ -267,13 +290,14 @@ pub fn molecule_check_bom(b: &Board, spec: &Value, before: Option<&Board>, bom:     for r in &contacts {         let Some(fp) = b.footprints.get(r) else { f.error(format!("contact {r} (spec.molecule.contacts) is not on the board"), ""); continue };         let Some((_, pad, drill)) = molecule_part(&fp.lib).filter(|p| p.0 == "contact") else { f.error(format!("contact {r} is {}, not a MachineContact footprint", fp.lib), hint_fp); continue };+        let over = m["contactDrillMm"].is_number();         let (pad, drill) = (m["contactPadMm"].as_f64().unwrap_or(pad), m["contactDrillMm"].as_f64().unwrap_or(drill));         let mut good = true;         if let Some(p) = pad_of(r) {             let d = p.drill.unwrap_or(0.0);-            if (p.size.0 - pad).abs() > 0.01 || (p.size.1 - pad).abs() > 0.01 || (d - drill).abs() > 0.01 {+            if (p.size.0 - pad).abs() > 0.01 || (p.size.1 - pad).abs() > 0.01 || !drill_ok(d, drill, over) {                 good = false;-                f.error(format!("{r} ({}) pad {:.2} x {:.2} mm, drill {d:.2} mm; expected {pad} mm pad, {drill} mm drill", fp.lib, p.size.0, p.size.1), hint_fp);+                f.error(format!("{r} ({}) pad {:.2} x {:.2} mm, drill {d:.2} mm; expected {pad} mm pad, {}", fp.lib, p.size.0, p.size.1, drill_words(drill, over)), hint_fp);             }         }         if let Some(o) = origin {@@ -1071,6 +1095,29 @@ mod tests {      fn board(text: &str) -> Board { Board::from_text("t.kicad_pcb", text.to_string()).unwrap() } +    #[test]+    fn the_current_and_the_earlier_hardware_drills_both_pass() {+        // issue #251 (Noah): medium contact 0.87 mm now, 0.78 mm on the earlier hardware; large pin 3.6 / 3.45+        let drill_err = |f: &Findings| f.errors.iter().any(|e| e.contains("drill") && e.contains("expected"));+        for d in ["0.87", "0.78"] {+            let f = molecule_check(&board(&BOARD.replace("(drill 0.78)", &format!("(drill {d})"))), &json!({}), None);+            assert!(!drill_err(&f), "MC1 drilled {d} mm: {:?}", f.errors);+        }+        let f = molecule_check(&board(&BOARD.replace("(drill 0.78)", "(drill 0.81)")), &json!({}), None);+        let e = f.errors.iter().find(|e| e.contains("MC1")).expect("0.81 mm is neither hardware's");+        assert!(e.contains("0.87 mm drill (0.78 mm, the earlier hardware's, also accepted)"), "{e}");+        // a spec override is exact: the earlier drill no longer passes+        let f = molecule_check(&board(BOARD), &json!({"molecule": {"contactDrillMm": 0.87}}), None);+        assert!(f.errors.iter().any(|e| e.contains("MC1") && e.contains("expected 1.3 mm pad, 0.87 mm drill")), "{:?}", f.errors);+        let large = |d: &str| BOARD.replace("size 1.6 1.6", "size 5.2 5.2").replace("drill 1.2", d).replace("MachinePinMediumShort", "MachinePinLargeShort");+        for d in ["drill 3.6", "drill 3.45"] {+            let f = molecule_check(&board(&large(d)), &json!({}), None);+            assert!(!f.errors.iter().any(|e| e.starts_with("MP") && e.contains("drill")), "large pins {d}: {:?}", f.errors);+        }+        assert_eq!(legacy_drill(2.75), Some(2.62));+        assert_eq!(legacy_drill(1.2), None);+    }+     #[test]     fn a_contact_not_named_mc_n_is_a_finding_with_the_rename_never_an_error() {         // issue #138: J1 on MachineContactMedium passed; the registry counts only MC<n>
crates/adom-aiflow/src/molecule_pins.rs+20−7
@@ -1,7 +1,8 @@ //! Issue #138: machine pins and contacts by reference designator, as the wiki's model registry reads //! them (rule adom.molecule-pins/2: molecule-publish's scripts/pins.json and pin_names.py). The-//! registry counts a machine contact only when it is a one-pad part NAMED MC<n> on a 0.78 or 2.62 mm-//! hole, and a machine pin only when it is named MP1 to MP4 (MS<n> for any extra one). A contact named+//! registry counts a machine contact only when it is a one-pad part NAMED MC<n> on a machine contact+//! hole (0.87 or 2.75 mm; 0.78 or 2.62 mm on the earlier hardware), and a machine pin only when it is+//! named MP1 to MP4 (MS<n> for any extra one). A contact named //! J3 on a MachineContactMedium footprint passes every other check here and still gets no wire attach //! point in Hydrogen. This is the KiCad half of that census, ported; it reports findings with the //! rename to make, and never refuses: AI Flow suggests, the registry decides.@@ -11,7 +12,9 @@ use aiflow_board::Board;  pub const RULE: &str = "adom.molecule-pins/2"; /// pins.json drillBucketsMm and drillToleranceMm.-const BUCKETS: [(&str, f64); 4] = [("mediumContact", 0.78), ("mediumPin", 1.20), ("largeContact", 2.62), ("largePin", 3.45)];+/// Issue #251: the current machine hardware's drills first (0.87 / 1.2 / 2.75 / 3.6 mm), then the earlier+/// hardware's (0.78 / 2.62 / 3.45 mm), accepted during the changeover.+const BUCKETS: [(&str, &[f64]); 4] = [("mediumContact", &[0.87, 0.78]), ("mediumPin", &[1.20]), ("largeContact", &[2.75, 2.62]), ("largePin", &[3.6, 3.45])]; const DRILL_TOL: f64 = 0.001; /// pins.json furniturePackages: glob, case ignored, against the footprint name after its last ':' /// and the file name of the 3D model.@@ -61,7 +64,7 @@ fn file_name(path: &str) -> String { path.replace('\\', "/").rsplit('/').next().  fn bucket(drill: Option<f64>) -> Option<&'static str> {     let d = drill?;-    BUCKETS.iter().find(|(_, v)| (d - v).abs() < DRILL_TOL).map(|(k, _)| *k)+    BUCKETS.iter().find(|(_, v)| v.iter().any(|v| (d - v).abs() < DRILL_TOL)).map(|(k, _)| *k) }  fn atoms(n: &Node) -> impl Iterator<Item = &str> { n.items.iter().filter_map(|it| if let Item::Atom { text, .. } = it { Some(text.as_str()) } else { None }) }@@ -166,7 +169,7 @@ pub fn findings(rows: &[Row]) -> Vec<(String, String)> {     if !unnamed.is_empty() {         let names = free_names(rows, "MC", unnamed.len());         out.push((format!("{} machine-contact part(s) not named MC<n>, so the registry will not count them as machine contacts: {}", unnamed.len(), list(&unnamed, true)),-            format!("Rename them {} (one-pad part, MC<n>, on a 0.78 or 2.62 mm hole) in the schematic and the board, best before layout: {WHY}. After layout a rename also changes silkscreen labels, pinout tables and the copper fingerprint.", names.join(", "))));+            format!("Rename them {} (one-pad part, MC<n>, on a 0.87 or 2.75 mm hole; 0.78 or 2.62 mm on the earlier hardware) in the schematic and the board, best before layout: {WHY}. After layout a rename also changes silkscreen labels, pinout tables and the copper fingerprint.", names.join(", "))));     }     let pin_named = by("machine-contact", "refused", Some("pin-name"));     if !pin_named.is_empty() {@@ -186,7 +189,7 @@ pub fn findings(rows: &[Row]) -> Vec<(String, String)> {     let loose = by("machine-pin", "warned", None);     if !loose.is_empty() {         out.push((format!("{} part(s) fit the machine-pin standard only in part and are not machine pins to the registry: {}", loose.len(), list(&loose, true)),-            format!("A machine pin is named MP1 to MP4 (MS<n> beyond the four corners) on a MachinePin footprint whose name or model says its length (Short or Standard), on a 1.20 or 3.45 mm hole; {WHY}.")));+            format!("A machine pin is named MP1 to MP4 (MS<n> beyond the four corners) on a MachinePin footprint whose name or model says its length (Short or Standard), on a 1.20 or 3.6 mm hole (3.45 mm on the earlier hardware); {WHY}.")));     }     let groups = by("group", "group", None);     if !groups.is_empty() {@@ -196,7 +199,7 @@ pub fn findings(rows: &[Row]) -> Vec<(String, String)> {     let off = by("", "refused", Some("hole-off-table")).into_iter().chain(by("", "warned", Some("hole-off-table"))).collect::<Vec<_>>();     if !off.is_empty() {         out.push((format!("{} machine pin(s) or contact(s) drilled off the standard sizes: {}", off.len(), list(&off, true)),-            "Machine pins are drilled 1.20 mm (medium) or 3.45 mm (large), machine contacts 0.78 mm or 2.62 mm, within 0.001 mm; use the Adom library footprints (lib/Molecule.pretty), whose drills match.".into()));+            "Machine pins are drilled 1.20 mm (medium) or 3.6 mm (large), machine contacts 0.87 mm or 2.75 mm, within 0.001 mm; the earlier hardware's 3.45, 0.78 and 2.62 mm are still accepted. Use the Adom molecule footprints drilled for the current hardware.".into()));     }     let dups = by("", "refused", Some("duplicate"));     if !dups.is_empty() {@@ -348,4 +351,14 @@ mod tests {         assert!(text.contains("outside MP1 to MP4: MP5") && text.contains("not in capitals: mc2"), "{text}");         assert!(names_from_footprints(&parts[..2]).is_empty());     }++    #[test]+    fn both_hardwares_holes_are_in_the_table() {+        // issue #251: 0.87 / 2.75 / 3.6 mm now, 0.78 / 2.62 / 3.45 mm on the earlier hardware, 1.2 mm both+        for (d, k) in [(0.87, "mediumContact"), (0.78, "mediumContact"), (1.2, "mediumPin"), (2.75, "largeContact"), (2.62, "largeContact"), (3.6, "largePin"), (3.45, "largePin")] {+            assert_eq!(bucket(Some(d)), Some(k), "{d}");+        }+        assert_eq!(bucket(Some(0.81)), None);+    }+ }
crates/aiflow-bridge/src/altium.rs+17−2
@@ -248,14 +248,15 @@ impl Eda for AltiumEda {     }      fn routing_validate(&self, t: &dyn Transport, _a: &Value) -> Value {-        let r = t.send("altium_routing_drc", &json!({}));+        // altium-bridge 0.2.109 checks the board named (before, the board in front)+        let r = t.send("altium_routing_drc", &json!({"filePath": self.path}));         let (errors, warnings) = split_severity(&r);         json!({"success": r["success"], "unconnected": r["unconnected"], "errors": errors.len(), "warnings": warnings.len(),                "clean": errors.is_empty() && r["unconnected"].as_u64().unwrap_or(0) == 0, "drc": r, "warningRules": rule_counts(&warnings), "source": "Altium online DRC"})     }      fn full_drc(&self, t: &dyn Transport, _a: &Value) -> Value {-        let r = t.send("altium_routing_drc", &json!({"full": true}));+        let r = t.send("altium_routing_drc", &json!({"full": true, "filePath": self.path}));         let (errors, warnings) = split_severity(&r);         let v: Vec<Value> = errors.iter().map(|x| json!({"type": x["rule"], "items": [x["description"]], "at": x["at"]})).collect();         json!({"success": r["success"], "violations": v, "unconnected": r["unconnected"], "errors": errors.len(), "warnings": warnings.len(),@@ -549,5 +550,19 @@ mod tests {         assert_eq!(r["unchanged"], true);         assert!(!sent.borrow().iter().any(|(v, _)| v == "altium_set_design_rules"));     }++    #[test]+    fn the_drc_names_the_runs_board() {+        // altium-bridge 0.2.109 checks the board named; before, whichever board was in front+        let sent = RefCell::new(Vec::new());+        let t = |v: &str, a: &Value| { sent.borrow_mut().push((v.to_string(), a.clone())); json!({"success": true, "violations": [], "unconnected": 0}) };+        let e = AltiumEda { path: "C:/b.PcbDoc".into() };+        e.full_drc(&t, &json!({}));+        e.routing_validate(&t, &json!({}));+        let s = sent.borrow();+        assert!(s.iter().all(|(v, a)| v == "altium_routing_drc" && a["filePath"] == "C:/b.PcbDoc"), "{s:?}");+        assert_eq!(s[0].1["full"], true);+    }+ } 
docs/release-0.2.112.mdadded+14
@@ -0,0 +1,14 @@+# adom-aiflow 0.2.112++## Molecule check: the new machine hardware's hole sizes (issue #251, Noah)++The machine contacts and large pins changed drills (Noah, 2026-11-25): medium contact 0.87 mm (was 0.78), large contact 2.75 mm (was 2.62), large pin 3.6 mm (was 3.45); the medium pin stays 1.2 mm and every pad is unchanged. The molecule check (`molecule check`, and inside `place check`, `gate` and `finish`) expected only the old drills, so a board drilled for the new hardware failed placement, the gate and finish.++- The new drills are the expected ones, and the earlier hardware's drills still pass during the changeover. A refusal says both: `expected 1.3 mm pad, 0.87 mm drill (0.78 mm, the earlier hardware's, also accepted)`.+- A `spec.molecule` drill override (`pinDrillMm`, `contactDrillMm`) stays exact: it accepts only the size it names.+- The machine pin and contact census (MC<n> / MP<n> names, issue #138) counts both hardwares' holes.+- The hints and the aiflow-molecule skill tables give the new sizes and note that the Adom KiCad Library 1.2.3 / 1.2.4 footprints still carry the earlier drills.++## Altium: the DRC names the run's board++`altium_routing_drc` is sent the run's `.PcbDoc` (`filePath`). altium-bridge 0.2.109 checks the board named; an older bridge checked whichever board was in front.
package.json+1−1
@@ -1,7 +1,7 @@ {   "slug": "adom-aiflow",   "type": "app",-  "version": "0.2.111",+  "version": "0.2.112",   "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.111",+  "version": "0.2.112",   "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+1−1
@@ -407,7 +407,7 @@ The first `step` (or `capture start`) asks the test box once which recorder its Deterministic checks that report, each an OK or FINDINGS with suggestions (never a refusal):  - **`netlist check [--sch design.kicad_sch] [--board B] [--net exported.net]`**: exports the schematic's netlist with kicad-cli (`sch export netlist --format kicadsexpr`, through `ADOM_AIFLOW_KICAD_CLI`; `adom-aiflow-kicad-cli-remote` does it on a desktop's KiCad 10 and carries the sub-sheets, lib tables and `${KIPRJMOD}` symbol libraries) and compares it pin by pin with the board's pads: missing and extra references, and every pin whose net differs (`/VIN` equals `VIN`; unlabelled `Net-(...)` nets compare by their pins). In a run it is recorded; `finish` re-checks the stored netlist against the board it finishes on and asks again when the schematic changed.-- **`molecule check [--board B --spec S]`**, and inside `place check`, `gate` and `finish` whenever the spec has `"molecule": {...}`: MP1 to MP4 are MachinePin footprints (MediumShort 1.6 mm pad / 1.2 mm drill, or large 5.2 / 3.45), MP1 is the front-left pin and MP2 to MP4 follow counterclockwise seen from above (back left, back right, front right), the four sit on a rectangle whose sides are whole grid steps (a warning when not 4 mm multiples, which a LrgMed scaffold needs), every MachineContact (medium 1.3 / 0.78) sits on the grid from MP1, pins and contacts keep the edge margin, `molecule.fixed` positions hold, and `fixedRefs` are where the start board had them. Corner-pin class (0.2.17, issue #87): an error when the pins are medium but the board needs large ones (seats in the base scaffold, over 100 g with its parts, a motor, actuator, heatsink over 20 g, cabled connector or hard-pressed button, longest side over 100 mm, or a pin net over 3.5 A in `spec.loads`); a warning when the mass is unknown or a part looks like an undeclared mechanical load; large pins with no reason are fine. The rule, its data and the spec fields are in skill aiflow-molecule. Spec: `"molecule": {"gridMm": 2, "edgeMarginMm": 2, "cornerPinsNet": "GND", "contacts": [...], "fixed": {"J1": [0, 12]}, "seat": "base|lrgmed|board", "massG": 42, "mechanicalLoads": [{"ref": "M1", "kind": "motor"}], "pinCurrentA": 1.2}` (mm from MP1, y up; all optional); `--bom <csv>` (default: the run's BOM) gives a `mass_g` column.+- **`molecule check [--board B --spec S]`**, and inside `place check`, `gate` and `finish` whenever the spec has `"molecule": {...}`: MP1 to MP4 are MachinePin footprints (MediumShort 1.6 mm pad / 1.2 mm drill, or large 5.2 / 3.6; the earlier hardware's 3.45 also passes), MP1 is the front-left pin and MP2 to MP4 follow counterclockwise seen from above (back left, back right, front right), the four sit on a rectangle whose sides are whole grid steps (a warning when not 4 mm multiples, which a LrgMed scaffold needs), every MachineContact (medium 1.3 / 0.87, the earlier 0.78 also passing) sits on the grid from MP1, pins and contacts keep the edge margin, `molecule.fixed` positions hold, and `fixedRefs` are where the start board had them. Corner-pin class (0.2.17, issue #87): an error when the pins are medium but the board needs large ones (seats in the base scaffold, over 100 g with its parts, a motor, actuator, heatsink over 20 g, cabled connector or hard-pressed button, longest side over 100 mm, or a pin net over 3.5 A in `spec.loads`); a warning when the mass is unknown or a part looks like an undeclared mechanical load; large pins with no reason are fine. The rule, its data and the spec fields are in skill aiflow-molecule. Spec: `"molecule": {"gridMm": 2, "edgeMarginMm": 2, "cornerPinsNet": "GND", "contacts": [...], "fixed": {"J1": [0, 12]}, "seat": "base|lrgmed|board", "massG": 42, "mechanicalLoads": [{"ref": "M1", "kind": "motor"}], "pinCurrentA": 1.2}` (mm from MP1, y up; all optional); `--bom <csv>` (default: the run's BOM) gives a `mass_g` column. - **Fab rules**: `"fab": {"rules": "fab" | "jlcpcb"}` in the spec. `fab` (the 3rd party fab) requires the project's own `.kicad_dru` beside the board; those rules are private and never shipped or restated. `jlcpcb` requires the JLCPCB pack for the board's copper layer count: on 2 layers the shipped profile, installed with `rules install --profile jlcpcb --layers 2` (JLCPCB's published 2-layer capabilities, cited in the file; `--force` replaces another rules file, keeps it as `.kicad_dru.bak` and says what it replaced); on 4, 6 or more layers `rules use --profile jlcpcb --layers <n>` loads the pack from adom/pcb-design-rules (`rules install` refuses a layer count it does not ship). A layer suffix pins the count: `"rules": "jlcpcb-6L"`. When the spec has no `fab.rules`, the gate, finish and `rules check` use what `rules use` recorded in run.json `fabRules` (an intake run has no spec yet), and warn when the spec and `fabRules` disagree. `rules check` says whether the board matches; the gate and finish refuse when it does not. - **3D models right way up**: `models` (and `models --offline`, no bridge) takes every bound model's bbox from `step2glb features` on the shared service (paced, cached per file in the run; the STEP file's own points when the service gives nothing), applies the footprint's rotate/offset as KiCad does, and warns when a flat SMD chip's thinnest axis is not Z or an SMD body's bottom is off the board. Fix the binding and look in the native 3D viewer; when a model is right as it is, `models --ack R1,C2 --why "<what you saw>"`. `finish` refuses while any warning is open. Never adom-chipsmith. `models` also compares each top-side model with its footprint's body outline (F.Fab, else the courtyard) and, when its centre is off or it lies across the body, notes the offset or quarter turn that would centre it (issue #240): advisory, look in the native 3D viewer and fix the footprint's model or leave it. - **Pads are real copper in every board GLB**: after `step2glb convert`, `board-glb copper --glb <kicad.glb> --board <design>.kicad_pcb --out <board>.glb [--finish copper|enig|hasl] [--paste none|solder]` makes them so by construction from the footprints' layers (pad/via/track meshes by KiCad layer name get a copper material with explicit metal and roughness; the mask is rebuilt as the outline minus every F.Mask/B.Mask aperture; solder only on F.Paste/B.Paste apertures of fitted parts; test points stay bare copper), then runs the gate. `board-glb check` alone refuses grey or default-metal pads, a mask over any exposed pad centre, solder on a pad without paste, or a board file whose pads do not line up with the GLB. A board file with no pads and no F.Mask/B.Mask apertures has no exposed copper: the GLB is still written (substrate and silkscreen opaque, mask whole) and the gate passes with the note "no exposed copper on this board". In a run the result is recorded (`boardGlb`). Rule and details: aiflow-molecule. Never hand-recolour a material index or lift pads through the mask. Publish only the `board-glb copper` output, never the raw step2glb GLB.
skills/aiflow-molecule/SKILL.md+7−6
@@ -1,7 +1,7 @@ --- name: aiflow-molecule description: >--  Make an adom-aiflow board an Adom molecule that fits the scaffold: the 2 mm grid, the origin at the MP1 (front-left) machine pin, the corner-pin class rule (large MachinePinLargeShort when the board seats in the base scaffold, weighs over 100 g, carries a motor, actuator, heatsink over 20 g, cabled connector or hard-pressed button, is over 100 mm long, a pin carries over 3.5 A, or it has a large contact unless spec.molecule.largeContactMediumPins says why medium is right; otherwise MachinePinMediumShort, 1.6 mm pad, 1.2 mm drill) at the corners as MP1 to MP4, MachineContactMedium (1.3 mm pad, 0.78 mm drill) for the signal contacts (named MC<n>, as the wiki registry counts them), MachineContactLarge (4.4 mm pad, 2.62 mm drill, 14 AWG solid wire) for a power net over 3.5 A, footprints from the Adom KiCad Library 1.2.3, the fab-rules profile (3rd party fab default, jlcpcb optional), then STEP export, `step2glb convert --molecule` with its stats gates, real copper pads (`adom-aiflow board-glb copper`: pads and test points are copper, the mask opens and paste shows only where the footprint layers say, with a gate), and molecule-publish. Medium-pin molecules mount on a LrgMed user scaffold (8 mm medium contact grid, offset 4 mm from its front-left large pin, large pins on a 32 mm base grid). Trigger words: aiflow molecule, make it a molecule, fits our scaffold, machine pins, large or medium pins, MachinePinLargeShort, MachinePinMediumShort, MachineContactMedium, MachineContactLarge, large contact, 14 AWG, high-current contact, MP1, molecule grid, molecule outline, fab rules profile, kicad_dru, molecule conformance, molecule export, step2glb molecule, publish molecule, LrgMed scaffold, copper pads, grey pads, test points, solder mask openings, paste layer, board GLB, board-glb.+  Make an adom-aiflow board an Adom molecule that fits the scaffold: the 2 mm grid, the origin at the MP1 (front-left) machine pin, the corner-pin class rule (large MachinePinLargeShort when the board seats in the base scaffold, weighs over 100 g, carries a motor, actuator, heatsink over 20 g, cabled connector or hard-pressed button, is over 100 mm long, a pin carries over 3.5 A, or it has a large contact unless spec.molecule.largeContactMediumPins says why medium is right; otherwise MachinePinMediumShort, 1.6 mm pad, 1.2 mm drill) at the corners as MP1 to MP4, MachineContactMedium (1.3 mm pad, 0.87 mm drill) for the signal contacts (named MC<n>, as the wiki registry counts them), MachineContactLarge (4.4 mm pad, 2.75 mm drill, 14 AWG solid wire) for a power net over 3.5 A (the earlier hardware's 0.78 / 2.62 / 3.45 mm drills still pass), footprints from the Adom KiCad Library 1.2.3, the fab-rules profile (3rd party fab default, jlcpcb optional), then STEP export, `step2glb convert --molecule` with its stats gates, real copper pads (`adom-aiflow board-glb copper`: pads and test points are copper, the mask opens and paste shows only where the footprint layers say, with a gate), and molecule-publish. Medium-pin molecules mount on a LrgMed user scaffold (8 mm medium contact grid, offset 4 mm from its front-left large pin, large pins on a 32 mm base grid). Trigger words: aiflow molecule, make it a molecule, fits our scaffold, machine pins, large or medium pins, MachinePinLargeShort, MachinePinMediumShort, MachineContactMedium, MachineContactLarge, large contact, 14 AWG, high-current contact, MP1, molecule grid, molecule outline, fab rules profile, kicad_dru, molecule conformance, molecule export, step2glb molecule, publish molecule, LrgMed scaffold, copper pads, grey pads, test points, solder mask openings, paste layer, board GLB, board-glb. ---  # aiflow-molecule: a board that drops into the scaffold@@ -21,7 +21,7 @@ Choose the corner pins at intake, before placement, with this rule (issue #87, a  Otherwise use MEDIUM pins (`MachinePinMediumShort`): small boards that sit in another board or a LrgMed user scaffold. Do not invent other thresholds. -**Large contacts.** A power net over 3.5 A comes onto the board through `MachineContactLarge` (4.4 mm pad, 2.62 mm drill), wired with 14 AWG solid wire, which carries well above the medium contact's rating (the large class is rated 20.8 A). A board that needs a large contact is a heavy-current board, so as a rule of thumb its corner pins go large too (rule 6). When medium corners are right anyway (a light board in a LrgMed user scaffold whose one large contact is a motor feed, say), keep them on purpose: set `spec.molecule.largeContactMediumPins` to a sentence saying why. The override covers rule 6 only; any other reason still needs large pins. A net carried only by large contacts and large pins is judged against the large class's 20.8 A, not the medium 3.5 A, so a 12 A rail on a large contact does not count against medium corners; a medium contact on the same net still does.+**Large contacts.** A power net over 3.5 A comes onto the board through `MachineContactLarge` (4.4 mm pad, 2.75 mm drill), wired with 14 AWG solid wire, which carries well above the medium contact's rating (the large class is rated 20.8 A). A board that needs a large contact is a heavy-current board, so as a rule of thumb its corner pins go large too (rule 6). When medium corners are right anyway (a light board in a LrgMed user scaffold whose one large contact is a motor feed, say), keep them on purpose: set `spec.molecule.largeContactMediumPins` to a sentence saying why. The override covers rule 6 only; any other reason still needs large pins. A net carried only by large contacts and large pins is judged against the large class's 20.8 A, not the medium 3.5 A, so a 12 A rail on a large contact does not count against medium corners; a medium contact on the same net still does.  | | Medium | Large | |---|---|---|@@ -55,7 +55,7 @@ Declare the inputs in the spec so `molecule check` can apply the rule:  Large pins mate directly to the base scaffold on a 32 mm grid. Medium pins require the chosen LrgMed scaffold's actual 8 mm contact grid and available span. Check all four sockets, seating height, pin model, drill/pad dimensions and outline clearance. A large-pin replacement is not a footprint-name substitution: update schematic/library/BOM, layout, models, fixture and electrical checks. Use the component page's engineering assets, not its animated inspection hero. Keep a compatible free medium GND contact for the probe tether when large corner heads are not verified compatible. -The medium-pin dimensions and example below apply only when medium pins were selected. Large pins are 5.2 mm pad / 3.45 mm drill in the Adom KiCad Library (the check's expected sizes); confirm them against the selected component assets and record unresolved conflicts between documentation and model geometry before claiming mechanical fit.+The medium-pin dimensions and example below apply only when medium pins were selected. Large pins are 5.2 mm pad / 3.6 mm drill for the current hardware (the check's expected sizes; the earlier hardware's 3.45 mm, still in the Adom KiCad Library 1.2.3 / 1.2.4 footprints, also passes); confirm them against the selected component assets and record unresolved conflicts between documentation and model geometry before claiming mechanical fit.  ## 1. The rules @@ -63,9 +63,10 @@ The medium-pin dimensions and example below apply only when medium pins were sel |---|---| | Grid | 2 mm for every pin and contact, measured from MP1 | | Origin | the centre of MP1, the front-left (FL) corner pin; aux and grid origin on it; y up in the design frame, y down in KiCad |-| Corner pins | counterclockwise seen from above: MP1 (FL), MP2 (BL), MP3 (BR), MP4 (FR), the board-to-molecule tool's order (Colby, 2026-11-17), net GND; the class from the rule above: `MachinePinMediumShort` (1.6 mm pad, 1.2 mm drill) or `MachinePinLargeShort` (5.2 mm pad, 3.45 mm drill; `MachinePinLargeStandard` on LrgMed user-scaffold corners) |-| Contacts | footprint `MachineContactMedium`: 1.3 mm pad, 0.78 mm drill, one per signal the Control Panel wires to; `MachineContactLarge` (4.4 mm pad, 2.62 mm drill, 14 AWG solid wire) for a power net over 3.5 A, which takes large corner pins (rule 6). Name every contact `MC1`, `MC2`, ... in the schematic and the board: the wiki's model registry (rule `adom.molecule-pins/2`, molecule-publish) counts only one-pad parts named `MC<n>` as machine contacts, so a contact named `J3` gets no wire attach point in Hydrogen |-| Library | the Adom KiCad Library 1.2.3 (KiCad plugin manager); copy the footprints and their STEP models into the project (`lib/Molecule.pretty`, `3d/`) so the project travels |+| Corner pins | counterclockwise seen from above: MP1 (FL), MP2 (BL), MP3 (BR), MP4 (FR), the board-to-molecule tool's order (Colby, 2026-11-17), net GND; the class from the rule above: `MachinePinMediumShort` (1.6 mm pad, 1.2 mm drill) or `MachinePinLargeShort` (5.2 mm pad, 3.6 mm drill; `MachinePinLargeStandard` on LrgMed user-scaffold corners) |+| Contacts | footprint `MachineContactMedium`: 1.3 mm pad, 0.87 mm drill, one per signal the Control Panel wires to; `MachineContactLarge` (4.4 mm pad, 2.75 mm drill, 14 AWG solid wire) for a power net over 3.5 A, which takes large corner pins (rule 6). Name every contact `MC1`, `MC2`, ... in the schematic and the board: the wiki's model registry (rule `adom.molecule-pins/2`, molecule-publish) counts only one-pad parts named `MC<n>` as machine contacts, so a contact named `J3` gets no wire attach point in Hydrogen |+| Drills | the current machine hardware (Noah, 2026-11-25): medium pin 1.2 mm, medium contact 0.87 mm, large contact 2.75 mm, large pin 3.6 mm; pads unchanged. The earlier hardware's 0.78 / 2.62 / 3.45 mm still pass during the changeover; a `spec.molecule` drill override is exact (issue #251) |+| Library | the Adom KiCad Library 1.2.3 (KiCad plugin manager); copy the footprints and their STEP models into the project (`lib/Molecule.pretty`, `3d/`) so the project travels. Its 1.2.3 / 1.2.4 footprints carry the earlier drills: for the new hardware set the drills above in the project copy | | Markers | MP1 to MP4 are the anchoring markers the step2glb molecule conversion reads; keep those exact references and the library's 3D models on them | | Outline | pin span plus an edge margin all round (24 x 16 mm span + 2 mm = 28 x 20 mm here), with **rounded corners**: an arc of radius = the edge margin, centred on each corner pin, so the edge stays the same distance from the pin all the way round (2 mm here; the 1.6 mm pin pad then clears the edge by 1.2 mm). Suggest this by default; never 45 degree chamfers, which read as unfinished. | | Scaffold fit | medium-pin molecules mount on a LrgMed user scaffold: an 8 mm medium contact grid, offset 4 mm from its front-left large pin, with its large pins on a 32 mm base grid. Keep the pin span on 8 mm multiples so every corner pin lands on a scaffold hole |