Define BattleResult type and server output parser #127

Closed
opened 2026-08-30 10:22:01 +02:00 by SirStone · 2 comments
Owner

Wayfinder child of: #126

Design the BattleResult type (rounds, winners, scores, ticks, per-bot results) and implement parsing of the Java battle runner's stdout into it. This is the contract the whole framework is built on.

Blocked by: nothing

Grilling Revisions

Parser file: lives in common_libs/test_framework/parser.nim (not test_framework.nim). Named parser.nim to avoid confusion with test files.

BattleResult fields — full score breakdown:

  • Per bot: rank, name, totalScore, survival, lastSurvivorBonus, bulletDamage, bulletKillBonus, ramDamage, ramKillBonus, firstPlaces, secondPlaces, thirdPlaces
  • Per round: seq[RoundResult] with roundNumber, turnCount, winner

Output contract — stdout/stderr split:

  • Parser only reads stdout (lifecycle markers + results block).
  • Diagnostic output goes to stderr — parser never sees it.
  • Runner must be updated to print per-round winner in the results block.

Tests: common_libs/test_framework/tests/test_parser.nim

**Wayfinder child of:** #126 Design the `BattleResult` type (rounds, winners, scores, ticks, per-bot results) and implement parsing of the Java battle runner's stdout into it. This is the contract the whole framework is built on. **Blocked by:** nothing ### Grilling Revisions **Parser file**: lives in `common_libs/test_framework/parser.nim` (not `test_framework.nim`). Named `parser.nim` to avoid confusion with test files. **BattleResult fields — full score breakdown:** - Per bot: `rank`, `name`, `totalScore`, `survival`, `lastSurvivorBonus`, `bulletDamage`, `bulletKillBonus`, `ramDamage`, `ramKillBonus`, `firstPlaces`, `secondPlaces`, `thirdPlaces` - Per round: `seq[RoundResult]` with `roundNumber`, `turnCount`, `winner` **Output contract — stdout/stderr split:** - Parser only reads stdout (lifecycle markers + results block). - Diagnostic output goes to stderr — parser never sees it. - Runner must be updated to print per-round winner in the results block. **Tests**: `common_libs/test_framework/tests/test_parser.nim`
SirStone added the wayfinder:task label 2026-08-30 10:22:01 +02:00
Author
Owner

Dependency correction

Blocked by: #133 (not "nothing" as originally stated). The parser cannot be implemented until #133 defines the structured stdout output format from BattleRunner.java.

## Dependency correction Blocked by: #133 (not "nothing" as originally stated). The parser cannot be implemented until #133 defines the structured stdout output format from BattleRunner.java.
Author
Owner

Implemented in commit 57a1915.

Implemented in commit 57a1915.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SirStone/SirRoboGarage#127