Skip to content

Implement full EFP2 command set#13

Merged
seigel merged 10 commits intomainfrom
claude/magical-hodgkin
Mar 4, 2026
Merged

Implement full EFP2 command set#13
seigel merged 10 commits intomainfrom
claude/magical-hodgkin

Conversation

@seigel
Copy link
Copy Markdown
Owner

@seigel seigel commented Mar 4, 2026

Summary

  • Implements all 18 EFP2 protocol commands as individual parsers in src/commands/, each following the established register/parse pattern
  • Adds a test file per command covering registration, invalid token lengths, and all parsed fields
  • Expands the cyrano.test.js protocol round-trip suite to cover every command end-to-end through process(), fixes mislabelled test names, and removes a stale skipped test
  • Adds CLAUDE.md with build/test commands, architecture overview, and full EFP2 protocol reference (node topology, command table, field layouts, piste/competition codes, Master state machine)

Commands implemented

ACK NAK BOUTSTOP BROKEN DENY DISP GETTEAM HELLO INFO MSG NEXT PING PREV REPLACE STANDBY STOP TEAM UPDATED

Test plan

  • npm test passes (20 suites, 188 passing, 3 skipped)
  • Review command field mappings against the Cyrano 2.0 protocol spec PDF
  • Spot-check INFO (42 tokens) and TEAM (20 tokens) parsed output shapes

🤖 Generated with Claude Code

seigel and others added 10 commits March 3, 2026 21:30
Adds parser and tests for the EFP2 REPLACE command, which reports a
team member substitution on a piste (piste code, side, fencer number 1-3).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds parser and tests for the EFP2 BOUTSTOP command, which cancels a
previously sent DISP and clears the bout on the given piste.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds parser and tests for the EFP2 TEAM command, which transfers the
list of team members for one side on a piste. Parses 4 members (3 active
+ reserve), 9 round fencer assignments, and a unique team ID.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds parsers and tests for the remaining simple EFP2 commands:
- NEXT/PREV: referee requests next/previous match (1 param: piste)
- STANDBY: switch apparatus to sleep mode (1 param: piste)
- BROKEN: report lost contact with piste (1 param: piste)
- UPDATED: notify clients that competition XML data has changed (2 params: eventId, competitionCode)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds parser and tests for the EFP2 INFO command, the primary piste state
message. Parses 42 tokens covering bout metadata (piste, event, phase,
round, state, stopwatch), referee flags (remote control, priority, calls
for technician/video/doctor/DT, reverse, standby), and full scoring data
for both fencers (id, name, nation, score, cards, lamps, video reviews).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Completes the full EFP2 command set:
- ACK/NAK: zero-param bout result acknowledgements from server to master
- GETTEAM: request team list from Server of Results (piste, side)
- DENY: rejection response with reason string

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds round-trip tests for all 18 EFP2 commands through process(),
an unknown command test, fixes three mislabelled test names ('ping'
was used for STOP and MSG), and removes the stale skipped DISP test
that referenced an outdated output shape.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…f-concept)

Introduces a symmetric build/compose architecture that mirrors the existing
parse/process pipeline. `build()` returns a token array, `registerBuilder()`
registers it per command, and `compose()` at the protocol layer assembles the
full |EFP2|COMMAND|...| wire string. Round-trip tests verify parse→compose
fidelity for HELLO with and without a piste code.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds build() and registerBuilder() to all remaining 17 commands, registers
every builder in commands/index.js, and adds #registerBuilder + #build unit
tests to each command file. Protocol-level round-trip tests (compose ∘ process)
are added for all 18 commands in cyrano.test.js.

Test count grows from 195 → 246 passing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two UDP actors on loopback — Server (port 50100) and Master/piste RED
(port 50101) — walk through the complete lifecycle specified in the EFP2
protocol: HELLO → DISP → INFO(Not active) → INFO(Fencing) ×8 →
INFO(Ending) → ACK → INFO(Not active). The wire bytes logged at each
step are produced by compose() and consumed by process().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@seigel seigel merged commit b1a47e4 into main Mar 4, 2026
3 checks 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.

1 participant