← Commit history
0.2.129: place verify explains a REF** placeholder (kicad-bridge#161)
6 files changed
+45−13
Cargo.lock+10−10@@ -4,7 +4,7 @@ version = 4 [[package]] name = "adom-aiflow"-version = "0.2.128"+version = "0.2.129" dependencies = [ "aiflow-analyze", "aiflow-board",@@ -27,7 +27,7 @@ dependencies = [ [[package]] name = "aiflow-analyze"-version = "0.2.128"+version = "0.2.129" dependencies = [ "aiflow-board", "serde",@@ -37,7 +37,7 @@ dependencies = [ [[package]] name = "aiflow-board"-version = "0.2.128"+version = "0.2.129" dependencies = [ "roxmltree", "serde",@@ -46,7 +46,7 @@ dependencies = [ [[package]] name = "aiflow-bridge"-version = "0.2.128"+version = "0.2.129" dependencies = [ "aiflow-board", "serde",@@ -55,7 +55,7 @@ dependencies = [ [[package]] name = "aiflow-copper"-version = "0.2.128"+version = "0.2.129" dependencies = [ "aiflow-board", "aiflow-grid",@@ -65,7 +65,7 @@ dependencies = [ [[package]] name = "aiflow-grid"-version = "0.2.128"+version = "0.2.129" dependencies = [ "aiflow-board", "serde",@@ -74,7 +74,7 @@ dependencies = [ [[package]] name = "aiflow-place"-version = "0.2.128"+version = "0.2.129" dependencies = [ "aiflow-board", "serde",@@ -83,7 +83,7 @@ dependencies = [ [[package]] name = "aiflow-pours"-version = "0.2.128"+version = "0.2.129" dependencies = [ "aiflow-board", "aiflow-copper",@@ -93,7 +93,7 @@ dependencies = [ [[package]] name = "aiflow-router"-version = "0.2.128"+version = "0.2.129" dependencies = [ "aiflow-board", "aiflow-grid",@@ -104,7 +104,7 @@ dependencies = [ [[package]] name = "aiflow-run"-version = "0.2.128"+version = "0.2.129" dependencies = [ "serde", "serde_json",
Cargo.toml+1−1@@ -14,7 +14,7 @@ members = [ ] [workspace.package]-version = "0.2.128"+version = "0.2.129" edition = "2021" license = "MIT" repository = "https://wiki.adom.inc/adom/adom-aiflow"
crates/adom-aiflow/src/placement_verify.rs+25@@ -104,6 +104,16 @@ pub fn edge_connector_why(board: &Board, p: &Value, spec: &Value) -> Result<(),S Ok(()) } +/// kicad-bridge#161: live footprints still carrying KiCad's library placeholder reference (REF**), with+/// what to do. KiCad Bridge 1.1.12 turns a library footprint's legacy reference text into its Reference.+fn placeholder_refs(parts: &[Value]) -> Option<String> {+ let held: Vec<String> = parts.iter().filter(|p| p["ref"].as_str().is_some_and(|r| r.starts_with("REF*")))+ .map(|p| p["footprint"].as_str().unwrap_or("?").to_string()).collect();+ if held.is_empty() { return None; }+ Some(format!("{} library footprint(s) kept the REF** placeholder instead of their reference ({}): KiCad Bridge before 1.1.12 did not carry a legacy footprint's reference text into it (kicad-bridge#161). Update KiCad Bridge to 1.1.12 or later (macOS: the next 2.0.x build), place them again, then `place verify`",+ held.len(), held.join(", ")))+}+ /// Issue #269: the saved board's footprints (with a reference, without one), each footprint counted once. fn saved_counts(board: &Board) -> (usize, usize) { let unnamed = board.root.find_all("footprint").filter(|fp| aiflow_board::reference_of(fp).as_deref().map_or(true, str::is_empty)).count();@@ -133,6 +143,9 @@ pub fn check_with_spec(board: &Board, before: &Value, validation: &Value, after: return Err(format!("placement snapshot ({which} the check) does not qualify: {}", failed.join("; "))); } let parts=state["footprints"].as_array().ok_or("missing live footprints")?;+ // kicad-bridge#161: a library footprint with the legacy (fp_text reference "REF**") came in with its+ // placeholder before KiCad Bridge 1.1.12, and read here as "unexpected live reference REF**"+ if let Some(why) = placeholder_refs(parts) { return Err(why); } // issue #269 (King Silver): footprints with an empty reference (an Altium import's free pads and mounting // holes, board-only) collapse into one entry of the saved board's by-reference map: count them apart on both // sides; they have no reference to compare a pose by@@ -264,6 +277,18 @@ mod tests { assert!(e.contains("1 without") && e.contains("saved 1 and 2"), "{e}"); } + #[test]+ fn a_ref_placeholder_names_the_bridge_update() {+ // kicad-bridge#161 (Jinwon Kim): two wiki footprints placed by an older bridge both read REF**+ let (b,_,v)=fixture();+ let fp = |x: f64| json!({"ref":"REF**","x":x,"y":x,"rotation":0,"side":"F.Cu","footprint":"wiki:SOT-23","insideOutline":true});+ let s=json!({"success":true,"source":"live-editor","revision":"rev","boardPath":"board","footprintCount":2,"footprints":[fp(2.0), fp(8.0)]});+ let e=check_with_spec(&b,&s,&v,&s,"board",&Value::Null).unwrap_err();+ assert!(e.starts_with("2 library footprint(s) kept the REF** placeholder") && e.contains("wiki:SOT-23") && e.contains("1.1.12"), "{e}");+ let (b,s,v)=fixture();+ assert!(check_with_spec(&b,&s,&v,&s,"board",&Value::Null).is_ok());+ }+ #[test] fn a_locked_footprint_points_at_place_verify() { let h = super::locked_hint(&serde_json::json!({"errorCode": "footprint_locked", "offendingRefs": ["MP1"], "message": "pass allowLocked:true"})).unwrap();
docs/release-0.2.129.mdadded+7@@ -0,0 +1,7 @@+# adom-aiflow 0.2.129++## place verify explains a REF** placeholder (kicad-bridge#161)++Before KiCad Bridge 1.1.12, a library footprint written with the legacy `(fp_text reference "REF**")` (wiki PCM footprints among them) was placed with that placeholder as its reference, and `place verify` stopped at "unexpected live reference REF**" (or a duplicate or count mismatch when several did).++`place verify` now names those footprints first and says what to do: update KiCad Bridge to 1.1.12 or later (macOS: the next 2.0.x build), place them again, then verify. On 1.1.12 the footprints carry their real references and nothing changes.
package.json+1−1@@ -1,7 +1,7 @@ { "slug": "adom-aiflow", "type": "app",- "version": "0.2.128",+ "version": "0.2.129", "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.128",+ "version": "0.2.129", "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.",