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.
project-page: find a part's symbol by the MPN without its /packaging suffix when parts matched the page that way #72
Why
parts matches MCP73831T-2ACI/OT to the wiki page adom/mcp73831t-2aci. Its wikiMatch note reads "the page for MCP73831T-2ACI, the MPN without its /OT packaging suffix", so parts passes.
project-page then looks the part's symbol up in the exported library by the full MPN only. The page's symbol is named MCP73831T-2ACI, so the lookup fails and the export refuses with "1 of 32 parts are not in the exported library: MCP73831T-2ACI/OT (U2)". Nothing gets published.
Change
tools/project-page.py gets a new mpn_candidates(p) helper. When the row has a wiki page and the MPN carries a / packaging suffix, it returns the MPN followed by the MPN without that suffix. Both symbol lookups use it: the one in the library check and the one in the table name resolution. Nothing else changes.
Base and testing
- Base: adom/adom-aiflow 0.2.56 as published on 2026-11-06,
tools/project-page.pyas cloned. - Tested on the Ghost Hand board run (32 distinct parts, one of them MCP73831T-2ACI/OT). I rebuilt with
cargo build --release -p adom-aiflow, since the script isinclude_str!'d, and ranproject-page --page john/ghost-hand --page-dir board. Results are in the comments.
Result with the patched build: OK: project page ... README revision 1 with 32 parts, KiCad PCM repository ... (32 symbols, 23 footprints, 23 models for 32 distinct parts). With the unpatched 0.2.56 the same run refused, saying MCP73831T-2ACI/OT was not in the library.
🤖 Generated with Claude Code
Diff Skip to comments (1)
@@ -1,1031 +1,1041 @@⋯ 45 unchanged lines ⋯ ADD_CHUNK = 10 ++def mpn_candidates(p):+ """The MPN, then the MPN without a packaging suffix (MCP73831T-2ACI/OT -> MCP73831T-2ACI) when the+ parts record matched the page that way (wikiMatch), so the page's symbol is found by its own name."""+ out = [p["mpn"]]+ if p.get("wiki") and "/" in p["mpn"]:+ out.append(p["mpn"].split("/")[0])+ return out+ def clip(text, n=600): """Error text within n characters, keeping its beginning (the cause) and its end (issue #76).""" text = text or ""⋯ 513 unchanged lines ⋯ """The part's symbol in the packaged library, or None.""" if p.get("projectLib") and not p.get("wiki"): return p["projectLib"]["symbol"] if p["projectLib"]["symbol"] in syms else None- return next((by_norm[norm(c)] for c in [p["mpn"]] + rep_names.get(norm(p["mpn"]), []) if norm(c) in by_norm), None)+ return next((by_norm[norm(c)] for c in mpn_candidates(p) + rep_names.get(norm(p["mpn"]), []) if norm(c) in by_norm), None) # --- Route (b) for a footprint with no 3D model ---⋯ 177 unchanged lines ⋯ if p.get("projectLib") and not p.get("wiki"): name = p["projectLib"]["symbol"] if p["projectLib"]["symbol"] in syms else None else:- name = next((by_norm[norm(c)] for c in [p["mpn"]] + rep_names.get(norm(p["mpn"]), []) if norm(c) in by_norm), None)+ name = next((by_norm[norm(c)] for c in mpn_candidates(p) + rep_names.get(norm(p["mpn"]), []) if norm(c) in by_norm), None) if not name: missing.append(label) continue⋯ 273 unchanged lines ⋯ if __name__ == "__main__": main()+
Comments
Log in to comment.