app
Adom Aiflow Wiring
Public Made by Adomby adom
Harness routing, connector serviceability and assembly review CLI with dynamic AI guidance
← Commit history
Add duplicate conductor GLB audit and neighboring connector service clearance guidance
2 files changed
+17−2
SKILL.md+3−1@@ -1,6 +1,6 @@ --- name: adom-aiflow-wiring-description: Design and review real installed harnesses, connector mating and removal, wire colors, crimp contacts, bend radius, strain relief, cable holders and optional service animation.+description: Use when designing or reviewing real installed harnesses, connector mating and removal, wire colors, crimp contacts, bend radius, strain relief, cable holders and optional service animation. --- # Wiring is part of the assembly @@ -37,3 +37,5 @@ Assign stable physical conductor IDs and map every rendered wire mesh to them. C At each connector use the manufacturer's wire-entry datum and axis, terminal position and insulation-crimp envelope. Reserve a straight lead-out section before the first bend and the specified bend radius. Wires cannot enter arbitrary faces of a housing, pass through its walls, protrude from the mating face or bend sharply inside a crimp barrel. Verify scene geometry and cross-sections, not just endpoint coordinates. A bounded curve is not automatically a bend-radius pass. Make unresolved entry geometry a visible finding and fix it before presenting an installed harness as correct. Review every neighboring connector, not only the harness's own endpoints. Reserve the complete plug insertion/withdrawal corridor plus latch, finger and release-tool access. A cable passing above a housing can block mating even without intersecting the housing solid. Check both static installed envelopes and all service swept volumes; route or retain wires outside those reservations. Include wire sag, manufacturing tolerances and service movement. Rerun after connector relocation or cable-holder changes.++Run `adom-aiflow-wiring audit-glb assembly.glb` on the final export. Tag exactly one root node per real conductor with `extras.physicalConductorId`; do not tag each tessellated primitive. The command rejects duplicate IDs and missing inventories. Also inspect the live viewer: additive loads can retain obsolete wire meshes even when the exported GLB is correct. Reload or use the viewer's documented replacement API; do not hide stale wires and call the scene clean.
src/main.rs+14−1@@ -27,7 +27,20 @@ fn lint(v:&Value)->Value{ } json!({"schemaVersion":1,"passed":issues.is_empty(),"findings":issues,"animationRequired":false,"qualification":"Review completeness only; evidence paths require independent review, not proof of physical fit."}) }-fn main(){let a:Vec<_>=env::args().collect();if a.len()!=3||a[1]!="lint"{eprintln!("Usage: adom-aiflow-wiring lint wiring.json");process::exit(2)}let r=fs::read_to_string(&a[2]).map_err(|e|e.to_string()).and_then(|s|serde_json::from_str(&s).map_err(|e|e.to_string()));match r{Ok(v)=>{let o=lint(&v);println!("{}",serde_json::to_string_pretty(&o).unwrap());if o["passed"]!=true{process::exit(1)}},Err(e)=>{eprintln!("ERROR: {e}");process::exit(2)}}}+fn audit_glb(path:&str)->Result<Value,String>{+ let b=fs::read(path).map_err(|e|e.to_string())?;+ if b.len()<20 || &b[0..4]!=b"glTF" {return Err("Not a GLB".into())}+ let n=u32::from_le_bytes(b[12..16].try_into().unwrap()) as usize;+ if &b[16..20]!=b"JSON" || n>b.len()-20 {return Err("Invalid JSON chunk".into())}+ let g:Value=serde_json::from_slice(&b[20..20+n]).map_err(|e|e.to_string())?;+ let mut ids:std::collections::BTreeMap<String,Vec<String>>=std::collections::BTreeMap::new();+ for node in g["nodes"].as_array().into_iter().flatten(){+ if let Some(id)=node["extras"]["physicalConductorId"].as_str(){ids.entry(id.into()).or_default().push(node["name"].as_str().unwrap_or("unnamed").into());}+ }+ let duplicates:Vec<_>=ids.iter().filter(|(_,n)|n.len()>1).map(|(id,n)|json!({"id":id,"nodes":n})).collect();+ Ok(json!({"schemaVersion":1,"passed":!ids.is_empty()&&duplicates.is_empty(),"physicalConductors":ids,"duplicates":duplicates,"hint":"Tag exactly one conductor root with extras.physicalConductorId per installed wire. Child primitives stay untagged. This detects duplicate roots, not geometric intersections or viewer scene accumulation; inspect the live scene separately."}))+}+fn main(){let a:Vec<_>=env::args().collect();if a.len()==3 && a[1]=="audit-glb" {match audit_glb(&a[2]){Ok(v)=>{println!("{}",serde_json::to_string_pretty(&v).unwrap());process::exit(if v["passed"]==true{0}else{1})},Err(e)=>{eprintln!("ERROR: {e}");process::exit(2)}}} if a.len()!=3||a[1]!="lint"{eprintln!("Usage: adom-aiflow-wiring lint wiring.json | audit-glb assembly.glb");process::exit(2)}let r=fs::read_to_string(&a[2]).map_err(|e|e.to_string()).and_then(|s|serde_json::from_str(&s).map_err(|e|e.to_string()));match r{Ok(v)=>{let o=lint(&v);println!("{}",serde_json::to_string_pretty(&o).unwrap());if o["passed"]!=true{process::exit(1)}},Err(e)=>{eprintln!("ERROR: {e}");process::exit(2)}}} #[cfg(test)]mod tests{use super::*;#[test]fn unknowns_fail(){let r=lint(&json!({"harnesses":[{"id":"fan","requiredLengthMm":151,"minimumAvailableLengthMm":150}]}));assert_eq!(r["passed"],false);assert!(r["findings"].as_array().unwrap().iter().any(|v|v["check"]=="length"));assert!(r["findings"].as_array().unwrap().iter().any(|v|v["check"]=="forceEvidence"));}#[test]fn empty_fails(){assert_eq!(lint(&json!({}))["passed"],false)}} #[cfg(test)] mod geometry_tests {