The current tools/battle_runner/RunBattle.java uses BattleRunner.create() with .embeddedServer(). The test framework (#126) needs it to connect to an external TR server (started separately by the Nim framework with -I flag) and print structured output to stdout that Nim can parse.
Requirements
Modify BattleRunner.create() to connect to an external server URL (passed as CLI arg or env var)
Define a structured stdout output format (recommend JSON-lines) that includes: round results, winners, scores, per-bot results, total ticks
This output format is the contract that #127's parser implements — co-design them
Accept battle configuration as CLI args: bot paths, number of rounds, arena size
## Wayfinder child of: #126
### Context
The current `tools/battle_runner/RunBattle.java` uses `BattleRunner.create()` with `.embeddedServer()`. The test framework (#126) needs it to connect to an **external** TR server (started separately by the Nim framework with `-I` flag) and print structured output to stdout that Nim can parse.
### Requirements
- Modify `BattleRunner.create()` to connect to an external server URL (passed as CLI arg or env var)
- Define a structured stdout output format (recommend JSON-lines) that includes: round results, winners, scores, per-bot results, total ticks
- This output format is the **contract** that #127's parser implements — co-design them
- Accept battle configuration as CLI args: bot paths, number of rounds, arena size
- Exit cleanly when battle completes
### Blocked by
Nothing
### Blocks
#127, #130
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.
## 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.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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.