# Basketball Arena (星穹篮域) > Deterministic 3D Elemental Basketball Arena — Authoritative 120 Hz simulation, Hosted OJ Bot Sandbox, and Step-Locked Remote Evaluation Gateway (`/ws/eval`). ## Live Runtime Metadata - engineVersion: 0.2.3 - protocolVersion: 2 - sdkVersion: 0.1.0 - defaultRulesetHash: r2-586e7fb7b23eeb62 - supportedHostedKinds: script, bt, nn (`wasm` is not enabled) - authorMaxBatchSize: 4 ## Full Context (Single-Fetch Recommended for AI Agents) - [llms-full.txt](/llms-full.txt): Complete public documentation (all 5 guides) + live runtime limits, AST whitelist, 17 BotHelpers signatures, BotWeightsView API, default AgentParams JSON, and wire examples. - [GET /api/v1/bot-contract](/api/v1/bot-contract): Machine-readable JSON contract (limits, AST allowlist, reserved IDs, default AgentParams, downloads, and endpoints). ## Public SDK & Starter Downloads (Standalone External Repo Setup) - [GET /downloads](/downloads): JSON catalog with availability, byte sizes, and SHA-256 checksums. - [hoop-sdk-packages.tar.gz](/downloads/hoop-sdk-packages.tar.gz) (878347 bytes): Precompiled public @hoop/* npm tarballs (protocol, sim-core, observation, runner, bot-sdk, env-kit, arena) for standalone local development, hoop-bot CLI, and headless simulation - [bot-ts-starter.tar.gz](/downloads/bot-ts-starter.tar.gz) (10189 bytes): Standalone TypeScript starter bot template (4-layer starter bot source, tsconfig, check/micro/matrix scripts, ready for hoop-sdk-packages.tar.gz) Quickstart (external workspace without cloning the platform repo): ```bash curl -fsSLO /downloads/bot-ts-starter.tar.gz curl -fsSLO /downloads/hoop-sdk-packages.tar.gz tar -xzf bot-ts-starter.tar.gz tar -xzf hoop-sdk-packages.tar.gz -C bot-ts-starter cd bot-ts-starter && npm install npm run check:bot && npm run bench:micro ``` ## Public Documentation Pages (Markdown) - [公开文档总览](/docs/index.md): 文档导航、快速路径与实时服务状态入口 - [Bot 开发与 SDK 接入指南](/docs/bot-development-guide.md): BotFactoryFn、ObservationView、AiIntent、BotHelpers、避坑清单与 hoop-bot CLI - [玩法规则、几何与物理模型](/docs/rules-and-physics.md): 坐标系、三分弧与抛物线物理、3D 抢球、肘击 5A 破冰矩阵与同帧竞速裁决 - [参数表、规则预设与接入协议](/docs/protocols-and-presets.md): AgentParams Schema、5 套预设、Hosted OJ 沙箱红线、/ws/eval、/ws/bots 与公开 REST API - [竞技场赛制、计分与过程诊断](/docs/arena-and-scoring.md): 双榜规则、托管平等天梯(主连通分量 1200 均值 + Davidson-BT Elo ± RD)、Remote 官方池、v2 联赛积分与 17 题微场景 ## Key HTTP & WebSocket Endpoints - `GET /api/v1/health` — Server liveness, `engineVersion`, `rulesetHash` - `GET /api/v1/presets` — Built-in presets + redacted `defaultAgentParams` - `GET /api/v1/bot-contract` — Full sandbox limits, AST allowlist, downloads catalog, and default `AgentParams` - `GET /downloads` / `GET /downloads/:filename` — Download standalone `@hoop/*` SDK tarballs & `bot-ts-starter` project archive - `POST /api/v1/bots/submissions` — Submit immutable Hosted OJ bot (`{ manifest, code, weightsBase64? }`; auth: `Authorization: Bearer ` or author session cookie + trusted `Origin`) - `GET /api/v1/bots` (supports `?sourcePublic=1`, `?teamSize=`, `?preset=`) / `GET /api/v1/bots/:botId/versions` — Public metadata & version history - `GET /api/v1/bots/:botId/source` / `GET /api/v1/bots/:botId/download` — Fail-closed public source view & deterministic runnable `.tar.gz` download (active usable version only, strictly gated on admin `isSourcePublic=true`, otherwise `403 bot_source_not_public`) - `PATCH /api/v1/bots/:botId/versions/:version` — Toggle version status (`active` / `disabled`) - `POST /api/v1/arena/sparring` / `GET /api/v1/arena/sparring?role=challenger|opponent|all` / `GET /api/v1/arena/sparring/:jobId` / `DELETE /api/v1/arena/sparring/:jobId` — Reciprocal black-box sparring (2..10 even games vs built-in dummies or any active hosted bot; both challenger and opponent authors see symmetric results & private replay with own-side latency masking, sliding-window rate limits, zero leaderboard pollution) - `GET /api/v1/admin/arena-settings` / `PATCH /api/v1/admin/arena-settings` — Admin runtime configuration for sparring limits/gate and Ladder V2 scheduling toggle (`ladderEnabled`) + live `ladderStatus` - `POST /api/v1/tokens` / `GET /api/v1/tokens` / `DELETE /api/v1/tokens/:id` — Manage Remote CLI API Tokens (author session required) - `GET /api/v1/arena/pools` / `GET /api/v1/arena/leaderboard` — Equal-footing Active-Only Bayesian Davidson-BT Ladder V2 (Elo 1200 = uniform mean of the primary connected component, `Elo ± RD`, unified `Ranked` / `Provisional` / `Awaiting` graduation with zero privileged system-benchmark tier, 3-lane scheduler `L1 placement/staging -> L2 overlapping-CI refinement -> L3 connectivity bridges`, `Incumbent + Staging` zero-downtime promotion, 1 ranked slot/author/bucket; pass `?poolHash=` for frozen legacy archives or `?track=remote` for Remote track where `/ws/eval` auto-derives immutable snapshots) - `GET /api/v1/arena/h2h?teamSize=&preset=` — Active H2H win/draw/loss and `gapElo ± gapRd90` matrix among current active entrants - `GET /api/v1/arena/ladder-status` — Live 6-bucket Ladder V2 convergence, active/provisional/staging counts, and in-flight lease telemetry - `GET /api/v1/arena/ranked-slot` / `PUT /api/v1/arena/ranked-slot` — Inspect or switch your 1 ranked slot per `(teamSize, preset)` bucket (`{ teamSize, preset, botId }` binds or stages smoothly; `botId: null` withdraws immediately; platform/admin and built-in bots use dedicated `bot:` slots on equal footing) - `WS /ws/eval` — Step-locked batched remote evaluation (first message MUST be `type: "eval:start"` with `botName`, `botVersion`, `token`, `teamSize`, `preset`, and `evalScope: "official"` or `evalScope: "practice"` + `opponents` + even `gamesPerOpponent`) - `WS /ws/bots/:roomId?grant=` — Real-time room remote bot (`bot:hello` -> `bot:init` -> `bot:obs` / `bot:intent`) ## Hosted OJ Critical Checklist 1. Single-file strict ES2022 script (zero `import`/`export`), top-level `function createBot(ctx, helpers, weights)` returning `{ decide(obs, params) }`. 2. `weights` is a frozen `BotWeightsView` (NOT a `Uint8Array`): read bytes via `weights.byteLength`, `weights.byteAt(i)`, `weights.copySlice(start, end)`. 3. Admission enables strict return validation: `decide()` must return a plain object with only allowed `AiIntent` keys (`targetX`, `targetZ`, `facing`, `throttle?`, `action`, `elbow`, `jump`, `pass`, `passTargetSeat?`, `trace?`). 4. Size & timing hard caps: code <= 2097152 bytes (2 MiB), weights <= 16777216 bytes (16 MiB), avg <= 2 ms, p99 <= 5 ms, hard timeout 10 ms, RSS <= 256 MiB. 5. Disallowed globals/syntax include `console`, `Date`, `Math.random`, `Promise`, `RegExp`, `WeakMap`, `async`/`await`, `Object.create`, `Object.defineProperty`, and computed `Math[k]`/`Object[k]`.