Skip to content

fix(adapters): use bool data_type for MegaSquirt MIL channel - #2

Merged
SomethingNew71 merged 1 commit into
mainfrom
claude/cranky-joliot-9092d2
Aug 24, 2026
Merged

SomethingNew71 merged 1 commit into
mainfrom
claude/cranky-joliot-9092d2

Conversation

@SomethingNew71

@SomethingNew71 SomethingNew71 commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Problem

GET /api/adapters logged a Zod validation error on every request and silently omitted the MegaSquirt adapter from the response:

Invalid adapter YAML megasquirt/megasquirt-tunerstudio: ... channels[19].data_type

Cause

specs/adapters/megasquirt/megasquirt-tunerstudio.adapter.yaml declared data_type: boolean on the mil channel (index 19). AdapterChannelSchema in server/schemas/adapter.ts accepts float | int | bool | string | enumboolean is not a member.

Because safeParse fails the whole document, server/api/adapters.get.ts:46 logged the error and returned null for that adapter, so MegaSquirt never reached the listing or the marketplace UI.

Fix

One line: booleanbool. This was the only boolean in specs/; the two other bool-typed channels in the repo already used bool.

Verification

1. Live GET /api/adapters on this PR's Vercel preview deployment — HTTP 200, 9 adapters, MegaSquirt present:

{
  "id": "megasquirt-tunerstudio",
  "name": "MegaSquirt TunerStudio Datalog",
  "version": "1.0.0",
  "vendor": "megasquirt",
  "channelCount": 21,
  "categories": ["engine","electrical","pressure","fuel","ignition","temperature","speed","drivetrain","diagnostics"],
  "fileFormat": "csv",
  "extensions": [".csv"]
}

Vendors returned: aim, ecumaster, emerald, haltech, link, megasquirt, romraider, rusefi, speeduino — all 9, none dropped.

2. All nine adapter YAMLs parsed against the project's own AdapterYamlSchema:

  OK   speeduino/speeduino-mlg  (22 channels)
  OK   ecumaster/ecumaster-emu-csv  (33 channels)
  OK   haltech/haltech-nsp  (37 channels)
  OK   romraider/romraider-csv  (27 channels)
  OK   link/link-llg  (57 channels)
  OK   megasquirt/megasquirt-tunerstudio  (21 channels)
  OK   rusefi/rusefi-mlg  (46 channels)
  OK   emerald/emerald-lg  (32 channels)
  OK   aim/aim-xrk  (47 channels)

valid=9 invalid=0

Channel 19 now parses as {"id":"mil", ..., "data_type":"bool", ...}.

The mil channel declared data_type: boolean, which is not in the
AdapterChannelSchema enum (float | int | bool | string | enum). Zod
rejected the whole file, so adapters.get.ts skipped megasquirt from
GET /api/adapters and logged the validation error on every request.
Copilot AI lite review requested due to automatic review settings August 24, 2026 00:24
@vercel

vercel Bot commented Aug 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
open-ecu-alliance Ready Ready Preview Aug 24, 2026 12:25am

Request Review

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 Zod validation failure that caused the MegaSquirt adapter YAML to be rejected and omitted from GET /api/adapters, by aligning the adapter channel data_type value with the server’s AdapterChannelSchema.

Changes:

  • Update MegaSquirt mil channel data_type from boolean to bool to match z.enum(['float','int','bool','string','enum']).
  • Ensure the MegaSquirt adapter YAML can pass schema validation and be included in the adapters listing.

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

@SomethingNew71
SomethingNew71 merged commit 3cad1c6 into main Aug 24, 2026
3 checks passed
@SomethingNew71
SomethingNew71 deleted the claude/cranky-joliot-9092d2 branch August 24, 2026 00:33
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