Skip to content

Commit f838b81

Browse files
john-b-yangclaude
andcommitted
Give ladder climbers an adversarial task prompt
Ladder run configs only set game_description to e.g. 'BattleSnake ladder', so a climbing model was never told it's writing code to defeat an opponent (the shared instance template even frames rounds as a cooperative relay). Add a shared ladder_prompt.yaml with an arena-agnostic prompt that states the adversarial task and pulls in arena specifics via a new {{arena_description}} template var (exposed from the arena's static description through GameContext). All 19 run configs include it; make_* build configs are unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 8c597b7 commit f838b81

22 files changed

Lines changed: 40 additions & 56 deletions

codeclash/agents/utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ class GameContext(BaseModel):
2626
round: int
2727
rounds: int
2828
working_dir: str
29+
# Arena's static description (CodeArena.description), exposed to prompt templates as
30+
# {{arena_description}}. Optional so non-pvp GameContext construction sites keep working.
31+
arena_description: str = ""
2932

3033
def _render_prompt_templates(self) -> dict:
3134
context = self.model_dump()

codeclash/tournaments/pvp.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ def get_agent(self, agent_config: dict, prompts: dict) -> Player:
7979
round=1,
8080
rounds=self.rounds,
8181
working_dir=str(DIR_WORK),
82+
arena_description=self.game.description,
8283
)
8384

8485
return get_agent(agent_config, game_context, environment)

configs/ablations/ladder/battlesnake.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,5 @@ player:
2424
temperature: 0.2
2525
max_tokens: 4096
2626
push: True
27-
prompts:
28-
game_description: |-
29-
BattleSnake ladder
27+
prompts: !include ablations/ladder/ladder_prompt.yaml
3028
ladder: !include ablations/ladder/rungs/battlesnake.yaml

configs/ablations/ladder/battlesnake__gemini_3_5_flash.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,5 @@ player:
1818
agent: !include mini/default.yaml
1919
model: !include mini/models/llama_gemini_3_5_flash.yaml
2020
push: True
21-
prompts:
22-
game_description: |-
23-
BattleSnake ladder
21+
prompts: !include ablations/ladder/ladder_prompt.yaml
2422
ladder: !include ablations/ladder/rungs/battlesnake.yaml

configs/ablations/ladder/battlesnake__gpt_5_5.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,5 @@ player:
1818
agent: !include mini/default.yaml
1919
model: !include mini/models/llama_gpt_5_5.yaml
2020
push: True
21-
prompts:
22-
game_description: |-
23-
BattleSnake ladder
21+
prompts: !include ablations/ladder/ladder_prompt.yaml
2422
ladder: !include ablations/ladder/rungs/battlesnake.yaml

configs/ablations/ladder/battlesnake__opus_4_7.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,5 @@ player:
1818
agent: !include mini/default.yaml
1919
model: !include mini/models/llama_opus_4_7.yaml
2020
push: True
21-
prompts:
22-
game_description: |-
23-
BattleSnake ladder
21+
prompts: !include ablations/ladder/ladder_prompt.yaml
2422
ladder: !include ablations/ladder/rungs/battlesnake.yaml

configs/ablations/ladder/battlesnake__opus_4_8.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,5 @@ player:
1818
agent: !include mini/default.yaml
1919
model: !include mini/models/llama_opus_4_8.yaml
2020
push: True
21-
prompts:
22-
game_description: |-
23-
BattleSnake ladder
21+
prompts: !include ablations/ladder/ladder_prompt.yaml
2422
ladder: !include ablations/ladder/rungs/battlesnake.yaml

configs/ablations/ladder/battlesnake__sonnet_5.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,5 @@ player:
1818
agent: !include mini/default.yaml
1919
model: !include mini/models/llama_sonnet_5.yaml
2020
push: True
21-
prompts:
22-
game_description: |-
23-
BattleSnake ladder
21+
prompts: !include ablations/ladder/ladder_prompt.yaml
2422
ladder: !include ablations/ladder/rungs/battlesnake.yaml

configs/ablations/ladder/battlesnake_llama_smoke.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ player:
2323
step_limit: 10 # smoke override: stop after 10 steps (cost cap disabled in default.yaml)
2424
model: !include mini/models/llama_opus_4_8.yaml
2525
push: True
26-
prompts:
27-
game_description: "BattleSnake ladder smoke over the llama endpoint."
26+
prompts: !include ablations/ladder/ladder_prompt.yaml
2827
ladder:
2928
- {agent: dummy, name: pinky, branch_init: human/moxuz/pinky-snek} # simple heuristic (port)
3029
- {agent: dummy, name: tr8r, branch_init: human/noahspriggs/tr-8r} # 2016 winner (port)

configs/ablations/ladder/corewar.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,5 @@ player:
1616
temperature: 0.2
1717
max_tokens: 4096
1818
push: True
19-
prompts:
20-
game_description: |-
21-
Core War ladder
19+
prompts: !include ablations/ladder/ladder_prompt.yaml
2220
ladder: !include ablations/ladder/rungs/corewar.yaml

0 commit comments

Comments
 (0)