Skip to content

test: refresh fixtures for canboat 8.0.0 and require ts-pgns 2.0.0 - #455

Draft
keesverruijt wants to merge 4 commits into
masterfrom
fix/129540-gnss-system-fixture
Draft

test: refresh fixtures for canboat 8.0.0 and require ts-pgns 2.0.0#455
keesverruijt wants to merge 4 commits into
masterfrom
fix/129540-gnss-system-fixture

Conversation

@keesverruijt

@keesverruijt keesverruijt commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Draft — blocked on canboat/ts-pgns#53.
test.yml runs npm ci, and this branch now requires @canboat/ts-pgns@^2.0.0, which is not published yet — CI cannot even install until ts-pgns#53 lands and is released. Un-draft then.

Brings the fixtures up to canboat 8.0.0 (released 2026-08-25), which reaches canboatjs through ts-pgns 2.0.0. No library code needed changing: the decoder already reads to end-of-data, so the newly authored MinLength costs it nothing, and no source file referenced a manufacturer name that 8.0.0 renamed or dropped.

Field renames and additions

test/pgns/129540.jsreserved11gnssSystem (30 occurrences). canboat #792 decodes the 4 bits after Status in each satellite record as a GNSS System lookup. The device in these fixtures leaves the nibble at 0xF (unavailable), so the value is null either way — only the key changes.

test/pgns/130845.js — refreshed for the layout canboat adopted between 6.2.x and 7.1.0: displayGroupnetworkGroup, minlengthoperation, and repeatIndicator/reserved7/spare9 replaced by instance/source. The encode direction previously wrote 0xff at offset 9 because the stale fixture had no field for that byte; with operation: 'Set' present it round-trips to the original 01 exactly. Fixture drift, not an encoder bug.

test/pgns/129039.js, 129793.js, 129794.js — 8.0.0 gives all three AIS PGNs their trailing Sequence ID; 129793 also gains spare15 and reserved16.

test/pgns/130824.js — the Maretron annunciator fields are named now: field4/field5/field6/field8annunciatorInstance/annunciatorState/pattern/alertId.

Short captures — the new encoded fixture key

Three of these captures are shorter than the definition they now decode against. That is exactly what canboat 8.0.0 records as MinLength: the device was built against the earlier layout and stops transmitting where that layout ended.

Decoding accepts them unchanged. Encoding always writes the full definition, so the round-trip no longer reproduces the recorded frame — by design, not by defect. A fixture can now name the frame it re-encodes to in encoded, leaving the real capture as the decode input:

fixture captured re-encodes to
129793 AIS UTC and Date Report 36 bytes 39
129794 AIS Class A Static and Voyage 75 bytes 76
130850 Simnet Command AP NoDrift 11 bytes 12

test/test.js reads test.encoded || test.input in the encode direction; every other fixture is untouched.

package.json

@canboat/ts-pgns ^1.11.9^2.0.0. The old range still resolves the published 1.11.18 and its canboat 6.2.0 definitions, against which these fixtures fail by design.

Note on 130850 — decode side unchanged

master currently fails 4× on 130850 against the published ts-pgns, and "Node.js CI & Test" has been red since the #447 merge on 2026-06-29. That is not a canboatjs defect: those fixtures are already correct for canboat 7.x/8.x and only fail against the older published package. Three of the four pass here unmodified; the fourth is the NoDrift short capture above, which needed the encoded key rather than a fixture rewrite.

(Closed PR #448 attempted these same 130850 fixtures from the other direction.)

Verification

Built ts-pgns from canboat 8.0.0 and linked it in:

ts-pgns built from canboatjs result
published 1.11.18 (canboat 6.2.0) 188 pass, 4 fail — 130850
canboat 8.0.0, before this PR 178 pass, 14 fail
canboat 8.0.0 + this PR 136 jest + 192 mocha, 0 failing

npm run ci-lint clean (eslint + prettier --check lib test).

🤖 Generated with Claude Code

canboat #792 decodes the 4 reserved bits after Status in each PGN 129540
satellite record as a GNSS System lookup (GPS/GLONASS/Galileo/BeiDou/QZSS),
so the parser now emits gnssSystem where it used to emit reserved11.

The device in these fixtures leaves the nibble at 0xF (unavailable), so the
value is null either way -- only the key changes.

Requires @canboat/ts-pgns built from canboat >= 8.0.0-beta1. Against the
currently published ts-pgns (canboat 6.2.0) this fixture fails, so it must
land after ts-pgns publishes from canboat 8.x.
canboat reworked PGN 130845 between 6.2.x and 7.1.0; the fixtures still
described the old field set. displayGroup is now networkGroup, minlength
is now operation, and repeatIndicator/reserved7/spare9 are gone in favour
of instance and source.

The bytes are unchanged -- only the field names and shape moved. The
encode direction previously wrote 0xff at offset 9 because the stale
fixture had no field for that byte; with operation: 'Set' present it
round-trips to the original 01 exactly, so this was fixture drift and not
an encoder bug.

Verified against ts-pgns built from canboat 8.0.0-beta1: full suite green,
136 jest + 192 mocha, and npm run ci-lint clean.
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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.

keesverruijt and others added 2 commits August 25, 2026 16:51
canboat 8.0.0 appends a trailing Sequence ID to the three AIS PGNs
(129039, 129793 -- which also gains spare15 and reserved16 -- and 129794),
and names the Maretron annunciator fields that 130824 carried as field4,
field5, field6 and field8: annunciatorInstance, annunciatorState, pattern
and alertId.

Three of these captures are shorter than the definition they now decode
against, which is what canboat records as MinLength: the device was built
against the earlier layout and stops transmitting where that layout ended.
Decoding accepts them unchanged, but encoding always writes the full
definition, so a fixture can now name the frame it re-encodes to in
`encoded` -- 129793 (36 -> 39 bytes), 129794 (75 -> 76) and the 130850
NoDrift command (11 -> 12). The recorded capture stays the decode input.

136 jest + 192 mocha pass, 0 failing, against ts-pgns built from canboat
8.0.0. ci-lint clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The fixtures on this branch decode against canboat 8.0.0, which ts-pgns
publishes as 2.0.0 -- a major, because canboat corrected 78
MANUFACTURER_CODE names and dropped 8 duplicate codes. ^1.11.9 would still
resolve the published 1.11.18 and its canboat 6.2.0 definitions.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@keesverruijt keesverruijt changed the title test: refresh 129540 and 130845 fixtures for canboat 8.0.0-beta1 test: refresh fixtures for canboat 8.0.0 and require ts-pgns 2.0.0 Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant