← Commit history
Cargo.lock+10−10
@@ -4,7 +4,7 @@ version = 4  [[package]] name = "adom-aiflow"-version = "0.2.83"+version = "0.2.84" dependencies = [  "aiflow-analyze",  "aiflow-board",@@ -25,7 +25,7 @@ dependencies = [  [[package]] name = "aiflow-analyze"-version = "0.2.83"+version = "0.2.84" dependencies = [  "aiflow-board",  "serde",@@ -35,7 +35,7 @@ dependencies = [  [[package]] name = "aiflow-board"-version = "0.2.83"+version = "0.2.84" dependencies = [  "roxmltree",  "serde",@@ -44,7 +44,7 @@ dependencies = [  [[package]] name = "aiflow-bridge"-version = "0.2.83"+version = "0.2.84" dependencies = [  "aiflow-board",  "serde",@@ -53,7 +53,7 @@ dependencies = [  [[package]] name = "aiflow-copper"-version = "0.2.83"+version = "0.2.84" dependencies = [  "aiflow-board",  "aiflow-grid",@@ -63,7 +63,7 @@ dependencies = [  [[package]] name = "aiflow-grid"-version = "0.2.83"+version = "0.2.84" dependencies = [  "aiflow-board",  "serde",@@ -72,7 +72,7 @@ dependencies = [  [[package]] name = "aiflow-place"-version = "0.2.83"+version = "0.2.84" dependencies = [  "aiflow-board",  "serde",@@ -81,7 +81,7 @@ dependencies = [  [[package]] name = "aiflow-pours"-version = "0.2.83"+version = "0.2.84" dependencies = [  "aiflow-board",  "aiflow-copper",@@ -91,7 +91,7 @@ dependencies = [  [[package]] name = "aiflow-router"-version = "0.2.83"+version = "0.2.84" dependencies = [  "aiflow-board",  "aiflow-grid",@@ -101,7 +101,7 @@ dependencies = [  [[package]] name = "aiflow-run"-version = "0.2.83"+version = "0.2.84" dependencies = [  "serde",  "serde_json",
Cargo.toml+1−1
@@ -14,7 +14,7 @@ members = [ ]  [workspace.package]-version = "0.2.83"+version = "0.2.84" edition = "2021" license = "MIT" repository = "https://wiki.adom.inc/adom/adom-aiflow"
SKILL.md+1−1
@@ -311,7 +311,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, 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.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. - **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. - **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.
bin/adom-aiflow
⋯ 1 unchanged line ⋯
crates/adom-aiflow/src/checks.rs+23−15
@@ -194,7 +194,7 @@ pub fn molecule_check_bom(b: &Board, spec: &Value, before: Option<&Board>, bom:     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 MP1 (front left), MP2 (front right), MP3 (back left), MP4 (back right)"), hint_fp); continue };+        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 (pad, drill) = (m["pinPadMm"].as_f64().unwrap_or(pad), m["pinDrillMm"].as_f64().unwrap_or(drill));         match pad_of(&r) {@@ -214,12 +214,14 @@ pub fn molecule_check_bom(b: &Board, spec: &Value, before: Option<&Board>, bom:         let (p1, p2, p3, p4) = (pins["MP1"], pins["MP2"], pins["MP3"], pins["MP4"]);         let minx = pins.values().map(|p| p.0).fold(f64::MAX, f64::min);         let maxy = pins.values().map(|p| p.1).fold(f64::MIN, f64::max);-        let hint_pos = "MP1 is the front-left pin: the smallest x and the largest KiCad y (y grows toward the front). MP2 is front right, MP3 back left, MP4 back right, on one rectangle.";+        // counterclockwise seen from above (Colby, 2026-11-17, the board-to-molecule tool's order): MP1 front+        // left, MP2 back left, MP3 back right, MP4 front right+        let hint_pos = "MP1 is the front-left pin: the smallest x and the largest KiCad y (y grows toward the front). Then counterclockwise seen from above: MP2 back left, MP3 back right, MP4 front right, on one rectangle.";         if (p1.0 - minx).abs() > 0.01 || (p1.1 - maxy).abs() > 0.01 {             f.error(format!("MP1 at ({:.2}, {:.2}) is not the front-left pin (front-left corner of the pins is ({minx:.2}, {maxy:.2}))", p1.0, p1.1), hint_pos);         }-        let (w, h) = (p2.0 - p1.0, p1.1 - p3.1);-        let rect = (p2.1 - p1.1).abs() < 0.01 && (p3.0 - p1.0).abs() < 0.01 && (p4.0 - p2.0).abs() < 0.01 && (p4.1 - p3.1).abs() < 0.01 && w > 0.0 && h > 0.0;+        let (w, h) = (p4.0 - p1.0, p1.1 - p2.1);+        let rect = (p2.0 - p1.0).abs() < 0.01 && (p4.1 - p1.1).abs() < 0.01 && (p3.0 - p4.0).abs() < 0.01 && (p3.1 - p2.1).abs() < 0.01 && w > 0.0 && h > 0.0;         if !rect {             f.error(format!("MP1 to MP4 are not on a rectangle: MP1 ({:.2}, {:.2}), MP2 ({:.2}, {:.2}), MP3 ({:.2}, {:.2}), MP4 ({:.2}, {:.2})", p1.0, p1.1, p2.0, p2.1, p3.0, p3.1, p4.0, p4.1), hint_pos);         } else {@@ -1054,9 +1056,9 @@ mod tests {  (setup (aux_axis_origin 100 100))  (gr_rect (start 98 82) (end 126 102) (layer "Edge.Cuts"))  (footprint "Molecule:MachinePinMediumShort" (layer "F.Cu") (at 100 100) (property "Reference" "MP1") (pad "1" thru_hole circle (at 0 0) (size 1.6 1.6) (drill 1.2) (layers "*.Cu") (net "GND")))- (footprint "Molecule:MachinePinMediumShort" (layer "F.Cu") (at 124 100) (property "Reference" "MP2") (pad "1" thru_hole circle (at 0 0) (size 1.6 1.6) (drill 1.2) (layers "*.Cu") (net "GND")))- (footprint "Molecule:MachinePinMediumShort" (layer "F.Cu") (at 100 84) (property "Reference" "MP3") (pad "1" thru_hole circle (at 0 0) (size 1.6 1.6) (drill 1.2) (layers "*.Cu") (net "GND")))- (footprint "Molecule:MachinePinMediumShort" (layer "F.Cu") (at 124 84) (property "Reference" "MP4") (pad "1" thru_hole circle (at 0 0) (size 1.6 1.6) (drill 1.2) (layers "*.Cu") (net "GND")))+ (footprint "Molecule:MachinePinMediumShort" (layer "F.Cu") (at 100 84) (property "Reference" "MP2") (pad "1" thru_hole circle (at 0 0) (size 1.6 1.6) (drill 1.2) (layers "*.Cu") (net "GND")))+ (footprint "Molecule:MachinePinMediumShort" (layer "F.Cu") (at 124 84) (property "Reference" "MP3") (pad "1" thru_hole circle (at 0 0) (size 1.6 1.6) (drill 1.2) (layers "*.Cu") (net "GND")))+ (footprint "Molecule:MachinePinMediumShort" (layer "F.Cu") (at 124 100) (property "Reference" "MP4") (pad "1" thru_hole circle (at 0 0) (size 1.6 1.6) (drill 1.2) (layers "*.Cu") (net "GND")))  (footprint "Molecule:MachineContactMedium" (layer "F.Cu") (at 100 88) (property "Reference" "MC1") (pad "1" thru_hole circle (at 0 0) (size 1.3 1.3) (drill 0.78) (layers "*.Cu") (net "VIN")))  (footprint "Resistor_SMD:R_0402_1005Metric" (layer "F.Cu") (at 110 90) (property "Reference" "R1")    (pad "1" smd roundrect (at -0.5 0) (size 0.5 0.6) (layers "F.Cu") (net "VIN"))@@ -1350,8 +1352,14 @@ mod tests {         let f = molecule_check(&board(&off), &spec, None);         assert!(f.errors.iter().any(|e| e.contains("off the 2 mm grid")), "{:?}", f.lines);         assert!(f.errors.iter().any(|e| e.contains("spec.molecule.fixed")), "{:?}", f.lines);-        // MP1 swapped with MP3: not front left-        let swapped = BOARD.replace("(at 100 100) (property \"Reference\" \"MP1\")", "(at 100 84) (property \"Reference\" \"MP1\")").replace("(at 100 84) (property \"Reference\" \"MP3\")", "(at 100 100) (property \"Reference\" \"MP3\")");+        // MP1 swapped with MP2 (back left): not front left+        let swapped = BOARD.replace("(at 100 100) (property \"Reference\" \"MP1\")", "(at 100 84) (property \"Reference\" \"MP1\")").replace("(at 100 84) (property \"Reference\" \"MP2\")", "(at 100 100) (property \"Reference\" \"MP2\")");+        let f = molecule_check(&board(&swapped), &spec, None);+        assert!(f.errors.iter().any(|e| e.contains("front-left")), "{:?}", f.lines);+        // AI Flow's old numbering (MP2 front right, MP3 back left, MP4 back right) is not the rule any more+        let old = BOARD.replace("(at 100 84) (property \"Reference\" \"MP2\")", "(at 124 100) (property \"Reference\" \"MP2\")").replace("(at 124 84) (property \"Reference\" \"MP3\")", "(at 100 84) (property \"Reference\" \"MP3\")").replace("(at 124 100) (property \"Reference\" \"MP4\")", "(at 124 84) (property \"Reference\" \"MP4\")");+        let f = molecule_check(&board(&old), &spec, None);+        assert!(f.errors.iter().any(|e| e.contains("not on a rectangle")), "the old order is reported: {:?}", f.lines);         let f = molecule_check(&board(&swapped), &spec, None);         assert!(f.errors.iter().any(|e| e.contains("front-left")), "{:?}", f.lines);     }@@ -1429,14 +1437,14 @@ mod tests {      #[test]     fn corner_pins_renamed_in_place_are_not_moved() {-        // the start board numbered MP1 and MP3 the other way round; the human renamed them to the rule+        // the start board numbered MP1 and MP2 the other way round; the human renamed them to the rule         let spec = json!({"molecule": {}});-        let start = BOARD.replace("\"MP1\"", "\"MPX\"").replace("\"MP3\"", "\"MP1\"").replace("\"MPX\"", "\"MP3\"");+        let start = BOARD.replace("\"MP1\"", "\"MPX\"").replace("\"MP2\"", "\"MP1\"").replace("\"MPX\"", "\"MP2\"");         let f = molecule_check(&board(BOARD), &spec, Some(&board(&start)));         assert!(f.errors.is_empty(), "{:?}", f.lines);-        assert!(f.lines.iter().any(|l| l.contains("renamed in place") && l.contains("MP1 is the part that was MP3")), "{:?}", f.lines);+        assert!(f.lines.iter().any(|l| l.contains("renamed in place") && l.contains("MP1 is the part that was MP2")), "{:?}", f.lines);         // a rename plus a real move is still a move-        let moved = BOARD.replace("(at 100 84) (property \"Reference\" \"MP3\")", "(at 100 86) (property \"Reference\" \"MP3\")");+        let moved = BOARD.replace("(at 100 84) (property \"Reference\" \"MP2\")", "(at 100 86) (property \"Reference\" \"MP2\")");         let f = molecule_check(&board(&moved), &spec, Some(&board(&start)));         assert!(f.errors.iter().any(|e| e.contains("moved since the run started")), "{:?}", f.lines);     }@@ -1471,10 +1479,10 @@ mod tests {             .replace("126 102", "162 102").replace("98 82", "98 30");         let fixed = bad.replace("160", "164").replace("32", "28")             .replace("162 102", "166 102").replace("98 30", "98 26");-        let spec = json!({"molecule": {"fixed": {"MP1": [0,0], "MP2": [64,0], "MP3": [0,72], "MP4": [64,72]}}});+        let spec = json!({"molecule": {"fixed": {"MP1": [0,0], "MP2": [0,72], "MP3": [64,72], "MP4": [64,0]}}});         let f = molecule_check(&board(&fixed), &spec, Some(&board(&bad)));         assert!(f.errors.is_empty(), "{:?}", f.lines);-        let invalid = json!({"molecule": {"fixed": {"MP2": [60,0], "MP3": [0,68], "MP4": [60,68]}}});+        let invalid = json!({"molecule": {"fixed": {"MP2": [0,68], "MP3": [60,68], "MP4": [60,0]}}});         assert!(molecule_check(&board(&bad), &invalid, Some(&board(&bad))).errors.iter().any(|e| e.contains("LrgMed 8 mm")));         let anchor = fixed.replace("(at 100 100)", "(at 102 100)");         let f = molecule_check(&board(&anchor), &spec, Some(&board(&bad)));
docs/release-0.2.84.mdadded+11
@@ -0,0 +1,11 @@+# AI Flow 0.2.84++- **Molecule corner pins are numbered counterclockwise, seen from above** (Colby, 2026-11-17: the board-to-molecule+  tool's order). MP1 front left, MP2 back left, MP3 back right, MP4 front right; it was MP2 front right, MP3 back+  left, MP4 back right. `molecule check` (and place check, gate and finish on a molecule) now reads the rectangle in+  that order, and its messages say so. The aiflow-molecule skill (the rules table and the TPS54202 example), the+  adom-aiflow skill and docs/spec-example.json follow.+- A board still numbered the old way gets "MP1 to MP4 are not on a rectangle" with the order in the hint. Renaming+  MP2 to MP4 in place (same footprints and positions) is reported as a rename, never a move of a fixed part.+- Publishing is unaffected: the wiki registry (adom.molecule-pins/2) and step2glb need MP1 to MP4 as the corner+  pins, in no particular order. Molecules already published keep their pages.
docs/spec-example.json+1−1
@@ -607,7 +607,7 @@     "edgeMarginMm": 2,     "cornerPinsNet": "GND"   },-  "moleculeNote": "present when the board is an Adom molecule: `molecule check` (and place check, gate, finish) require MP1 to MP4 machine pins with MP1 front-left, the pin rectangle and every contact on gridMm from MP1 (4 mm multiples warned for LrgMed scaffolds), edgeMarginMm to the outline, and fixedRefs where the start board had them; pinPadMm/pinDrillMm override the pin size.",+  "moleculeNote": "present when the board is an Adom molecule: `molecule check` (and place check, gate, finish) require MP1 to MP4 machine pins with MP1 front-left and MP2 to MP4 counterclockwise seen from above (back left, back right, front right), the pin rectangle and every contact on gridMm from MP1 (4 mm multiples warned for LrgMed scaffolds), edgeMarginMm to the outline, and fixedRefs where the start board had them; pinPadMm/pinDrillMm override the pin size.",   "requireEvidence": [     "calcs",     "simulation"
package.json+1−1
@@ -1,7 +1,7 @@ {   "slug": "adom-aiflow",   "type": "app",-  "version": "0.2.83",+  "version": "0.2.84",   "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.83",+  "version": "0.2.84",   "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
@@ -397,7 +397,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, 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.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. - **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. - **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+2−2
@@ -63,7 +63,7 @@ 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 | MP1 (FL), MP2 (FR), MP3 (BL), MP4 (BR), 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) |+| 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 | | 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 |@@ -154,7 +154,7 @@ A locked interface with its contacts named `MC<n>`, a rules profile in the board  ## Worked example: TPS54202 molecule -- 28 x 20 mm, MP1 to MP4 at (0,0), (24,0), (0,16), (24,16), all GND.+- 28 x 20 mm, MP1 to MP4 at (0,0), (0,16), (24,16), (24,0) (counterclockwise from front left), all GND. - Contacts on the short edges: MC1 VIN (0,12), MC2 GND (0,8), MC3 EN (0,4); MC4 VOUT (24,12), MC5 GND (24,8), MC6 VMON (24,4). Input on the left, output on the right, each with its own ground. - Rules: 3rd party fab 2-layer profile, 1.6 mm FR4, designed for 0.5 oz outer copper. - The Adom library footprints reference their STEP through the plugin manager's path; the project carries copies in `kicad/3d/` so the board renders on any machine.
tests/page-results-workflow.py+3−3
@@ -12,9 +12,9 @@ binary = str(pathlib.Path(sys.argv[1]).resolve()) BOARD = '''(kicad_pcb (version 20260206)  (gr_rect (start 98 82) (end 126 102) (layer "Edge.Cuts"))  (footprint "Molecule:MachinePinMediumShort" (layer "F.Cu") (at 100 100) (property "Reference" "MP1") (pad "1" thru_hole circle (at 0 0) (size 1.6 1.6) (drill 1.2) (layers "*.Cu") (net "GND")))- (footprint "Molecule:MachinePinMediumShort" (layer "F.Cu") (at 124 100) (property "Reference" "MP2") (pad "1" thru_hole circle (at 0 0) (size 1.6 1.6) (drill 1.2) (layers "*.Cu") (net "GND")))- (footprint "Molecule:MachinePinMediumShort" (layer "F.Cu") (at 100 84) (property "Reference" "MP3") (pad "1" thru_hole circle (at 0 0) (size 1.6 1.6) (drill 1.2) (layers "*.Cu") (net "GND")))- (footprint "Molecule:MachinePinMediumShort" (layer "F.Cu") (at 124 84) (property "Reference" "MP4") (pad "1" thru_hole circle (at 0 0) (size 1.6 1.6) (drill 1.2) (layers "*.Cu") (net "GND")))+ (footprint "Molecule:MachinePinMediumShort" (layer "F.Cu") (at 100 84) (property "Reference" "MP2") (pad "1" thru_hole circle (at 0 0) (size 1.6 1.6) (drill 1.2) (layers "*.Cu") (net "GND")))+ (footprint "Molecule:MachinePinMediumShort" (layer "F.Cu") (at 124 84) (property "Reference" "MP3") (pad "1" thru_hole circle (at 0 0) (size 1.6 1.6) (drill 1.2) (layers "*.Cu") (net "GND")))+ (footprint "Molecule:MachinePinMediumShort" (layer "F.Cu") (at 124 100) (property "Reference" "MP4") (pad "1" thru_hole circle (at 0 0) (size 1.6 1.6) (drill 1.2) (layers "*.Cu") (net "GND")))  (footprint "Molecule:MachineContactMedium" (layer "F.Cu") (at 100 88) (property "Reference" "MC1") (pad "1" thru_hole circle (at 0 0) (size 1.3 1.3) (drill 0.78) (layers "*.Cu") (net "VIN"))) ) '''