← Commit history
Merge PR #617: 0.2.117: small blockers and quick fixes (#257-#261, #263, #265, #267) (release-0.2.117 -> main) merge
Showing changes introduced by the merge (against its first parent).
16 files changed
+229−38
Cargo.lock+10−10Cargo.toml+1−1bin/adom-aiflowcrates/adom-aiflow/src/fields_versions.rs+2−1crates/adom-aiflow/src/main.rs+14−1crates/adom-aiflow/src/netclasses.rs+57−13crates/adom-aiflow/src/schematic_symbols.rs+22−2crates/adom-aiflow/src/supply.rs+25−2crates/aiflow-bridge/src/lib.rs+13−2crates/aiflow-place/src/lib.rs+21−1docs/release-0.2.117.md+41package.json+1−1page.json+1−1skills/adom-aiflow/SKILL.md+1−1tests/project-page-library.py+16tools/project-page.py+4−2Cargo.lock+10−10@@ -4,7 +4,7 @@ version = 4 [[package]] name = "adom-aiflow"-version = "0.2.116"+version = "0.2.117" dependencies = [ "aiflow-analyze", "aiflow-board",@@ -25,7 +25,7 @@ dependencies = [ [[package]] name = "aiflow-analyze"-version = "0.2.116"+version = "0.2.117" dependencies = [ "aiflow-board", "serde",@@ -35,7 +35,7 @@ dependencies = [ [[package]] name = "aiflow-board"-version = "0.2.116"+version = "0.2.117" dependencies = [ "roxmltree", "serde",@@ -44,7 +44,7 @@ dependencies = [ [[package]] name = "aiflow-bridge"-version = "0.2.116"+version = "0.2.117" dependencies = [ "aiflow-board", "serde",@@ -53,7 +53,7 @@ dependencies = [ [[package]] name = "aiflow-copper"-version = "0.2.116"+version = "0.2.117" dependencies = [ "aiflow-board", "aiflow-grid",@@ -63,7 +63,7 @@ dependencies = [ [[package]] name = "aiflow-grid"-version = "0.2.116"+version = "0.2.117" dependencies = [ "aiflow-board", "serde",@@ -72,7 +72,7 @@ dependencies = [ [[package]] name = "aiflow-place"-version = "0.2.116"+version = "0.2.117" dependencies = [ "aiflow-board", "serde",@@ -81,7 +81,7 @@ dependencies = [ [[package]] name = "aiflow-pours"-version = "0.2.116"+version = "0.2.117" dependencies = [ "aiflow-board", "aiflow-copper",@@ -91,7 +91,7 @@ dependencies = [ [[package]] name = "aiflow-router"-version = "0.2.116"+version = "0.2.117" dependencies = [ "aiflow-board", "aiflow-grid",@@ -102,7 +102,7 @@ dependencies = [ [[package]] name = "aiflow-run"-version = "0.2.116"+version = "0.2.117" dependencies = [ "serde", "serde_json",
Cargo.toml+1−1@@ -14,7 +14,7 @@ members = [ ] [workspace.package]-version = "0.2.116"+version = "0.2.117" edition = "2021" license = "MIT" repository = "https://wiki.adom.inc/adom/adom-aiflow"
bin/adom-aiflow⋯ 1 unchanged line ⋯
crates/adom-aiflow/src/fields_versions.rs+2−1@@ -251,7 +251,8 @@ mod tests { } fn tempfile_dir() -> std::path::PathBuf {- let d = std::env::temp_dir().join(format!("aiflow-fv-{}", std::process::id()));+ // its own folder: the 0.10.12 test above writes into aiflow-fv-<pid>, and this one removes its folder at the end+ let d = std::env::temp_dir().join(format!("aiflow-fv-shaped-{}", std::process::id())); std::fs::create_dir_all(&d).unwrap(); d }
crates/adom-aiflow/src/main.rs+14−1@@ -1614,6 +1614,9 @@ fn clip_stop_event(mut ev: Value, stop: &ClipStop) -> Value { /// Pull again every stopped clip that is not in the run: flagged `pullFailed`, or recorded with a /// local file that never arrived. The desktop path comes from the capture or, for older runs, /// from the ledger's clip-stop lines. Returns (pulled now, still missing).+/// Issue #263: after this many takes in a row are still finalising, a retry stops waiting on the rest.+const RETRY_GIVE_UP_AFTER: usize = 3;+ fn repull_failed_clips(r: &mut Run, br: &Bridge, dir: &Path) -> (usize, usize) { let save_to = std::fs::canonicalize(dir).unwrap_or(dir.to_path_buf()).display().to_string(); let mut by_rid: std::collections::HashMap<String, String> = Default::default();@@ -1624,6 +1627,13 @@ fn repull_failed_clips(r: &mut Run, br: &Bridge, dir: &Path) -> (usize, usize) { } let caps = r.data["captures"].as_array().cloned().unwrap_or_default(); let (mut pulled, mut missing) = (0, 0);+ // issue #263 (Kenneth Foli Jørgensen): say what is being collected, wait briefly per take (it had its full+ // budget at its own stop), and stop waiting once several takes in a row are still not finalised+ let pending = caps.iter().filter(|c| c.get("file").is_some() && c.get("discarded").is_none() && c["stopPending"] == true+ && !c["file"].as_str().map(|f| aiflow_bridge::nonempty(Path::new(f))).unwrap_or(false)).count();+ let budget = aiflow_bridge::retry_budget_secs();+ if pending > 0 { eprintln!("collecting {pending} clip(s) the desktop was still finalising (up to {budget} s each; AIFLOW_CLIP_RETRY_SECONDS)"); }+ let mut still_finalising = 0usize; for (i, c) in caps.iter().enumerate() { // running clips have no file key yet; discarded ones are never shown if c.get("file").is_none() || c.get("discarded").is_some() { continue; }@@ -1631,7 +1641,10 @@ fn repull_failed_clips(r: &mut Run, br: &Bridge, dir: &Path) -> (usize, usize) { let mut remote = c["remoteFile"].as_str().map(str::to_string).or_else(|| c["recordingId"].as_str().and_then(|rid| by_rid.get(rid)).cloned()); // issue #98: a take that was still finalising at its stop is stopped again now if let (None, true, Some(rid)) = (&remote, c["stopPending"] == true, c["recordingId"].as_str()) {- let stop = br.record_stop(rid, &save_to);+ if still_finalising >= RETRY_GIVE_UP_AFTER { missing += 1; continue; }+ let stop = br.record_stop_within(rid, &save_to, budget);+ if stop.pending() && stop.remote.is_none() { still_finalising += 1; } else { still_finalising = 0; }+ if still_finalising == RETRY_GIVE_UP_AFTER { eprintln!("WARNING: {RETRY_GIVE_UP_AFTER} takes in a row are still not finalised on the desktop; the rest are left flagged (the desktop recorder may be stuck: check it, then `adom-aiflow recut` collects them)"); } let cap = &mut r.data["captures"][i]; if let Some(o) = cap.as_object_mut() { if !stop.pending() || stop.remote.is_some() { o.remove("stopPending"); } } match (&stop.remote, stop.failure()) { (Some(rm), _) => remote = Some(rm.clone()), (None, Some(why)) => cap["stopError"] = json!(why), _ => {} }
crates/adom-aiflow/src/netclasses.rs+57−13@@ -247,12 +247,15 @@ pub fn derive(board: Option<&Board>, spec: &Value) -> NetClassPlan { // Group by (min_width_um) so width-ladder arrays like [1.2, 0.8, 0.5, 0.25] enforce the // declared neckdown floor (0.25 mm) in DRC while keeping the preferred trunk width (1.2 mm) // in KiCad's netclass track_width.- let mut wide_groups: BTreeMap<i64, (f64, Vec<String>)> = BTreeMap::new();+ // issue #267 (Jørgen Lolk Mollerup): grouped by (min width, clearance), so one net's netClearance never+ // tightens another net of the same width; a clearance suffix is added only when one width needs two classes+ let net_clr = |n: &str| spec["netClearance"][n].as_f64().unwrap_or(base_clearance).max(base_clearance);+ let mut wide_groups: BTreeMap<(i64, i64), (f64, Vec<String>)> = BTreeMap::new(); if let Some(o) = spec["wideNets"].as_object() { for (net, v) in o { if assigned.contains(net) { continue; } let (min_w, opt_w) = parse_width_ladder(v, 0.5, min_track);- let entry = wide_groups.entry((min_w * 1000.0).round() as i64).or_insert((opt_w, Vec::new()));+ let entry = wide_groups.entry(((min_w * 1000.0).round() as i64, (net_clr(net) * 1000.0).round() as i64)).or_insert((opt_w, Vec::new())); entry.0 = entry.0.max(opt_w); entry.1.push(net.clone()); }@@ -260,18 +263,20 @@ pub fn derive(board: Option<&Board>, spec: &Value) -> NetClassPlan { let def_w = spec["wideTrack"].as_f64().unwrap_or(0.5).max(min_track); for n in a.iter().filter_map(|v| v.as_str()) { if assigned.contains(n) { continue; }- let entry = wide_groups.entry((def_w * 1000.0).round() as i64).or_insert((def_w, Vec::new()));+ let entry = wide_groups.entry(((def_w * 1000.0).round() as i64, (net_clr(n) * 1000.0).round() as i64)).or_insert((def_w, Vec::new())); entry.1.push(n.to_string()); } }- let multi_wide = wide_groups.len() > 1;- for (w_um, (opt_w, mut nets)) in wide_groups {+ let widths: std::collections::BTreeSet<i64> = wide_groups.keys().map(|k| k.0).collect();+ let multi_wide = widths.len() > 1;+ let split = |w: i64| wide_groups.keys().filter(|k| k.0 == w).count() > 1;+ let split_widths: std::collections::BTreeSet<i64> = widths.iter().copied().filter(|w| split(*w)).collect();+ for ((w_um, c_um), (opt_w, mut nets)) in wide_groups { nets.sort(); let min_w = w_um as f64 / 1000.0;- let name = if multi_wide { format!("POWER_{w_um}UM") } else { "POWER_WIDE".into() };- let clr = nets.iter()- .filter_map(|n| spec["netClearance"][n].as_f64())- .fold(base_clearance, f64::max);+ let base_name = if multi_wide { format!("POWER_{w_um}UM") } else { "POWER_WIDE".into() };+ let name = if split_widths.contains(&w_um) { format!("{base_name}_CLR{c_um}UM") } else { base_name };+ let clr = c_um as f64 / 1000.0; for n in &nets { assigned.insert(n.clone()); } classes.push(NetClassSpec { name,@@ -376,12 +381,17 @@ pub fn derive(board: Option<&Board>, spec: &Value) -> NetClassPlan { } if let Some(a) = spec["signalPriority"].as_array() { for entry in a {+ // issue #255 (Deepak Madan): an explicit `"sensitive": true`, or a class named for it (analog, sensitive,+ // adc as a word), never a substring of `why` ("sensitive to coupling" made a 0.4 mm QFN unescapable) let cls = entry["class"].as_str().or(entry["name"].as_str()).unwrap_or("").to_ascii_lowercase();- let why = entry["why"].as_str().unwrap_or("").to_ascii_lowercase();- if cls.contains("analog") || cls.contains("sens") || cls.contains("adc") || why.contains("analog") || why.contains("sens") {- for n in entry["nets"].as_array().into_iter().flatten().filter_map(|v| v.as_str()) {- if !assigned.contains(n) { sensitive.insert(n.to_string()); }+ let named = cls.split(|c: char| !c.is_ascii_alphanumeric()).any(|w| matches!(w, "analog" | "analogue" | "sensitive" | "adc"));+ let explicit = entry["sensitive"].as_bool();+ if explicit.unwrap_or(named) {+ let nets: Vec<&str> = entry["nets"].as_array().into_iter().flatten().filter_map(|v| v.as_str()).filter(|n| !assigned.contains(*n)).collect();+ if !nets.is_empty() {+ notes.push(format!("signalPriority {}: {} sensitive (SENSITIVE_ANALOG, the wider clearance) because {}", if cls.is_empty() { "entry".to_string() } else { format!("class {cls}") }, nets.join(", "), if explicit == Some(true) { "it says \"sensitive\": true".to_string() } else { format!("its class is named {cls}") })); }+ for n in nets { sensitive.insert(n.to_string()); } } } }@@ -903,4 +913,38 @@ mod tests { crate::checks::dru_syntax(&format!("(version 1)\n{dru}")).unwrap(); let _ = std::fs::remove_dir_all(&td); }++ #[test]+ fn one_nets_clearance_does_not_tighten_another_of_the_same_width() {+ // issue #267 (Jørgen Lolk Mollerup): A=0.2 mm, B no override, both 0.8 mm wide, base 0.15 mm+ let clr_of = |spec: &Value, net: &str| derive(None, spec).classes.iter().find(|c| c.nets.iter().any(|n| n == net)).map(|c| (c.name.clone(), c.clearance_mm)).unwrap();+ let spec = json!({"clearance": 0.15, "wideNets": {"A": [0.8, 0.15], "B": [0.8, 0.15]}, "netClearance": {"A": 0.2}});+ let (na, ca) = clr_of(&spec, "A");+ let (nb, cb) = clr_of(&spec, "B");+ assert_eq!((ca, cb), (0.2, 0.15), "{na} {nb}");+ assert_ne!(na, nb);+ assert!(na.contains("CLR200UM") && nb.contains("CLR150UM"), "{na} {nb}");+ // no override anywhere: one class, the name as before+ let plain = json!({"clearance": 0.15, "wideNets": {"A": [0.8, 0.15], "B": [0.8, 0.15]}});+ assert_eq!(clr_of(&plain, "A"), ("POWER_WIDE".to_string(), 0.15));+ assert_eq!(clr_of(&plain, "B").0, "POWER_WIDE");+ // the array form too+ let arr = json!({"clearance": 0.15, "wideNets": ["A", "B"], "netClearance": {"A": 0.2}});+ assert_eq!((clr_of(&arr, "A").1, clr_of(&arr, "B").1), (0.2, 0.15));+ }+++ #[test]+ fn a_why_that_mentions_sensitivity_does_not_make_a_net_sensitive() {+ // issue #255 (Deepak Madan): "sensitive to coupling" in a why made a 0.4 mm-pitch QFN's nets SENSITIVE_ANALOG+ let sens = |spec: Value| derive(None, &spec).classes.iter().find(|c| c.name == "SENSITIVE_ANALOG").map(|c| c.nets.clone()).unwrap_or_default();+ assert!(sens(json!({"signalPriority": [{"class": "data", "nets": ["SDA"], "why": "sensitive to coupling"}]})).is_empty());+ assert!(sens(json!({"signalPriority": [{"class": "sensor_bus", "nets": ["SCL"]}]})).is_empty(), "sensor is not sensitive");+ assert_eq!(sens(json!({"signalPriority": [{"class": "analog", "nets": ["VREF"]}]})), vec!["VREF".to_string()]);+ assert_eq!(sens(json!({"signalPriority": [{"class": "data", "nets": ["THERM"], "sensitive": true}]})), vec!["THERM".to_string()]);+ assert!(sens(json!({"signalPriority": [{"class": "adc", "nets": ["AIN"], "sensitive": false}]})).is_empty(), "an explicit false wins");+ let plan = derive(None, &json!({"signalPriority": [{"class": "analog", "nets": ["VREF"]}]}));+ assert!(plan.notes.iter().any(|n| n.contains("VREF") && n.contains("class is named analog")), "{:?}", plan.notes);+ }+ }
crates/adom-aiflow/src/schematic_symbols.rs+22−2@@ -391,6 +391,14 @@ fn opamp_check(sym: &LibSym, pins: &[&Pin], texts: &[&Txt], custom: bool) -> Vec } /// The polarity findings of one lib symbol, per unit.+/// Issue #257 (Deepak Madan): E and C pin names alone do not make a transistor. A 7-segment display names its pins+/// after its segments (a..g, DP), so `e` and `c` read as emitter and collector. A transistor unit has no full+/// segment set, and either at most four pins (B, C, E and a tab) or a base pin.+fn transistor_like(pins: &[&Pin]) -> bool {+ let segments = ["A", "B", "D", "F", "G"].iter().all(|s| !named(pins, &[s]).is_empty());+ !segments && (pins.len() <= 4 || !named(pins, &["B", "BASE"]).is_empty())+}+ fn polarity(sym: &LibSym, custom: bool) -> Vec<(Sev, String)> { let units: BTreeSet<u32> = sym.pins.iter().map(|p| p.unit).filter(|u| *u > 0).collect(); let units: Vec<u32> = if units.is_empty() { vec![0] } else { units.into_iter().collect() };@@ -402,9 +410,9 @@ fn polarity(sym: &LibSym, custom: bool) -> Vec<(Sev, String)> { let tag = if u > 0 && sym.pins.iter().any(|p| p.unit > 1) { format!("unit {u}: ") } else { String::new() }; let mut found: Vec<(Sev, String)> = Vec::new(); found.extend(diode_check(&pins, &shapes));- match bjt_check(&pins, &shapes) {+ match bjt_check(&pins, &shapes).filter(|_| transistor_like(&pins)) { Some(f) => found.push(f),- None if custom && named(&pins, &["E", "EMITTER"]).len() == 1 && named(&pins, &["C", "COLLECTOR"]).len() == 1 && shapes.iter().all(|s| !(s.kind == "polyline" && s.pts.len() >= 3)) => found.push((Sev::Warn, "a transistor with E and C pins but no emitter arrow recognised in the drawing".into())),+ None if custom && transistor_like(&pins) && named(&pins, &["E", "EMITTER"]).len() == 1 && named(&pins, &["C", "COLLECTOR"]).len() == 1 && shapes.iter().all(|s| !(s.kind == "polyline" && s.pts.len() >= 3)) => found.push((Sev::Warn, "a transistor with E and C pins but no emitter arrow recognised in the drawing".into())), None => {} } found.extend(opamp_check(sym, &pins, &texts, custom));@@ -967,6 +975,18 @@ mod tests { assert!(rep["errors"][0].as_str().unwrap().contains("collector lead"), "{rep}"); } + #[test]+ fn a_seven_segment_displays_e_and_c_pins_are_not_a_transistor() {+ // issue #257 (Deepak Madan): a custom 4-digit display, pins a..g, DP and Dig1..Dig4, drawn as a rectangle+ let f = Fixture::new();+ let names = ["a", "b", "c", "d", "e", "f", "g", "DP", "Dig1", "Dig2", "Dig3", "Dig4"];+ let pins: String = names.iter().enumerate().map(|(k, n)| format!(r#"(pin passive line (at -7.62 {} 0) (length 2.54) (name "{n}") (number "{}"))"#, 12.7 - 2.54 * k as f64, k + 1)).collect::<Vec<_>>().join(" ");+ let lib = format!(r#"(symbol "My:DISP4" (symbol "DISP4_0_1" (rectangle (start -5.08 15.24) (end 5.08 -17.78) (stroke (width 0.254)) (fill (type background)))) (symbol "DISP4_1_1" {pins}))"#);+ let p = f.write("d.kicad_sch", &sheet(&[lib], &placed("My:DISP4", "DS1", 100.0, 80.0)));+ let rep = check(&p, &Value::Null).unwrap();+ assert!(!rep["warnings"].to_string().contains("transistor") && !rep["errors"].to_string().contains("emitter"), "{rep}");+ }+ #[test] fn label_only_sheets_text_over_parts_and_off_border_warn() { let f = Fixture::new();
crates/adom-aiflow/src/supply.rs+25−2@@ -170,6 +170,12 @@ pub fn decision(mpn: &str, refs: &[String], tries: &[Value], assessed: Option<&V format!("{who}: {}", parts.join("; ")) } +/// Issue #259: the factory refused for want of a land pattern it could read.+fn land_pattern_refusal(a: &Value) -> bool {+ let why = a["reason"].as_str().unwrap_or("").to_ascii_lowercase().replace('-', " ");+ why.contains("land pattern") || why.contains("footprint we'd trust") || why.contains("recommended pcb layout")+}+ /// The next command for a part with no page, by where it stands. pub fn next(mpn: &str, tries: &[Value], assessed: Option<&Value>, choice: Option<&Value>) -> String { let refused_n = tries.iter().filter(|a| refused(a)).count();@@ -189,6 +195,11 @@ pub fn next(mpn: &str, tries: &[Value], assessed: Option<&Value>, choice: Option if tries.last().map(pending).unwrap_or(false) { return "`part-request --refresh` once the factory has answered".into(); }+ // issue #259 (Max Jenkinson): a refusal for want of a land pattern the factory can read (connectors publish it as+ // a dimensioned drawing, not text) fails the same way on every retry, and the part's supply is not the problem+ if refused_n >= 1 && tries.iter().filter(|a| refused(a)).any(land_pattern_refusal) {+ return format!("the factory cannot read {mpn}'s land pattern (a drawing, not text; usual for connectors), so another datasheet will refuse the same way: give it from the project library (`parts --project-lib <dir>`: symbol, footprint, STEP and provenance). Take the footprint from a source that already has it: KiCad's own libraries (Connector_USB, Connector_JST, ... hold many receptacles by MPN), the assembly house's library for a part it stocks, or the maker's CAD download; check its pads against the datasheet's drawing and record where it came from in provenance");+ } if refused_n == 1 && tries.len() == 1 { return format!("retry once with a changed input: `part-request {mpn} --as <orderable MPN>` (`adom-wiki part candidates {mpn}`), `--datasheet <the maker's product page, package drawing or CAD link>`, or `--manufacturer <maker>`"); }@@ -214,7 +225,7 @@ mod tests { #[test] fn the_next_step_walks_retry_then_assessment_then_the_humans_choice() {- let one = vec![refused_at("U7X", None, "No land-pattern drawing.")];+ let one = vec![refused_at("U7X", None, "Datasheet unreadable.")]; assert!(next("U7X", &[], None, None).contains("part-request U7X")); assert!(next("U7X", &one, None, None).contains("retry once")); let two = vec![one[0].clone(), refused_at("U7X-1", None, "No distributor sells it.")];@@ -223,7 +234,7 @@ mod tests { assert!(next("U7X", &two, Some(&a), None).contains("ask the human")); assert!(next("U7X", &two, Some(&a), Some(&json!({"pick": "A1"}))).contains("put A1 in the BOM")); let line = decision("U7X", &["U7".into()], &two, Some(&a), None);- assert_eq!(line, "U7 (U7X): refused twice (No land-pattern drawing; No distributor sells it); supply risk high (NRND, 1 distributor); alternatives A1, B2");+ assert_eq!(line, "U7 (U7X): refused twice (Datasheet unreadable; No distributor sells it); supply risk high (NRND, 1 distributor); alternatives A1, B2"); let mut q = refused_at("U7X", None, ""); q["state"] = json!("queued"); assert!(next("U7X", &[q], None, None).contains("--refresh"));@@ -262,4 +273,16 @@ mod tests { assert!(refused(&d["partRequests"]["U9"][0])); assert_eq!(answer(&json!({"status": "ok", "data": {"request": {"state": "queued", "status_url": "/x"}}}))["status_url"], "/x"); }++ #[test]+ fn a_land_pattern_refusal_points_to_the_project_library_not_a_retry() {+ // issue #259 (Max Jenkinson): USB-C receptacles publish the land pattern as a drawing; every retry refuses+ let why = "The datasheet has no land-pattern drawing, so we can't draw a footprint we'd trust for this part";+ let n = next("USB4105-GF-A", &[refused_at("USB4105-GF-A", None, why)], None, None);+ assert!(n.contains("project library") && n.contains("KiCad's own libraries") && !n.contains("retry once"), "{n}");+ // another refusal still gets the retry first+ let other = next("U7X", &[refused_at("U7X", None, "Datasheet link is dead.")], None, None);+ assert!(other.contains("retry once"), "{other}");+ }+ }
crates/aiflow-bridge/src/lib.rs+13−2@@ -254,6 +254,13 @@ pub fn finalise_budget_secs() -> u64 { std::env::var("AIFLOW_CLIP_FINALISE_SECONDS").ok().and_then(|v| v.trim().parse().ok()).unwrap_or(300) } +/// Issue #263 (Kenneth Foli Jørgensen): how long a later retry (`finish`, `deliver`, `recut` collecting a take+/// that was still finalising at its stop) waits for that take (default 20 s, AIFLOW_CLIP_RETRY_SECONDS). The+/// take had its full finalise_budget_secs() at its own stop; 26 such takes at 300 s each held finish two hours.+pub fn retry_budget_secs() -> u64 {+ std::env::var("AIFLOW_CLIP_RETRY_SECONDS").ok().and_then(|v| v.trim().parse().ok()).unwrap_or(20)+}+ /// The recorder no longer has this take registered ("No recording with id ..."). pub fn recording_unknown(reply: &Value) -> bool { let f = reply_fields(reply);@@ -714,8 +721,12 @@ impl Bridge { /// Every wait is bounded (issue #98): the stop and status calls have a process time limit, a /// finalising take is polled for at most finalise_budget_secs(), and a take the recorder no /// longer knows comes back at once with `failure()` set (the caller flags it pullFailed).- pub fn record_stop(&self, recording_id: &str, save_to: &str) -> ClipStop {- let polls = (finalise_budget_secs() / FINALISE_POLL_SECS).max(1) as usize;+ pub fn record_stop(&self, recording_id: &str, save_to: &str) -> ClipStop { self.record_stop_within(recording_id, save_to, finalise_budget_secs()) }++ /// `record_stop` with its own finalise budget in seconds: a retry of a take that was already given its+ /// full budget at its stop (issue #263, `finish` collecting pending clips) waits only `retry_budget_secs`.+ pub fn record_stop_within(&self, recording_id: &str, save_to: &str, budget_secs: u64) -> ClipStop {+ let polls = (budget_secs / FINALISE_POLL_SECS).max(1) as usize; let (mut r, got) = stop_take( &mut |v: &str, a: &Value| self.raw_call_bounded(v, a, std::time::Duration::from_secs(120)), &mut || std::thread::sleep(std::time::Duration::from_secs(FINALISE_POLL_SECS)),
crates/aiflow-place/src/lib.rs+21−1@@ -469,8 +469,10 @@ pub fn move_in_text(board: &Board, moves: &BTreeMap<String, Move>) -> Result<(St let new_at = format!("(at {} {}{})", num(m.x), num(m.y), if nrot == 0.0 { String::new() } else { format!(" {}", num(nrot)) }); edits.push((fp.start + at.start, fp.start + at.end, new_at)); if drot.abs() > 1e-9 {- // every nested (at ...) except the footprint's own+ // every nested (at ...) except the footprint's own; issue #260/#265: KiCad 10's `(point (at x y) ...)`+ // takes no angle (its local position turns with the footprint as it is), so it is left as it is fn walk(n: &aiflow_board::Node, base: usize, drot: f64, edits: &mut Vec<(usize, usize, String)>, top: bool) {+ if n.tag == "point" { return; } for c in n.nodes() { if c.tag == "at" && !top { let a = c.number(3).unwrap_or(0.0) + drot;@@ -825,4 +827,22 @@ mod tests { let plain = Board::from_text("p.kicad_pcb", t("")).unwrap(); assert!(!copper_outside(&plain, &["U1".to_string()]).is_empty()); }++ #[test]+ fn a_kicad_10_point_takes_no_angle_when_its_footprint_turns() {+ // issue #260 / #265 (Prajeeth Anand): `(point (at x y) ...)` got an angle and KiCad could not load the board+ let t = r#"(kicad_pcb (layers (0 "F.Cu" signal) (2 "B.Cu" signal) (25 "Edge.Cuts" user))+ (gr_rect (start 0 0) (end 40 40) (layer "Edge.Cuts"))+ (footprint "Button_Switch_SMD:SW_DIP" (layer "F.Cu") (at 10 10) (property "Reference" "SW1" (at 0 -3 0) (layer "F.SilkS"))+ (point (at 1.5 -2) (size 0.5) (layer "F.Fab"))+ (pad "1" smd rect (at -1 0) (size 1 1) (layers "F.Cu"))))"#;+ let b = Board::from_text("t.kicad_pcb", t.to_string()).unwrap();+ let mut moves = BTreeMap::new();+ moves.insert("SW1".to_string(), Move { x: 20.0, y: 20.0, rotation: Some(90.0) });+ let (out, _) = move_in_text(&b, &moves).unwrap();+ assert!(out.contains("(point (at 1.5 -2) (size 0.5)"), "{out}");+ assert!(out.contains("(pad \"1\" smd rect (at -1 0 90)"), "the pad still turns: {out}");+ assert!(Board::from_text("t.kicad_pcb", out).is_ok());+ }+ }
docs/release-0.2.117.mdadded+41@@ -0,0 +1,41 @@+# adom-aiflow 0.2.117++Small blockers and quick fixes from the late-November issues.++## Placement: a rotated part with KiCad 10 point markers (issues #260, #265, Prajeeth Anand)++`place check` and `place land` added an angle to every `(at ...)` inside a rotated footprint, including KiCad 10's `(point (at x y) ...)` fab markers, which take none. KiCad could not load the moved board ("Expecting ')'"). Stock footprints such as `Connector_Dsub:DSUB-9_*` and the `SW_DIP_*` slide switches carry them. A `point` now keeps its `(at x y)`; pads, texts and properties still turn.++## project-page: KiCad's `private` property flag (issue #261, Kenneth Foli Jørgensen)++Packaging quoted the bare `private` keyword of `(property private "Name" "Value")`, so the property had four atoms and KiCad 10 refused the whole library. That hit adom/rp2040 and any copy of it. `private` now stays bare; the name and value after it are quoted as before.++## rules sync: clearance grouping and "sensitive" nets (issues #267 Jørgen Lolk Mollerup, #255 Deepak Madan)++- Wide nets were grouped by width alone, and the group took its largest `netClearance`, so a net with no override was tightened to another net's clearance. They are now grouped by width and clearance. A class name gets a clearance suffix (`POWER_WIDE_CLR200UM`) only when one width needs two classes; otherwise the names are as before.+- A `signalPriority` entry made its nets SENSITIVE_ANALOG (the wider clearance) when its `why` merely contained "sens" ("sensitive to coupling"), which made a 0.4 mm-pitch QFN unescapable. Now only `"sensitive": true` or a class named analog, sensitive or adc (as a word) does, and `rules sync` notes which entry made which nets sensitive. `"sensitive": false` keeps a class out.++## finish: collecting clips the desktop never finalised (issue #263, Kenneth Foli Jørgensen)++`finish`, `deliver` and `recut` stop again a take that was still finalising at its own stop. Each retry waited the full 300 s finalise budget, so 26 such takes held `finish` about two hours with no output.+- A retry now waits 20 s per take (`AIFLOW_CLIP_RETRY_SECONDS`).+- It says first how many clips it is collecting.+- After three takes in a row are still not finalised, it stops waiting and leaves the rest flagged, with a warning that the desktop recorder may be stuck.++A take Adom Bridge no longer knows still ends at once.++## schematic check: a 7-segment display is not a transistor (issue #257, Deepak Madan)++A display's segment pins `e` and `c` read as emitter and collector, so a custom display symbol got "a transistor with E and C pins but no emitter arrow". The transistor checks now apply only to a unit that looks like one: no full a..g segment set, and at most four pins or a base pin.++## part-request: a land pattern the factory cannot read (issue #259, Max Jenkinson)++When the factory refuses a part for want of a land pattern it can read (connectors publish it as a dimensioned drawing), the next step no longer offers a retry that fails the same way. It points to the project-library route (`parts --project-lib`), with where a trustworthy footprint comes from: KiCad's own libraries, the assembly house's library for a part it stocks, or the maker's CAD download, checked against the datasheet drawing and recorded in provenance. Accepting a footprint file as `part-request` input is a separate, larger change.++## Skill: the Fusion bridge minimum per platform (issue #258, Max Jenkinson)++The skill's minimums (1.11.33, and 1.13.87 for Fusion's newer board format) are the Windows bridge's (`adom/fusion-bridge`). The macOS bridge, `adom/fusion-bridge-macos`, is on its own version line (1.8.x), so a current Mac bridge could never meet them. The skill now says so and tells a Mac user to use the newest macOS release.++## Test fix++A 0.2.115 test shared a temporary folder with another test and removed it, which could fail the other test when they ran together. It has its own folder now.
package.json+1−1@@ -1,7 +1,7 @@ { "slug": "adom-aiflow", "type": "app",- "version": "0.2.116",+ "version": "0.2.117", "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.116",+ "version": "0.2.117", "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@@ -205,7 +205,7 @@ While a plan, check-in or human step is open, `finish-guard` answers `waiting-fo When the human asks for a board in Fusion ("a 12 V to 5 V buck converter using the TPS54202, in Fusion"), the whole flow below is yours: they should never have to spell out a step. Read `docs/fusion-lane.md`-once; the Fusion bridge must be 1.11.33 or later, and 1.13.87 or later for a board in Fusion's newer format (every board Fusion 2706 creates: bottom copper is layer 304, named Bottom; AI Flow reads it as B.Cu either way). Hydrogen stays full screen behind Fusion; keep Fusion+once; on Windows the Fusion bridge (`adom/fusion-bridge`) must be 1.11.33 or later, and 1.13.87 or later for a board in Fusion's newer format (every board Fusion 2706 creates: bottom copper is layer 304, named Bottom; AI Flow reads it as B.Cu either way). On macOS the bridge is a separate package, `adom/fusion-bridge-macos`, on its own version line (1.8.x in November 2026): its numbers are not comparable with the Windows ones, so the Windows minimums do not apply there. Use the newest macOS release (`bridge_check_updates {"name":"fusion360"}` says whether one is newer); when a Fusion verb AI Flow calls is missing on the Mac, the step's error names it (issue #258). Hydrogen stays full screen behind Fusion; keep Fusion windowed (about 90 % of the screen), never maximized, so the human sees both and a screen recording catches Fusion's 3D view. Inside Hydrogen, the VS Code tab (the chat) always stays in the left pane with its file explorer closed (`adom-vscode sidebar close`), and every webview (the timeline, the parts pages,
tests/project-page-library.py+16@@ -656,5 +656,21 @@ class PackagingSuffix(unittest.TestCase): self.assertEqual(mod.mpn_candidates({"mpn": "ABC1234,115"}), ["ABC1234,115"]) +class PrivateProperty(unittest.TestCase):+ """Issue #261 (Kenneth Foli Jørgensen): KiCad 8+'s `(property private ...)` keeps `private` bare; quoted, KiCad 10+ refuses the whole library (adom/rp2040 carries two KLC private properties)."""+ def test_private_stays_a_bare_keyword(self):+ import importlib.util+ spec = importlib.util.spec_from_file_location("project_page", SCRIPT)+ mod = importlib.util.module_from_spec(spec); spec.loader.exec_module(mod)+ q = mod.quote_atoms+ self.assertEqual(q('(property private "KLC_S4.2_DVDD" "Not a standalone power converter")'), '(property private "KLC_S4.2_DVDD" "Not a standalone power converter")')+ self.assertEqual(q('(property private KLC_S4.2 "x")'), '(property private "KLC_S4.2" "x")')+ self.assertEqual(q('(property Footprint lib:name (at 0 0 0))'), '(property "Footprint" "lib:name" (at 0 0 0))')+ self.assertEqual(q('(property "privateNote" "x")'), '(property "privateNote" "x")')+ parsed = mod.sx_parse(q('(symbol "RP2040" (property private "KLC_S4.2_DVDD" "y") (property "Value" "RP2040"))'))+ self.assertEqual(parsed[2][:4], ["property", "private", "KLC_S4.2_DVDD", "y"])++ if __name__ == "__main__": unittest.main()
tools/project-page.py+4−2@@ -414,8 +414,10 @@ def quote_atoms(text): (issue #196: wiki symbols written `(property Footprint lib:name ...)`). The rest of this script reads and rewrites the quoted form KiCad itself writes, so put the quotes in once, where a library is read.""" text = re.sub(r'\((symbol|extends)\s+(' + _ATOM + r')(?=[\s)])', lambda m: f'({m.group(1)} "{m.group(2)}"', text)- text = re.sub(r'\(property\s+(' + _ATOM + r')(?=\s)', lambda m: f'(property "{m.group(1)}"', text)- return re.sub(r'\(property\s+(' + _QSTR + r')\s+(' + _ATOM + r')(?=[\s)])', lambda m: f'(property {m.group(1)} "{m.group(2)}"', text)+ # issue #261: KiCad 8+'s `(property private "Name" "Value")` keeps `private` a bare keyword; quoted, the+ # property has four atoms and KiCad 10 refuses the whole library+ text = re.sub(r'\(property\s+(private\s+)?(?!private\s)(' + _ATOM + r')(?=\s)', lambda m: f'(property {m.group(1) or ""}"{m.group(2)}"', text)+ return re.sub(r'\(property\s+(private\s+)?(' + _QSTR + r')\s+(' + _ATOM + r')(?=[\s)])', lambda m: f'(property {m.group(1) or ""}{m.group(2)} "{m.group(3)}"', text) def top_symbols(text):