Reuse datasheet family aliases and skip the LLM for catalog passives.

Store BOM MPN and orderable code on the same PDF blob, derive TI datasheet slugs from package/Q1 codes, and map LCSC/DigiKey R/C/L parameters to specs without a model call.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-28 02:11:49 +02:00
co-authored by Cursor
parent 27a3ce8bd0
commit dd46ce1da1
11 changed files with 437 additions and 30 deletions
+12
View File
@@ -19,6 +19,18 @@ def _client(tmp_path) -> TestClient:
return TestClient(app)
def test_library_alias_resolves_family_mpn(storage):
from backend.services.datasheet_store import resolve_datasheet, store_datasheet_bytes
store_datasheet_bytes(
storage, PDF, "ESP32-S31-WROOM-3",
extra_mpns=["ESP32-S31-WROOM-3-N16R16V"],
)
assert resolve_datasheet(storage, "ESP32-S31-WROOM-3")
assert resolve_datasheet(storage, "ESP32-S31-WROOM-3-N16R16V")
assert proj_svc.library_has_datasheet(storage, "ESP32-S31-WROOM-3")
def test_save_datasheet_also_stores_in_library(storage):
meta = proj_svc.create_project(storage, "local", "board")
key = proj_svc.save_datasheet(storage, "local", meta.id, "CH340E", PDF)