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.
Audit missing CAD with wiki-first sourcing and global component scope #2
Supersedes PR #1 with John's global-catalog requirement. Global component pages serve ALL ADOM USERS; board-only definitions, unresolved identities and copper features stay in the board project page. A rename is not evidence of general reuse. The new check verifies these instructions in the rebuilt CLI. Rebuilt release and reran the real-ESC CLI integration test after this update; both passed.
The models step mentions fetching a STEP or fixing a path, but does not tell an AI how to identify and source missing components. This change prints a six-part workflow in plan and stores it in the run's flow: exact-reference inventory; wiki first; adom-parts-search and manufacturer/distributor sites next; Pup for browser-only downloads; verified component-page publication with provenance; portable paths and native KiCad model verification.
It distinguishes bare copper test pads, DNP parts, unresolved land patterns and approximate models. Existing pages are reused and their asset completeness checked. This is guidance for the AI, not a new automatic identity/sourcing gate. Both distributed skills describe it.
Validation before submitting: rebuilt with cargo build --release -p adom-aiflow; cargo test --workspace passed; ran python3 tests/component-workflow.py target/release/adom-aiflow /home/adom/aiflow-esc-astra/final-native/esc-g431-astra.kicad_pcb /home/adom/aiflow-esc-astra/spec.json. The rebuilt CLI processed the actual 149-footprint ESC in a disposable run, printed the ordered wiki-first workflow, and persisted all six actions. No bridge or original run was mutated by the test.
Distribution caveat for Fable: the downloaded page package advertises 0.1.25, but its Cargo workspace is 0.1.0 and published main.rs lacks the installed binary's models/tour/compose commands. This PR is against that currently published source. Please carry the small plan-rendering change into your current source and synchronize it before releasing; do not replace current commands with this older source snapshot. The local rebuilt binary was isolated, not installed over the working binary.
Diff Skip to comments
@@ -1,162 +1,171 @@⋯ 11 unchanged lines ⋯ { "name": "models", "who": "ai",- "does": "every footprint on the board has its 3D model resolved (kicad_model_check): fetch the vendor STEP, build one, or fix the path, so the board renders as it will be built; a bare footprint in the 3D view is a missing model",+ "does": "audit every board component and missing symbol, footprint or 3D asset; resolve exact identities on the wiki first, then adom-parts-search and manufacturer/supplier sites (Pup when browser access is needed); publish missing component pages, repair portable model paths, and verify the native 3D board with kicad_model_check", "binary": [ "models" ],- "record": "nothing to film: the model check's list and the fixes; the 3D walkthrough later is the proof"+ "record": "nothing to film: the model check's list and the fixes; the 3D walkthrough later is the proof",+ "workflow": [+ "Inventory every reference from the actual board and schematic: manufacturer, MPN, supplier code, package, value and ratings; group repeated exact parts and record their references. Do not invent an MPN or silently substitute a similar value/package. Distinguish populated parts, DNP parts and bare copper/mechanical features; a bare test pad needs no purchased component or fictitious 3D body.",+ "Search the wiki FIRST for each exact manufacturer/MPN and supplier code; reuse the matching component page and inspect its symbol, footprint and STEP/WRL assets. A page existing is not proof its CAD bundle is complete. Record the page URL and missing assets per reference.",+ "For missing identities or assets, use adom-parts-search next, then original manufacturer and distributor websites. Use Pup to navigate and download through the automated browser when curl/fetch is blocked or the site requires JavaScript; do not treat a blocked fetch as proof the part is unavailable. Read the relevant parts-search and Pup skills for current commands.",+ "Verify manufacturer, exact ordering code, package dimensions, pin numbering and required electrical ratings against source evidence before accepting CAD or a candidate part. Preserve source URLs and provenance. Label generated or approximate models as such; never present an approximate body as a verified vendor model.",+ "Global component pages are shared resources for ALL ADOM USERS, never a board-specific BOM dump. Create one only for a distinct reusable manufacturer part or independently specified reusable custom component, after searching for duplicates. Write a part-focused page with portable verified assets and provenance, and improve existing pages. Keep board references, unresolved identities, one-off land patterns, bare copper test pads and project-only assemblies inside the board project wiki page; do not create catalog placeholders or rename a one-off feature to make it appear global.",+ "Use portable project/library model paths, preserve placement and routing, rerun kicad_model_check and inspect the saved board in native KiCad 3D. Report reference coverage, reused/created page URLs, unresolved identities and missing CAD separately. A successful download or wiki publication alone does not close a missing-model finding."+ ] }, { "name": "placement",⋯ 137 unchanged lines ⋯ "clips": "every `step <name>` stops the previous step's clip and starts a new window recording tagged with the step, when the board is open on a test box; run.json captures[] carries one entry per clip with its step, start, stop and file, and deliver lists them; the final video is cut from these clips, one segment per step, so two engines' videos line up step for step; a return (step <name> --back --why) is a new visit and gets its own clip, tagged <step>-<visit> with the reason, so the rework is on camera and the final cut can show the loop", "screenshots": "every step visit gets two background screenshots of the editor window, at its start and at its end (shot-<step>-<visit>-start.png, shot-<step>-<visit>-end.png), logged as artifacts, so a run's own README has a picture for every step without anyone taking one" }+@@ -1,1094 +1,1100 @@⋯ 518 unchanged lines ⋯ lines.push(format!("flow \"{}\": {}", flow["name"].as_str().unwrap_or(""), flow["scope"].as_str().unwrap_or(""))); for st in flow["steps"].as_array().cloned().unwrap_or_default() { lines.push(format!(" step {:<10} {:<7} {}", st["name"].as_str().unwrap_or(""), st["who"].as_str().unwrap_or(""), st["does"].as_str().unwrap_or("")));+ if let Some(workflow) = st["workflow"].as_array() {+ for (i, action) in workflow.iter().filter_map(Value::as_str).enumerate() {+ lines.push(format!(" {}. {}", i + 1, action));+ }+ } } lines.push(format!(" later: {}", flow["later"].as_array().map(|a| a.iter().filter_map(|x| x["name"].as_str()).collect::<Vec<_>>().join(", ")).unwrap_or_default())); lines.push("stages the binary offers:".into());⋯ 567 unchanged lines ⋯ } } }+@@ -1,83 +1,92 @@⋯ 80 unchanged lines ⋯ - `finish` is the only thing that ends a run. A run without `finish` is not a result, and its minutes are still counting. - KiCad drops pour islands that touch nothing: a heat spreader drawn across dense routing on the other layer fills as fragments and reads small in `measure`. Put the copper where the layer is actually free (the analysis numbers say when it is not). - 0.1's analyses are conservative heuristics (IPC-2221 for tracks, presence, connection style and vias for pours and tabs); they say so in their output. 0.2 computes cross-sections through the filled copper.++## Component coverage before placement++The `models` step also audits component identity and library coverage. Run `plan` to read its ordered sourcing workflow. Inventory every reference on the actual board and schematic, and track exact manufacturer/MPN, supplier code, package and required ratings. Reuse exact wiki component pages first; check their assets rather than assuming a page contains a complete CAD bundle. Use `adom-parts-search` next and manufacturer/distributor sites for gaps. Pup is the browser fallback for JavaScript or blocked curl/fetch downloads; read its skill for current commands.++Publish missing identified component pages with verified symbol/footprint/model assets and provenance; improve existing pages instead of duplicating them. Do not invent identities for generic land patterns, DNP parts or bare copper test pads, or silently substitute a similar part. Record unresolved identities and missing assets separately. Generated/approximate bodies must be labelled. Keep model paths portable, preserve layout, rerun `kicad_model_check`, and visibly inspect native KiCad 3D before calling model coverage complete. The AI performs this sourcing audit; these instructions do not add an automatic sourcing or component-identity gate.++Global component pages serve ALL ADOM USERS. Publish only distinct reusable manufacturer parts or independently specified reusable custom components, after duplicate checking. Keep page titles and assets part-focused and portable. Board reference mappings, unresolved identities, one-off footprints, bare copper features and project-only assemblies belong in the board project wiki page, not new component catalog entries. Do not turn project-specific placeholders into generic-looking pages merely by renaming them.+@@ -1,83 +1,92 @@⋯ 80 unchanged lines ⋯ - `finish` is the only thing that ends a run. A run without `finish` is not a result, and its minutes are still counting. - KiCad drops pour islands that touch nothing: a heat spreader drawn across dense routing on the other layer fills as fragments and reads small in `measure`. Put the copper where the layer is actually free (the analysis numbers say when it is not). - 0.1's analyses are conservative heuristics (IPC-2221 for tracks, presence, connection style and vias for pours and tabs); they say so in their output. 0.2 computes cross-sections through the filled copper.++## Component coverage before placement++The `models` step also audits component identity and library coverage. Run `plan` to read its ordered sourcing workflow. Inventory every reference on the actual board and schematic, and track exact manufacturer/MPN, supplier code, package and required ratings. Reuse exact wiki component pages first; check their assets rather than assuming a page contains a complete CAD bundle. Use `adom-parts-search` next and manufacturer/distributor sites for gaps. Pup is the browser fallback for JavaScript or blocked curl/fetch downloads; read its skill for current commands.++Publish missing identified component pages with verified symbol/footprint/model assets and provenance; improve existing pages instead of duplicating them. Do not invent identities for generic land patterns, DNP parts or bare copper test pads, or silently substitute a similar part. Record unresolved identities and missing assets separately. Generated/approximate bodies must be labelled. Keep model paths portable, preserve layout, rerun `kicad_model_check`, and visibly inspect native KiCad 3D before calling model coverage complete. The AI performs this sourcing audit; these instructions do not add an automatic sourcing or component-identity gate.++Global component pages serve ALL ADOM USERS. Publish only distinct reusable manufacturer parts or independently specified reusable custom components, after duplicate checking. Keep page titles and assets part-focused and portable. Board reference mappings, unresolved identities, one-off footprints, bare copper features and project-only assemblies belong in the board project wiki page, not new component catalog entries. Do not turn project-specific placeholders into generic-looking pages merely by renaming them.+@@ -0,0 +1,10 @@+# Wiki-first component and CAD coverage++## Component coverage before placement++The `models` step also audits component identity and library coverage. Run `plan` to read its ordered sourcing workflow. Inventory every reference on the actual board and schematic, and track exact manufacturer/MPN, supplier code, package and required ratings. Reuse exact wiki component pages first; check their assets rather than assuming a page contains a complete CAD bundle. Use `adom-parts-search` next and manufacturer/distributor sites for gaps. Pup is the browser fallback for JavaScript or blocked curl/fetch downloads; read its skill for current commands.++Publish missing identified component pages with verified symbol/footprint/model assets and provenance; improve existing pages instead of duplicating them. Do not invent identities for generic land patterns, DNP parts or bare copper test pads, or silently substitute a similar part. Record unresolved identities and missing assets separately. Generated/approximate bodies must be labelled. Keep model paths portable, preserve layout, rerun `kicad_model_check`, and visibly inspect native KiCad 3D before calling model coverage complete. The AI performs this sourcing audit; these instructions do not add an automatic sourcing or component-identity gate.++Global component pages serve ALL ADOM USERS. Publish only distinct reusable manufacturer parts or independently specified reusable custom components, after duplicate checking. Keep page titles and assets part-focused and portable. Board reference mappings, unresolved identities, one-off footprints, bare copper features and project-only assemblies belong in the board project wiki page, not new component catalog entries. Do not turn project-specific placeholders into generic-looking pages merely by renaming them.+@@ -0,0 +1,18 @@+"""Exercise the compiled plan on a real board in a disposable run (no bridge)."""+import pathlib,subprocess,tempfile,sys,json+binary,board,spec=map(lambda p:str(pathlib.Path(p).resolve()),sys.argv[1:])+with tempfile.TemporaryDirectory(prefix='aiflow-components-') as d:+ base=[binary,'--ai-thread','ESC AI Flow Astra','--run',d]+ subprocess.run(base+['start','--board',board,'--spec',spec,'--engine','component-workflow-test'],check=True,capture_output=True,text=True)+ result=subprocess.run(base+['plan'],check=True,capture_output=True,text=True)+ text=result.stdout+ assert 'wiki FIRST' in text and 'Pup' in text and 'adom-parts-search' in text+ assert text.index('Search the wiki FIRST')<text.index('use adom-parts-search next')+ for phrase in ['Do not invent an MPN','bare test pad','provenance','portable project/library model paths','kicad_model_check','ALL ADOM USERS','inside the board project wiki page']:+ assert phrase in text,phrase+ manifest=json.load(open(pathlib.Path(d)/'run.json'))+ step=next(s for s in manifest['flow']['steps'] if s['name']=='models')+ assert len(step['workflow'])==6+ print(text)+ print('PASS: rebuilt CLI prints ordered sourcing workflow and persists it in the isolated run.')+
Comments
Log in to comment.
No comments yet.