Closed bug report

Exact MPN search recommends packaging variant despite an available exact Mouser hit

John Lauer · 1mo ago ·closed by John Lauer

adom-parts-search 2.0.12; Linux WSL2; Hydrogen webview on AdomLapper. No native bridge is involved in the recommendation calculation.

An exact TPS389001DSER search returns an in-stock exact Mouser hit (595-TPS389001DSER, 2190 units, $1.92), but the recommendation chooses TPS389001DSET (5600 units, $2.22). The exact hit is second in the vendor result order. These are different orderable packaging suffixes; a packaging alternative must be explicit rather than silently winning an exact-MPN search. Captured 2026-09-09; stock/pricing are a snapshot, not a reservation.

Reproduce once with adom-parts-search show TPS389001DSER --limit 3, then inspect /state without spending another search. Expected: rank exact MPN matches within the preferred eligible supplier ahead of substring or description-only hits. If recommending a variant, return an explicit substitution hint and matched-vs-requested MPN fields. Preserve family-query behavior when there is no exact hit.

The screenshot shows the exact Mouser hit; the attached reduced response shows both candidates and the wrong recommendation. Raw C38 film is indexed in the Depth Lab project for engineering review. No purchase was made. Add a deterministic test with DSET listed before an available DSER result and verify UI/CLI show the same exact recommendation.

C38-parts-search-exact-mismatch

parts-search-exact-mismatch-evidence.json

2 Replies

John Lauer · 1mo ago

Confirmed a second case in adom-parts-search 2.0.12 / Hydrogen 1.0.311: exact query 74LVC2G17GV,125 recommends the automotive 74LVC2G17GV-Q100H ($0.28, 4466 Mouser stock), despite an exact standard part hit ($0.19, 2080 stock) in the same response. C49 records the live search and inspection. We explicitly selected the exact part; no purchase occurred.

For the separate 74LVC2G07GV,125 query, the exact part was out of stock and the Q100 variant was available, so we reviewed its own manufacturer datasheet before selecting it. That is a justified substitution requiring explicit engineering review, unlike silently preferring the nonexact variant when the exact part is available.

C49-sequence

John Lauer · 19d ago

Fixed in 2.0.14 (published). An exact part number now wins over any packaging or grade variant, and a substitution is never silent.

What was wrong: the recommendation took the first in-stock hit per vendor, so a variant listed ahead of the exact part (reel vs cut tape, automotive grade, a suffix sibling) could be recommended for an exact-MPN search.

What it does now, for a query that looks like a full part number:

  1. The exact part, in stock at Mouser.
  2. The exact part, in stock at DigiKey.
  3. Only then a variant, and it is flagged as a substitution with the requested MPN named.

Family and keyword searches (STM32H7, LM358) behave exactly as before. Matching ignores case and surrounding whitespace, and keeps punctuation, so 74LVC2G17GV,125 is not confused with 74LVC2G17GV-Q100,125.

The JSON gained three fields on recommendation: requested_mpn, exact_match, substitution. The CLI summary line says (exact match) or (SUBSTITUTION, NOT the requested X), and the app shows a badge or an amber banner.

Seven regression tests, all passing: exact_mpn_beats_a_variant_listed_first, exact_mpn_with_punctuation_beats_the_automotive_variant, exact_at_digikey_beats_a_variant_at_mouser, a_variant_is_only_ever_an_explicit_substitution, family_queries_are_unchanged, cheapest_policy_stays_on_the_exact_part, exactness_ignores_case_and_whitespace.

Live, from the published 2.0.14 installed off the wiki (not a dev build):

$ adom-parts-search search "74LVC2G17GV,125"
OK: Mouser: 2 hit(s) | DigiKey: 3 hit(s) | JLCPCB: 2 hit(s) | recommendation: Mouser 74LVC2G17GV,125 (exact match)

TPS389001DSER returned Mouser TPS389001DSER (exact match) on the same code before publish.

Rendered on a real laptop (arav-rog, Chrome, 1707px wide at 1.5x, published 2.0.14). The first frame is this issue's exact scenario: Mouser lists the -Q100H variant first, and the recommendation still lands on 74LVC2G17GV,125. The second is the substitution banner, driven through the page's own renderRecommendation with a substitution result because no live query reliably produces one; it measures 1574x36, one line, no overflow, role="alert".

exact-match

substitution-banner

Log in to reply.