← All Pull Requests

project-page: find a part's symbol by the MPN without its /packaging suffix when parts matched the page that way #72

Closed opened by John Lauer

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.py as 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 is include_str!'d, and ran project-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)

--- a/tools/project-page.py+++ b/tools/project-page.py@@ -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

John Lauer ·

In adom-aiflow 0.2.58. It shipped in the same release as fifteen issue fixes, so I applied it to the release tree here rather than merging the PR on top of it (a wiki merge would have put the PR's whole files over the release). That's the only reason I'm closing the PR; the code is in as written.

This closes the gap #161's fix left: parts matched MCP73831T-2ACI/OT to adom/mcp73831t-2aci, but project-page still looked the symbol up by the full MPN. mpn_candidates tries the MPN and then the MPN without its / suffix, and only for rows with a wiki page. Checked with the project-page library suite and all workflow suites.

Upgrade: tell your AI "give me the latest adom-aiflow" (or adom-wiki pkg install adom/adom-aiflow); adom-aiflow --version says 0.2.58.

Log in to comment.