Closed general

parts: a BOM row cannot name its component page (off-board battery adom/adom-1317 reported MISSING)

John Lauer · 1d ago ·closed by John Lauer

adom-aiflow 0.2.57, parts

A BOM row cannot name its wiki component page, so a part whose page slug is not derived from its MPN is reported MISSING even though the page exists.

Board: Ghost Hand rev 2 (john/ghost-hand). The battery is off-board (spec offBoard, BOM placement off-board): Adafruit 1317, MPN 1317 (that is Adafruit's and Mouser's part number). Its public component page is adom/adom-1317 (component.mpn = 1317; the same convention as adom/adom-1578 from rev 1, because a bare numeric slug is a poor page name). parts tries adom/1317 and the slug forms, then the project library, and prints:

  1317                   BT1        MISSING
  1317: project library: not in provenance.json

What I tried: a wiki column in the BOM (adom/adom-1317 on the BT1 row) is not read. The netlist page field (the documented override, issue #157) cannot help an off-board part, which by design is not in the netlist.

Workaround used: a project-library entry for 1317 carrying the page's STEP, a zero-pad off-board footprint and a symbol, with the page named in provenance.json.

Suggestion: read a wiki (or page) column on BOM rows as the same override the netlist page field gives, and/or search pages by component.mpn (the page's own declaration) when the slug forms miss. A test: a BOM row with MPN 1317 and wiki = adom/adom-1317 resolves to that page.

1 Reply

John Lauer · 22h ago

Thanks John, clear report, and the test you suggested is now in the suite.

What was wrong: parts only looked for a page by the MPN's slug forms (adom/1317 and friends), then the project library. The BOM had no way to name a page, and the netlist page field cannot help an off-board part, since by design it is not in the netlist. So the battery, whose page is adom/adom-1317 (component.mpn 1317), came out MISSING.

What changed, in adom-aiflow 0.2.58 (both of your suggestions):

  • A BOM row can name its component page in a wiki column (also read as page, wiki_page or component_page), as owner/slug or a wiki.adom.inc URL. parts uses it when that page's page.json reads, and says so in the source notes ("adom/adom-1317 is named in the BOM's wiki column"). It ranks like the netlist page: above a project-library entry marked "prefer": true. A named page that cannot be read is said plainly, and parts falls back to the MPN search.
  • When the slug forms miss, parts now checks the search hits whose slug carries the MPN as a whole part (adom-1317 for 1317, but not a13170), at most four, and takes the one whose page.json component.mpn is the MPN. So your BOM row works even without the wiki column.
  • Builds on PR #74: the off-board placement column and the wiki column live side by side in the same BOM.

How it was verified: tests/parts-sources-workflow.py now runs parts on a BOM with an off-board 1578 row naming adom/adom-1578, an off-board 1317 row with no wiki cell (found as adom/adom-1317 through component.mpn), and a row naming a page that does not exist (reported, still missing). Unit tests cover the column and the slug candidates. All suites pass.

Still open: nothing for this issue. You can drop the project-library workaround entry for 1317 once you have upgraded.

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.

John Lauer closed this · 22h ago

Log in to reply.