0.4.2 — 2026-04-03
EDC16 hardware-number extraction fix, evidence-based detection system, confidence scoring reframed as identification quality, and documentation consistency pass.
Fixed — EDC16 Extractor
- Hardware number extraction —
_resolve_hardware_number()was too narrow (only searched the calibration area for0281xxxxxx). BMW EDC16C31/C35 and some VAG PD bins store the HW number in the boot sector or active header and were missed entirely. The method now searches five regions in priority order: active header → calibration area → extended active window → boot sector → full-binary fallback. Supports spaced/dotted variants (0.281.xxx.xxx) with normalisation. - OEM part number extraction — new
_resolve_oem_part_number()method extracts vehicle-manufacturer part numbers (VAG format03G906016J, BMW format12 14 7 626 350). Previously hardcoded toNone. ecu_familyvsecu_variantclassify bug —ecu_familywas set to the variant string (e.g.EDC16C8) instead of the canonicalEDC16, causing--organizeto create a folder per variant instead of a singlescanned/Bosch/EDC16/directory. Nowecu_familyis always"EDC16"; the specific sub-variant is stored only inecu_variant.
Added — Evidence-Based Detection
- Evidence tag system in
BaseManufacturerExtractor— 16 standard evidence-tag constants across three categories: structural (SIZE_MATCH,MAGIC_MATCH,HEADER_MATCH,POINTER_TABLE,LAYOUT_FINGERPRINT,BOOT_BLOCK), identity (FAMILY_STRING,DETECTION_SIGNATURE,IDENT_BLOCK,FAMILY_ANCHOR), and cross-check (EXCLUSION_CLEAR,FILL_PATTERN,SYNC_MARKER,MANUFACTURER_CONFIRM). DetectionResultdataclass — rich return type wrappingmatched: boolandevidence: Tuple[str, ...]for future migration ofcan_handle().- Instance plumbing —
_last_evidenceattribute,_set_evidence()helper, andlast_detection_evidenceproperty on the base class. detection_evidencefield added to the identity dict inidentifier.py— the service reads evidence tags aftercan_handle()and passes them through to the result.- Scan CLI now injects
detection_evidenceanddetection_strengthfrom the extractor instance into the identity dict before scoring, ensuring evidence-based scoring works in batch mode.
Changed — Confidence Scoring
- Reframed as identification quality — the score measures how reliably the system detected and extracted identity fields, not whether the binary content is unmodified. A tuned file with intact ident blocks scores identically to a stock file. All docstrings, CLI help text, and documentation updated to reflect this.
DetectionStrengthenum deprecated — retained as a fallback for extractors not yet upgraded to evidence tags; marked with.. deprecated::docstring.- No scoring weights or tier thresholds were changed.
Changed — Documentation
confidence.mdrewritten around the identification framing; tier descriptions, signal explanations, and filename-penalty rationale all updated.about.md— added "Learn more" cross-reference section linking to CLI ref, recipe format, confidence, contributing, and disclaimer.commands/identify.md— tier descriptions aligned with new confidence framing; added "See also" section.commands/cook.md—validate strict→validate before; added "See also" links.commands/families.md—CONTRIBUTING.mdplain text → proper markdown link.recipe-format.md— added "See also" section and back-navigation link.bosch-internals.md— tier thresholds updated (Medium 25–54, Low 0–24, Suspicious < 0); added link toconfidence.md.
Tests
- 4,751 tests passing (up from 4,734 in 0.4.1).
- 18 new EDC16 test methods across two new test classes:
TestExtractHardwareNumberExpanded(11 tests — active header, boot region, mirror region, petrol format, spaced/dotted normalisation, region priority, 2 MB extended window) andTestExtractOemPartNumber(6 tests — absent OEM, key presence, VAG detection, suffix letters, space normalisation, type checking).