0.4.4 — 2026-05-14
Recipe safety guards, instruction annotation (VIN detection), patcher collision
safety, recipe provenance & fingerprinting, and full CLI/TUI surfacing of all
new signals. Repository moved to v-arapidis/openremap-core.
Added — Recipe Safety Guards (openremap/core/services/recipe_builder.py)
- Size match guard (hard error) —
build_recipe()now raisesValueErrorimmediately if the original and modified binaries are not the same size. No diff is run and no recipe is produced. ECU flash images are fixed-size; a mismatch almost always means two different ECU models or a corrupted file. - Identity match guard (warning, not fatal) — both binaries are identified
independently after the size check. If their
match_keyvalues differ a human-readable warning is recorded (accessible viacook_warnings()) and embedded inrecipe["ecu"]["cook_warnings"]. The recipe is still built so legitimate edge-cases (unknown / anonymised bins) are not blocked. cook_warnings()method — returns the list of non-fatal warnings produced during the lastbuild_recipe()call. Always returns a fresh copy; safe to call multiple times.check_size_match()/check_identity_match()— public guard methods exposed individually for programmatic use.
Added — Recipe Provenance & Fingerprinting (openremap/core/services/recipe_builder.py, openremap/core/schemas/analyzer.py)
creatorblock — every recipe now embeds acreatordict containing:tool("openremap-core"),tool_version,created_at(ISO 8601 UTC), optionalauthorsub-object,signature(reserved, currentlynull), and a derivedtrust_level.trust_level— four-tier provenance signal:UNSIGNED(no author info),COMMUNITY(author present, no signature),SIGNED(author + signature, future),VERIFIED(signed + platform-verified identity, future).fingerprint— deterministicsha256:…hash of the instruction content (offset + ob + mbtuples, sorted). Same tune always produces the same fingerprint regardless of metadata. Useful for deduplication and accidental corruption detection.- Schema version bumped from
4.0→4.1to reflect the new top-level fields (creator,fingerprint,openremapenvelope) and theflagslist on each instruction. - New Pydantic schemas —
InstructionFlagSchema,AuthorSchema,CreatorSchemaadded toopenremap/core/schemas/analyzer.py.AnalyzerResponseSchemaextended withopenremap,creator,fingerprint.
Added — Instruction Annotation / VIN Detection (openremap/core/services/annotator.py)
- New module
annotator.py— pluggable instruction annotation system that attaches non-destructive flags to suspicious instructions after diffing. Nothing is removed; the user decides what to do with flagged instructions. InstructionFlag— frozen dataclass withkind,reason,confidence(HIGH | MEDIUM | LOW), andaction(always"REVIEW").VINScanner— detects instructions that overlap with an ISO 3779 VIN-shaped byte sequence ([A-HJ-NPR-Z0-9]{17}) in the original binary. Uses a ±24-byte margin around the instruction to catch partial overlaps. Emits a singleVIN_SUSPECTflag per instruction (confidenceHIGH).RecipeAnnotator— runs all registered scanners over every instruction and attaches aflagslist (empty list when clean). Pluggable viaadd_scanner(). Helpers:flagged_count(),flag_summary().- Annotator wired into
build_recipe()—RecipeAnnotatorruns automatically at the end of every cook; every instruction in the produced recipe contains aflagskey.
Improved — Patcher Collision Safety (openremap/core/services/patcher.py)
- Overlapping write detection —
apply_all()now calls_find_overlapping_instructions()before writing a single byte. If any two instructions share overlapping byte ranges,ValueErroris raised with a detailed report listing every conflicting pair. The buffer is never touched. - Ambiguous match detection —
_find()now returns(absolute_offset, match_count). Whenmatch_count > 1, the result is flagged asPatchResult.ambiguous = Trueand a warning is appended toPatchResult.message. ambiguous_count()— new helper that counts ambiguous results afterapply_all().summarise()extended — the summary dict now includes an"ambiguous"key alongsidesuccess,failed, andshifted.
Improved — CLI (openremap/cli/commands/cook.py)
ValueErrorcaught explicitly — the size-mismatch hard error is now caught asValueError(before the genericExceptionhandler) and printed as a red error message; exits with code 1 without creating an output file.- Cook warnings surfaced —
analyzer.cook_warnings()is iterated after a successful cook; each warning is printed in bold yellow to stderr. - Flagged instructions listed — if any instructions carry flags, a yellow
banner is printed to stderr followed by a per-instruction breakdown:
0xOFFSET — KIND (CONFIDENCE): reason. - Summary table extended —
_print_summary()now shows⚠ Flagged(count of flagged instructions, only when >0) andTrust Levelrows.
Improved — TUI (openremap/tui/app.py)
CookDonemessage extended — carrieswarnings: listandflagged: listalongsiderecipeandoutput_path._do_cookupdated — collectsanalyzer.cook_warnings()and the flagged instruction list after a successful cook and passes them toCookDone.ValueError(size mismatch) is now caught explicitly._render_cook_resultextended — the result panel now shows:- Trust Level — colour-coded: yellow =
UNSIGNED, blue =COMMUNITY, green =SIGNED, bold green =VERIFIED. - ⚠ Flagged — count row, only shown when >0 flagged instructions.
- Fingerprint — truncated to
sha256:xxxxxxxxxxxxxxxx…for readability. - Cook warnings — each warning printed in bold yellow below the save path.
- Flagged instruction details — per-instruction breakdown in yellow with offset, kind, confidence, and reason.
- Trust Level — colour-coded: yellow =
Changed — Repository URL
- All GitHub URLs updated from
github.com/Openremap/openremap-coretogithub.com/v-arapidis/openremap-coreacrossREADME.md,pyproject.toml,CHANGELOG.md,docs/install/developers.md, andopenremap/tui/app.py. - Codecov badge URL updated to
codecov.io/gh/v-arapidis/openremap-core.
Fixed
__version__out of sync —openremap/__init__.pywas still on0.4.2whilepyproject.tomlwas0.4.3. Both are now0.4.4.
Tests
tests/tuning/test_annotator.py(new) — full suite forInstructionFlag,VINScanner(detection, no false positives, partial overlaps, adjacent boundary, lowercase non-match, single-flag-per-instruction), andRecipeAnnotator(flags on all instructions,flagged_count,flag_summary,add_scanner, empty list, in-place return, flag dict serialisation).tests/tuning/test_patcher_collision_safety.py(new) — exhaustive collision-safety suite: duplicateoboutside/inside±EXACT_WINDOW, sameobwith differentctx, empty-ctx exact-offset fallback, realistic engine vs ABS simulation, overlapping instruction detection, adjacent writes, snapshot isolation, ambiguous match flagging, existence validator, collateral damage checks, overlap edge cases.tests/tuning/test_recipe_creation_safety.py(new) — safety guard suite: size mismatch (all edge cases), identity mismatch (mockedidentify_ecu),cook_warnings()API (populated, embedded, cleared between calls, returns copy), raw diff scope (VIN, checksum, IMMO bytes all captured — documents intentional behaviour).tests/cli/test_cli_cook.py—test_cook_files_of_different_sizesupdated: now expectsexit_code == 1and no output file (previously expected success with mismatched-size metadata).tests/tuning/test_recipe_builder.py— assertions added forcreator,fingerprint,flagskey on instructions, and schema version4.1.