Skip to content

fix(psi-pro): correct two invalid psi.mode examples + test every example - #5

Merged
travisccook merged 1 commit into
mainfrom
fix/psi-invalid-examples
Jul 6, 2026
Merged

fix(psi-pro): correct two invalid psi.mode examples + test every example#5
travisccook merged 1 commit into
mainfrom
fix/psi-invalid-examples

Conversation

@travisccook

Copy link
Copy Markdown
Owner

Found by strengthening the examples round-trip test to check all examples, not just the first (the gap that also hid the negative-int engine bug).

psi.mode (template {address}T{mode}, both enums) had two examples referencing codes not in the psi.mode enum:

  • 5T03 — the code is 3, not 035T3 (Rear, Slow Flash)
  • 0T6 — there is no mode 60T1 (All, Reset — preserves the address-0 'All' demo with a valid mode)

Both now round-trip to a structured, editable step. Also strengthens the round-trip test to exercise every example, and bumps libraryVersion 2.2.0 → 2.2.1 (manifest + releases.json + test assertions in sync). 137 tests pass; validator green.

The examples-round-trip test only exercised examples[0], hiding that psi.mode's
other two examples referenced enum codes not in psi.mode: 5T03 (code is '3', not
'03') and 0T6 (no code '6' at all). Both failed to parse back to a structured step.

- Fix data: 5T03 -> 5T3 (Rear, Slow Flash); 0T6 -> 0T1 (All, Reset). Both valid.
- Strengthen the round-trip test to exercise EVERY example, not just the first —
  this is what would have caught it (and the negative-int bug) in CI.
- Bump libraryVersion 2.2.0 -> 2.2.1 (manifest + releases.json in sync) and the
  version assertions in the tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@travisccook
travisccook merged commit 01ea108 into main Jul 6, 2026
2 checks passed
@travisccook
travisccook deleted the fix/psi-invalid-examples branch July 6, 2026 21:27
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review

Checks — all green.

  • npm ci — clean install (272 packages, no errors; only pre-existing npm audit advisory, unrelated).
  • npm run validate — passes for all 9 boards + cross-file check, including boards/psi-pro.json.
  • npm test — 7 suites / 137 tests pass, including the newly strengthened test/web.test.js round-trip check.

What this PR does. Pure data fix in libraries/boards/psi-pro.json:104-108: two psi.mode command examples referenced enum codes that don't exist —5T03 (valid code is "3", not "03"; there's no zero-padding on this param) and 0T6 (there's no "6" in the psi.mode enum at libraries/boards/psi-pro.json:21-65, which only has 1,3,5,9,11,13,15,17,18,92). Fixed to 5T3 (Rear / Slow Flash) and 0T1 (All / Reset), both valid.

Board-contribution rules — all satisfied:

  • examples present (unchanged, still 3 per command). ✅
  • Placeholder ↔ param mapping for {address}T{mode} untouched by this PR and still valid. ✅
  • param.enum refs (psi.address, psi.mode) resolve; unaffected by this change. ✅
  • Command ids unaffected (no new/renamed commands). ✅
  • libraries/manifest.json bumped 2.2.02.2.1 (correct patch bump per semver rules — this is a data/example fix, not a new command or breaking rename). releases.json updated in lockstep (version + notes) and test assertions in test/engine.test.js, test/load-node.test.js follow suit. ✅
  • confidence: "high" on psi-pro is pre-existing and untouched by this diff — out of scope here, not a regression.

Safety-class check: psi.mode (libraries/boards/psi-pro.json:88) is an LED-effect display command (safety: "cosmetic") — correctly cosmetic, not movement/power. No mislabeling introduced by this PR. No src/*.js changes in this diff, so the engine/UI/round-trip invariant is untouched.

Nice catch, worth calling out: the real value-add here is test/web.test.js:56-63 — the round-trip example test previously only checked cmd.examples[0], silently ignoring examples 2 and 3, which is exactly how these two bad codes went unnoticed. The PR changes it to loop over every example. This is a good, minimal, low-risk hardening of CI that will catch this class of bug in future board PRs — no concerns with the approach.

No issues found. LGTM from a data/process standpoint.

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