aboutsummaryrefslogtreecommitdiff
path: root/frontend/build/web/assets/assets/coding_tree_structure.json
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/build/web/assets/assets/coding_tree_structure.json')
-rw-r--r--frontend/build/web/assets/assets/coding_tree_structure.json344
1 files changed, 344 insertions, 0 deletions
diff --git a/frontend/build/web/assets/assets/coding_tree_structure.json b/frontend/build/web/assets/assets/coding_tree_structure.json
new file mode 100644
index 000000000..20767563c
--- /dev/null
+++ b/frontend/build/web/assets/assets/coding_tree_structure.json
@@ -0,0 +1,344 @@
+{
+ "edges": [
+ {
+ "arrows": "to",
+ "from": "agbenchmark/generate_test.py::TestWriteFile::test_method[challenge_data0]",
+ "id": "agbenchmark/generate_test.py::TestWriteFile::test_method[challenge_data0]_to_agbenchmark/generate_test.py::TestReadFile::test_method[challenge_data0]",
+ "to": "agbenchmark/generate_test.py::TestReadFile::test_method[challenge_data0]"
+ },
+ {
+ "arrows": "to",
+ "from": "agbenchmark/generate_test.py::TestUrlShortener::test_method[challenge_data0]",
+ "id": "agbenchmark/generate_test.py::TestUrlShortener::test_method[challenge_data0]_to_agbenchmark/generate_test.py::TestTicTacToe::test_method[challenge_data0]",
+ "to": "agbenchmark/generate_test.py::TestTicTacToe::test_method[challenge_data0]"
+ },
+ {
+ "arrows": "to",
+ "from": "agbenchmark/generate_test.py::TestFileOrganizer::test_method[challenge_data0]",
+ "id": "agbenchmark/generate_test.py::TestFileOrganizer::test_method[challenge_data0]_to_agbenchmark/generate_test.py::TestUrlShortener::test_method[challenge_data0]",
+ "to": "agbenchmark/generate_test.py::TestUrlShortener::test_method[challenge_data0]"
+ },
+ {
+ "arrows": "to",
+ "from": "agbenchmark/generate_test.py::TestPasswordGenerator::test_method[challenge_data0]",
+ "id": "agbenchmark/generate_test.py::TestPasswordGenerator::test_method[challenge_data0]_to_agbenchmark/generate_test.py::TestFileOrganizer::test_method[challenge_data0]",
+ "to": "agbenchmark/generate_test.py::TestFileOrganizer::test_method[challenge_data0]"
+ },
+ {
+ "arrows": "to",
+ "from": "agbenchmark/generate_test.py::TestThreeSum::test_method[challenge_data0]",
+ "id": "agbenchmark/generate_test.py::TestThreeSum::test_method[challenge_data0]_to_agbenchmark/generate_test.py::TestPasswordGenerator::test_method[challenge_data0]",
+ "to": "agbenchmark/generate_test.py::TestPasswordGenerator::test_method[challenge_data0]"
+ },
+ {
+ "arrows": "to",
+ "from": "agbenchmark/generate_test.py::TestWriteFile::test_method[challenge_data0]",
+ "id": "agbenchmark/generate_test.py::TestWriteFile::test_method[challenge_data0]_to_agbenchmark/generate_test.py::TestThreeSum::test_method[challenge_data0]",
+ "to": "agbenchmark/generate_test.py::TestThreeSum::test_method[challenge_data0]"
+ },
+ {
+ "arrows": "to",
+ "from": "agbenchmark/generate_test.py::TestReadFile::test_method[challenge_data0]",
+ "id": "agbenchmark/generate_test.py::TestReadFile::test_method[challenge_data0]_to_agbenchmark/generate_test.py::TestBattleship::test_method[challenge_data0]",
+ "to": "agbenchmark/generate_test.py::TestBattleship::test_method[challenge_data0]"
+ },
+ {
+ "arrows": "to",
+ "from": "agbenchmark/generate_test.py::TestTicTacToe::test_method[challenge_data0]",
+ "id": "agbenchmark/generate_test.py::TestTicTacToe::test_method[challenge_data0]_to_agbenchmark/generate_test.py::TestBattleship::test_method[challenge_data0]",
+ "to": "agbenchmark/generate_test.py::TestBattleship::test_method[challenge_data0]"
+ }
+ ],
+ "nodes": [
+ {
+ "color": "grey",
+ "data": {
+ "category": [
+ "general",
+ "coding",
+ "scrape_synthesize",
+ "data"
+ ],
+ "cutoff": 60,
+ "dependencies": [
+ "TestWriteFile"
+ ],
+ "eval_id": "f219f3d3-a41b-45a9-a3d0-389832086ee8",
+ "ground": {
+ "answer": "The content of output.txt should be 'Hello World!'",
+ "eval": {
+ "type": "file"
+ },
+ "files": [
+ "output.txt"
+ ],
+ "should_contain": [
+ "Hello World!"
+ ]
+ },
+ "info": {
+ "description": "Tests if the agent can read a file.",
+ "difficulty": "interface",
+ "side_effects": [
+ ""
+ ]
+ },
+ "name": "TestReadFile",
+ "task": "Read the file called file_to_read.txt and write its content to a file called output.txt"
+ },
+ "id": "agbenchmark/generate_test.py::TestReadFile::test_method[challenge_data0]",
+ "label": "ReadFile",
+ "shape": "dot"
+ },
+ {
+ "color": "grey",
+ "data": {
+ "category": [
+ "general",
+ "coding",
+ "scrape_synthesize",
+ "data"
+ ],
+ "cutoff": 60,
+ "dependencies": [],
+ "eval_id": "021c695a-6cc4-46c2-b93a-f3a9b0f4d123",
+ "ground": {
+ "answer": "The word 'Washington', printed to a .txt file named anything",
+ "eval": {
+ "type": "file"
+ },
+ "files": [
+ ".txt"
+ ],
+ "should_contain": [
+ "Washington"
+ ],
+ "should_not_contain": []
+ },
+ "info": {
+ "description": "Tests if the agent can write a file",
+ "difficulty": "interface",
+ "side_effects": [
+ ""
+ ]
+ },
+ "name": "TestWriteFile",
+ "task": "Write the word 'Washington' to a .txt file"
+ },
+ "id": "agbenchmark/generate_test.py::TestWriteFile::test_method[challenge_data0]",
+ "label": "WriteFile",
+ "shape": "dot"
+ },
+ {
+ "color": "grey",
+ "data": {
+ "category": [
+ "coding",
+ "general"
+ ],
+ "cutoff": 150,
+ "dependencies": [
+ "TestUrlShortener"
+ ],
+ "eval_id": "504b1648-e14a-4982-8b27-074598eb4fd0",
+ "ground": {
+ "answer": "The correct python file for a TicTacToe game is written",
+ "eval": {
+ "type": "python"
+ },
+ "files": [
+ "test.py"
+ ],
+ "should_contain": [],
+ "should_not_contain": []
+ },
+ "info": {
+ "description": "Tests if the agent can create Tic-Tac-Toe game",
+ "difficulty": "basic",
+ "side_effects": []
+ },
+ "name": "TestTicTacToe",
+ "task": "Build a Tic-Tac-Toe game using a python CLI. Here are the specifications.\n\nThe Grid: The game board is a 3x3 grid, consisting of 3 rows and 3 columns, creating a total of 9 squares.\n\nPlayers: There are two players. One player uses the number \"1\", and the other player uses the number \"2\".\n\nTaking Turns: Players take turns to put their respective numbers (\"1\" or \"2\") in an empty square of the grid. Once a player has placed their number in a square, it cannot be changed or removed.\n\nObjective: The goal is to get three of your numbers in a row, either horizontally, vertically, or diagonally.\n\nEnd of the Game: The game concludes in one of two ways: One player gets three of their numbers in a row (horizontally, vertically, or diagonally) and is declared the winner.\nAll squares on the grid are filled, and no player has three in a row. This situation is a \"draw\" or a \"tie\".\n\nTechnical specifications:\nBuild a file called tic_tac_toe.py. This file will be called through command lines. You will have to prompt users for their move. Player 1 will always start.\nPlayers will input their move in the following format: \"x,y\" where x and y represent the location in the grid (0,0 is top left, 2,2 is bottom right).\n\nYour primary requirement is to halt the game when appropriate and to print only one of these three exact sentences:\n\n\"Player 1 won!\"\n\"Player 2 won!\"\n\"Draw\"\n\nEdge cases: A player can send an incorrect location. Either the location is incorrect or the square is already filled. In this case, this counts as doing nothing, and the player gets prompted for new locations again.\n\n\nYou will be expected to create a python file called tic_tac_toe.py that will run through command lines by using ```python tic_tac_toe.py```.\n\nHere is an example of how your tic_tac_toe.py game will be tested.\n```\nprocess = subprocess.Popen(\n ['python', 'tic_tac_toe.py'],\n stdout=subprocess.PIPE,\n text=True\n)\n\noutput, _ = process.communicate('\\n'.join([\"0,0\", \"1,0\", \"0,1\", \"1,1\", \"0,2\"]))\n\nassert \"Player 1 won!\" in output\n```"
+ },
+ "id": "agbenchmark/generate_test.py::TestTicTacToe::test_method[challenge_data0]",
+ "label": "TicTacToe",
+ "shape": "dot"
+ },
+ {
+ "color": "grey",
+ "data": {
+ "category": [
+ "coding"
+ ],
+ "cutoff": 150,
+ "dependencies": [
+ "TestFileOrganizer"
+ ],
+ "eval_id": "8106fd7f-83fd-496e-9513-280f4a3f012c",
+ "ground": {
+ "answer": "The correct python file for a basic url shortener CLI",
+ "eval": {
+ "type": "python"
+ },
+ "files": [
+ "test.py"
+ ],
+ "should_contain": [],
+ "should_not_contain": []
+ },
+ "info": {
+ "description": "Tests if the agent can create a URL shortener.",
+ "difficulty": "basic",
+ "side_effects": []
+ },
+ "name": "TestUrlShortener",
+ "task": "Build a basic URL shortener using a python CLI. Here are the specifications.\n\nFunctionality: The program should have two primary functionalities.\n\nShorten a given URL.\nRetrieve the original URL from a shortened URL.\n\nCLI: The command-line interface should accept a URL as its first input. It should be able to determine if the url is a shortened url or not. If the url is not shortened, it will display ONLY the shortened url, otherwise, it will display ONLY the original unshortened URL. Afterwards, it should prompt the user for another URL to process.\n\nTechnical specifications:\nBuild a file called url_shortener.py. This file will be called through command lines.\n\nEdge cases:\nFor the sake of simplicity, there will be no edge cases, you can assume the input is always correct and the user immediately passes the shortened version of the url he just shortened.\n\nYou will be expected to create a python file called url_shortener.py that will run through command lines by using python url_shortener.py.\n\nThe url_shortener.py will be tested this way:\n```\nimport unittest\nfrom url_shortener import shorten_url, retrieve_url\n\nclass TestURLShortener(unittest.TestCase):\n def test_url_retrieval(self):\n # Shorten the URL to get its shortened form\n shortened_url = shorten_url('https://www.example.com')\n\n # Retrieve the original URL using the shortened URL directly\n retrieved_url = retrieve_url(shortened_url)\n\n self.assertEqual(retrieved_url, 'https://www.example.com', \"Retrieved URL does not match the original!\")\n\nif __name__ == \"__main__\":\n unittest.main()\n```"
+ },
+ "id": "agbenchmark/generate_test.py::TestUrlShortener::test_method[challenge_data0]",
+ "label": "UrlShortener",
+ "shape": "dot"
+ },
+ {
+ "color": "grey",
+ "data": {
+ "category": [
+ "coding",
+ "general"
+ ],
+ "cutoff": 90,
+ "dependencies": [
+ "TestPasswordGenerator"
+ ],
+ "eval_id": "029c1e6f-2b36-451e-bca6-60063b827d2e",
+ "ground": {
+ "answer": "The correct python file is written and organizes the files accordingly",
+ "eval": {
+ "type": "python"
+ },
+ "files": [
+ "test.py"
+ ],
+ "should_contain": [],
+ "should_not_contain": []
+ },
+ "info": {
+ "description": "Tests if the agent can create a file organizer.",
+ "difficulty": "basic",
+ "side_effects": []
+ },
+ "name": "TestFileOrganizer",
+ "task": "Create a file organizer CLI tool in Python that sorts files in a directory based on their file types (e.g., images, documents, audio) and moves them into these corresponding folders: 'images', 'documents', 'audio'. The entry point will be a python file that can be run this way: python organize_files.py --directory_path=YOUR_DIRECTORY_PATH"
+ },
+ "id": "agbenchmark/generate_test.py::TestFileOrganizer::test_method[challenge_data0]",
+ "label": "FileOrganizer",
+ "shape": "dot"
+ },
+ {
+ "color": "grey",
+ "data": {
+ "category": [
+ "coding"
+ ],
+ "cutoff": 90,
+ "dependencies": [
+ "TestThreeSum"
+ ],
+ "eval_id": "ac75c471-e0ce-400c-ba9a-fb72aaab444f",
+ "ground": {
+ "answer": "password_generator.py is created and satisfies the requirements.",
+ "eval": {
+ "type": "python"
+ },
+ "files": [
+ "test.py"
+ ],
+ "should_contain": [],
+ "should_not_contain": []
+ },
+ "info": {
+ "description": "Tests if the agent can create a random password generator.",
+ "difficulty": "basic",
+ "side_effects": []
+ },
+ "name": "TestPasswordGenerator",
+ "task": "Create a random password generator. The password should have between 8 and 16 characters and should contain letters, numbers and symbols. The password should be printed to the console. The entry point will be a python file that can be run this way: python password_generator.py [--len x] where x is the length of the password. If no length is specified, the password should be 8 characters long. The password_generator can also be imported as a module and called as password = password_generator.generate_password(len=x). Any invalid input should raise a ValueError."
+ },
+ "id": "agbenchmark/generate_test.py::TestPasswordGenerator::test_method[challenge_data0]",
+ "label": "PasswordGenerator",
+ "shape": "dot"
+ },
+ {
+ "color": "grey",
+ "data": {
+ "category": [
+ "coding",
+ "general"
+ ],
+ "cutoff": 60,
+ "dependencies": [
+ "TestWriteFile"
+ ],
+ "eval_id": "a1ff38a4-1032-4bf2-960a-3b927f9936f4",
+ "ground": {
+ "answer": "The three_sum function coded properly.",
+ "eval": {
+ "type": "python"
+ },
+ "files": [
+ "test.py"
+ ],
+ "should_contain": [
+ "[0, 1, 2]",
+ "[0, 2, 5]",
+ "[0, 2, 3]"
+ ],
+ "should_not_contain": []
+ },
+ "info": {
+ "description": "Tests if the agent can create the three_sum function.",
+ "difficulty": "basic",
+ "side_effects": []
+ },
+ "name": "TestThreeSum",
+ "task": "Create a three_sum function in a file called sample_code.py. Given an array of integers, return indices of the three numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may not use the same element twice. Example: Given nums = [2, 7, 11, 15], target = 20, Because nums[0] + nums[1] + nums[2] = 2 + 7 + 11 = 20, return [0, 1, 2]."
+ },
+ "id": "agbenchmark/generate_test.py::TestThreeSum::test_method[challenge_data0]",
+ "label": "ThreeSum",
+ "shape": "dot"
+ },
+ {
+ "color": "grey",
+ "data": {
+ "category": [
+ "coding",
+ "general"
+ ],
+ "cutoff": 90,
+ "dependencies": [
+ "TestTicTacToe",
+ "TestReadFile"
+ ],
+ "eval_id": "4d613d05-475f-4f72-bf12-f6d3714340c1",
+ "ground": {
+ "answer": "The implementation of battleship that passes all the tests.",
+ "eval": {
+ "type": "pytest"
+ },
+ "files": [],
+ "should_contain": [],
+ "should_not_contain": []
+ },
+ "info": {
+ "description": "Tests if the agent can create a Battleship.",
+ "difficulty": "expert",
+ "side_effects": []
+ },
+ "name": "TestBattleship",
+ "task": "Build a battleship game\n\nSpecifications:\n\nOverview: Battleship is a two-player strategy game where each player places their fleet of ships on a grid and tries to sink the opponent's fleet by guessing their locations.\nPlayers take turns calling out a row and column, attempting to name a square containing one of the opponent's ships.\n\nThe Grid: Each player's grid is a 10x10 grid, identified by rows (using numbers 1-10) and columns (using letters A-J).\n\nShips:\n\nCarrier - 5 squares\nBattleship - 4 squares\nCruiser - 3 squares\nSubmarine - 3 squares\nDestroyer - 2 squares\nEach ship occupies contiguous squares on the grid, arranged either horizontally or vertically.\n\nSetup:\n\nAt the start of the game, each player places their fleet on their grid. This setup is hidden from the opponent.\nThe game begins with Player 1, followed by Player 2, and so on.\nTaking Turns:\n\nOn a player's turn, they announce a grid square (e.g., \"D5\").\nThe opponent announces whether that square is a \"hit\" (if there's a part of a ship on that square) or \"miss\" (if the square is empty).\nIf a player hits a square occupied by a ship, they get another turn to guess. This continues until they make a miss, at which point their turn ends.\nIf a player hits all the squares occupied by a ship, the opponent must announce the sinking of that specific ship, e.g., \"You sank my Battleship!\"\n\nObjective: The goal is to sink all of your opponent's ships before they sink yours.\n\nEnd of the Game: The game ends when one player has sunk all of the opponent's ships. The winner is the player who sinks all the opposing fleet first.\n\nTechnical details:\nIn your root folder you will find an abstract class that defines the public interface of the Battleship class you will have to build:\n```\nfrom abc import ABC, abstractmethod\nfrom typing import Optional\n\nfrom pydantic import BaseModel, validator\n\n\n# Models for the request and response payloads\nclass ShipPlacement(BaseModel):\n ship_type: str\n start: dict # {\"row\": int, \"column\": str}\n direction: str\n\n @validator(\"start\")\n def validate_start(cls, start):\n row, column = start.get(\"row\"), start.get(\"column\")\n\n if not (1 <= row <= 10):\n raise ValueError(\"Row must be between 1 and 10 inclusive.\")\n\n if column not in list(\"ABCDEFGHIJ\"):\n raise ValueError(\"Column must be one of A, B, C, D, E, F, G, H, I, J.\")\n\n return start\n\n\nclass Turn(BaseModel):\n target: dict # {\"row\": int, \"column\": str}\n\n\nclass TurnResponse(BaseModel):\n result: str\n ship_type: Optional[str] # This would be None if the result is a miss\n\n\nclass GameStatus(BaseModel):\n is_game_over: bool\n winner: Optional[str]\n\n\nfrom typing import List\n\n\nclass Game(BaseModel):\n game_id: str\n players: List[str]\n board: dict # This could represent the state of the game board, you might need to flesh this out further\n ships: List[ShipPlacement] # List of ship placements for this game\n turns: List[Turn] # List of turns that have been taken\n\n\nclass AbstractBattleship(ABC):\n SHIP_LENGTHS = {\n \"carrier\": 5,\n \"battleship\": 4,\n \"cruiser\": 3,\n \"submarine\": 3,\n \"destroyer\": 2,\n }\n\n @abstractmethod\n def create_ship_placement(self, game_id: str, placement: ShipPlacement) -> None:\n \"\"\"\n Place a ship on the grid.\n \"\"\"\n pass\n\n @abstractmethod\n def create_turn(self, game_id: str, turn: Turn) -> TurnResponse:\n \"\"\"\n Players take turns to target a grid cell.\n \"\"\"\n pass\n\n @abstractmethod\n def get_game_status(self, game_id: str) -> GameStatus:\n \"\"\"\n Check if the game is over and get the winner if there's one.\n \"\"\"\n pass\n\n @abstractmethod\n def get_winner(self, game_id: str) -> str:\n \"\"\"\n Get the winner of the game.\n \"\"\"\n pass\n\n @abstractmethod\n def get_game(self) -> Game:\n \"\"\"\n Retrieve the state of the game.\n \"\"\"\n pass\n\n @abstractmethod\n def delete_game(self, game_id: str) -> None:\n \"\"\"\n Delete a game given its ID.\n \"\"\"\n pass\n\n @abstractmethod\n def create_game(self) -> None:\n \"\"\"\n Create a new game.\n \"\"\"\n pass\n\n```\nAt any moment you can run ```pytest``` to execute the tests.\nYou have two types of test: \n- positive tests => test the battleship game being used in ideal conditions\n- negative tests => tests the battleship game behaviour when used incorrectly\n\nSuccess criteria:\n- you will need to write a file called battleship.py that implements the abstract Battleship class.\n- this class will have to pass all the tests.\n- you're not allowed to modify any other file than the battleship.py. You can add other files as long as the main entrypoint is the battleship class."
+ },
+ "id": "agbenchmark/generate_test.py::TestBattleship::test_method[challenge_data0]",
+ "label": "Battleship",
+ "shape": "dot"
+ }
+ ]
+}