Skip to content

Commit fd06b97

Browse files
Merge pull request #246 from robocode-dev/ch-030-resume-rumble-client
feat(CH-030): require Runner behavior compatibility
2 parents 771a6d9 + 3740cb3 commit fd06b97

20 files changed

Lines changed: 301 additions & 18 deletions

File tree

.clue/id-ledger.yaml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
counters:
2-
ADR: "45"
2+
ADR: "46"
33
AN: "1"
44
ARCH: "26"
55
C: "4"
66
CAP: "17"
7-
CH: "29"
7+
CH: "30"
88
G: "1"
99
GTD: "1"
10-
IDR: "3"
10+
IDR: "4"
1111
LOG: "1"
1212
P: "3"
1313
PDR: "12"
@@ -238,6 +238,11 @@ entries:
238238
state: live
239239
prefix: ADR
240240
component: "45"
241+
- id: ADR-046
242+
kind: numeric
243+
state: live
244+
prefix: ADR
245+
component: "46"
241246
- id: AN-001
242247
kind: numeric
243248
state: live
@@ -624,6 +629,17 @@ entries:
624629
- id: CH-029-tasks
625630
kind: opaque
626631
state: live
632+
- id: CH-030
633+
kind: numeric
634+
state: live
635+
prefix: CH
636+
component: "30"
637+
- id: CH-030-open-questions
638+
kind: opaque
639+
state: live
640+
- id: CH-030-tasks
641+
kind: opaque
642+
state: live
627643
- id: G-001
628644
kind: numeric
629645
state: live
@@ -649,6 +665,11 @@ entries:
649665
state: live
650666
prefix: IDR
651667
component: "3"
668+
- id: IDR-004
669+
kind: numeric
670+
state: live
671+
prefix: IDR
672+
component: "4"
652673
- id: LOG-001
653674
kind: numeric
654675
state: retired

.github/workflows/clue.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# `clue validate --forbid-changes`, and the full-loop acceptance-brief gate — lives in
88
# Cliewen's reusable workflow, so upstream fixes arrive by updating one
99
# reference instead of by re-copying steps. Only the triggers below and the
10-
# four inputs are ours to choose.
10+
# five inputs are ours to choose.
1111
#
1212
# `clue-source: release` downloads the binary from the pinned Cliewen release
1313
# and verifies it against that release's own SHA256SUMS; this repository
@@ -21,16 +21,19 @@
2121
# while a SHA names one tree forever. A branch reference must never be used
2222
# here.
2323
#
24-
# The `edited` trigger and the upstream unit's fetch-depth 0 are load-bearing:
25-
# the acceptance-brief gate must re-run when a pull-request body changes, and
26-
# change detection needs the base commit.
24+
# The `edited` and `ready_for_review` triggers and the upstream unit's fetch-depth
25+
# 0 are load-bearing: the acceptance-brief gate must re-run when a pull-request
26+
# body changes or a draft becomes a merge candidate, and change detection needs
27+
# the base commit. With those triggers in place, `draft-aware` lets unfinished
28+
# drafts retain their transient change workspace without weakening the ready or
29+
# main-branch gate.
2730
name: Clue
2831

2932
on:
3033
push:
3134
branches: [main]
3235
pull_request:
33-
types: [opened, synchronize, reopened, edited]
36+
types: [opened, synchronize, reopened, edited, ready_for_review]
3437
workflow_dispatch:
3538

3639
permissions:
@@ -45,3 +48,4 @@ jobs:
4548
clue-version: 0.20.0
4649
clue-source: release
4750
clue-install-directory: ''
51+
draft-aware: true

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## [1.2.0] - Unreleased - Runner compatibility precondition
2+
3+
### 🚀 Improvements
4+
5+
- Runner:
6+
- Added an optional behavior-version precondition that rejects incompatible servers before starting bot processes.
7+
18
## [1.1.0] - 2026-08-04 - Rumble foundations
29

310
### 🐞 Bug Fixes

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1.0
1+
1.2.0

bot-api/typescript/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ npm install @robocode.dev/tank-royale-bot-api
2626
To install a specific version:
2727

2828
```bash
29-
npm install @robocode.dev/tank-royale-bot-api@1.1.0
29+
npm install @robocode.dev/tank-royale-bot-api@1.2.0
3030
```
3131

3232
The `ws` package is required at runtime in a Node.js environment:

bot-api/typescript/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bot-api/typescript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@robocode.dev/tank-royale-bot-api",
3-
"version": "1.1.0",
3+
"version": "1.2.0",
44
"description": "Tank Royale Bot API for TypeScript/JavaScript",
55
"license": "Apache-2.0",
66
"homepage": "https://robocode-dev.github.io/tank-royale/",

bot-api/typescript/src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
* Do not edit manually — the version is controlled by the /VERSION file in the repository root
55
* and stamped into this file by the Gradle `syncVersion` task (same mechanism as package.json).
66
*/
7-
export const API_VERSION = "1.1.0";
7+
export const API_VERSION = "1.2.0";

docs/capabilities/CAP-001-battle-runner/criteria.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,4 +360,16 @@ Feature: battle-runner — TBD - created by archiving change add-battle-runner-a
360360
When the deterministic regression harness runs the same setup and input sequence twice
361361
Then it SHALL produce byte-for-byte equivalent result snapshots
362362
And changing one input SHALL change the result snapshot
363+
364+
# Requirement: Behavior-Version Precondition
365+
# A caller may require a server behavior epoch before allowing the Runner to start requested bot processes.
366+
367+
@BR-049
368+
Scenario: Require a compatible server behavior version
369+
Test-type: Integration
370+
Given a user configures `BattleRunner` with a positive expected behavior version
371+
When the Runner connects its observer and controller roles to the server
372+
Then both handshakes SHALL advertise the same behavior version
373+
And the advertised value SHALL equal the expected version before the Runner starts any requested bot process
374+
And a missing, inconsistent, or mismatched value SHALL fail the battle with a descriptive `BattleException`
363375
```
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
id: ADR-046
3+
type: decision
4+
status: verified
5+
links: [CAP-001, CAP-016, ADR-042]
6+
title: Battle Runner enforces an expected behavior version before bot boot
7+
author: agent
8+
accepted-by: Flemming N. Larsen (2026-08-29, Codex conversation)
9+
---
10+
11+
# ADR-046 — Battle Runner enforces an expected behavior version before bot boot
12+
13+
## Context
14+
15+
Ranked Rumble execution must compare the synchronized engine epoch with the running server's handshake before the Runner starts the requested untrusted bot code. Battle Runner receives the server handshake internally but previously exposed no way for a caller to require its `behaviorVersion`.
16+
17+
## Decision
18+
19+
Battle Runner adds an optional `requireBehaviorVersion(int)` builder precondition. When configured, the Runner requires both role handshakes to advertise the same positive value and requires that value to equal the expected version after connection but before the Runner starts the requested bot processes. A missing, inconsistent, or mismatched value fails the battle with `BattleException`.
20+
21+
The default remains unpinned for backward compatibility. The API does not expose unrelated handshake fields or infer behavior compatibility from the Tank Royale release version.
22+
23+
## Consequences
24+
25+
Rumble Client can delegate fail-closed compatibility enforcement to the component that owns the server connection. Existing Runner callers retain their current behavior, while callers that require an epoch must opt in explicitly. The API must ship in a released Runner artifact before the external client can depend on it.

0 commit comments

Comments
 (0)