Skip to content

fix(megasquirt): correct MIL channel data_type from boolean to bool - #1

Merged
SomethingNew71 merged 1 commit into
mainfrom
fix/megasquirt-mil-data-type
Aug 13, 2026
Merged

SomethingNew71 merged 1 commit into
mainfrom
fix/megasquirt-mil-data-type

Conversation

@SomethingNew71

Copy link
Copy Markdown
Contributor

Corrects a one-character typo that was silently disabling the whole MegaSquirt adapter downstream.

The MIL channel declares data_type: boolean, but the adapter schema's enum is
["float", "int", "bool", "string", "enum"]. Across every adapter in this repo the value appears
307 times as float, 12 as int, 2 as bool, and exactly once as boolean — this line — so it
is a typo, not an intended variant.

It matters more than a single field suggests: a consumer deserializing data_type into a closed
enum rejects the entire adapter document, not just the offending channel. That is what
happened in UltraLog — megasquirt-tunerstudio.adapter.yaml failed to parse on every launch, and
all of its channel-name normalisation went with it. UltraLog has since been made tolerant of the
misspelling (ClassicMiniDIY/UltraLog#81), but the data should be correct at the source.

Other validator findings

While confirming this fix I ran every adapter and protocol against the schemas in schema/. The
repo does not currently pass its own validator, and there is no CI running it, which is why
this shipped. Nothing below is changed in this PR — flagging it separately:

Adapters — 6/9 valid

  • megasquirt-tunerstudio — category: diagnostics is not in the schema's category enum, and
    file_format.header_row is required but absent
  • haltech-nsp — header_row/data_start_row use -1 as a sentinel, but the schema sets
    minimum: 0; timestamp_column/timestamp_unit are null where a string is required
  • emerald-lg — channels carry internal_id, which the schema disallows

Protocols — 4/9 valid

  • ecumaster-emu-broadcast — configurable_base_id, default_base_id
  • maxxecu-default — base_address, base_address_configurable
  • emtron-broadcast — byte_order at protocol level
  • megasquirt-broadcast — comment
  • rusefi-broadcast — offset on messages

Most of these look like the schema lagging the data rather than bad data — diagnostics is a
real category (UltraLog's own type already supports it), -1 is a meaningful "auto-detect"
sentinel, and the extra protocol keys look deliberate. So the fix is probably to widen the schemas
rather than strip the fields, but that is a judgement call per field and belongs in its own PR.

Worth adding scripts/validate-all.sh to CI once the schemas and data agree, so the next typo is
caught before it reaches consumers.

The adapter schema's data_type enum is [float, int, bool, string, enum];
"boolean" is not a member. Across all adapters the value appears 307 times as
float, 12 as int, 2 as bool and once as "boolean" — this MIL channel — so it is
a typo rather than an intended variant.

Consumers that deserialize data_type into a closed enum reject the whole
adapter on this one field, which is what happened in UltraLog: the entire
MegaSquirt TunerStudio adapter silently failed to load, taking its channel
normalisation with it (ClassicMiniDIY/UltraLog#81).
Copilot AI lite review requested due to automatic review settings August 12, 2026 17:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a schema-invalid data_type value in the MegaSquirt TunerStudio adapter so downstream consumers that deserialize data_type as a closed enum don’t reject the entire adapter document.

Changes:

  • Updates the MIL channel data_type from boolean to the schema-valid bool.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@SomethingNew71
SomethingNew71 merged commit 4abc749 into main Aug 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants