main
John Lauer Continue exact component library audit with MCU, headers, fuse and diode assets 1f97681
from pathlib import Path
import json,hashlib,shutil
root=Path(__file__).resolve().parents[2]
for slug,mpn,man,source,ds,package in [('b140-13-f','B140-13-F','Diodes Incorporated','https://www.diodes.com/part/view/B140','https://www.diodes.com/datasheet/download/B130.pdf','SMA / DO-214AC'),('0466005-nr','0466005.NR','Littelfuse','https://www.littelfuse.com','https://www.littelfuse.com/assetdocs/fuse-466-datasheet?assetguid=dbe9bcd7-6072-4adf-bf5b-d33e52a6b90f','1206 thin-film fuse')]:
 p=root/'components'/slug;diode=slug=='b140-13-f';plain=slug+'-nominal.step' if diode else slug+'-generic.step'
 c={'mpn':mpn,'manufacturer':man,'package':package,'pin_count':2,'category':'Diodes' if diode else 'Circuit Protection','datasheet':ds,'wiki_url':'https://wiki.adom.inc/adom/'+slug,'parts':{'symbol':slug+'.kicad_sym','footprint':slug+'.kicad_mod','step':plain,'model_3d':slug+'-hero.glb','model_3d_plain':slug+'.glb','model_3d_step':plain,'lbr':slug+'.lbr','adom_lbr':slug+'.adom-lbr.json','datasheet':'datasheet.pdf'},'distributor_links':{'mouser':'621-B140-F'} if diode else {'mouser':'576-0466005.NR','digikey':'F1460CT-ND'},'pins':[{'number':'1','name':'K' if diode else '1','type':'passive'},{'number':'2','name':'A' if diode else '2','type':'passive'}],'qualification':{'status':'provisional','model':'Original nominal reconstruction' if diode else 'Generic KiCad model with attribution','assembly':'Native variant binding and physical qualification pending'}}
 # Do not invent distributor identifiers; retain only corroborated project data below.
 if diode:c['distributor_links']={}
 title=mpn+(' Schottky boost diode' if diode else ' 5 A fast-acting fuse')
 d=dict(slug=slug,type='hardware',kind='component',version='0.1.0',title=title,description=('40 V, 1 A SMA Schottky diode with explicit cathode mapping and nominal original CAD.' if diode else '5 A, 32 V 1206 fuse; exact NR order code, reflow-pattern candidate and attributed generic CAD.'),brief='Exact two-terminal part with documented polarity or suffix identity; physical qualification pending.',license='MIT AND CC-BY-SA-4.0',tags=['diode','Schottky','SMA'] if diode else ['fuse','1206','Littelfuse'],hero={'type':'image','path':'hero.png'},source={'name':man,'url':source},component=c,because='Exact part used on the custom electronic load; original catalog record was missing.')
 (p/'page.json').write_text(json.dumps(d,indent=2)+'\n');d.update(name='@adom/'+slug,files=['README.md','LICENSE','LICENSE-KICAD.md','THIRD_PARTY.md','page.json','package.json','provenance.json','footprint-input.json',slug+'*','symbol.html','footprint.html','hero.png','datasheet.pdf','skills/**']+(['build_model.py'] if diode else []),dependencies={});(p/'package.json').write_text(json.dumps(d,indent=2)+'\n');shutil.copyfile(root/'components/lm339bidr/LICENSE',p/'LICENSE')
 (p/'THIRD_PARTY.md').write_text('The symbol is derived from KiCad Device:'+('D_Schottky' if diode else 'Fuse')+', CC-BY-SA 4.0 with KiCad design exception. '+('Original nominal CAD is Adom MIT.' if diode else 'Generic Fuse_1206_3216Metric STEP is Copyright2020 kicad StepUp, CC-BY-SA4.0 with design exception; its header is preserved. Derived GLB retains that license. Source retrieved from adom/0466005-nrhf as generic geometry, not as proof of exact NR material identity.')+' Adom documentation and manufacturer-pattern transcription are MIT. Manufacturer PDF remains manufacturer copyright. See LICENSE-KICAD.md.\n')
 common='''\nThe component remains provisional. Native library validity, polarity/pin mapping, nominal geometry, process qualification and physical circuit acceptance are separate checks. The annotated hero contains nonphysical reference artwork; use the clean model in assemblies. STEP uses mm, GLB meters, Z up and seating at zero.\n'''
 if diode:
  text='''# B140-13-F Schottky rectifier

Diodes Incorporated 40 V, 1 A SMA Schottky rectifier. The 1 A rating is conditional on the datasheet's specified thermal conditions, not an arbitrary current rating at any board temperature. This exact -13-F part is SMA; the B140B part is SMB and is not the same footprint.

Pin 1 is cathode K, pin 2 anode A. The model's light band is on the cathode at negative X. In the electronic-load boost circuit D4, K connects to V_GATE and A to BOOST_SW. Verify the physical band and PCB orientation before assembly.

The original nominal model follows DS13002 Rev20-2 SMA dimensions: body4.3x2.65 mm, total span5.2 mm and body-top height2.18 mm. Lead width1.45 mm, nominal thickness0.2 mm. Taper, angular J-bends and band width are simplified; no internal die or production ink is represented. This is not manufacturer CAD and not a tolerance envelope.

The manufacturer suggested pattern has 2.5x1.7 mm pads, 4.0 mm center spacing, outer span6.5 mm and inner gap1.5 mm. Solder-mask, paste and courtyard still need process review. The board's generic SMA variant must be compared before adopting this footprint.

[Datasheet](https://www.diodes.com/datasheet/download/B130.pdf) · [Manufacturer product](https://www.diodes.com/part/view/B140)
'''
 else:
  text='''# 0466005.NR fast-acting fuse

Littelfuse 466-series 5 A, 32 V fuse in 1206 format, used as F1 in the electronic load. This record preserves the **NR** order code. NRHF adds the halogen-free suffix; do not claim the NR item is the NRHF item or transfer its environmental declarations without evidence.

The manufacturer series table gives 50 A interrupting capacity at32 VAC/VDC, nominal cold resistance0.011 ohm and nominal melting I²t1.6 A²s. These do not establish protection coordination with the MOSFET, wiring or DUT. Apply ambient/continuous-current derating and the time-current curve; a 5 A fuse is not a precise 5 A electronic current limit. Pins1/2 are interchangeable passive terminals.

The supplied generic KiCad model measures3.2x1.6x0.55 mm, within the nominal drawing ranges (3.175±0.127,1.524±0.127,0.584±0.076 mm). It is a package representation, not exact Littelfuse geometry, coating or the factory T rating mark. Generic source and derived GLB are CC-BY-SA4.0 with KiCad's exception, not MIT-only.

The candidate reflow footprint transcribes the drawing's rounded1.14x2.03 mm pads and3.81 mm outer span. Centers at±1.335 mm yield1.53 mm gap versus the drawing's rounded1.52 mm callout. This0.01 mm rounding reconciliation is explicit; process validation remains necessary. The existing board generic1206 footprint is a separate variant.

The bundled reference is the manufacturer's2015 series PDF mirrored by adom/0466005-nrhf. The current2023 series PDF accessible through the manufacturer web document retains the5 A electrical row and these package dimensions. The exact NR identity is also listed in the manufacturer's January2026 RoHS certificate. A source-hosted PDF is not authority to change the BOM suffix.

[Current manufacturer datasheet](https://www.littelfuse.com/assetdocs/fuse-466-datasheet?assetguid=dbe9bcd7-6072-4adf-bf5b-d33e52a6b90f) · [Exact NR certificate](https://www.littelfuse.com/assetdocs/coc-rohs10-0466005?assetguid=15ce1965-5372-4216-9f9b-39f72cd945bb)
'''
 (p/'README.md').write_text(text+common)
 (p/('skills/'+slug)).mkdir(parents=True,exist_ok=True)
 (p/('skills/'+slug+'/SKILL.md')).write_text(f'''---
name: {slug}
description: Use when importing {mpn}, checking its exact package identity, and reviewing polarity or protection limits.
---
# {mpn}

Parent skill: wiki-component.

Read README.md and provenance.json. Preserve exact MPN and package; do not substitute look-alike variants. {'Pin1 is cathode, band at negative X, pin2 anode. Check the actual band against the board.' if diode else 'NR is not NRHF. Pins are nonpolar. Preserve suffix identity and environmental-document scope.'}

Use the clean model in assemblies, not the annotated hero. Geometry is nominal and does not establish full tolerance fit. Keep the KiCad symbol/model attribution described in THIRD_PARTY.md.

Review the manufacturer land pattern against the actual solder process before changing copper. {'Review reverse voltage, peak and average current, forward drop and thermal conditions for the circuit.' if diode else 'Review time-current curves, ambient derating, interrupting capacity and fault coordination. A fuse rating is not an electronic current-limit setpoint.'}

Preserve project acceptance gates. No model or library check proves physical safety, solder qualification or circuit behavior.
''')
 prov={'part':mpn,'reviewDate':'2026-10-11','datasheet':{'primary':ds,'localSha256':hashlib.sha256((p/'datasheet.pdf').read_bytes()).hexdigest(),'localRevision':'DS13002 Rev20-2 April2023' if diode else 'Manufacturer2015 PDF mirrored from adom/0466005-nrhf; current2023 web document reviewed'},'model':{'kind':'Original Adom nominal SMA' if diode else 'Generic KiCad Fuse_1206_3216Metric','license':'MIT' if diode else 'CC-BY-SA-4.0 with KiCad design exception','source':'build_model.py' if diode else 'adom/0466005-nrhf:0466005-nrhf.step','limitations':['Nominal geometry only','No internal construction or complete tolerance envelope','Physical circuit acceptance remains open']},'symbol':{'source':'KiCad Device:D_Schottky' if diode else 'KiCad Device:Fuse','license':'CC-BY-SA-4.0 with KiCad design exception'},'qualification':'Provisional','visualReview':{'wiki':'pending; task browser closed by user'},'assetSha256':{}}
 (p/'provenance.json').write_text(json.dumps(prov,indent=2)+'\n')