Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions docs/capabilities/CAP-015-rumble-result-data/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
id: CAP-015
type: capability
status: draft
links: [G-001, P-003]
title: Rumble result data
provenance: inferred
reversal-cost: low
---

# CAP-015 — Rumble result data

Provide an auditable, machine-written record of ranked Tank Royale Rumble battles, so contributors can submit results without write access and everyone can reproduce the leaderboard and match advice from immutable facts.

The capability is implemented in the external `robocode-dev/rumble-data` repository. Its portable Python scripts validate issue-ops batches, append accepted facts, derive projections, and serve the static dashboard. Criteria remain draft until their external automated evidence is registered under P-001/M-002.
46 changes: 46 additions & 0 deletions docs/capabilities/CAP-015-rumble-result-data/criteria.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
id: CAP-015-criteria
type: criteria
status: draft
links: [CAP-015]
title: Acceptance criteria for CAP-015 (rumble-result-data)
ac-prefix: RDA
provenance: inferred
reversal-cost: low
---

```gherkin
Feature: rumble-result-data — Rumble result data

@RDA-001 @draft
Scenario: A registered contributor's valid result becomes an immutable fact and derived advice
Test-type: Integration
Given a registered forge account submits a labelled batch with a supported engine pin, active cataloged bots, and plausible Battle Runner results
When the serialized ingestion workflow drains the batch
Then each valid result is written once as a content-addressed raw fact
And the leaderboard, pairing statistics, and matches-needed projections are regenerated from the accepted facts

@RDA-002 @draft
Scenario: Invalid or duplicate results never become facts
Test-type: Integration
Given a submission has a malformed envelope, unregistered client, incompatible engine pin, unknown or disqualified bot, implausible score set, or duplicate battle ID
When validation processes the submission
Then the invalid result is rejected with a diagnostic
And it is absent from the raw facts and every derived projection

@RDA-003 @draft
Scenario: Projections remain reproducible after retention and moderation changes
Test-type: Integration
Given accepted facts are compacted into a monthly rollup or a current ban, registration, disqualification, or exclusion changes
When aggregation runs from repository-tracked inputs
Then it produces the same projection for equivalent facts
And it excludes facts disallowed by the current moderation and registration records without deleting them

@RDA-004 @draft
Scenario: The published dashboard displays generated, versioned leaderboard data
Test-type: E2E
Given GitHub Pages is deployed from the static dashboard artifact
When a visitor selects a ranked game type
Then the dashboard requests its generated leaderboard projection and links each entry to its generated detail shard
And it does not require a live application backend
```
29 changes: 29 additions & 0 deletions docs/capabilities/CAP-015-rumble-result-data/design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
id: CAP-015-design
type: design
status: draft
links: [CAP-015, ARCH-024, P-003]
title: Design notes for CAP-015 (rumble-result-data)
provenance: inferred
reversal-cost: low
---

# CAP-015 design

The external `robocode-dev/rumble-data` repository owns result storage and projections, while this corpus records the durable capability and contracts. Its ingestion, scoring, retention, moderation, dashboard, and operational rules are defined by [ARCH-024](../../design/rumble/aggregation-and-dashboard.md).

## Input and immutable-fact contracts

`engine.json` pins a positive `behaviorVersion`, Tank Royale release and image references, and ranked settings for `1v1`, `twinduel`, and `melee`. `catalog.json` is the synchronized published bot catalog; only its active name-and-version entries can occur in ranked results. A contributor is admitted by a reviewed `clients/<forge-account>.json` registration that declares stable client IDs.

An issue-ops submission is one fenced JSON batch envelope with `schemaVersion`, `clientId`, `clientVersion`, and one to sixty result records. Each record includes a UUID `battleId`, completion time, matching nested client identity, behavior version, game type, pinned battle dimensions, and the complete Battle Runner participant result model. The validator checks the contract independently for every record, then normalizes valid records with the submitting account and payload hash. A content-addressed JSON file under `results/raw/<year>/<month>/` is the authoritative fact; issue bodies are receipts, never state.

## Projection and moderation contracts

`scripts/aggregate.py` is a pure function of raw facts and rollups, `catalog.json`, `engine.json`, registrations, `bans.json`, and `exclusions.json`. It emits one versioned leaderboard, pairing-statistics file, matches-needed file, and bot detail shard per game type, plus contributor totals. The projection identifier hashes its relevant inputs. Rankings use only the current `behaviorVersion` epoch and active bot versions.

CI serializes ingestion and is the sole writer of facts and projections on `main`. Moderators never rewrite a fact: an exclusion, ban, disqualification, or removed registration only affects the next recomputation. Monthly rollups replace raw files older than three full months on the archive branch after an equivalent projection is verified, retaining the event-sourcing guarantee.

## External evidence

The external `robocode-dev/rumble-data` repository holds the implementation and focused suite for RDA-001 through RDA-004 at merged commit `26b14f512ffb12cf775f038ec53567cdefe34d9e`. Its eight-test standard-library suite covers acceptance, rejection, TwinDuel validation, compaction, moderation filtering, and dashboard references. The pending [rumble-data#4](https://github.com/robocode-dev/rumble-data/pull/4) repair extends that suite with every-ranked-type matchmaking advice and catalog-synchronization coverage; M-007 remains in progress until it is accepted. During P-001/M-002, those tests will receive purpose tags and this criteria artifact can become active without changing the criterion meanings.
1 change: 1 addition & 0 deletions docs/capabilities/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ Each capability folder holds `README.md` (what and why), `criteria.md` (acceptan
- [CAP-012 — User documentation](CAP-012-user-documentation/README.md) · `active`
- [CAP-013 — TypeScript Bot API npm publishing](CAP-013-typescript-bot-api-npm-publish/README.md) · `draft`
- [CAP-014 — Rumble bot catalog](CAP-014-rumble-bot-catalog/README.md) · `draft`
- [CAP-015 — Rumble result data](CAP-015-rumble-result-data/README.md) · `draft`
<!-- clue:index:end -->
2 changes: 1 addition & 1 deletion docs/plans/P-003-rumble.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The milestones mirror the design's Change Proposal Roadmap in order. Each milest
|---|---|---|---|---|
| M-005 | Tank Royale prepared for rumble | `behaviorVersion` exists server-side and in the schema; SPDX `license` field in the booter bot config; Battle Runner exposes battle results for the client; rumble game presets defined; deterministic replay-regression hook in place | done | CH-009; server/runner/booter contracts and focused acceptance evidence |
| M-006 | `rumble-bots` repository live | Repository scaffolded under the community organization with validation CI, templates, and governance; a sample bot PR passes validation end to end | done | CH-010; `robocode-dev/rumble-bots#1` merged as `c735e6ff4`; 4 external focused tests and the validator smoke check pass |
| M-007 | `rumble-data` repository live | Result inbox drained by CI into immutable raw facts; aggregation produces leaderboard, pairings, and matches-needed projections; dashboard published on Pages | todo | |
| M-007 | `rumble-data` repository live | Result inbox drained by CI into immutable raw facts; aggregation produces leaderboard, pairings, and matches-needed projections; dashboard published on Pages | in progress | CH-011; the initial implementation is at `robocode-dev/rumble-data@26b14f512ffb12cf775f038ec53567cdefe34d9e`; [robocode-dev/rumble-data#4](https://github.com/robocode-dev/rumble-data/pull/4) repairs ranked advice for every V1 game type and catalog synchronization, pending maintainer acceptance |
| M-008 | Rumble client runs ranked battles | Client pulls the bot catalog and matchmaking advice, runs a ranked battle, and its submitted result lands in `rumble-data` via issue-ops with no human in the loop | todo | |
| M-009 | Rumble documentation published | User guides live under `/web/docs/rumble/` with one quickstart per audience: bot author, battle contributor, moderator | todo | |
| M-010 | GUI supports TwinDuel | The GUI game-type dialog can select and start the `TwinDuel` preset using the common game-type contract | todo | |
Expand Down
Loading