Modify BattleRunner.java to connect to external server and emit structured output #133
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Wayfinder child of: #126
Context
The current
tools/battle_runner/RunBattle.javausesBattleRunner.create()with.embeddedServer(). The test framework (#126) needs it to connect to an external TR server (started separately by the Nim framework with-Iflag) and print structured output to stdout that Nim can parse.Requirements
BattleRunner.create()to connect to an external server URL (passed as CLI arg or env var)Blocked by
Nothing
Blocks
#127, #130
Spec addition from grilling
The structured stdout format is the contract between Java and Nim. Recommend JSON-lines, one JSON object per event:
{"event":"ready"}— server connected{"event":"round_end","round":1,"results":[{"name":"Bot1","score":100,"rank":1},...]}{"event":"battle_end","winners":["Bot1"],"total_rounds":10,"results":[...]}This format must be co-designed with #127 (the Nim parser). Implement parser and emitter together or define the schema first.
BattleRunner process timeout: 30s after last output line.
Implemented in commit
57a1915.