MCPcopy Create free account
hub / github.com/CodeClash-ai/CodeClash / validate_code

Method validate_code

codeclash/arenas/figgie/figgie.py:105–118  ·  view source on GitHub ↗
(self, agent: Player)

Source from the content-addressed store, hash-verified

103 stats.player_stats[player].score = score
104
105 def validate_code(self, agent: Player) -> tuple[bool, str | None]:
106 if self.submission not in agent.environment.execute("ls")["output"]:
107 return False, f"No {self.submission} file found in the root directory"
108
109 bot_content = agent.environment.execute(f"cat {self.submission}")["output"]
110
111 if "def get_action(" not in bot_content:
112 return (
113 False,
114 f"{self.submission} must define a get_action(state) function. "
115 "See the game description for the required signature.",
116 )
117
118 return True, None

Callers

nothing calls this directly

Calls 1

executeMethod · 0.45

Tested by

no test coverage detected