Commit changes to the agent's codebase.
(self)
| 194 | |
| 195 | commands = ["git status", "git apply tmp_patch.txt", "rm -f tmp_patch.txt"] |
| 196 | cmd = " && ".join(commands) |
| 197 | self.logger.debug(f"Executing command: {cmd}") |
| 198 | assert_zero_exit_code(self.environment.execute(cmd), logger=self.logger) |
| 199 | |
| 200 | # --- Helper methods --- |
| 201 | |
| 202 | def _round_message(self, round: int) -> str: |
| 203 | """Commit/tag message for a round. The tournament sets ``commit_label`` on the player config — |
| 204 | a prefix that carries its own separator (the ladder sets ``"Rung 2/50 (opponent, elo #49) — "``; |
| 205 | PvP sets ``""``). Pure concatenation, no per-mode branching here.""" |
| 206 | return f"{self.config['commit_label']}Round {round} Update" |
| 207 | |
| 208 | def _tag_round(self, round: int) -> None: |
| 209 | """Git tag the codebase at the given round.""" |
| 210 | tag = self._get_round_tag_name(round) |
| 211 | assert_zero_exit_code( |
| 212 | self.environment.execute(f"git tag -a {tag} -m '{self._round_message(round)}'"), |
| 213 | logger=self.logger, |
no test coverage detected