Skip to content

The first exam for code agents in the physical world: frozen robot tasks from many benchmark suites, each answered with a program and verified in a separate sandbox. Runs on Harbor.

6.6 KB
Raw Blame

core/

The match core (docs/framework_zh.md §5): it hosts every match under one set of rules and never names a sport or a harness. Version: VERSION in __init__.py (bump on every change; every sport's golden replay must still pass).

File Contract / job
sport.py ② the sport interface: MatchConfig (seats, sides, format, modes, renderer), Phase, Refused, MatchBase (the optional hooks and their defaults), ActionLayer / LowLayer / SchemaLayer, check_command; request validation (core 0.2.11): check_body (every request), check_action + parse_action (every act: any exception while reading an action is the player's 400, never a technical failure; core 0.2.13: an entity from a seat without entities is refused)
http.py, client.py, game.py ① the player protocol: the HTTP envelope (/<seat>/<endpoint>, limits; core 0.2.16: each authenticated seat its own budget), the client loop of built-in players, the generic game CLI (core 0.2.13: a shortcut sends entity as written, true / false as booleans and an enum value as text)
realtime.py, turn.py, service.py flow: eai-standard-realtime/1.0 (slowdown, freeze and review, act pipeline, delayed effects, entities) and eai-standard-turn/1.0 (turns, chess clocks, reviews); what both share (seats and sides, observations, team channel, retirement, final.json); core 0.2.13: the realtime clock and the act segment restart when Match.resume() has returned; core 0.2.18: a declared reaction delay D (sport.toml [timing] reaction_delay_steps, spec.reaction_delay): an act takes effect at max(the next boundary, the step of the seat's latest world state + D), local.py alike; core 0.2.20: the team channel (channel.py) is read with a read mark and never consumed: every message has a per-side seq, observe / status / wait show the teammates' messages after team_since (else the recent ones) and team_seq, POST /<seat>/team {"since": n} pages through the log (before 0.2.20 each message went to whichever client of the seat read first); core 0.2.23: the reaction report (report only, no effect on validity or grading): every realtime act's cmd row logs seen (the step of the seat's latest world state), the header logs the timing, and final.json reaction gives per seat the acts that took effect within D (effect step - seen step <= D; D = 0: the next boundary) as a count and a share and the actual delay in steps (median, p90, max); the fresh-process replay recomputes it (episode.reaction_report, replay_check.json reaction; final.json reaction.replayed); core 0.2.26: after the end observe / act answer 409 with the final state and draw nothing, and once the match is finalized a late request's failure is only logged (it never voids a finished match)
episode.py ③ the match record: episode.jsonl and the fresh-process replay (python -m core.episode PLUGIN DIR)
diaglog.py, diagnose.py diagnostics (core 0.2.25; information only, never replayed, in no hash): the rows observe (k, view_steps), act_received (k, act_id, obs_id_last, seen), effect, act_dropped, event (what Match.step() returns), team_delivered, written by the service and by local.py; the post-match diagnosis python -m core.diagnose PLUGIN RUN_DIR (load() -> the rep dict with a deterministic world() replay; the sport's analysis sports/<sport>/diagnose.py: units, implied, metrics; writes diag/units.jsonl, claims.jsonl, summary.json); a sport's diagnose.py is never copied into a task
outcome.py, grading.py judgement: the no-draw chain, N-side ranking, solo scoring; the verifier (validity, reward fields, no-code audit hookup; core 0.2.14: hidden official seeds and the continuous score; core 0.2.19: once a hidden seed set is registered only its seeds are official, over the sport's own official_config, which can only lower it)
seeds.py hidden official seeds (core 0.2.14): the private set's format, the salted commitments, the registered sha256 and the membership test the verifier runs (copied into every task as tests/seeds.py)
score.py the continuous score (core 0.2.14): sport.toml [score] (share, margin, own from scores(), or the Match.continuous_score() hook), one number per side, larger is better; a forfeiting side gets the declared forfeit value; final.json continuous, replayed and checked by the verifier
observe.py, channel.py, rng.py, spec.py the observation whitelist and camera tiles (through renderers/), the reply images of an action (Match.reply_views, core 0.2.8: snapshotted under the lock, drawn off it by the same camera worker, attached to the reply as observation), the team channel, random streams by name, sport.toml
seats.py, metering/ per-seat counters, locks and chess clocks; the metering hookup (think_clock.py, api_errors.py: byte-identical copies); player modes (PLAYER_MODE_<seat>): model (metered by the seat's proxy, required for validity), oracle (exempt), unmetered (core 0.2.29: the runner meters the model itself, e.g. a plain Harbor with native agents; no proxy, no meter required)
spectator.py the broadcast log (broadcast.jsonl, the legacy writer copied as spectator/broadcast_log.py) and the replay video (replay.mp4, a fresh-process replay drawn by the spectator renderer; core 0.2.13: written as replay.part.mp4 and renamed when complete, so a killed render leaves no replay.mp4; core 0.2.28: a sport's own Sport.spectator_scene(cfg) + Match.spectator_state() when defined); never read back
final.json compatibility service.py COMPAT: the sport's fields are lifted to the top level (unless a core field has the name) and score is set, so the Season-1 readers work; the sport fields also stay under sport_fields
workers.py, serve.py, launch.py worker processes (plan, render, camera), the service entry point, the launcher (one metering proxy per seat; core 0.2.22: a seat's proxy keeps no RO_SEAT_* and no other seat's per-seat variable, and a seat on route chatgpt no task-wide credential; none for an unmetered seat, core 0.2.29)
local.py, testkit.py, tests/ in-process matches of built-in players, the generic test suite of every sport (core 0.2.12: prestart_no_show asks for the no-show decision at step 0, not for an unfinished world: a sport's forfeit hook may end its world; core 0.2.13: fairness plays a format with its declared sides and counts sides, not seats; core 0.2.17: the fresh-process replays of determinism and solo_quit may take the sport's [timing] replay_timeout_s when it is above 1800 s), the core's own tests