app
AI Flow
Public Made by Adomby adom
Adom's AI Flow: a tool to help the AI follow all of the steps it takes to build a board.
← Commit history
Validate large-pin scaffold spacing and document selection for heavy or repeatedly handled molecules
3 files changed
+34−2
crates/adom-aiflow/src/checks.rs+18@@ -227,6 +227,13 @@ pub fn molecule_check(b: &Board, spec: &Value, before: Option<&Board>) -> Findin if medium_pins && (!near_multiple(w, 8.0) || !near_multiple(h, 8.0)) { f.error(format!("pin span {w:.2} x {h:.2} mm cannot seat on the LrgMed 8 mm medium-contact grid"), "Use 8 mm corner-pin spans; the LrgMed contacts are at FL + 4 + 8 k mm. The 2 mm signal/wiring grid is separate. Verify all four pins against the selected scaffold circuit.json and check Z seating with adom-aiflow-probing stack before claiming fit."); }+ let large_pins = (1..=4).all(|k| b.footprints.get(&format!("MP{k}")).map(|fp| fp.lib.to_ascii_lowercase().contains("machinepinlarge")).unwrap_or(false));+ if !medium_pins && !large_pins {+ f.error("corner pins mix incompatible or unsupported pin classes".into(), "Choose one verified corner-pin/socket system for all four corners.");+ }+ if large_pins && (!near_multiple(w, 32.0) || !near_multiple(h, 32.0)) {+ f.error(format!("large-pin span {w:.2} x {h:.2} mm cannot seat on the base scaffold 32 mm grid"), "Use 32 mm corner-pin spans and verify socket alignment, seating height, pad edge clearance and assembly loads; changing footprint names alone does not establish fit.");+ } } } origin = Some(p1);@@ -531,6 +538,17 @@ mod tests { fn board(text: &str) -> Board { Board::from_text("t.kicad_pcb", text.to_string()).unwrap() } + #[test]+ fn molecule_large_pin_grid_rejects_medium_span() {+ let text = BOARD.replace("MachinePinMediumShort", "MachinePinLargeShort")+ .replace("size 1.6 1.6", "size 5.2 5.2").replace("drill 1.2", "drill 3.45");+ let result = molecule_check(&board(&text), &json!({"molecule":{}}), None);+ assert!(result.errors.iter().any(|e| e.contains("base scaffold 32 mm grid")));+ let valid = text.replace("124", "132").replace(" 84", " 68");+ let result = molecule_check(&board(&valid), &json!({"molecule":{}}), None);+ assert!(!result.errors.iter().any(|e| e.contains("base scaffold 32 mm grid")));+ }+ fn netlist(r2_pin2: &str, extra: &str) -> String { format!(r#"(export (version "E") (components (comp (ref "MP1")) (comp (ref "MP2")) (comp (ref "MP3")) (comp (ref "MP4")) (comp (ref "J1")) (comp (ref "R1") (footprint "Resistor_SMD:R_0402_1005Metric")) (comp (ref "R2")) {extra})
skills/aiflow-molecule/SKILL.md+8@@ -8,6 +8,14 @@ description: >- A molecule is a small board whose machine pins seat it on a scaffold and whose contacts take wires to the Control Panel. The pin geometry is the mechanical interface: get it wrong and the board does not fit, however good the circuit is. Decide the molecule at intake (it is the default for Adom work), lay it out before placement, and lock it. +## Select the corner-pin class before placement++Do not always default to medium pins. Use large pins for larger or heavier assemblies and for equipment intended for frequent workcell insertion/extraction. Record the decision and its basis (board dimensions, cooler mass/load path and expected handling) in the design requirements. This is a qualitative Adom selection policy, not a verified insertion-cycle rating; do not invent numerical size, mass or lifetime thresholds.++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-pin dimensions must come from the selected component assets; record unresolved conflicts between documentation and model geometry before claiming mechanical fit.+ ## 1. The rules | Rule | Value |
skills/aiflow-scaffold-probe/SKILL.md+8−2@@ -59,7 +59,7 @@ Start from a known-good layout of the same editor version (a published workcell ``` - `sku` is the published molecule's wiki identity (molecule-publish comes first).-- `position` is the layout coordinate of the molecule's FL pin (MP1), in mm; `rotation.z` in degrees. Large-pin molecules and scaffolds sit on the base scaffold's grid (16 + 32 n). A medium-pin molecule needs a LrgMed user scaffold (adom/scaffold-lrgmed-<W>x<H>: large pins at the corners on the 32 mm base grid, medium contacts on a 4 mm grid): put the scaffold's FL large pin on the base grid and the molecule's FL pin on the scaffold's 4 mm grid, so the molecule's pin span must be a multiple of 4 mm. Each stacked level adds about 8.4 mm of z in the reference layouts; the editor snaps it when the layout opens.+- `position` is the layout coordinate of the molecule's FL pin (MP1), in mm; `rotation.z` in degrees. Large-pin molecules and scaffolds sit on the base scaffold's grid (16 + 32 n). A medium-pin molecule needs a LrgMed user scaffold (adom/scaffold-lrgmed-<W>x<H>: large pins at the corners on the 32 mm base grid, medium contacts on an 8 mm grid, offset 4 mm from the scaffold FL pin): put the scaffold's FL large pin on the base grid and the molecule's FL pin on a verified medium socket, so the molecule's pin span must be a multiple of 8 mm. Derive each Z seating height from the selected pin shoulder, contact lip and board thickness; do not assume a universal 8.4 mm stack increment. - `pins` and `pinType`: copy what the molecule's import gives for its pin size; do not invent values. - `contactPosition` is molecule-local (mm from MP1; z is the footprint JSON's `contact_z`, 2.8 mm for medium contacts). `contactName` matches the board's reference. - Check the layout against the geometry before handing it over: a three.js page that loads the base grid, the scaffold GLB, the molecule GLB and the control panel GLB (Draco, so load it with DRACOLoader) at the layout's positions, with the wires drawn to each panel contact's position from the panel's `.kicad_pcb`. Land the wire ends on the panel board's top face (find the flat mesh about 160 x 45 mm; the panel's own bounding box includes the dock connector and parts below the board, so neither its centre nor its minimum z is the board). Render it headless (puppeteer-core with Chromium) and look at a close view of the contact row.@@ -103,6 +103,12 @@ The layout JSON, the contact mapping table, the probe plan, and a line in the ru | J5 (24,8) | GND | MC15 (GND) | reference for ADC and GPIO | | J6 (24,4) | VMON | MC29 (USER_IO29, ADC3) | VOUT/2, about 2.5 V | -J2 and J5 are the same net on the molecule, so this plan also joins -PS1 and panel GND through the board; with JP1 bridged (the default) they are already common, so nothing changes. The molecule sits on a LrgMed 64 x 64 scaffold (FL large pin at 240, 464; molecule FL pin at 260, 488, centred on the scaffold's 4 mm grid). Layout, preview and probe plan: the john/buck-12v5v-molecule page, `scaffold/`.+J2 and J5 are the same net on the molecule, so this plan also joins -PS1 and panel GND through the board; with JP1 bridged (the default) they are already common, so nothing changes. The molecule sits on a LrgMed 64 x 64 scaffold (FL large pin at 240, 464; molecule FL pin at 260, 488, historical coordinates requiring revalidation against the actual 8 mm socket grid). Layout, preview and probe plan: the john/buck-12v5v-molecule page, `scaffold/`. Probe points: TP1 SW (15.6, 4.9), TP2 FB (9.4, 5.6), TP3 VOUT (21.6, 4.9), TP4 GND (15.6, 2.8). Expected: VOUT 4.98 V (4.86 to 5.11 V over the reference tolerance), about 3 mV ripple at 12 V, UVLO start 8.6 V and stop 6.9 V, and a 0 to 1 A step of about 180 mV (the vendor model's figure; the fitted model said less), settling in about 0.2 ms.++## Corner-pin selection and design feedback++At intake, select medium versus large corner pins from board dimensions, assembly mass/load path and expected insertion/extraction frequency. Larger/heavier or repeatedly handled workcell tools favor large pins; document the reason without inventing cycle ratings. Medium pins use the selected LrgMed scaffold’s 8 mm grid and finite span; large pins use the base scaffold’s 32 mm grid. The 2 mm wiring grid is separate. Recheck all sockets, seating and probe-ground compatibility.++Include heatsinks, fans, guards and wires in access/collision checks. Fan rotation does not remove the housing or heatsink from the collision model. If access fails, record a return to interface/placement/routing, implement test points in the native board and revalidate it. Never claim coverage from proposed coordinates alone. Edge connectors need mating/cable clearance after every resize.