Skip to content

Conversation

@makrsmark
Copy link
Collaborator

@makrsmark makrsmark commented Jan 23, 2026

Summary by CodeRabbit

  • New Features

    • Added Honeywell Label 16 Position Report decoder plugin to decode positions, routes/waypoints, and departure/arrival airport data.
  • Tests

    • Added comprehensive unit tests covering valid variants and negative cases.
  • Chores

    • Registered the new plugin in the official plugin list for availability.

✏️ Tip: You can customize this high-level summary in your review settings.

Copy link
Contributor

Copilot AI left a comment

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 adds support for parsing Honeywell Label 16 position reports with the "(2" preamble and "(Z" suffix. The decoder extracts session IDs, coordinates, and routing information (either waypoint-based or airport-based).

Changes:

  • Adds a new decoder plugin for Honeywell Label 16 messages
  • Registers the new plugin in the MessageDecoder
  • Exports the new plugin from the official plugins module

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
lib/plugins/official.ts Exports the new Label_16_Honeywell plugin
lib/plugins/Label_16_Honeywell.ts Implements the Honeywell Label 16 decoder with position and routing extraction
lib/plugins/Label_16_Honeywell.test.ts Provides test coverage for the three message variants and invalid input handling
lib/MessageDecoder.ts Registers the Label_16_Honeywell plugin in the decoder

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coderabbitai
Copy link

coderabbitai bot commented Jan 23, 2026

Walkthrough

Registers and exports a new decoder plugin, Label_16_Honeywell, and adds its implementation and unit tests. The plugin parses Honeywell Label 16 position reports, extracting coordinates and either waypoints or departure/arrival airports.

Changes

Cohort / File(s) Summary
Plugin Implementation
lib/plugins/Label_16_Honeywell.ts
Adds Label_16_Honeywell class (extends DecoderPlugin) with name, qualifiers(), and decode(...). Validates (2... (Z) messages, decodes coordinates, branches into waypoint or route parsing, and returns a DecodeResult.
Plugin Tests
lib/plugins/Label_16_Honeywell.test.ts
New unit tests covering metadata, three valid decode variants (position, route/waypoints, formatted items), and a negative case for non-matching input.
Registration & Export
lib/MessageDecoder.ts, lib/plugins/official.ts
Registers Label_16_Honeywell in MessageDecoder constructor and re-exports it from lib/plugins/official.ts.

Sequence Diagram(s)

(No sequence diagram generated — change is a new plugin implementation without multi-component sequential flow requiring visualization.)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • kevinelliott

Poem

🐰 I nibble through bytes, a tiny delight,
Label Sixteen glows in the moonlight.
Coordinates hop into place with cheer,
Waypoints and routes now draw near.
Hooray — new decoder, a carrot-worthy sight!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Label 16 (2 (Z parsing' directly summarizes the main change: implementing a decoder for Honeywell Label 16 messages with the specific format markers (2 and (Z.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@lib/plugins/Label_16_Honeywell.ts`:
- Around line 18-76: In decode (method decode in Label_16_Honeywell.ts) add
strict length and format guards before slicing the payload: validate
message.text has the expected minimal length and that between (the substring
between "(2" and "(Z") is long enough for each planned substring index (e.g.,
session id, coordinate slice between.substring(4,17), indices 17-28, and the
trailing 2 chars); catch and handle exceptions from
CoordinateUtils.decodeStringCoordinatesDecimalMinutes and treat any parse error
as a failed decode by setting decodeResult.decoded = false and
decodeResult.decoder.decodeLevel = "none" (and log when options.debug), and
ensure ResultFormatter.* calls only run when the guards pass so malformed/short
payloads do not throw or leave the result marked as decoded.
🧹 Nitpick comments (1)
lib/plugins/Label_16_Honeywell.test.ts (1)

22-66: Consider passing label: "16" in test messages for realism.
This keeps tests aligned with MessageDecoder usage and future-proofs if Message becomes stricter.

♻️ Proposed refactor
 describe("Label_16_Honeywell", () => {
   let plugin: Label_16_Honeywell;
+  const decode = (text: string) => plugin.decode({ label: "16", text });

   beforeEach(() => {
     const decoder = new MessageDecoder();
     plugin = new Label_16_Honeywell(decoder);
   });
@@
   test("decodes variant 1", () => {
     const text = "(2AAABN39211W 77144KTEBMMTO-/A(Z";
-    const decodeResult = plugin.decode({ text: text });
+    const decodeResult = decode(text);
@@
   test("decodes variant 2", () => {
     const text = "(2AAAAN37265W 78334-SSI  /O(Z";
-    const decodeResult = plugin.decode({ text: text });
+    const decodeResult = decode(text);
@@
   test("decodes variant 3", () => {
     const text = "(2AAABN37197W 78404-SLOJOGRONK/O(Z";
-    const decodeResult = plugin.decode({ text: text });
+    const decodeResult = decode(text);
@@
   test("does not decode <invalid>", () => {
     const text = "(2 Bogus message";
-    const decodeResult = plugin.decode({ text: text });
+    const decodeResult = decode(text);

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.

1 participant