{"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "from __future__ import annotations\n\n\ndef unique_prime_factors(n: int) -> list[int]:\n \"\"\"\n Returns unique prime factors of n as a list.\n\n >>> unique_prime_factors(0)\n []\n >>> unique_prime_factors(100)\n [2, 5]\n >>> unique_prime_factors(2560)\n [2, 5]\n >>> unique_prime_factors(10**-2)\n []\n >>> unique_prime_factors(0.02)\n []\n >>> unique_prime_factors(10**241)\n [2, 5]\n >>> unique_prime_factors(10**-354)\n []\n >>> unique_prime_factors('hello')\n Traceback (most recent call last):\n ...\n TypeError: '<=' not supported between instances of 'int' and 'str'\n >>> unique_prime_factors([1,2,'hello'])\n Traceback (most recent call last):\n ...\n TypeError: '<=' not supported between instances of 'int' and 'list'\n \"\"\"\n i = 2\n factors = []\n while i * i <= n:\n if not n % i:\n while not n % i:\n n //= i\n factors.append(i)\n i += 1\n if n > 1:\n factors.append(n)\n return factors\n"}, "sha256": "b5fdaeea227d14de76a346cf26b797996de459fe1737db9200a4f042cb65d72a"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "b5fdaeea227d14de76a346cf26b797996de459fe1737db9200a4f042cb65d72a", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "5b653ad91cff58b8a228e550cb10f2f94aa7c206be38415710d7cb9fefce271c", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00001"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00001", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "from __future__ import annotations\n\n\ndef unique_prime_factors(n: int) -> list[int]:\n \"\"\"\n Returns unique prime factors of n as a list.\n\n >>> unique_prime_factors(0)\n []\n >>> unique_prime_factors(100)\n [2, 5]\n >>> unique_prime_factors(2560)\n [2, 5]\n >>> unique_prime_factors(10**-2)\n []\n >>> unique_prime_factors(0.02)\n []\n >>> unique_prime_factors(10**241)\n [2, 5]\n >>> unique_prime_factors(10**-354)\n []\n >>> unique_prime_factors('hello')\n Traceback (most recent call last):\n ...\n TypeError: '<=' not supported between instances of 'int' and 'str'\n >>> unique_prime_factors([1,2,'hello'])\n Traceback (most recent call last):\n ...\n TypeError: '<=' not supported between instances of 'int' and 'list'\n \"\"\"\n i = 2\n factors = []\n while i * i <= n:\n if not n % i:\n while not n % i:\n n //= i\n factors.append(i)\n i += 1\n if n > 0:\n factors.append(n)\n return factors\n"}, "sha256": "f8b1d92f50d6157790ef49e03018f9295a1837240f3e7cd9e6e2ff003fe89b56"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "unique_prime_factors:1", "got": "[2, 5, 1]\n", "source": "unique_prime_factors(100)\n", "truncated": false, "want": "[2, 5]\n"}, {"example_id": "unique_prime_factors:3", "got": "[0.01]\n", "source": "unique_prime_factors(10**-2)\n", "truncated": false, "want": "[]\n"}, {"example_id": "unique_prime_factors:4", "got": "[0.02]\n", "source": "unique_prime_factors(0.02)\n", "truncated": false, "want": "[]\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "off_by_one", "seed": 7, "span": {"col_offset": 11, "end_byte": 969, "lineno": 39, "node": "Constant", "node_col_offset": 11, "node_end_col_offset": 12, "node_end_lineno": 39, "node_lineno": 39, "op_index": 0, "original_text": "1", "replacement_text": "0", "start_byte": 968}}, "public_tests": {"examples": [{"example_id": "unique_prime_factors:0", "source": "unique_prime_factors(0)\n", "want": "[]\n"}, {"example_id": "unique_prime_factors:1", "source": "unique_prime_factors(100)\n", "want": "[2, 5]\n"}, {"example_id": "unique_prime_factors:2", "source": "unique_prime_factors(2560)\n", "want": "[2, 5]\n"}, {"example_id": "unique_prime_factors:3", "source": "unique_prime_factors(10**-2)\n", "want": "[]\n"}, {"example_id": "unique_prime_factors:4", "source": "unique_prime_factors(0.02)\n", "want": "[]\n"}, {"example_id": "unique_prime_factors:5", "source": "unique_prime_factors(10**241)\n", "want": "[2, 5]\n"}, {"example_id": "unique_prime_factors:6", "source": "unique_prime_factors(10**-354)\n", "want": "[]\n"}, {"example_id": "unique_prime_factors:7", "source": "unique_prime_factors('hello')\n", "want": "Traceback (most recent call last):\n ...\nTypeError: '<=' not supported between instances of 'int' and 'str'\n"}, {"example_id": "unique_prime_factors:8", "source": "unique_prime_factors([1,2,'hello'])\n", "want": "Traceback (most recent call last):\n ...\nTypeError: '<=' not supported between instances of 'int' and 'list'\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-52bd7ff7bd30675a", "tree_sha256": "b5fdaeea227d14de76a346cf26b797996de459fe1737db9200a4f042cb65d72a", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/prime_factors.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def hamming_distance(string1: str, string2: str) -> int:\n \"\"\"Calculate the Hamming distance between two equal length strings\n In information theory, the Hamming distance between two strings of equal\n length is the number of positions at which the corresponding symbols are\n different. https://en.wikipedia.org/wiki/Hamming_distance\n\n Args:\n string1 (str): Sequence 1\n string2 (str): Sequence 2\n\n Returns:\n int: Hamming distance\n\n >>> hamming_distance(\"python\", \"python\")\n 0\n >>> hamming_distance(\"karolin\", \"kathrin\")\n 3\n >>> hamming_distance(\"00000\", \"11111\")\n 5\n >>> hamming_distance(\"karolin\", \"kath\")\n Traceback (most recent call last):\n ...\n ValueError: String lengths must match!\n \"\"\"\n if len(string1) != len(string2):\n raise ValueError(\"String lengths must match!\")\n\n count = 0\n\n for char1, char2 in zip(string1, string2):\n if char1 != char2:\n count += 1\n\n return count\n"}, "sha256": "f46df4c5270fd0c51e21a534123df98303618f284d5d461f4f7b3aad5fff2401"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "f46df4c5270fd0c51e21a534123df98303618f284d5d461f4f7b3aad5fff2401", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "e0efa2357881276edd94eaed90944a92b68d33e8288cd189dba005915cdcd89f", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00003"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00003", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 11, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def hamming_distance(string1: str, string2: str) -> int:\n \"\"\"Calculate the Hamming distance between two equal length strings\n In information theory, the Hamming distance between two strings of equal\n length is the number of positions at which the corresponding symbols are\n different. https://en.wikipedia.org/wiki/Hamming_distance\n\n Args:\n string1 (str): Sequence 1\n string2 (str): Sequence 2\n\n Returns:\n int: Hamming distance\n\n >>> hamming_distance(\"python\", \"python\")\n 0\n >>> hamming_distance(\"karolin\", \"kathrin\")\n 3\n >>> hamming_distance(\"00000\", \"11111\")\n 5\n >>> hamming_distance(\"karolin\", \"kath\")\n Traceback (most recent call last):\n ...\n ValueError: String lengths must match!\n \"\"\"\n if len(string1) != len(string2):\n raise ValueError(\"String lengths must match!\")\n\n count = 0\n\n for char1, char2 in zip(string1, string2):\n if char1 != char2:\n count -= 1\n\n return count\n"}, "sha256": "65d936222c219c8d375b0f80109cc7533dc5173987ebb832b3cd374ca7f195a7"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "hamming_distance:1", "got": "-3\n", "source": "hamming_distance(\"karolin\", \"kathrin\")\n", "truncated": false, "want": "3\n"}, {"example_id": "hamming_distance:2", "got": "-5\n", "source": "hamming_distance(\"00000\", \"11111\")\n", "truncated": false, "want": "5\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 18, "end_byte": 967, "lineno": 32, "node": "AugAssign", "node_col_offset": 12, "node_end_col_offset": 22, "node_end_lineno": 32, "node_lineno": 32, "op_index": 0, "original_text": "+=", "replacement_text": "-=", "start_byte": 965}}, "public_tests": {"examples": [{"example_id": "hamming_distance:0", "source": "hamming_distance(\"python\", \"python\")\n", "want": "0\n"}, {"example_id": "hamming_distance:1", "source": "hamming_distance(\"karolin\", \"kathrin\")\n", "want": "3\n"}, {"example_id": "hamming_distance:2", "source": "hamming_distance(\"00000\", \"11111\")\n", "want": "5\n"}, {"example_id": "hamming_distance:3", "source": "hamming_distance(\"karolin\", \"kath\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: String lengths must match!\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-c9b3cdaed361d596", "tree_sha256": "f46df4c5270fd0c51e21a534123df98303618f284d5d461f4f7b3aad5fff2401", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:strings/hamming_distance.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "import re\n\n\ndef dna(dna: str) -> str:\n \"\"\"\n https://en.wikipedia.org/wiki/DNA\n Returns the second side of a DNA strand\n\n >>> dna(\"GCTA\")\n 'CGAT'\n >>> dna(\"ATGC\")\n 'TACG'\n >>> dna(\"CTGA\")\n 'GACT'\n >>> dna(\"GFGG\")\n Traceback (most recent call last):\n ...\n ValueError: Invalid Strand\n \"\"\"\n\n if len(re.findall(\"[ATCG]\", dna)) != len(dna):\n raise ValueError(\"Invalid Strand\")\n\n return dna.translate(dna.maketrans(\"ATCG\", \"TAGC\"))\n"}, "sha256": "f61c530f7904ba7102b315be9c2ff2385ea4c9ccfe78f9bb08d939fabebdc7c5"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "f61c530f7904ba7102b315be9c2ff2385ea4c9ccfe78f9bb08d939fabebdc7c5", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "b54d1572afe383558102eee786bd7dee9a5f0ba695d9f90aea3d87c39a8536f5", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00007"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00007", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 13, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "import re\n\n\ndef dna(dna: str) -> str:\n \"\"\"\n https://en.wikipedia.org/wiki/DNA\n Returns the second side of a DNA strand\n\n >>> dna(\"GCTA\")\n 'CGAT'\n >>> dna(\"ATGC\")\n 'TACG'\n >>> dna(\"CTGA\")\n 'GACT'\n >>> dna(\"GFGG\")\n Traceback (most recent call last):\n ...\n ValueError: Invalid Strand\n \"\"\"\n\n if len(re.findall(\"[ATCG]\", dna)) == len(dna):\n raise ValueError(\"Invalid Strand\")\n\n return dna.translate(dna.maketrans(\"ATCG\", \"TAGC\"))\n"}, "sha256": "6d5031d4f3724b51ca20be0b04aa2dbd7119151673d8964369f5af344ecd4002"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "dna:0", "got": "ValueError: Invalid Strand", "source": "dna(\"GCTA\")\n", "truncated": false, "want": "'CGAT'\n"}, {"example_id": "dna:1", "got": "ValueError: Invalid Strand", "source": "dna(\"ATGC\")\n", "truncated": false, "want": "'TACG'\n"}, {"example_id": "dna:2", "got": "ValueError: Invalid Strand", "source": "dna(\"CTGA\")\n", "truncated": false, "want": "'GACT'\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "boolean_condition", "seed": 7, "span": {"col_offset": 38, "end_byte": 373, "lineno": 21, "node": "Compare", "node_col_offset": 7, "node_end_col_offset": 49, "node_end_lineno": 21, "node_lineno": 21, "op_index": 0, "original_text": "!=", "replacement_text": "==", "start_byte": 371}}, "public_tests": {"examples": [{"example_id": "dna:0", "source": "dna(\"GCTA\")\n", "want": "'CGAT'\n"}, {"example_id": "dna:1", "source": "dna(\"ATGC\")\n", "want": "'TACG'\n"}, {"example_id": "dna:2", "source": "dna(\"CTGA\")\n", "want": "'GACT'\n"}, {"example_id": "dna:3", "source": "dna(\"GFGG\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: Invalid Strand\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-7329776741a5811e", "tree_sha256": "f61c530f7904ba7102b315be9c2ff2385ea4c9ccfe78f9bb08d939fabebdc7c5", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:strings/dna.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def circle_sort(collection: list) -> list:\n \"\"\"A pure Python implementation of circle sort algorithm\n\n :param collection: a mutable collection of comparable items in any order\n :return: the same collection in ascending order\n\n Examples:\n >>> circle_sort([0, 5, 3, 2, 2])\n [0, 2, 2, 3, 5]\n >>> circle_sort([])\n []\n >>> circle_sort([-2, 5, 0, -45])\n [-45, -2, 0, 5]\n >>> collections = ([], [0, 5, 3, 2, 2], [-2, 5, 0, -45])\n >>> all(sorted(collection) == circle_sort(collection) for collection in collections)\n True\n \"\"\"\n\n if len(collection) < 2:\n return collection\n\n def circle_sort_util(collection: list, low: int, high: int) -> bool:\n \"\"\"\n >>> arr = [5,4,3,2,1]\n >>> circle_sort_util(lst, 0, 2)\n True\n >>> arr\n [3, 4, 5, 2, 1]\n \"\"\"\n\n swapped = False\n\n if low == high:\n return swapped\n\n left = low\n right = high\n\n while left < right:\n if collection[left] > collection[right]:\n collection[left], collection[right] = (\n collection[right],\n collection[left],\n )\n swapped = True\n\n left += 1\n right -= 1\n\n if left == right and collection[left] > collection[right + 1]:\n collection[left], collection[right + 1] = (\n collection[right + 1],\n collection[left],\n )\n\n swapped = True\n\n mid = low + int((high - low) / 2)\n left_swap = circle_sort_util(collection, low, mid)\n right_swap = circle_sort_util(collection, mid + 1, high)\n\n return swapped or left_swap or right_swap\n\n is_not_sorted = True\n\n while is_not_sorted is True:\n is_not_sorted = circle_sort_util(collection, 0, len(collection) - 1)\n\n return collection\n"}, "sha256": "0906cfd86b12cf67d94b722d3ce5a982b68fc829f06333fad2a308a0726722a8"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "0906cfd86b12cf67d94b722d3ce5a982b68fc829f06333fad2a308a0726722a8", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "458aadcd5d840028c45db7444a7542fbee27840e14759ad294d39e5d86d4af3d", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00008"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00008", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 13, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def circle_sort(collection: list) -> list:\n \"\"\"A pure Python implementation of circle sort algorithm\n\n :param collection: a mutable collection of comparable items in any order\n :return: the same collection in ascending order\n\n Examples:\n >>> circle_sort([0, 5, 3, 2, 2])\n [0, 2, 2, 3, 5]\n >>> circle_sort([])\n []\n >>> circle_sort([-2, 5, 0, -45])\n [-45, -2, 0, 5]\n >>> collections = ([], [0, 5, 3, 2, 2], [-2, 5, 0, -45])\n >>> all(sorted(collection) == circle_sort(collection) for collection in collections)\n True\n \"\"\"\n\n if len(collection) < 2:\n return collection\n\n def circle_sort_util(collection: list, low: int, high: int) -> bool:\n \"\"\"\n >>> arr = [5,4,3,2,1]\n >>> circle_sort_util(lst, 0, 2)\n True\n >>> arr\n [3, 4, 5, 2, 1]\n \"\"\"\n\n swapped = False\n\n if low == high:\n return swapped\n\n left = low\n right = high\n\n while left < right:\n if collection[left] > collection[right]:\n collection[left], collection[right] = (\n collection[right],\n collection[left],\n )\n swapped = True\n\n left += 1\n right -= 1\n\n if left != right and collection[left] > collection[right + 1]:\n collection[left], collection[right + 1] = (\n collection[right + 1],\n collection[left],\n )\n\n swapped = True\n\n mid = low + int((high - low) / 2)\n left_swap = circle_sort_util(collection, low, mid)\n right_swap = circle_sort_util(collection, mid + 1, high)\n\n return swapped or left_swap or right_swap\n\n is_not_sorted = True\n\n while is_not_sorted is True:\n is_not_sorted = circle_sort_util(collection, 0, len(collection) - 1)\n\n return collection\n"}, "sha256": "9252c98fd62396ffc1417f377e12da24025a96cbbfce6b7a67be4098b3e663f6"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "circle_sort:0", "got": "[0, 2, 3, 2, 5]\n", "source": "circle_sort([0, 5, 3, 2, 2])\n", "truncated": false, "want": "[0, 2, 2, 3, 5]\n"}, {"example_id": "circle_sort:4", "got": "False\n", "source": "all(sorted(collection) == circle_sort(collection) for collection in collections)\n", "truncated": false, "want": "True\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "boolean_condition", "seed": 7, "span": {"col_offset": 16, "end_byte": 1284, "lineno": 50, "node": "Compare", "node_col_offset": 11, "node_end_col_offset": 24, "node_end_lineno": 50, "node_lineno": 50, "op_index": 0, "original_text": "==", "replacement_text": "!=", "start_byte": 1282}}, "public_tests": {"examples": [{"example_id": "circle_sort:0", "source": "circle_sort([0, 5, 3, 2, 2])\n", "want": "[0, 2, 2, 3, 5]\n"}, {"example_id": "circle_sort:1", "source": "circle_sort([])\n", "want": "[]\n"}, {"example_id": "circle_sort:2", "source": "circle_sort([-2, 5, 0, -45])\n", "want": "[-45, -2, 0, 5]\n"}, {"example_id": "circle_sort:3", "source": "collections = ([], [0, 5, 3, 2, 2], [-2, 5, 0, -45])\n", "want": ""}, {"example_id": "circle_sort:4", "source": "all(sorted(collection) == circle_sort(collection) for collection in collections)\n", "want": "True\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-2fbc6a1aedb6ea6d", "tree_sha256": "0906cfd86b12cf67d94b722d3ce5a982b68fc829f06333fad2a308a0726722a8", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:sorts/circle_sort.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def f(x):\n \"\"\"\n This is the function to integrate, f(x) = (x - 0)^2 = x^2.\n\n :param x: The input value\n :return: The value of f(x)\n\n >>> f(0)\n 0\n >>> f(1)\n 1\n >>> f(0.5)\n 0.25\n \"\"\"\n return x**2\n"}, "sha256": "ff21c134e72e49a6e18a9a3d03ff125473491699a7adb3099beb83a61141d30f"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "ff21c134e72e49a6e18a9a3d03ff125473491699a7adb3099beb83a61141d30f", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "dde0866ce03ef2329d59ff54de6512316729af5da65d2521afdca2427d585e3c", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00009"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00009", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 16, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def f(x):\n \"\"\"\n This is the function to integrate, f(x) = (x - 0)^2 = x^2.\n\n :param x: The input value\n :return: The value of f(x)\n\n >>> f(0)\n 0\n >>> f(1)\n 1\n >>> f(0.5)\n 0.25\n \"\"\"\n return x**2 + 1\n"}, "sha256": "cb2060836c7f33fb5b035c2affd321e2487b318705a0fe1cadb4c343cfb58d61"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "f:0", "got": "1\n", "source": "f(0)\n", "truncated": false, "want": "0\n"}, {"example_id": "f:1", "got": "2\n", "source": "f(1)\n", "truncated": false, "want": "1\n"}, {"example_id": "f:2", "got": "1.25\n", "source": "f(0.5)\n", "truncated": false, "want": "0.25\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 229, "lineno": 15, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 15, "node_end_lineno": 15, "node_lineno": 15, "op_index": 0, "original_text": "x**2", "replacement_text": "x**2 + 1", "start_byte": 225}}, "public_tests": {"examples": [{"example_id": "f:0", "source": "f(0)\n", "want": "0\n"}, {"example_id": "f:1", "source": "f(1)\n", "want": "1\n"}, {"example_id": "f:2", "source": "f(0.5)\n", "want": "0.25\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-d44abb0285594913", "tree_sha256": "ff21c134e72e49a6e18a9a3d03ff125473491699a7adb3099beb83a61141d30f", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/trapezoidal_rule.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def dp_match(text: str, pattern: str) -> bool:\n r\"\"\"\n Dynamic programming matching algorithm.\n\n | Time complexity: O(\\|text\\| * \\|pattern\\|)\n | Space complexity: O(\\|text\\| * \\|pattern\\|)\n\n :param text: Text to match.\n :param pattern: Pattern to match.\n :return: ``True`` if `text` matches `pattern`, ``False`` otherwise.\n\n >>> dp_match('abc', 'a.c')\n True\n >>> dp_match('abc', 'af*.c')\n True\n >>> dp_match('abc', 'a.c*')\n True\n >>> dp_match('abc', 'a.c*d')\n False\n >>> dp_match('aa', '.*')\n True\n \"\"\"\n m = len(text)\n n = len(pattern)\n dp = [[False for _ in range(n + 1)] for _ in range(m + 1)]\n dp[0][0] = True\n\n for j in range(1, n + 1):\n dp[0][j] = pattern[j - 1] == \"*\" and dp[0][j - 2]\n\n for i in range(1, m + 1):\n for j in range(1, n + 1):\n if pattern[j - 1] in {\".\", text[i - 1]}:\n dp[i][j] = dp[i - 1][j - 1]\n elif pattern[j - 1] == \"*\":\n dp[i][j] = dp[i][j - 2]\n if pattern[j - 2] in {\".\", text[i - 1]}:\n dp[i][j] |= dp[i - 1][j]\n else:\n dp[i][j] = False\n\n return dp[m][n]\n"}, "sha256": "4c67111780bb70660d8a61404df8f3683ac6c79e280bc802dfdc701ac85e3a5a"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "4c67111780bb70660d8a61404df8f3683ac6c79e280bc802dfdc701ac85e3a5a", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "333cd652f885ac6523a32d198f2984ac811b02804235139a75456f05b06db29c", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00010"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00010", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def dp_match(text: str, pattern: str) -> bool:\n r\"\"\"\n Dynamic programming matching algorithm.\n\n | Time complexity: O(\\|text\\| * \\|pattern\\|)\n | Space complexity: O(\\|text\\| * \\|pattern\\|)\n\n :param text: Text to match.\n :param pattern: Pattern to match.\n :return: ``True`` if `text` matches `pattern`, ``False`` otherwise.\n\n >>> dp_match('abc', 'a.c')\n True\n >>> dp_match('abc', 'af*.c')\n True\n >>> dp_match('abc', 'a.c*')\n True\n >>> dp_match('abc', 'a.c*d')\n False\n >>> dp_match('aa', '.*')\n True\n \"\"\"\n m = len(text)\n n = len(pattern)\n dp = [[False for _ in range(n + 1)] for _ in range(m + 1)]\n dp[0][0] = True\n\n for j in range(1, n + 1):\n dp[0][j] = pattern[j - 1] != \"*\" and dp[0][j - 2]\n\n for i in range(1, m + 1):\n for j in range(1, n + 1):\n if pattern[j - 1] in {\".\", text[i - 1]}:\n dp[i][j] = dp[i - 1][j - 1]\n elif pattern[j - 1] == \"*\":\n dp[i][j] = dp[i][j - 2]\n if pattern[j - 2] in {\".\", text[i - 1]}:\n dp[i][j] |= dp[i - 1][j]\n else:\n dp[i][j] = False\n\n return dp[m][n]\n"}, "sha256": "530823b04a4e73e77bf249ed7bd1fc9c26c5e4a8339262ce51bff7406bcd1d12"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "dp_match:4", "got": "False\n", "source": "dp_match('aa', '.*')\n", "truncated": false, "want": "True\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "boolean_condition", "seed": 7, "span": {"col_offset": 34, "end_byte": 745, "lineno": 29, "node": "Compare", "node_col_offset": 19, "node_end_col_offset": 40, "node_end_lineno": 29, "node_lineno": 29, "op_index": 0, "original_text": "==", "replacement_text": "!=", "start_byte": 743}}, "public_tests": {"examples": [{"example_id": "dp_match:0", "source": "dp_match('abc', 'a.c')\n", "want": "True\n"}, {"example_id": "dp_match:1", "source": "dp_match('abc', 'af*.c')\n", "want": "True\n"}, {"example_id": "dp_match:2", "source": "dp_match('abc', 'a.c*')\n", "want": "True\n"}, {"example_id": "dp_match:3", "source": "dp_match('abc', 'a.c*d')\n", "want": "False\n"}, {"example_id": "dp_match:4", "source": "dp_match('aa', '.*')\n", "want": "True\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-3e87adc7aca54dfc", "tree_sha256": "4c67111780bb70660d8a61404df8f3683ac6c79e280bc802dfdc701ac85e3a5a", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:dynamic_programming/regex_match.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def signum(num: float) -> int:\n \"\"\"\n Applies signum function on the number\n\n Custom test cases:\n >>> signum(-10)\n -1\n >>> signum(10)\n 1\n >>> signum(0)\n 0\n >>> signum(-20.5)\n -1\n >>> signum(20.5)\n 1\n >>> signum(-1e-6)\n -1\n >>> signum(1e-6)\n 1\n >>> signum(\"Hello\")\n Traceback (most recent call last):\n ...\n TypeError: '<' not supported between instances of 'str' and 'int'\n >>> signum([])\n Traceback (most recent call last):\n ...\n TypeError: '<' not supported between instances of 'list' and 'int'\n \"\"\"\n if num < 0:\n return -1\n return 1 if num else 0\n"}, "sha256": "b4915a1473356c9c2028027fd53f7e7755543e227fdcc9c44fae4d8a29c19e39"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "b4915a1473356c9c2028027fd53f7e7755543e227fdcc9c44fae4d8a29c19e39", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "a5f88e42db540585bf7642c4b4679cf76593f8031a49bddc2c7dd36f4bc90694", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00011"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00011", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def signum(num: float) -> int:\n \"\"\"\n Applies signum function on the number\n\n Custom test cases:\n >>> signum(-10)\n -1\n >>> signum(10)\n 1\n >>> signum(0)\n 0\n >>> signum(-20.5)\n -1\n >>> signum(20.5)\n 1\n >>> signum(-1e-6)\n -1\n >>> signum(1e-6)\n 1\n >>> signum(\"Hello\")\n Traceback (most recent call last):\n ...\n TypeError: '<' not supported between instances of 'str' and 'int'\n >>> signum([])\n Traceback (most recent call last):\n ...\n TypeError: '<' not supported between instances of 'list' and 'int'\n \"\"\"\n if num < 1:\n return -1\n return 1 if num else 0\n"}, "sha256": "417fec8eee83061797b8e3ec3b2e764af445cd954b11a8b07c8ca89b45efe381"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "signum:2", "got": "-1\n", "source": "signum(0)\n", "truncated": false, "want": "0\n"}, {"example_id": "signum:6", "got": "-1\n", "source": "signum(1e-6)\n", "truncated": false, "want": "1\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "off_by_one", "seed": 7, "span": {"col_offset": 13, "end_byte": 601, "lineno": 29, "node": "Constant", "node_col_offset": 13, "node_end_col_offset": 14, "node_end_lineno": 29, "node_lineno": 29, "op_index": 0, "original_text": "0", "replacement_text": "1", "start_byte": 600}}, "public_tests": {"examples": [{"example_id": "signum:0", "source": "signum(-10)\n", "want": "-1\n"}, {"example_id": "signum:1", "source": "signum(10)\n", "want": "1\n"}, {"example_id": "signum:2", "source": "signum(0)\n", "want": "0\n"}, {"example_id": "signum:3", "source": "signum(-20.5)\n", "want": "-1\n"}, {"example_id": "signum:4", "source": "signum(20.5)\n", "want": "1\n"}, {"example_id": "signum:5", "source": "signum(-1e-6)\n", "want": "-1\n"}, {"example_id": "signum:6", "source": "signum(1e-6)\n", "want": "1\n"}, {"example_id": "signum:7", "source": "signum(\"Hello\")\n", "want": "Traceback (most recent call last):\n ...\nTypeError: '<' not supported between instances of 'str' and 'int'\n"}, {"example_id": "signum:8", "source": "signum([])\n", "want": "Traceback (most recent call last):\n ...\nTypeError: '<' not supported between instances of 'list' and 'int'\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-413d4d00136fd20a", "tree_sha256": "b4915a1473356c9c2028027fd53f7e7755543e227fdcc9c44fae4d8a29c19e39", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/signum.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def get_bit(number: int, position: int) -> int:\n \"\"\"\n Get the bit at the given position\n\n Details: perform bitwise and for the given number and X,\n Where X is a number with all the bits - zeroes and bit on given position - one.\n If the result is not equal to 0, then the bit on the given position is 1, else 0.\n\n >>> get_bit(0b1010, 0)\n 0\n >>> get_bit(0b1010, 1)\n 1\n >>> get_bit(0b1010, 2)\n 0\n >>> get_bit(0b1010, 3)\n 1\n \"\"\"\n return int((number & (1 << position)) != 0)\n"}, "sha256": "23f79c67759708919c3b5e7ba83406df0b382fe86cdd48f0cbedbbc8c92afd96"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "23f79c67759708919c3b5e7ba83406df0b382fe86cdd48f0cbedbbc8c92afd96", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "ba362279af24183db3b7c33ab48c50e22f67c598d2d0e52d7b4ac2e3daf2ab0b", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00013"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00013", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def get_bit(number: int, position: int) -> int:\n \"\"\"\n Get the bit at the given position\n\n Details: perform bitwise and for the given number and X,\n Where X is a number with all the bits - zeroes and bit on given position - one.\n If the result is not equal to 0, then the bit on the given position is 1, else 0.\n\n >>> get_bit(0b1010, 0)\n 0\n >>> get_bit(0b1010, 1)\n 1\n >>> get_bit(0b1010, 2)\n 0\n >>> get_bit(0b1010, 3)\n 1\n \"\"\"\n return int((number & (1 << position)) != 1)\n"}, "sha256": "09ccfa78678baf9517b8e2ca150ddf7ba6ae757f7b7461cc5bb9372a068ab19d"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "get_bit:0", "got": "1\n", "source": "get_bit(0b1010, 0)\n", "truncated": false, "want": "0\n"}, {"example_id": "get_bit:2", "got": "1\n", "source": "get_bit(0b1010, 2)\n", "truncated": false, "want": "0\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "off_by_one", "seed": 7, "span": {"col_offset": 45, "end_byte": 513, "lineno": 18, "node": "Constant", "node_col_offset": 45, "node_end_col_offset": 46, "node_end_lineno": 18, "node_lineno": 18, "op_index": 0, "original_text": "0", "replacement_text": "1", "start_byte": 512}}, "public_tests": {"examples": [{"example_id": "get_bit:0", "source": "get_bit(0b1010, 0)\n", "want": "0\n"}, {"example_id": "get_bit:1", "source": "get_bit(0b1010, 1)\n", "want": "1\n"}, {"example_id": "get_bit:2", "source": "get_bit(0b1010, 2)\n", "want": "0\n"}, {"example_id": "get_bit:3", "source": "get_bit(0b1010, 3)\n", "want": "1\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-cdaf1d74f1e0d7ae", "tree_sha256": "23f79c67759708919c3b5e7ba83406df0b382fe86cdd48f0cbedbbc8c92afd96", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:bit_manipulation/single_bit_manipulation_operations.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "from __future__ import annotations\n\n\ndef two_sum(nums: list[int], target: int) -> list[int]:\n \"\"\"\n >>> two_sum([2, 7, 11, 15], 9)\n [0, 1]\n >>> two_sum([15, 2, 11, 7], 13)\n [1, 2]\n >>> two_sum([2, 7, 11, 15], 17)\n [0, 3]\n >>> two_sum([7, 15, 11, 2], 18)\n [0, 2]\n >>> two_sum([2, 7, 11, 15], 26)\n [2, 3]\n >>> two_sum([2, 7, 11, 15], 8)\n []\n >>> two_sum([3 * i for i in range(10)], 19)\n []\n \"\"\"\n chk_map: dict[int, int] = {}\n for index, val in enumerate(nums):\n compl = target - val\n if compl in chk_map:\n return [chk_map[compl], index]\n chk_map[val] = index\n return []\n"}, "sha256": "8f5f7af6798330f6b079091f3996cd5fd7cb421b6afb6d8789bc5d1dcc79e172"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "8f5f7af6798330f6b079091f3996cd5fd7cb421b6afb6d8789bc5d1dcc79e172", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "8eef962660994b435b1d8dd10f3853a72271630a7a12353186f5ca404aaadcab", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00014"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00014", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "from __future__ import annotations\n\n\ndef two_sum(nums: list[int], target: int) -> list[int]:\n \"\"\"\n >>> two_sum([2, 7, 11, 15], 9)\n [0, 1]\n >>> two_sum([15, 2, 11, 7], 13)\n [1, 2]\n >>> two_sum([2, 7, 11, 15], 17)\n [0, 3]\n >>> two_sum([7, 15, 11, 2], 18)\n [0, 2]\n >>> two_sum([2, 7, 11, 15], 26)\n [2, 3]\n >>> two_sum([2, 7, 11, 15], 8)\n []\n >>> two_sum([3 * i for i in range(10)], 19)\n []\n \"\"\"\n chk_map: dict[int, int] = {}\n for index, val in enumerate(nums):\n compl = target + val\n if compl in chk_map:\n return [chk_map[compl], index]\n chk_map[val] = index\n return []\n"}, "sha256": "c52a301eff18aea222bbf7dafb3d8aaa1efafa08baf2b8c5fed3bfb5fc116aa6"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "two_sum:0", "got": "[]\n", "source": "two_sum([2, 7, 11, 15], 9)\n", "truncated": false, "want": "[0, 1]\n"}, {"example_id": "two_sum:1", "got": "[0, 1]\n", "source": "two_sum([15, 2, 11, 7], 13)\n", "truncated": false, "want": "[1, 2]\n"}, {"example_id": "two_sum:2", "got": "[]\n", "source": "two_sum([2, 7, 11, 15], 17)\n", "truncated": false, "want": "[0, 3]\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 23, "end_byte": 536, "lineno": 23, "node": "BinOp", "node_col_offset": 16, "node_end_col_offset": 28, "node_end_lineno": 23, "node_lineno": 23, "op_index": 0, "original_text": "-", "replacement_text": "+", "start_byte": 535}}, "public_tests": {"examples": [{"example_id": "two_sum:0", "source": "two_sum([2, 7, 11, 15], 9)\n", "want": "[0, 1]\n"}, {"example_id": "two_sum:1", "source": "two_sum([15, 2, 11, 7], 13)\n", "want": "[1, 2]\n"}, {"example_id": "two_sum:2", "source": "two_sum([2, 7, 11, 15], 17)\n", "want": "[0, 3]\n"}, {"example_id": "two_sum:3", "source": "two_sum([7, 15, 11, 2], 18)\n", "want": "[0, 2]\n"}, {"example_id": "two_sum:4", "source": "two_sum([2, 7, 11, 15], 26)\n", "want": "[2, 3]\n"}, {"example_id": "two_sum:5", "source": "two_sum([2, 7, 11, 15], 8)\n", "want": "[]\n"}, {"example_id": "two_sum:6", "source": "two_sum([3 * i for i in range(10)], 19)\n", "want": "[]\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-42102b9d16e1af5e", "tree_sha256": "8f5f7af6798330f6b079091f3996cd5fd7cb421b6afb6d8789bc5d1dcc79e172", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/two_sum.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def merge(arr: list[int]) -> list[int]:\n \"\"\"Return a sorted array.\n >>> merge([10,9,8,7,6,5,4,3,2,1])\n [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n >>> merge([1,2,3,4,5,6,7,8,9,10])\n [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n >>> merge([10,22,1,2,3,9,15,23])\n [1, 2, 3, 9, 10, 15, 22, 23]\n >>> merge([100])\n [100]\n >>> merge([])\n []\n \"\"\"\n if len(arr) > 1:\n middle_length = len(arr) // 2 # Finds the middle of the array\n left_array = arr[\n :middle_length\n ] # Creates an array of the elements in the first half.\n right_array = arr[\n middle_length:\n ] # Creates an array of the elements in the second half.\n left_size = len(left_array)\n right_size = len(right_array)\n merge(left_array) # Starts sorting the left.\n merge(right_array) # Starts sorting the right\n left_index = 0 # Left Counter\n right_index = 0 # Right Counter\n index = 0 # Position Counter\n while (\n left_index < left_size and right_index < right_size\n ): # Runs until the lowers size of the left and right are sorted.\n if left_array[left_index] < right_array[right_index]:\n arr[index] = left_array[left_index]\n left_index += 1\n else:\n arr[index] = right_array[right_index]\n right_index += 1\n index += 1\n while (\n left_index < left_size\n ): # Adds the left over elements in the left half of the array\n arr[index] = left_array[left_index]\n left_index += 1\n index += 1\n while (\n right_index < right_size\n ): # Adds the left over elements in the right half of the array\n arr[index] = right_array[right_index]\n right_index += 1\n index += 1\n return arr\n"}, "sha256": "b262d138e0740ab6aa614845d394aa7f9395b13710e5bb769e2f4637dc4ef379"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "b262d138e0740ab6aa614845d394aa7f9395b13710e5bb769e2f4637dc4ef379", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "fc211a5e730267337b76a74b4c7fc6a694d182121b6b944e611b805e2fe00c5e", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00017"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00017", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 16, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def merge(arr: list[int]) -> list[int]:\n \"\"\"Return a sorted array.\n >>> merge([10,9,8,7,6,5,4,3,2,1])\n [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n >>> merge([1,2,3,4,5,6,7,8,9,10])\n [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n >>> merge([10,22,1,2,3,9,15,23])\n [1, 2, 3, 9, 10, 15, 22, 23]\n >>> merge([100])\n [100]\n >>> merge([])\n []\n \"\"\"\n if len(arr) > 0:\n middle_length = len(arr) // 2 # Finds the middle of the array\n left_array = arr[\n :middle_length\n ] # Creates an array of the elements in the first half.\n right_array = arr[\n middle_length:\n ] # Creates an array of the elements in the second half.\n left_size = len(left_array)\n right_size = len(right_array)\n merge(left_array) # Starts sorting the left.\n merge(right_array) # Starts sorting the right\n left_index = 0 # Left Counter\n right_index = 0 # Right Counter\n index = 0 # Position Counter\n while (\n left_index < left_size and right_index < right_size\n ): # Runs until the lowers size of the left and right are sorted.\n if left_array[left_index] < right_array[right_index]:\n arr[index] = left_array[left_index]\n left_index += 1\n else:\n arr[index] = right_array[right_index]\n right_index += 1\n index += 1\n while (\n left_index < left_size\n ): # Adds the left over elements in the left half of the array\n arr[index] = left_array[left_index]\n left_index += 1\n index += 1\n while (\n right_index < right_size\n ): # Adds the left over elements in the right half of the array\n arr[index] = right_array[right_index]\n right_index += 1\n index += 1\n return arr\n"}, "sha256": "074f1465c8b0e8c26d0ebfeba70aa427d55ea097cec791caca1f0c6ec0b167bb"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "merge:0", "got": "RecursionError: maximum recursion depth exceeded", "source": "merge([10,9,8,7,6,5,4,3,2,1])\n", "truncated": false, "want": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n"}, {"example_id": "merge:1", "got": "RecursionError: maximum recursion depth exceeded", "source": "merge([1,2,3,4,5,6,7,8,9,10])\n", "truncated": false, "want": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n"}, {"example_id": "merge:2", "got": "RecursionError: maximum recursion depth exceeded", "source": "merge([10,22,1,2,3,9,15,23])\n", "truncated": false, "want": "[1, 2, 3, 9, 10, 15, 22, 23]\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "off_by_one", "seed": 7, "span": {"col_offset": 18, "end_byte": 371, "lineno": 14, "node": "Constant", "node_col_offset": 18, "node_end_col_offset": 19, "node_end_lineno": 14, "node_lineno": 14, "op_index": 0, "original_text": "1", "replacement_text": "0", "start_byte": 370}}, "public_tests": {"examples": [{"example_id": "merge:0", "source": "merge([10,9,8,7,6,5,4,3,2,1])\n", "want": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n"}, {"example_id": "merge:1", "source": "merge([1,2,3,4,5,6,7,8,9,10])\n", "want": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n"}, {"example_id": "merge:2", "source": "merge([10,22,1,2,3,9,15,23])\n", "want": "[1, 2, 3, 9, 10, 15, 22, 23]\n"}, {"example_id": "merge:3", "source": "merge([100])\n", "want": "[100]\n"}, {"example_id": "merge:4", "source": "merge([])\n", "want": "[]\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-7a45c92e46ccd4d3", "tree_sha256": "b262d138e0740ab6aa614845d394aa7f9395b13710e5bb769e2f4637dc4ef379", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:sorts/recursive_mergesort_array.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def ipv4_to_decimal(ipv4_address: str) -> int:\n \"\"\"\n Convert an IPv4 address to its decimal representation.\n\n Args:\n ip_address: A string representing an IPv4 address (e.g., \"192.168.0.1\").\n\n Returns:\n int: The decimal representation of the IP address.\n\n >>> ipv4_to_decimal(\"192.168.0.1\")\n 3232235521\n >>> ipv4_to_decimal(\"10.0.0.255\")\n 167772415\n >>> ipv4_to_decimal(\"10.0.255\")\n Traceback (most recent call last):\n ...\n ValueError: Invalid IPv4 address format\n >>> ipv4_to_decimal(\"10.0.0.256\")\n Traceback (most recent call last):\n ...\n ValueError: Invalid IPv4 octet 256\n \"\"\"\n\n octets = [int(octet) for octet in ipv4_address.split(\".\")]\n if len(octets) != 4:\n raise ValueError(\"Invalid IPv4 address format\")\n\n decimal_ipv4 = 0\n for octet in octets:\n if not 0 <= octet <= 255:\n raise ValueError(f\"Invalid IPv4 octet {octet}\") # noqa: EM102\n decimal_ipv4 = (decimal_ipv4 << 8) + int(octet)\n\n return decimal_ipv4\n"}, "sha256": "c5addf0c8bc971441899883d29d1096f60bbcd009fc78f57ea71f085e4379b20"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "c5addf0c8bc971441899883d29d1096f60bbcd009fc78f57ea71f085e4379b20", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "f310ae1019eaafdbfe2ff29998b97ce782f52b3ef1210c9779b3a1ab7b2e6bd4", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00018"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00018", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 2, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def ipv4_to_decimal(ipv4_address: str) -> int:\n \"\"\"\n Convert an IPv4 address to its decimal representation.\n\n Args:\n ip_address: A string representing an IPv4 address (e.g., \"192.168.0.1\").\n\n Returns:\n int: The decimal representation of the IP address.\n\n >>> ipv4_to_decimal(\"192.168.0.1\")\n 3232235521\n >>> ipv4_to_decimal(\"10.0.0.255\")\n 167772415\n >>> ipv4_to_decimal(\"10.0.255\")\n Traceback (most recent call last):\n ...\n ValueError: Invalid IPv4 address format\n >>> ipv4_to_decimal(\"10.0.0.256\")\n Traceback (most recent call last):\n ...\n ValueError: Invalid IPv4 octet 256\n \"\"\"\n\n octets = [int(octet) for octet in ipv4_address.split(\".\")]\n if len(octets) != 3:\n raise ValueError(\"Invalid IPv4 address format\")\n\n decimal_ipv4 = 0\n for octet in octets:\n if not 0 <= octet <= 255:\n raise ValueError(f\"Invalid IPv4 octet {octet}\") # noqa: EM102\n decimal_ipv4 = (decimal_ipv4 << 8) + int(octet)\n\n return decimal_ipv4\n"}, "sha256": "6720fc3426ba6455b400056f59f9d3b5ef2e5b5bdda1c0d643d8bdb7a5a5a065"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "ipv4_to_decimal:0", "got": "ValueError: Invalid IPv4 address format", "source": "ipv4_to_decimal(\"192.168.0.1\")\n", "truncated": false, "want": "3232235521\n"}, {"example_id": "ipv4_to_decimal:1", "got": "ValueError: Invalid IPv4 address format", "source": "ipv4_to_decimal(\"10.0.0.255\")\n", "truncated": false, "want": "167772415\n"}, {"example_id": "ipv4_to_decimal:2", "got": "655615\n", "source": "ipv4_to_decimal(\"10.0.255\")\n", "truncated": false, "want": "Traceback (most recent call last):\n ...\nValueError: Invalid IPv4 address format\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "off_by_one", "seed": 7, "span": {"col_offset": 22, "end_byte": 740, "lineno": 26, "node": "Constant", "node_col_offset": 22, "node_end_col_offset": 23, "node_end_lineno": 26, "node_lineno": 26, "op_index": 0, "original_text": "4", "replacement_text": "3", "start_byte": 739}}, "public_tests": {"examples": [{"example_id": "ipv4_to_decimal:0", "source": "ipv4_to_decimal(\"192.168.0.1\")\n", "want": "3232235521\n"}, {"example_id": "ipv4_to_decimal:1", "source": "ipv4_to_decimal(\"10.0.0.255\")\n", "want": "167772415\n"}, {"example_id": "ipv4_to_decimal:2", "source": "ipv4_to_decimal(\"10.0.255\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: Invalid IPv4 address format\n"}, {"example_id": "ipv4_to_decimal:3", "source": "ipv4_to_decimal(\"10.0.0.256\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: Invalid IPv4 octet 256\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-66a134cd57c5f051", "tree_sha256": "c5addf0c8bc971441899883d29d1096f60bbcd009fc78f57ea71f085e4379b20", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:conversions/ipv4_conversion.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def reverse_letters(sentence: str, length: int = 0) -> str:\n \"\"\"\n Reverse all words that are longer than the given length of characters in a sentence.\n If ``length`` is not specified, it defaults to 0.\n\n >>> reverse_letters(\"Hey wollef sroirraw\", 3)\n 'Hey fellow warriors'\n >>> reverse_letters(\"nohtyP is nohtyP\", 2)\n 'Python is Python'\n >>> reverse_letters(\"1 12 123 1234 54321 654321\", 0)\n '1 21 321 4321 12345 123456'\n >>> reverse_letters(\"racecar\")\n 'racecar'\n \"\"\"\n return \" \".join(\n word[::-1] if len(word) > length else word for word in sentence.split()\n )\n"}, "sha256": "766ae8d89806838d4677faab4b4a239b52fc9a949d9fcfe54cb37e18e0b9518d"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "766ae8d89806838d4677faab4b4a239b52fc9a949d9fcfe54cb37e18e0b9518d", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "98581f5d31787a7329c4792412858ed931c6d1294462f0c1e8a80fb9963b1456", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00019"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00019", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def reverse_letters(sentence: str, length: int = 0) -> str:\n \"\"\"\n Reverse all words that are longer than the given length of characters in a sentence.\n If ``length`` is not specified, it defaults to 0.\n\n >>> reverse_letters(\"Hey wollef sroirraw\", 3)\n 'Hey fellow warriors'\n >>> reverse_letters(\"nohtyP is nohtyP\", 2)\n 'Python is Python'\n >>> reverse_letters(\"1 12 123 1234 54321 654321\", 0)\n '1 21 321 4321 12345 123456'\n >>> reverse_letters(\"racecar\")\n 'racecar'\n \"\"\"\n return \" \".join(\n word[::-1] if len(word) >= length else word for word in sentence.split()\n )\n"}, "sha256": "ddc17ecdb785529a75e1abe2be10c645f08369761302e2975247bd3082884215"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "reverse_letters:0", "got": "'yeH fellow warriors'\n", "source": "reverse_letters(\"Hey wollef sroirraw\", 3)\n", "truncated": false, "want": "'Hey fellow warriors'\n"}, {"example_id": "reverse_letters:1", "got": "'Python si Python'\n", "source": "reverse_letters(\"nohtyP is nohtyP\", 2)\n", "truncated": false, "want": "'Python is Python'\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "comparison_boundary", "seed": 7, "span": {"col_offset": 32, "end_byte": 559, "lineno": 16, "node": "Compare", "node_col_offset": 22, "node_end_col_offset": 40, "node_end_lineno": 16, "node_lineno": 16, "op_index": 0, "original_text": ">", "replacement_text": ">=", "start_byte": 558}}, "public_tests": {"examples": [{"example_id": "reverse_letters:0", "source": "reverse_letters(\"Hey wollef sroirraw\", 3)\n", "want": "'Hey fellow warriors'\n"}, {"example_id": "reverse_letters:1", "source": "reverse_letters(\"nohtyP is nohtyP\", 2)\n", "want": "'Python is Python'\n"}, {"example_id": "reverse_letters:2", "source": "reverse_letters(\"1 12 123 1234 54321 654321\", 0)\n", "want": "'1 21 321 4321 12345 123456'\n"}, {"example_id": "reverse_letters:3", "source": "reverse_letters(\"racecar\")\n", "want": "'racecar'\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-e6cb337d96d7fd76", "tree_sha256": "766ae8d89806838d4677faab4b4a239b52fc9a949d9fcfe54cb37e18e0b9518d", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:strings/reverse_letters.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def modular_exponential(base: int, power: int, mod: int):\n \"\"\"\n >>> modular_exponential(5, 0, 10)\n 1\n >>> modular_exponential(2, 8, 7)\n 4\n >>> modular_exponential(3, -2, 9)\n -1\n \"\"\"\n\n if power < 0:\n return -1\n base %= mod\n result = 1\n\n while power > 0:\n if power & 1:\n result = (result * base) % mod\n power = power >> 1\n base = (base * base) % mod\n\n return result\n"}, "sha256": "c0018cd6453aff85d0e9f920af438ec0c72a4465be88aba87597f82bac83b5c6"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "c0018cd6453aff85d0e9f920af438ec0c72a4465be88aba87597f82bac83b5c6", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "882262b9f052166f96af2466bad8fbb05d32d5bb771742a7fa870709b21c6d1c", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00020"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00020", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def modular_exponential(base: int, power: int, mod: int):\n \"\"\"\n >>> modular_exponential(5, 0, 10)\n 1\n >>> modular_exponential(2, 8, 7)\n 4\n >>> modular_exponential(3, -2, 9)\n -1\n \"\"\"\n\n if power < 0:\n return -1\n base %= mod\n result = 1\n\n while power > 0:\n if power & 1:\n result = (result * base) // mod\n power = power >> 1\n base = (base * base) % mod\n\n return result\n"}, "sha256": "d61b15402fcfa30ffd2c428cc3708f5c9a746fa3881c4ddd8422e06f2ae3c594"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "modular_exponential:1", "got": "0\n", "source": "modular_exponential(2, 8, 7)\n", "truncated": false, "want": "4\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 37, "end_byte": 356, "lineno": 18, "node": "BinOp", "node_col_offset": 21, "node_end_col_offset": 42, "node_end_lineno": 18, "node_lineno": 18, "op_index": 0, "original_text": "%", "replacement_text": "//", "start_byte": 355}}, "public_tests": {"examples": [{"example_id": "modular_exponential:0", "source": "modular_exponential(5, 0, 10)\n", "want": "1\n"}, {"example_id": "modular_exponential:1", "source": "modular_exponential(2, 8, 7)\n", "want": "4\n"}, {"example_id": "modular_exponential:2", "source": "modular_exponential(3, -2, 9)\n", "want": "-1\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-68b78efb649b5e9a", "tree_sha256": "c0018cd6453aff85d0e9f920af438ec0c72a4465be88aba87597f82bac83b5c6", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/modular_exponential.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "from math import factorial, radians\n\n\ndef sin(\n angle_in_degrees: float, accuracy: int = 18, rounded_values_count: int = 10\n) -> float:\n \"\"\"\n Implement sin function.\n\n >>> sin(0.0)\n 0.0\n >>> sin(90.0)\n 1.0\n >>> sin(180.0)\n 0.0\n >>> sin(270.0)\n -1.0\n >>> sin(0.68)\n 0.0118679603\n >>> sin(1.97)\n 0.0343762121\n >>> sin(64.0)\n 0.8987940463\n >>> sin(9999.0)\n -0.9876883406\n >>> sin(-689.0)\n 0.5150380749\n >>> sin(89.7)\n 0.9999862922\n \"\"\"\n # Simplify the angle to be between 360 and -360 degrees.\n angle_in_degrees = angle_in_degrees - ((angle_in_degrees // 360.0) * 360.0)\n\n # Converting from degrees to radians\n angle_in_radians = radians(angle_in_degrees)\n\n result = angle_in_radians\n a = 3\n b = -1\n\n for _ in range(accuracy):\n result += (b * (angle_in_radians**a)) / factorial(a)\n\n b = -b # One positive term and the next will be negative and so on...\n a += 2 # Increased by 2 for every term.\n\n return round(result, rounded_values_count)\n"}, "sha256": "e1a60c9ec00ae8da4aba2fc2dd58d1796db5c121c8d740f53beabfa821a1c7fd"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "e1a60c9ec00ae8da4aba2fc2dd58d1796db5c121c8d740f53beabfa821a1c7fd", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "1ad40cb1266e72006bd8ed8d77bae413a28856f6e095ed00a7b2e1b1fdb88472", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00021"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00021", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "from math import factorial, radians\n\n\ndef sin(\n angle_in_degrees: float, accuracy: int = 18, rounded_values_count: int = 10\n) -> float:\n \"\"\"\n Implement sin function.\n\n >>> sin(0.0)\n 0.0\n >>> sin(90.0)\n 1.0\n >>> sin(180.0)\n 0.0\n >>> sin(270.0)\n -1.0\n >>> sin(0.68)\n 0.0118679603\n >>> sin(1.97)\n 0.0343762121\n >>> sin(64.0)\n 0.8987940463\n >>> sin(9999.0)\n -0.9876883406\n >>> sin(-689.0)\n 0.5150380749\n >>> sin(89.7)\n 0.9999862922\n \"\"\"\n # Simplify the angle to be between 360 and -360 degrees.\n angle_in_degrees = angle_in_degrees - ((angle_in_degrees // 360.0) * 360.0)\n\n # Converting from degrees to radians\n angle_in_radians = radians(angle_in_degrees)\n\n result = angle_in_radians\n a = 3\n b = -1\n\n for _ in range(accuracy):\n result += (b * (angle_in_radians**a)) / factorial(a)\n\n b = -b # One positive term and the next will be negative and so on...\n a += 2 # Increased by 2 for every term.\n\n return round(result, rounded_values_count) + 1\n"}, "sha256": "e4ee68d5810738255b8018aa9c7e8ddb1da6fa14fc5333d5294a6b1ee8daa174"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "sin:0", "got": "1.0\n", "source": "sin(0.0)\n", "truncated": false, "want": "0.0\n"}, {"example_id": "sin:1", "got": "2.0\n", "source": "sin(90.0)\n", "truncated": false, "want": "1.0\n"}, {"example_id": "sin:2", "got": "1.0\n", "source": "sin(180.0)\n", "truncated": false, "want": "0.0\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 1057, "lineno": 47, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 46, "node_end_lineno": 47, "node_lineno": 47, "op_index": 0, "original_text": "round(result, rounded_values_count)", "replacement_text": "round(result, rounded_values_count) + 1", "start_byte": 1022}}, "public_tests": {"examples": [{"example_id": "sin:0", "source": "sin(0.0)\n", "want": "0.0\n"}, {"example_id": "sin:1", "source": "sin(90.0)\n", "want": "1.0\n"}, {"example_id": "sin:2", "source": "sin(180.0)\n", "want": "0.0\n"}, {"example_id": "sin:3", "source": "sin(270.0)\n", "want": "-1.0\n"}, {"example_id": "sin:4", "source": "sin(0.68)\n", "want": "0.0118679603\n"}, {"example_id": "sin:5", "source": "sin(1.97)\n", "want": "0.0343762121\n"}, {"example_id": "sin:6", "source": "sin(64.0)\n", "want": "0.8987940463\n"}, {"example_id": "sin:7", "source": "sin(9999.0)\n", "want": "-0.9876883406\n"}, {"example_id": "sin:8", "source": "sin(-689.0)\n", "want": "0.5150380749\n"}, {"example_id": "sin:9", "source": "sin(89.7)\n", "want": "0.9999862922\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-f6ccaf90979b86aa", "tree_sha256": "e1a60c9ec00ae8da4aba2fc2dd58d1796db5c121c8d740f53beabfa821a1c7fd", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/sin.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def remove_digit(num: int) -> int:\n \"\"\"\n\n returns the biggest possible result\n that can be achieved by removing\n one digit from the given number\n\n >>> remove_digit(152)\n 52\n >>> remove_digit(6385)\n 685\n >>> remove_digit(-11)\n 1\n >>> remove_digit(2222222)\n 222222\n >>> remove_digit(\"2222222\")\n Traceback (most recent call last):\n TypeError: only integers accepted as input\n >>> remove_digit(\"string input\")\n Traceback (most recent call last):\n TypeError: only integers accepted as input\n \"\"\"\n\n if not isinstance(num, int):\n raise TypeError(\"only integers accepted as input\")\n else:\n num_str = str(abs(num))\n num_transpositions = [list(num_str) for char in range(len(num_str))]\n for index in range(len(num_str)):\n num_transpositions[index].pop(index)\n return max(\n int(\"\".join(list(transposition))) for transposition in num_transpositions\n )\n"}, "sha256": "61ca37f97e3dade0dd2bbf751faabf0e683e7b9d12a11d77371657bab171ef67"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "61ca37f97e3dade0dd2bbf751faabf0e683e7b9d12a11d77371657bab171ef67", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "ba78557d21a671d4c68043eca2a7d82d3ebb8dd1f4cc6d6ef76fc92b90c1b710", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00022"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00022", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def remove_digit(num: int) -> int:\n \"\"\"\n\n returns the biggest possible result\n that can be achieved by removing\n one digit from the given number\n\n >>> remove_digit(152)\n 52\n >>> remove_digit(6385)\n 685\n >>> remove_digit(-11)\n 1\n >>> remove_digit(2222222)\n 222222\n >>> remove_digit(\"2222222\")\n Traceback (most recent call last):\n TypeError: only integers accepted as input\n >>> remove_digit(\"string input\")\n Traceback (most recent call last):\n TypeError: only integers accepted as input\n \"\"\"\n\n if not isinstance(num, int):\n raise TypeError(\"only integers accepted as input\")\n else:\n num_str = str(abs(num))\n num_transpositions = [list(num_str) for char in range(len(num_str))]\n for index in range(len(num_str)):\n num_transpositions[index].pop(index)\n return max(\n int(\"\".join(list(transposition))) for transposition in num_transpositions\n ) + 1\n"}, "sha256": "5ad2b15e878d471acec65144cc97bcd40d2c3ade5c3b419623a795787e3f4298"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "remove_digit:0", "got": "53\n", "source": "remove_digit(152)\n", "truncated": false, "want": "52\n"}, {"example_id": "remove_digit:1", "got": "686\n", "source": "remove_digit(6385)\n", "truncated": false, "want": "685\n"}, {"example_id": "remove_digit:2", "got": "2\n", "source": "remove_digit(-11)\n", "truncated": false, "want": "1\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 15, "end_byte": 966, "lineno": 31, "node": "Return", "node_col_offset": 8, "node_end_col_offset": 9, "node_end_lineno": 33, "node_lineno": 31, "op_index": 0, "original_text": "max(\n int(\"\".join(list(transposition))) for transposition in num_transpositions\n )", "replacement_text": "max(\n int(\"\".join(list(transposition))) for transposition in num_transpositions\n ) + 1", "start_byte": 866}}, "public_tests": {"examples": [{"example_id": "remove_digit:0", "source": "remove_digit(152)\n", "want": "52\n"}, {"example_id": "remove_digit:1", "source": "remove_digit(6385)\n", "want": "685\n"}, {"example_id": "remove_digit:2", "source": "remove_digit(-11)\n", "want": "1\n"}, {"example_id": "remove_digit:3", "source": "remove_digit(2222222)\n", "want": "222222\n"}, {"example_id": "remove_digit:4", "source": "remove_digit(\"2222222\")\n", "want": "Traceback (most recent call last):\nTypeError: only integers accepted as input\n"}, {"example_id": "remove_digit:5", "source": "remove_digit(\"string input\")\n", "want": "Traceback (most recent call last):\nTypeError: only integers accepted as input\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-6516ac9b7ea66ad2", "tree_sha256": "61ca37f97e3dade0dd2bbf751faabf0e683e7b9d12a11d77371657bab171ef67", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/remove_digit.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "import re\n\n\ndef indian_phone_validator(phone: str) -> bool:\n \"\"\"\n Determine whether the string is a valid phone number or not\n :param phone:\n :return: Boolean\n >>> indian_phone_validator(\"+91123456789\")\n False\n >>> indian_phone_validator(\"+919876543210\")\n True\n >>> indian_phone_validator(\"01234567896\")\n False\n >>> indian_phone_validator(\"919876543218\")\n True\n >>> indian_phone_validator(\"+91-1234567899\")\n False\n >>> indian_phone_validator(\"+91-9876543218\")\n True\n \"\"\"\n pat = re.compile(r\"^(\\+91[\\-\\s]?)?[0]?(91)?[789]\\d{9}$\")\n if match := re.search(pat, phone):\n return match.string == phone\n return False\n"}, "sha256": "5f5871fd39f9468f352fc5f003985517b20ecf99e646279baa6ee1f231a1bdcf"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "5f5871fd39f9468f352fc5f003985517b20ecf99e646279baa6ee1f231a1bdcf", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "bac6bd615732ae6301fe8925c0a2097b66d9ad2809a902d24b178561b4a382f3", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00023"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00023", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 22, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "import re\n\n\ndef indian_phone_validator(phone: str) -> bool:\n \"\"\"\n Determine whether the string is a valid phone number or not\n :param phone:\n :return: Boolean\n >>> indian_phone_validator(\"+91123456789\")\n False\n >>> indian_phone_validator(\"+919876543210\")\n True\n >>> indian_phone_validator(\"01234567896\")\n False\n >>> indian_phone_validator(\"919876543218\")\n True\n >>> indian_phone_validator(\"+91-1234567899\")\n False\n >>> indian_phone_validator(\"+91-9876543218\")\n True\n \"\"\"\n pat = re.compile(r\"^(\\+91[\\-\\s]?)?[0]?(91)?[789]\\d{9}$\")\n if match := re.search(pat, phone):\n return match.string != phone\n return False\n"}, "sha256": "17255f225d48760ac107922abada3b0c96f71ffd12f79bb2ae25ab465753a6c5"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "indian_phone_validator:1", "got": "False\n", "source": "indian_phone_validator(\"+919876543210\")\n", "truncated": false, "want": "True\n"}, {"example_id": "indian_phone_validator:3", "got": "False\n", "source": "indian_phone_validator(\"919876543218\")\n", "truncated": false, "want": "True\n"}, {"example_id": "indian_phone_validator:5", "got": "False\n", "source": "indian_phone_validator(\"+91-9876543218\")\n", "truncated": false, "want": "True\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "boolean_condition", "seed": 7, "span": {"col_offset": 28, "end_byte": 652, "lineno": 24, "node": "Compare", "node_col_offset": 15, "node_end_col_offset": 36, "node_end_lineno": 24, "node_lineno": 24, "op_index": 0, "original_text": "==", "replacement_text": "!=", "start_byte": 650}}, "public_tests": {"examples": [{"example_id": "indian_phone_validator:0", "source": "indian_phone_validator(\"+91123456789\")\n", "want": "False\n"}, {"example_id": "indian_phone_validator:1", "source": "indian_phone_validator(\"+919876543210\")\n", "want": "True\n"}, {"example_id": "indian_phone_validator:2", "source": "indian_phone_validator(\"01234567896\")\n", "want": "False\n"}, {"example_id": "indian_phone_validator:3", "source": "indian_phone_validator(\"919876543218\")\n", "want": "True\n"}, {"example_id": "indian_phone_validator:4", "source": "indian_phone_validator(\"+91-1234567899\")\n", "want": "False\n"}, {"example_id": "indian_phone_validator:5", "source": "indian_phone_validator(\"+91-9876543218\")\n", "want": "True\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-fbd873dbb015f82b", "tree_sha256": "5f5871fd39f9468f352fc5f003985517b20ecf99e646279baa6ee1f231a1bdcf", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:strings/indian_phone_validator.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def get_1s_count(number: int) -> int:\n \"\"\"\n Count the number of set bits in a 32 bit integer using Brian Kernighan's way.\n Ref - https://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetKernighan\n >>> get_1s_count(25)\n 3\n >>> get_1s_count(37)\n 3\n >>> get_1s_count(21)\n 3\n >>> get_1s_count(58)\n 4\n >>> get_1s_count(0)\n 0\n >>> get_1s_count(256)\n 1\n >>> get_1s_count(-1)\n Traceback (most recent call last):\n ...\n ValueError: Input must be a non-negative integer\n >>> get_1s_count(0.8)\n Traceback (most recent call last):\n ...\n ValueError: Input must be a non-negative integer\n >>> get_1s_count(\"25\")\n Traceback (most recent call last):\n ...\n ValueError: Input must be a non-negative integer\n \"\"\"\n if not isinstance(number, int) or number < 0:\n raise ValueError(\"Input must be a non-negative integer\")\n\n count = 0\n while number:\n # This way we arrive at next set bit (next 1) instead of looping\n # through each bit and checking for 1s hence the\n # loop won't run 32 times it will only run the number of `1` times\n number &= number - 1\n count += 1\n return count\n"}, "sha256": "835a37970043464eb9a953ee9a7d481a8b11e916037312711872f871fdc5a3e4"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "835a37970043464eb9a953ee9a7d481a8b11e916037312711872f871fdc5a3e4", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "3b63c251e140239cfd3467b4bdec3d3478ca524f088e331a332fd8f0c094571b", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00027"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00027", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def get_1s_count(number: int) -> int:\n \"\"\"\n Count the number of set bits in a 32 bit integer using Brian Kernighan's way.\n Ref - https://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetKernighan\n >>> get_1s_count(25)\n 3\n >>> get_1s_count(37)\n 3\n >>> get_1s_count(21)\n 3\n >>> get_1s_count(58)\n 4\n >>> get_1s_count(0)\n 0\n >>> get_1s_count(256)\n 1\n >>> get_1s_count(-1)\n Traceback (most recent call last):\n ...\n ValueError: Input must be a non-negative integer\n >>> get_1s_count(0.8)\n Traceback (most recent call last):\n ...\n ValueError: Input must be a non-negative integer\n >>> get_1s_count(\"25\")\n Traceback (most recent call last):\n ...\n ValueError: Input must be a non-negative integer\n \"\"\"\n if isinstance(number, int) or number < 0:\n raise ValueError(\"Input must be a non-negative integer\")\n\n count = 0\n while number:\n # This way we arrive at next set bit (next 1) instead of looping\n # through each bit and checking for 1s hence the\n # loop won't run 32 times it will only run the number of `1` times\n number &= number - 1\n count += 1\n return count\n"}, "sha256": "f0370fab15f49680c35fc60c237251e6498221256bb1f64a9f64b0ab054516b6"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "get_1s_count:0", "got": "ValueError: Input must be a non-negative integer", "source": "get_1s_count(25)\n", "truncated": false, "want": "3\n"}, {"example_id": "get_1s_count:1", "got": "ValueError: Input must be a non-negative integer", "source": "get_1s_count(37)\n", "truncated": false, "want": "3\n"}, {"example_id": "get_1s_count:2", "got": "ValueError: Input must be a non-negative integer", "source": "get_1s_count(21)\n", "truncated": false, "want": "3\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "boolean_condition", "seed": 7, "span": {"col_offset": 7, "end_byte": 808, "lineno": 30, "node": "UnaryOp", "node_col_offset": 7, "node_end_col_offset": 34, "node_end_lineno": 30, "node_lineno": 30, "op_index": 0, "original_text": "not ", "replacement_text": "", "start_byte": 804}}, "public_tests": {"examples": [{"example_id": "get_1s_count:0", "source": "get_1s_count(25)\n", "want": "3\n"}, {"example_id": "get_1s_count:1", "source": "get_1s_count(37)\n", "want": "3\n"}, {"example_id": "get_1s_count:2", "source": "get_1s_count(21)\n", "want": "3\n"}, {"example_id": "get_1s_count:3", "source": "get_1s_count(58)\n", "want": "4\n"}, {"example_id": "get_1s_count:4", "source": "get_1s_count(0)\n", "want": "0\n"}, {"example_id": "get_1s_count:5", "source": "get_1s_count(256)\n", "want": "1\n"}, {"example_id": "get_1s_count:6", "source": "get_1s_count(-1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: Input must be a non-negative integer\n"}, {"example_id": "get_1s_count:7", "source": "get_1s_count(0.8)\n", "want": "Traceback (most recent call last):\n ...\nValueError: Input must be a non-negative integer\n"}, {"example_id": "get_1s_count:8", "source": "get_1s_count(\"25\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: Input must be a non-negative integer\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-8ad53ec0378e635f", "tree_sha256": "835a37970043464eb9a953ee9a7d481a8b11e916037312711872f871fdc5a3e4", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:bit_manipulation/count_1s_brian_kernighan_method.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def naive_pattern_search(s: str, pattern: str) -> list:\n \"\"\"\n >>> naive_pattern_search(\"ABAAABCDBBABCDDEBCABC\", \"ABC\")\n [4, 10, 18]\n >>> naive_pattern_search(\"ABC\", \"ABAAABCDBBABCDDEBCABC\")\n []\n >>> naive_pattern_search(\"\", \"ABC\")\n []\n >>> naive_pattern_search(\"TEST\", \"TEST\")\n [0]\n >>> naive_pattern_search(\"ABCDEGFTEST\", \"TEST\")\n [7]\n \"\"\"\n pat_len = len(pattern)\n position = []\n for i in range(len(s) - pat_len + 1):\n match_found = True\n for j in range(pat_len):\n if s[i + j] != pattern[j]:\n match_found = False\n break\n if match_found:\n position.append(i)\n return position\n"}, "sha256": "6f912b6763d0741f5ee479f755c1853fb7b01b1f6a731ed0003f9c55f6c04d71"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "6f912b6763d0741f5ee479f755c1853fb7b01b1f6a731ed0003f9c55f6c04d71", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "4e19ef5081872bf93b1b22656a1bd50ef8ba64a28e5c1a709483d2536a168009", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00028"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00028", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def naive_pattern_search(s: str, pattern: str) -> list:\n \"\"\"\n >>> naive_pattern_search(\"ABAAABCDBBABCDDEBCABC\", \"ABC\")\n [4, 10, 18]\n >>> naive_pattern_search(\"ABC\", \"ABAAABCDBBABCDDEBCABC\")\n []\n >>> naive_pattern_search(\"\", \"ABC\")\n []\n >>> naive_pattern_search(\"TEST\", \"TEST\")\n [0]\n >>> naive_pattern_search(\"ABCDEGFTEST\", \"TEST\")\n [7]\n \"\"\"\n pat_len = len(pattern)\n position = []\n for i in range(len(s) + pat_len + 1):\n match_found = True\n for j in range(pat_len):\n if s[i + j] != pattern[j]:\n match_found = False\n break\n if match_found:\n position.append(i)\n return position\n"}, "sha256": "fcfd71dae067090b22bb50cf3b239c2b082283fe4700d9674abf8f1972f0bd84"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "naive_pattern_search:0", "got": "IndexError: string index out of range", "source": "naive_pattern_search(\"ABAAABCDBBABCDDEBCABC\", \"ABC\")\n", "truncated": false, "want": "[4, 10, 18]\n"}, {"example_id": "naive_pattern_search:1", "got": "IndexError: string index out of range", "source": "naive_pattern_search(\"ABC\", \"ABAAABCDBBABCDDEBCABC\")\n", "truncated": false, "want": "[]\n"}, {"example_id": "naive_pattern_search:2", "got": "IndexError: string index out of range", "source": "naive_pattern_search(\"\", \"ABC\")\n", "truncated": false, "want": "[]\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 26, "end_byte": 449, "lineno": 16, "node": "BinOp", "node_col_offset": 19, "node_end_col_offset": 35, "node_end_lineno": 16, "node_lineno": 16, "op_index": 0, "original_text": "-", "replacement_text": "+", "start_byte": 448}}, "public_tests": {"examples": [{"example_id": "naive_pattern_search:0", "source": "naive_pattern_search(\"ABAAABCDBBABCDDEBCABC\", \"ABC\")\n", "want": "[4, 10, 18]\n"}, {"example_id": "naive_pattern_search:1", "source": "naive_pattern_search(\"ABC\", \"ABAAABCDBBABCDDEBCABC\")\n", "want": "[]\n"}, {"example_id": "naive_pattern_search:2", "source": "naive_pattern_search(\"\", \"ABC\")\n", "want": "[]\n"}, {"example_id": "naive_pattern_search:3", "source": "naive_pattern_search(\"TEST\", \"TEST\")\n", "want": "[0]\n"}, {"example_id": "naive_pattern_search:4", "source": "naive_pattern_search(\"ABCDEGFTEST\", \"TEST\")\n", "want": "[7]\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-fb0365a668236537", "tree_sha256": "6f912b6763d0741f5ee479f755c1853fb7b01b1f6a731ed0003f9c55f6c04d71", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:strings/naive_string_search.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def shell_sort(collection: list) -> list:\n \"\"\"Implementation of shell sort algorithm in Python\n :param collection: Some mutable ordered collection with heterogeneous\n comparable items inside\n :return: the same collection ordered by ascending\n\n >>> shell_sort([3, 2, 1])\n [1, 2, 3]\n >>> shell_sort([])\n []\n >>> shell_sort([1])\n [1]\n \"\"\"\n\n # Choose an initial gap value\n gap = len(collection)\n\n # Set the gap value to be decreased by a factor of 1.3\n # after each iteration\n shrink = 1.3\n\n # Continue sorting until the gap is 1\n while gap > 1:\n # Decrease the gap value\n gap = int(gap / shrink)\n\n # Sort the elements using insertion sort\n for i in range(gap, len(collection)):\n temp = collection[i]\n j = i\n while j >= gap and collection[j - gap] > temp:\n collection[j] = collection[j - gap]\n j -= gap\n collection[j] = temp\n\n return collection\n"}, "sha256": "fc8d61fdac7e6edb10daa825c5144ffb0f1572d13985bfe21df050a6c9067cab"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "fc8d61fdac7e6edb10daa825c5144ffb0f1572d13985bfe21df050a6c9067cab", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "3e1c8ba9b5ff41500c394d11900e0bf65a5d70503e02ef7b237a6b95706eb890", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00029"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00029", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 7, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def shell_sort(collection: list) -> list:\n \"\"\"Implementation of shell sort algorithm in Python\n :param collection: Some mutable ordered collection with heterogeneous\n comparable items inside\n :return: the same collection ordered by ascending\n\n >>> shell_sort([3, 2, 1])\n [1, 2, 3]\n >>> shell_sort([])\n []\n >>> shell_sort([1])\n [1]\n \"\"\"\n\n # Choose an initial gap value\n gap = len(collection)\n\n # Set the gap value to be decreased by a factor of 1.3\n # after each iteration\n shrink = 1.3\n\n # Continue sorting until the gap is 1\n while gap > 1:\n # Decrease the gap value\n gap = int(gap / shrink)\n\n # Sort the elements using insertion sort\n for i in range(gap, len(collection)):\n temp = collection[i]\n j = i\n while j >= gap or collection[j - gap] > temp:\n collection[j] = collection[j - gap]\n j -= gap\n collection[j] = temp\n\n return collection\n"}, "sha256": "85628a17535955bc3e17c39cc0828ce70434b3c24d973b5183589e6fb6b62fc7"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "shell_sort:0", "got": "IndexError: list index out of range", "source": "shell_sort([3, 2, 1])\n", "truncated": false, "want": "[1, 2, 3]\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "boolean_condition", "seed": 7, "span": {"col_offset": 27, "end_byte": 840, "lineno": 31, "node": "BoolOp", "node_col_offset": 18, "node_end_col_offset": 57, "node_end_lineno": 31, "node_lineno": 31, "op_index": 0, "original_text": "and", "replacement_text": "or", "start_byte": 837}}, "public_tests": {"examples": [{"example_id": "shell_sort:0", "source": "shell_sort([3, 2, 1])\n", "want": "[1, 2, 3]\n"}, {"example_id": "shell_sort:1", "source": "shell_sort([])\n", "want": "[]\n"}, {"example_id": "shell_sort:2", "source": "shell_sort([1])\n", "want": "[1]\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-f9fdc2c5d299d355", "tree_sha256": "fc8d61fdac7e6edb10daa825c5144ffb0f1572d13985bfe21df050a6c9067cab", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:sorts/shrink_shell_sort.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "from __future__ import annotations\n\n\ndef maximum_non_adjacent_sum(nums: list[int]) -> int:\n \"\"\"\n Find the maximum non-adjacent sum of the integers in the nums input list\n\n >>> maximum_non_adjacent_sum([1, 2, 3])\n 4\n >>> maximum_non_adjacent_sum([1, 5, 3, 7, 2, 2, 6])\n 18\n >>> maximum_non_adjacent_sum([-1, -5, -3, -7, -2, -2, -6])\n 0\n >>> maximum_non_adjacent_sum([499, 500, -3, -7, -2, -2, -6])\n 500\n \"\"\"\n if not nums:\n return 0\n max_including = nums[0]\n max_excluding = 0\n for num in nums[1:]:\n max_including, max_excluding = (\n max_excluding + num,\n max(max_including, max_excluding),\n )\n return max(max_excluding, max_including)\n"}, "sha256": "dc59aad3f504e26529c6a1d813ab10ff5c3b0a0b9fb77e77ca08c3ef759be8aa"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "dc59aad3f504e26529c6a1d813ab10ff5c3b0a0b9fb77e77ca08c3ef759be8aa", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "7883d5428bca935af88205131d61275c5fd7136ad4b5d1dd5f15fdc175bccd4f", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00030"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00030", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 23, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "from __future__ import annotations\n\n\ndef maximum_non_adjacent_sum(nums: list[int]) -> int:\n \"\"\"\n Find the maximum non-adjacent sum of the integers in the nums input list\n\n >>> maximum_non_adjacent_sum([1, 2, 3])\n 4\n >>> maximum_non_adjacent_sum([1, 5, 3, 7, 2, 2, 6])\n 18\n >>> maximum_non_adjacent_sum([-1, -5, -3, -7, -2, -2, -6])\n 0\n >>> maximum_non_adjacent_sum([499, 500, -3, -7, -2, -2, -6])\n 500\n \"\"\"\n if not nums:\n return 0\n max_including = nums[0]\n max_excluding = 0\n for num in nums[2:]:\n max_including, max_excluding = (\n max_excluding + num,\n max(max_including, max_excluding),\n )\n return max(max_excluding, max_including)\n"}, "sha256": "0e899b5f17f739cf19b4baa3faa31931a794de525a3298ecc2a82b0196dc5402"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "maximum_non_adjacent_sum:0", "got": "3\n", "source": "maximum_non_adjacent_sum([1, 2, 3])\n", "truncated": false, "want": "4\n"}, {"example_id": "maximum_non_adjacent_sum:1", "got": "14\n", "source": "maximum_non_adjacent_sum([1, 5, 3, 7, 2, 2, 6])\n", "truncated": false, "want": "18\n"}, {"example_id": "maximum_non_adjacent_sum:3", "got": "499\n", "source": "maximum_non_adjacent_sum([499, 500, -3, -7, -2, -2, -6])\n", "truncated": false, "want": "500\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "off_by_one", "seed": 7, "span": {"col_offset": 20, "end_byte": 545, "lineno": 21, "node": "Constant", "node_col_offset": 20, "node_end_col_offset": 21, "node_end_lineno": 21, "node_lineno": 21, "op_index": 0, "original_text": "1", "replacement_text": "2", "start_byte": 544}}, "public_tests": {"examples": [{"example_id": "maximum_non_adjacent_sum:0", "source": "maximum_non_adjacent_sum([1, 2, 3])\n", "want": "4\n"}, {"example_id": "maximum_non_adjacent_sum:1", "source": "maximum_non_adjacent_sum([1, 5, 3, 7, 2, 2, 6])\n", "want": "18\n"}, {"example_id": "maximum_non_adjacent_sum:2", "source": "maximum_non_adjacent_sum([-1, -5, -3, -7, -2, -2, -6])\n", "want": "0\n"}, {"example_id": "maximum_non_adjacent_sum:3", "source": "maximum_non_adjacent_sum([499, 500, -3, -7, -2, -2, -6])\n", "want": "500\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-b8479c6c36cb0cc5", "tree_sha256": "dc59aad3f504e26529c6a1d813ab10ff5c3b0a0b9fb77e77ca08c3ef759be8aa", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:dynamic_programming/max_non_adjacent_sum.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def alternative_string_arrange(first_str: str, second_str: str) -> str:\n \"\"\"\n Return the alternative arrangements of the two strings.\n :param first_str:\n :param second_str:\n :return: String\n >>> alternative_string_arrange(\"ABCD\", \"XY\")\n 'AXBYCD'\n >>> alternative_string_arrange(\"XY\", \"ABCD\")\n 'XAYBCD'\n >>> alternative_string_arrange(\"AB\", \"XYZ\")\n 'AXBYZ'\n >>> alternative_string_arrange(\"ABC\", \"\")\n 'ABC'\n \"\"\"\n first_str_length: int = len(first_str)\n second_str_length: int = len(second_str)\n abs_length: int = (\n first_str_length if first_str_length > second_str_length else second_str_length\n )\n output_list: list = []\n for char_count in range(abs_length):\n if char_count < first_str_length:\n output_list.append(first_str[char_count])\n if char_count < second_str_length:\n output_list.append(second_str[char_count])\n return \"\".join(output_list)\n"}, "sha256": "8dbd3b1339695ab198671326040e2b43278c1548bf65179a0e06abc167d6b2db"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "8dbd3b1339695ab198671326040e2b43278c1548bf65179a0e06abc167d6b2db", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "86b2a52bb30371ddc6da7b8032f1cfd2cb8e5bb573a4204b97ac4a018056292d", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00031"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00031", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def alternative_string_arrange(first_str: str, second_str: str) -> str:\n \"\"\"\n Return the alternative arrangements of the two strings.\n :param first_str:\n :param second_str:\n :return: String\n >>> alternative_string_arrange(\"ABCD\", \"XY\")\n 'AXBYCD'\n >>> alternative_string_arrange(\"XY\", \"ABCD\")\n 'XAYBCD'\n >>> alternative_string_arrange(\"AB\", \"XYZ\")\n 'AXBYZ'\n >>> alternative_string_arrange(\"ABC\", \"\")\n 'ABC'\n \"\"\"\n first_str_length: int = len(first_str)\n second_str_length: int = len(second_str)\n abs_length: int = (\n first_str_length if first_str_length > second_str_length else second_str_length\n )\n output_list: list = []\n for char_count in range(abs_length):\n if char_count < first_str_length:\n output_list.append(first_str[char_count])\n if char_count <= second_str_length:\n output_list.append(second_str[char_count])\n return \"\".join(output_list)\n"}, "sha256": "60467d3480f15604d67e6c06c874eb52459941494b32937868d473c136a92a5b"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "alternative_string_arrange:0", "got": "IndexError: string index out of range", "source": "alternative_string_arrange(\"ABCD\", \"XY\")\n", "truncated": false, "want": "'AXBYCD'\n"}, {"example_id": "alternative_string_arrange:3", "got": "IndexError: string index out of range", "source": "alternative_string_arrange(\"ABC\", \"\")\n", "truncated": false, "want": "'ABC'\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "comparison_boundary", "seed": 7, "span": {"col_offset": 22, "end_byte": 846, "lineno": 25, "node": "Compare", "node_col_offset": 11, "node_end_col_offset": 41, "node_end_lineno": 25, "node_lineno": 25, "op_index": 0, "original_text": "<", "replacement_text": "<=", "start_byte": 845}}, "public_tests": {"examples": [{"example_id": "alternative_string_arrange:0", "source": "alternative_string_arrange(\"ABCD\", \"XY\")\n", "want": "'AXBYCD'\n"}, {"example_id": "alternative_string_arrange:1", "source": "alternative_string_arrange(\"XY\", \"ABCD\")\n", "want": "'XAYBCD'\n"}, {"example_id": "alternative_string_arrange:2", "source": "alternative_string_arrange(\"AB\", \"XYZ\")\n", "want": "'AXBYZ'\n"}, {"example_id": "alternative_string_arrange:3", "source": "alternative_string_arrange(\"ABC\", \"\")\n", "want": "'ABC'\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-3e776cacb56b39eb", "tree_sha256": "8dbd3b1339695ab198671326040e2b43278c1548bf65179a0e06abc167d6b2db", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:strings/alternative_string_arrange.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def clear_bit(number: int, position: int) -> int:\n \"\"\"\n Set the bit at position to 0.\n\n Details: perform bitwise and for given number and X.\n Where X is a number with all the bits - ones and bit on given\n position - zero.\n\n >>> clear_bit(0b10010, 1) # 0b10000\n 16\n >>> clear_bit(0b0, 5) # 0b0\n 0\n \"\"\"\n return number & ~(1 << position)\n"}, "sha256": "6abe2bfd2226ae3edd14eb5d751633a94196611090d498bd926cbc06301f0084"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "6abe2bfd2226ae3edd14eb5d751633a94196611090d498bd926cbc06301f0084", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "55532d4e7bb1a780200909c7820744253c31febe74f8ad222b47d4f0069aa2ed", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00032"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00032", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def clear_bit(number: int, position: int) -> int:\n \"\"\"\n Set the bit at position to 0.\n\n Details: perform bitwise and for given number and X.\n Where X is a number with all the bits - ones and bit on given\n position - zero.\n\n >>> clear_bit(0b10010, 1) # 0b10000\n 16\n >>> clear_bit(0b0, 5) # 0b0\n 0\n \"\"\"\n return (number & ~(1 << position)) + 1\n"}, "sha256": "94023d07cb1a646c1459b5784c63b00e733f410e21306c82a1d4569e85b2f0a9"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "clear_bit:0", "got": "17\n", "source": "clear_bit(0b10010, 1) # 0b10000\n", "truncated": false, "want": "16\n"}, {"example_id": "clear_bit:1", "got": "1\n", "source": "clear_bit(0b0, 5) # 0b0\n", "truncated": false, "want": "0\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 367, "lineno": 14, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 36, "node_end_lineno": 14, "node_lineno": 14, "op_index": 0, "original_text": "number & ~(1 << position)", "replacement_text": "(number & ~(1 << position)) + 1", "start_byte": 342}}, "public_tests": {"examples": [{"example_id": "clear_bit:0", "source": "clear_bit(0b10010, 1) # 0b10000\n", "want": "16\n"}, {"example_id": "clear_bit:1", "source": "clear_bit(0b0, 5) # 0b0\n", "want": "0\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-fef003e1263285f7", "tree_sha256": "6abe2bfd2226ae3edd14eb5d751633a94196611090d498bd926cbc06301f0084", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:bit_manipulation/single_bit_manipulation_operations.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def abs_max_sort(x: list[int]) -> int:\n \"\"\"\n >>> abs_max_sort([0,5,1,11])\n 11\n >>> abs_max_sort([3,-10,-2])\n -10\n >>> abs_max_sort([])\n Traceback (most recent call last):\n ...\n ValueError: abs_max_sort() arg is an empty sequence\n \"\"\"\n if len(x) == 0:\n raise ValueError(\"abs_max_sort() arg is an empty sequence\")\n return sorted(x, key=abs)[-1]\n"}, "sha256": "3d86db9a2ccfeaa48ecd29926e8d36c396b5741483a233da5ae06ea11b791fe2"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "3d86db9a2ccfeaa48ecd29926e8d36c396b5741483a233da5ae06ea11b791fe2", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "ffd532e3ad554fdabf352b203d65da84947faeff9dcfa6f711988721a5486725", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00033"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00033", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 12, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def abs_max_sort(x: list[int]) -> int:\n \"\"\"\n >>> abs_max_sort([0,5,1,11])\n 11\n >>> abs_max_sort([3,-10,-2])\n -10\n >>> abs_max_sort([])\n Traceback (most recent call last):\n ...\n ValueError: abs_max_sort() arg is an empty sequence\n \"\"\"\n if len(x) == 1:\n raise ValueError(\"abs_max_sort() arg is an empty sequence\")\n return sorted(x, key=abs)[-1]\n"}, "sha256": "e7e2509401af00f7b9ac88f2a8d3325d223e4f678e9006c9616c44b799d86f87"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "abs_max_sort:2", "got": "IndexError: list index out of range", "source": "abs_max_sort([])\n", "truncated": false, "want": "Traceback (most recent call last):\n ...\nValueError: abs_max_sort() arg is an empty sequence\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "off_by_one", "seed": 7, "span": {"col_offset": 17, "end_byte": 286, "lineno": 12, "node": "Constant", "node_col_offset": 17, "node_end_col_offset": 18, "node_end_lineno": 12, "node_lineno": 12, "op_index": 0, "original_text": "0", "replacement_text": "1", "start_byte": 285}}, "public_tests": {"examples": [{"example_id": "abs_max_sort:0", "source": "abs_max_sort([0,5,1,11])\n", "want": "11\n"}, {"example_id": "abs_max_sort:1", "source": "abs_max_sort([3,-10,-2])\n", "want": "-10\n"}, {"example_id": "abs_max_sort:2", "source": "abs_max_sort([])\n", "want": "Traceback (most recent call last):\n ...\nValueError: abs_max_sort() arg is an empty sequence\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-6787677ac4ed089f", "tree_sha256": "3d86db9a2ccfeaa48ecd29926e8d36c396b5741483a233da5ae06ea11b791fe2", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/abs.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def find_minimum_partitions(string: str) -> int:\n \"\"\"\n Returns the minimum cuts needed for a palindrome partitioning of string\n\n >>> find_minimum_partitions(\"aab\")\n 1\n >>> find_minimum_partitions(\"aaa\")\n 0\n >>> find_minimum_partitions(\"ababbbabbababa\")\n 3\n \"\"\"\n length = len(string)\n cut = [0] * length\n is_palindromic = [[False for i in range(length)] for j in range(length)]\n for i, c in enumerate(string):\n mincut = i\n for j in range(i + 1):\n if c == string[j] and (i - j < 2 or is_palindromic[j + 1][i - 1]):\n is_palindromic[j][i] = True\n mincut = min(mincut, 0 if j == 0 else (cut[j - 1] + 1))\n cut[i] = mincut\n return cut[length - 1]\n"}, "sha256": "57255471f2ae827b3eb9d6172263db0f845941f3738361e1a8a07e18989c6103"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "57255471f2ae827b3eb9d6172263db0f845941f3738361e1a8a07e18989c6103", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "e489d90fa8e10ab5e537af6aa784293c36c368404592c56efb1167c4ed228509", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00034"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00034", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 12, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def find_minimum_partitions(string: str) -> int:\n \"\"\"\n Returns the minimum cuts needed for a palindrome partitioning of string\n\n >>> find_minimum_partitions(\"aab\")\n 1\n >>> find_minimum_partitions(\"aaa\")\n 0\n >>> find_minimum_partitions(\"ababbbabbababa\")\n 3\n \"\"\"\n length = len(string)\n cut = [0] * length\n is_palindromic = [[False for i in range(length)] for j in range(length)]\n for i, c in enumerate(string):\n mincut = i\n for j in range(i + 1):\n if c == string[j] and (i - j < 2 or is_palindromic[j + 1][i - 1]):\n is_palindromic[j][i] = True\n mincut = min(mincut, 0 if j == 0 else (cut[j - 1] - 1))\n cut[i] = mincut\n return cut[length - 1]\n"}, "sha256": "3c747c8c551324cb5efa046d9c7281d1d0018e57f7ee0954fdd87f2018b98e3d"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "find_minimum_partitions:0", "got": "-2\n", "source": "find_minimum_partitions(\"aab\")\n", "truncated": false, "want": "1\n"}, {"example_id": "find_minimum_partitions:1", "got": "-2\n", "source": "find_minimum_partitions(\"aaa\")\n", "truncated": false, "want": "0\n"}, {"example_id": "find_minimum_partitions:2", "got": "-13\n", "source": "find_minimum_partitions(\"ababbbabbababa\")\n", "truncated": false, "want": "3\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 66, "end_byte": 688, "lineno": 20, "node": "BinOp", "node_col_offset": 55, "node_end_col_offset": 69, "node_end_lineno": 20, "node_lineno": 20, "op_index": 0, "original_text": "+", "replacement_text": "-", "start_byte": 687}}, "public_tests": {"examples": [{"example_id": "find_minimum_partitions:0", "source": "find_minimum_partitions(\"aab\")\n", "want": "1\n"}, {"example_id": "find_minimum_partitions:1", "source": "find_minimum_partitions(\"aaa\")\n", "want": "0\n"}, {"example_id": "find_minimum_partitions:2", "source": "find_minimum_partitions(\"ababbbabbababa\")\n", "want": "3\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-d37172565d53f820", "tree_sha256": "57255471f2ae827b3eb9d6172263db0f845941f3738361e1a8a07e18989c6103", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:dynamic_programming/palindrome_partitioning.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def flip_bit(number: int, position: int) -> int:\n \"\"\"\n Flip the bit at position.\n\n Details: perform bitwise xor for given number and X.\n Where X is a number with all the bits - zeroes and bit on given\n position - one.\n\n >>> flip_bit(0b101, 1) # 0b111\n 7\n >>> flip_bit(0b101, 0) # 0b100\n 4\n \"\"\"\n return number ^ (1 << position)\n"}, "sha256": "e48b6a8b586ae0e460fa40788e990a9315655b4cf900cc636f60adbd202a0ccc"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "e48b6a8b586ae0e460fa40788e990a9315655b4cf900cc636f60adbd202a0ccc", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "e66b0a799e5e2ab364eeb88ed555107d831b18de0912a60ec6892f7fd5adec44", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00036"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00036", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def flip_bit(number: int, position: int) -> int:\n \"\"\"\n Flip the bit at position.\n\n Details: perform bitwise xor for given number and X.\n Where X is a number with all the bits - zeroes and bit on given\n position - one.\n\n >>> flip_bit(0b101, 1) # 0b111\n 7\n >>> flip_bit(0b101, 0) # 0b100\n 4\n \"\"\"\n return (number ^ (1 << position)) - 1\n"}, "sha256": "d4681404f8e43bfb3f0f699d99c9eb87fc3ef7f51dc0c8614c11b905726a352f"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "flip_bit:0", "got": "6\n", "source": "flip_bit(0b101, 1) # 0b111\n", "truncated": false, "want": "7\n"}, {"example_id": "flip_bit:1", "got": "3\n", "source": "flip_bit(0b101, 0) # 0b100\n", "truncated": false, "want": "4\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 359, "lineno": 14, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 35, "node_end_lineno": 14, "node_lineno": 14, "op_index": 0, "original_text": "number ^ (1 << position)", "replacement_text": "(number ^ (1 << position)) - 1", "start_byte": 335}}, "public_tests": {"examples": [{"example_id": "flip_bit:0", "source": "flip_bit(0b101, 1) # 0b111\n", "want": "7\n"}, {"example_id": "flip_bit:1", "source": "flip_bit(0b101, 0) # 0b100\n", "want": "4\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-ce46c425b3855bea", "tree_sha256": "e48b6a8b586ae0e460fa40788e990a9315655b4cf900cc636f60adbd202a0ccc", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:bit_manipulation/single_bit_manipulation_operations.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "from math import log2\n\n\ndef binary_count_trailing_zeros(a: int) -> int:\n \"\"\"\n Take in 1 integer, return a number that is\n the number of trailing zeros in binary representation of that number.\n\n >>> binary_count_trailing_zeros(25)\n 0\n >>> binary_count_trailing_zeros(36)\n 2\n >>> binary_count_trailing_zeros(16)\n 4\n >>> binary_count_trailing_zeros(58)\n 1\n >>> binary_count_trailing_zeros(4294967296)\n 32\n >>> binary_count_trailing_zeros(0)\n 0\n >>> binary_count_trailing_zeros(-10)\n Traceback (most recent call last):\n ...\n ValueError: Input value must be a positive integer\n >>> binary_count_trailing_zeros(0.8)\n Traceback (most recent call last):\n ...\n TypeError: Input value must be a 'int' type\n >>> binary_count_trailing_zeros(\"0\")\n Traceback (most recent call last):\n ...\n TypeError: '<' not supported between instances of 'str' and 'int'\n \"\"\"\n if a < 0:\n raise ValueError(\"Input value must be a positive integer\")\n elif isinstance(a, float):\n raise TypeError(\"Input value must be a 'int' type\")\n return 0 if (a == 0) else int(log2(a & -a))\n"}, "sha256": "63ced0d798f166667ac192c0e1cc4fb5ba91fe5f5fba53702565095a5f38b9ff"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "63ced0d798f166667ac192c0e1cc4fb5ba91fe5f5fba53702565095a5f38b9ff", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "c8e96349dfb61aadb18039fbfe1ddc899b6a1866133659b03c2cb7cd9deb4edf", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00037"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00037", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "from math import log2\n\n\ndef binary_count_trailing_zeros(a: int) -> int:\n \"\"\"\n Take in 1 integer, return a number that is\n the number of trailing zeros in binary representation of that number.\n\n >>> binary_count_trailing_zeros(25)\n 0\n >>> binary_count_trailing_zeros(36)\n 2\n >>> binary_count_trailing_zeros(16)\n 4\n >>> binary_count_trailing_zeros(58)\n 1\n >>> binary_count_trailing_zeros(4294967296)\n 32\n >>> binary_count_trailing_zeros(0)\n 0\n >>> binary_count_trailing_zeros(-10)\n Traceback (most recent call last):\n ...\n ValueError: Input value must be a positive integer\n >>> binary_count_trailing_zeros(0.8)\n Traceback (most recent call last):\n ...\n TypeError: Input value must be a 'int' type\n >>> binary_count_trailing_zeros(\"0\")\n Traceback (most recent call last):\n ...\n TypeError: '<' not supported between instances of 'str' and 'int'\n \"\"\"\n if a < 0:\n raise ValueError(\"Input value must be a positive integer\")\n elif isinstance(a, float):\n raise TypeError(\"Input value must be a 'int' type\")\n return 0 if (a != 0) else int(log2(a & -a))\n"}, "sha256": "17bc02ec299e735898ddcfe037b83a74d9e9d8666938502490288075a925fd20"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "binary_count_trailing_zeros:1", "got": "0\n", "source": "binary_count_trailing_zeros(36)\n", "truncated": false, "want": "2\n"}, {"example_id": "binary_count_trailing_zeros:2", "got": "0\n", "source": "binary_count_trailing_zeros(16)\n", "truncated": false, "want": "4\n"}, {"example_id": "binary_count_trailing_zeros:3", "got": "0\n", "source": "binary_count_trailing_zeros(58)\n", "truncated": false, "want": "1\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "boolean_condition", "seed": 7, "span": {"col_offset": 19, "end_byte": 1136, "lineno": 38, "node": "Compare", "node_col_offset": 17, "node_end_col_offset": 23, "node_end_lineno": 38, "node_lineno": 38, "op_index": 0, "original_text": "==", "replacement_text": "!=", "start_byte": 1134}}, "public_tests": {"examples": [{"example_id": "binary_count_trailing_zeros:0", "source": "binary_count_trailing_zeros(25)\n", "want": "0\n"}, {"example_id": "binary_count_trailing_zeros:1", "source": "binary_count_trailing_zeros(36)\n", "want": "2\n"}, {"example_id": "binary_count_trailing_zeros:2", "source": "binary_count_trailing_zeros(16)\n", "want": "4\n"}, {"example_id": "binary_count_trailing_zeros:3", "source": "binary_count_trailing_zeros(58)\n", "want": "1\n"}, {"example_id": "binary_count_trailing_zeros:4", "source": "binary_count_trailing_zeros(4294967296)\n", "want": "32\n"}, {"example_id": "binary_count_trailing_zeros:5", "source": "binary_count_trailing_zeros(0)\n", "want": "0\n"}, {"example_id": "binary_count_trailing_zeros:6", "source": "binary_count_trailing_zeros(-10)\n", "want": "Traceback (most recent call last):\n ...\nValueError: Input value must be a positive integer\n"}, {"example_id": "binary_count_trailing_zeros:7", "source": "binary_count_trailing_zeros(0.8)\n", "want": "Traceback (most recent call last):\n ...\nTypeError: Input value must be a 'int' type\n"}, {"example_id": "binary_count_trailing_zeros:8", "source": "binary_count_trailing_zeros(\"0\")\n", "want": "Traceback (most recent call last):\n ...\nTypeError: '<' not supported between instances of 'str' and 'int'\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-aae4be0f0fe76bd1", "tree_sha256": "63ced0d798f166667ac192c0e1cc4fb5ba91fe5f5fba53702565095a5f38b9ff", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:bit_manipulation/binary_count_trailing_zeros.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def compute_geometric_mean(*args: int) -> float:\n \"\"\"\n Return the geometric mean of the argument numbers.\n >>> compute_geometric_mean(2,8)\n 4.0\n >>> compute_geometric_mean('a', 4)\n Traceback (most recent call last):\n ...\n TypeError: Not a Number\n >>> compute_geometric_mean(5, 125)\n 25.0\n >>> compute_geometric_mean(1, 0)\n 0.0\n >>> compute_geometric_mean(1, 5, 25, 5)\n 5.0\n >>> compute_geometric_mean(2, -2)\n Traceback (most recent call last):\n ...\n ArithmeticError: Cannot Compute Geometric Mean for these numbers.\n >>> compute_geometric_mean(-5, 25, 1)\n -5.0\n \"\"\"\n product = 1\n for number in args:\n if not isinstance(number, int) and not isinstance(number, float):\n raise TypeError(\"Not a Number\")\n product *= number\n # Cannot calculate the even root for negative product.\n # Frequently they are restricted to being positive.\n if product < 0 and len(args) % 2 == 0:\n raise ArithmeticError(\"Cannot Compute Geometric Mean for these numbers.\")\n mean = abs(product) ** (1 / len(args))\n # Since python calculates complex roots for negative products with odd roots.\n if product < 0:\n mean = -mean\n # Since it does floating point arithmetic, it gives 64**(1/3) as 3.99999996\n possible_mean = float(round(mean))\n # To check if the rounded number is actually the mean.\n if possible_mean ** len(args) == product:\n mean = possible_mean\n return mean\n"}, "sha256": "8ad4ac73aed238d029e62de39e06c7df1d8607ff92df59d3ace87657f486da53"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "8ad4ac73aed238d029e62de39e06c7df1d8607ff92df59d3ace87657f486da53", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "6de3b6e8e8b3f0a31766072e18c9834e91bab779c6c70eb4f2d17e101f7d094b", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00039"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00039", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def compute_geometric_mean(*args: int) -> float:\n \"\"\"\n Return the geometric mean of the argument numbers.\n >>> compute_geometric_mean(2,8)\n 4.0\n >>> compute_geometric_mean('a', 4)\n Traceback (most recent call last):\n ...\n TypeError: Not a Number\n >>> compute_geometric_mean(5, 125)\n 25.0\n >>> compute_geometric_mean(1, 0)\n 0.0\n >>> compute_geometric_mean(1, 5, 25, 5)\n 5.0\n >>> compute_geometric_mean(2, -2)\n Traceback (most recent call last):\n ...\n ArithmeticError: Cannot Compute Geometric Mean for these numbers.\n >>> compute_geometric_mean(-5, 25, 1)\n -5.0\n \"\"\"\n product = 1\n for number in args:\n if not isinstance(number, int) or not isinstance(number, float):\n raise TypeError(\"Not a Number\")\n product *= number\n # Cannot calculate the even root for negative product.\n # Frequently they are restricted to being positive.\n if product < 0 and len(args) % 2 == 0:\n raise ArithmeticError(\"Cannot Compute Geometric Mean for these numbers.\")\n mean = abs(product) ** (1 / len(args))\n # Since python calculates complex roots for negative products with odd roots.\n if product < 0:\n mean = -mean\n # Since it does floating point arithmetic, it gives 64**(1/3) as 3.99999996\n possible_mean = float(round(mean))\n # To check if the rounded number is actually the mean.\n if possible_mean ** len(args) == product:\n mean = possible_mean\n return mean\n"}, "sha256": "4785c0f115b2c70a424812ea1b25156783785d1234316b9ae552d617dd4cc7f3"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "compute_geometric_mean:0", "got": "TypeError: Not a Number", "source": "compute_geometric_mean(2,8)\n", "truncated": false, "want": "4.0\n"}, {"example_id": "compute_geometric_mean:2", "got": "TypeError: Not a Number", "source": "compute_geometric_mean(5, 125)\n", "truncated": false, "want": "25.0\n"}, {"example_id": "compute_geometric_mean:3", "got": "TypeError: Not a Number", "source": "compute_geometric_mean(1, 0)\n", "truncated": false, "want": "0.0\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "boolean_condition", "seed": 7, "span": {"col_offset": 39, "end_byte": 719, "lineno": 25, "node": "BoolOp", "node_col_offset": 11, "node_end_col_offset": 72, "node_end_lineno": 25, "node_lineno": 25, "op_index": 0, "original_text": "and", "replacement_text": "or", "start_byte": 716}}, "public_tests": {"examples": [{"example_id": "compute_geometric_mean:0", "source": "compute_geometric_mean(2,8)\n", "want": "4.0\n"}, {"example_id": "compute_geometric_mean:1", "source": "compute_geometric_mean('a', 4)\n", "want": "Traceback (most recent call last):\n ...\nTypeError: Not a Number\n"}, {"example_id": "compute_geometric_mean:2", "source": "compute_geometric_mean(5, 125)\n", "want": "25.0\n"}, {"example_id": "compute_geometric_mean:3", "source": "compute_geometric_mean(1, 0)\n", "want": "0.0\n"}, {"example_id": "compute_geometric_mean:4", "source": "compute_geometric_mean(1, 5, 25, 5)\n", "want": "5.0\n"}, {"example_id": "compute_geometric_mean:5", "source": "compute_geometric_mean(2, -2)\n", "want": "Traceback (most recent call last):\n ...\nArithmeticError: Cannot Compute Geometric Mean for these numbers.\n"}, {"example_id": "compute_geometric_mean:6", "source": "compute_geometric_mean(-5, 25, 1)\n", "want": "-5.0\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-afe067ad08d0b879", "tree_sha256": "8ad4ac73aed238d029e62de39e06c7df1d8607ff92df59d3ace87657f486da53", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/geometric_mean.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def different_signs(num1: int, num2: int) -> bool:\n \"\"\"\n Return True if numbers have opposite signs False otherwise.\n\n >>> different_signs(1, -1)\n True\n >>> different_signs(1, 1)\n False\n >>> different_signs(1000000000000000000000000000, -1000000000000000000000000000)\n True\n >>> different_signs(-1000000000000000000000000000, 1000000000000000000000000000)\n True\n >>> different_signs(50, 278)\n False\n >>> different_signs(0, 2)\n False\n >>> different_signs(2, 0)\n False\n \"\"\"\n return num1 ^ num2 < 0\n"}, "sha256": "4ecec6ed2e004052a1a7945f001fe0280086a6cfd7779d853d3bcc8d4b235777"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "4ecec6ed2e004052a1a7945f001fe0280086a6cfd7779d853d3bcc8d4b235777", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "55a87b2eab5fcd922ab26b2309716fe5cd8e0d833f579a333500952756bc6ca4", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00040"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00040", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def different_signs(num1: int, num2: int) -> bool:\n \"\"\"\n Return True if numbers have opposite signs False otherwise.\n\n >>> different_signs(1, -1)\n True\n >>> different_signs(1, 1)\n False\n >>> different_signs(1000000000000000000000000000, -1000000000000000000000000000)\n True\n >>> different_signs(-1000000000000000000000000000, 1000000000000000000000000000)\n True\n >>> different_signs(50, 278)\n False\n >>> different_signs(0, 2)\n False\n >>> different_signs(2, 0)\n False\n \"\"\"\n return not num1 ^ num2 < 0\n"}, "sha256": "f07d72afac8b4cefaba3a93a9b70a52e50406eb9dfb193da71d5e49513c96cb2"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "different_signs:0", "got": "False\n", "source": "different_signs(1, -1)\n", "truncated": false, "want": "True\n"}, {"example_id": "different_signs:1", "got": "True\n", "source": "different_signs(1, 1)\n", "truncated": false, "want": "False\n"}, {"example_id": "different_signs:2", "got": "False\n", "source": "different_signs(1000000000000000000000000000, -1000000000000000000000000000)\n", "truncated": false, "want": "True\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 549, "lineno": 20, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 26, "node_end_lineno": 20, "node_lineno": 20, "op_index": 0, "original_text": "num1 ^ num2 < 0", "replacement_text": "not num1 ^ num2 < 0", "start_byte": 534}}, "public_tests": {"examples": [{"example_id": "different_signs:0", "source": "different_signs(1, -1)\n", "want": "True\n"}, {"example_id": "different_signs:1", "source": "different_signs(1, 1)\n", "want": "False\n"}, {"example_id": "different_signs:2", "source": "different_signs(1000000000000000000000000000, -1000000000000000000000000000)\n", "want": "True\n"}, {"example_id": "different_signs:3", "source": "different_signs(-1000000000000000000000000000, 1000000000000000000000000000)\n", "want": "True\n"}, {"example_id": "different_signs:4", "source": "different_signs(50, 278)\n", "want": "False\n"}, {"example_id": "different_signs:5", "source": "different_signs(0, 2)\n", "want": "False\n"}, {"example_id": "different_signs:6", "source": "different_signs(2, 0)\n", "want": "False\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-4f15de4223fad297", "tree_sha256": "4ecec6ed2e004052a1a7945f001fe0280086a6cfd7779d853d3bcc8d4b235777", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:bit_manipulation/numbers_different_signs.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def longest_palindromic_subsequence(input_string: str) -> int:\n \"\"\"\n This function returns the longest palindromic subsequence in a string\n >>> longest_palindromic_subsequence(\"bbbab\")\n 4\n >>> longest_palindromic_subsequence(\"bbabcbcab\")\n 7\n \"\"\"\n n = len(input_string)\n rev = input_string[::-1]\n m = len(rev)\n dp = [[-1] * (m + 1) for i in range(n + 1)]\n for i in range(n + 1):\n dp[i][0] = 0\n for i in range(m + 1):\n dp[0][i] = 0\n\n # create and initialise dp array\n for i in range(1, n + 1):\n for j in range(1, m + 1):\n # If characters at i and j are the same\n # include them in the palindromic subsequence\n if input_string[i - 1] == rev[j - 1]:\n dp[i][j] = 1 + dp[i - 1][j - 1]\n else:\n dp[i][j] = max(dp[i - 1][j], dp[i][j - 1])\n\n return dp[n][m]\n"}, "sha256": "d834746e5333956adb3dda1228ed1a408e53d29a913d5771fa18932616ada95b"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "d834746e5333956adb3dda1228ed1a408e53d29a913d5771fa18932616ada95b", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "b36ac003c82441a4f577cb6cbf776002eb4859a8e2417174460c4eb4838fdeca", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00042"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00042", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 10, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def longest_palindromic_subsequence(input_string: str) -> int:\n \"\"\"\n This function returns the longest palindromic subsequence in a string\n >>> longest_palindromic_subsequence(\"bbbab\")\n 4\n >>> longest_palindromic_subsequence(\"bbabcbcab\")\n 7\n \"\"\"\n n = len(input_string)\n rev = input_string[::-1]\n m = len(rev)\n dp = [[-1] * (m + 1) for i in range(n + 1)]\n for i in range(n + 1):\n dp[i][0] = 0\n for i in range(m + 1):\n dp[0][i] = 0\n\n # create and initialise dp array\n for i in range(1, n + 1):\n for j in range(1, m + 1):\n # If characters at i and j are the same\n # include them in the palindromic subsequence\n if input_string[i - 1] == rev[j - 1]:\n dp[i][j] = 1 + dp[i - 1][j - 1]\n else:\n dp[i][j] = max(dp[i - 1][j], dp[i][j - 1])\n\n return dp[n][m] + 1\n"}, "sha256": "b83c8e0b136f698cd44b1c44a7c251b3fd3aea5cb06fb40dc99d83ad2cde2d94"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "longest_palindromic_subsequence:0", "got": "5\n", "source": "longest_palindromic_subsequence(\"bbbab\")\n", "truncated": false, "want": "4\n"}, {"example_id": "longest_palindromic_subsequence:1", "got": "8\n", "source": "longest_palindromic_subsequence(\"bbabcbcab\")\n", "truncated": false, "want": "7\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 890, "lineno": 28, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 19, "node_end_lineno": 28, "node_lineno": 28, "op_index": 0, "original_text": "dp[n][m]", "replacement_text": "dp[n][m] + 1", "start_byte": 882}}, "public_tests": {"examples": [{"example_id": "longest_palindromic_subsequence:0", "source": "longest_palindromic_subsequence(\"bbbab\")\n", "want": "4\n"}, {"example_id": "longest_palindromic_subsequence:1", "source": "longest_palindromic_subsequence(\"bbabcbcab\")\n", "want": "7\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-5ed3a41ff605bd3d", "tree_sha256": "d834746e5333956adb3dda1228ed1a408e53d29a913d5771fa18932616ada95b", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:dynamic_programming/longest_palindromic_subsequence.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def create_ngram(sentence: str, ngram_size: int) -> list[str]:\n \"\"\"\n Create ngrams from a sentence\n\n >>> create_ngram(\"I am a sentence\", 2)\n ['I ', ' a', 'am', 'm ', ' a', 'a ', ' s', 'se', 'en', 'nt', 'te', 'en', 'nc', 'ce']\n >>> create_ngram(\"I am an NLPer\", 2)\n ['I ', ' a', 'am', 'm ', ' a', 'an', 'n ', ' N', 'NL', 'LP', 'Pe', 'er']\n >>> create_ngram(\"This is short\", 50)\n []\n \"\"\"\n return [sentence[i : i + ngram_size] for i in range(len(sentence) - ngram_size + 1)]\n"}, "sha256": "3881251200419c2008cd6f4ec6b1c04cafed25b764512c567432c86fe3abb1d8"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "3881251200419c2008cd6f4ec6b1c04cafed25b764512c567432c86fe3abb1d8", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "0710f2d46ab75a5c9639fd49f519e449ffe63ee647c884e0fca9127d0927c8db", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00044"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00044", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def create_ngram(sentence: str, ngram_size: int) -> list[str]:\n \"\"\"\n Create ngrams from a sentence\n\n >>> create_ngram(\"I am a sentence\", 2)\n ['I ', ' a', 'am', 'm ', ' a', 'a ', ' s', 'se', 'en', 'nt', 'te', 'en', 'nc', 'ce']\n >>> create_ngram(\"I am an NLPer\", 2)\n ['I ', ' a', 'am', 'm ', ' a', 'an', 'n ', ' N', 'NL', 'LP', 'Pe', 'er']\n >>> create_ngram(\"This is short\", 50)\n []\n \"\"\"\n return [sentence[i : i + ngram_size] for i in range(len(sentence) + ngram_size + 1)]\n"}, "sha256": "d1d2a889df381266f497288e29b9add4f812d94db50c931cdf5d7905b927fdaa"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "create_ngram:0", "got": "['I ', ' a', 'am', 'm ', ' a', 'a ', ' s', 'se', 'en', 'nt', 'te', 'en', 'nc', 'ce', 'e', '', '', '']\n", "source": "create_ngram(\"I am a sentence\", 2)\n", "truncated": false, "want": "['I ', ' a', 'am', 'm ', ' a', 'a ', ' s', 'se', 'en', 'nt', 'te', 'en', 'nc', 'ce']\n"}, {"example_id": "create_ngram:1", "got": "['I ', ' a', 'am', 'm ', ' a', 'an', 'n ', ' N', 'NL', 'LP', 'Pe', 'er', 'r', '', '', '']\n", "source": "create_ngram(\"I am an NLPer\", 2)\n", "truncated": false, "want": "['I ', ' a', 'am', 'm ', ' a', 'an', 'n ', ' N', 'NL', 'LP', 'Pe', 'er']\n"}, {"example_id": "create_ngram:2", "got": "['This is short', 'his is short', 'is is short', 's is short', ' is short', 'is short', 's short', ' short', 'short', 'hort', 'ort', 'rt', 't', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '']\n", "source": "create_ngram(\"This is short\", 50)\n", "truncated": false, "want": "[]\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 70, "end_byte": 484, "lineno": 12, "node": "BinOp", "node_col_offset": 56, "node_end_col_offset": 82, "node_end_lineno": 12, "node_lineno": 12, "op_index": 0, "original_text": "-", "replacement_text": "+", "start_byte": 483}}, "public_tests": {"examples": [{"example_id": "create_ngram:0", "source": "create_ngram(\"I am a sentence\", 2)\n", "want": "['I ', ' a', 'am', 'm ', ' a', 'a ', ' s', 'se', 'en', 'nt', 'te', 'en', 'nc', 'ce']\n"}, {"example_id": "create_ngram:1", "source": "create_ngram(\"I am an NLPer\", 2)\n", "want": "['I ', ' a', 'am', 'm ', ' a', 'an', 'n ', ' N', 'NL', 'LP', 'Pe', 'er']\n"}, {"example_id": "create_ngram:2", "source": "create_ngram(\"This is short\", 50)\n", "want": "[]\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-8622d18f97f27b2e", "tree_sha256": "3881251200419c2008cd6f4ec6b1c04cafed25b764512c567432c86fe3abb1d8", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:strings/ngram.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def fizz_buzz(number: int, iterations: int) -> str:\n \"\"\"\n | Plays FizzBuzz.\n | Prints Fizz if number is a multiple of ``3``.\n | Prints Buzz if its a multiple of ``5``.\n | Prints FizzBuzz if its a multiple of both ``3`` and ``5`` or ``15``.\n | Else Prints The Number Itself.\n\n >>> fizz_buzz(1,7)\n '1 2 Fizz 4 Buzz Fizz 7 '\n >>> fizz_buzz(1,0)\n Traceback (most recent call last):\n ...\n ValueError: Iterations must be done more than 0 times to play FizzBuzz\n >>> fizz_buzz(-5,5)\n Traceback (most recent call last):\n ...\n ValueError: starting number must be\n and integer and be more than 0\n >>> fizz_buzz(10,-5)\n Traceback (most recent call last):\n ...\n ValueError: Iterations must be done more than 0 times to play FizzBuzz\n >>> fizz_buzz(1.5,5)\n Traceback (most recent call last):\n ...\n ValueError: starting number must be\n and integer and be more than 0\n >>> fizz_buzz(1,5.5)\n Traceback (most recent call last):\n ...\n ValueError: iterations must be defined as integers\n \"\"\"\n if not isinstance(iterations, int):\n raise ValueError(\"iterations must be defined as integers\")\n if not isinstance(number, int) or not number >= 1:\n raise ValueError(\n \"\"\"starting number must be\n and integer and be more than 0\"\"\"\n )\n if not iterations >= 1:\n raise ValueError(\"Iterations must be done more than 0 times to play FizzBuzz\")\n\n out = \"\"\n while number <= iterations:\n if number % 3 == 0:\n out += \"Fizz\"\n if number % 5 == 0:\n out += \"Buzz\"\n if 0 not in (number % 3, number % 5):\n out += str(number)\n\n # print(out)\n number += 1\n out += \" \"\n return out\n"}, "sha256": "6eae7f855ccf9e8fb01603b186694ff1945f82c96b6e70b04cad9fdd552ac6bc"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "6eae7f855ccf9e8fb01603b186694ff1945f82c96b6e70b04cad9fdd552ac6bc", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "5dde9fa577a31cdc05e72bed3a7cbeded2dbf9052ebfe6ff65ffd80213dbd8fd", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00045"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00045", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 21, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def fizz_buzz(number: int, iterations: int) -> str:\n \"\"\"\n | Plays FizzBuzz.\n | Prints Fizz if number is a multiple of ``3``.\n | Prints Buzz if its a multiple of ``5``.\n | Prints FizzBuzz if its a multiple of both ``3`` and ``5`` or ``15``.\n | Else Prints The Number Itself.\n\n >>> fizz_buzz(1,7)\n '1 2 Fizz 4 Buzz Fizz 7 '\n >>> fizz_buzz(1,0)\n Traceback (most recent call last):\n ...\n ValueError: Iterations must be done more than 0 times to play FizzBuzz\n >>> fizz_buzz(-5,5)\n Traceback (most recent call last):\n ...\n ValueError: starting number must be\n and integer and be more than 0\n >>> fizz_buzz(10,-5)\n Traceback (most recent call last):\n ...\n ValueError: Iterations must be done more than 0 times to play FizzBuzz\n >>> fizz_buzz(1.5,5)\n Traceback (most recent call last):\n ...\n ValueError: starting number must be\n and integer and be more than 0\n >>> fizz_buzz(1,5.5)\n Traceback (most recent call last):\n ...\n ValueError: iterations must be defined as integers\n \"\"\"\n if not isinstance(iterations, int):\n raise ValueError(\"iterations must be defined as integers\")\n if not isinstance(number, int) or not number >= 1:\n raise ValueError(\n \"\"\"starting number must be\n and integer and be more than 0\"\"\"\n )\n if not iterations >= 1:\n raise ValueError(\"Iterations must be done more than 0 times to play FizzBuzz\")\n\n out = \"\"\n while number < iterations:\n if number % 3 == 0:\n out += \"Fizz\"\n if number % 5 == 0:\n out += \"Buzz\"\n if 0 not in (number % 3, number % 5):\n out += str(number)\n\n # print(out)\n number += 1\n out += \" \"\n return out\n"}, "sha256": "42587605ec528cec04c2bd38e6cd338e55edd0c53a4f3b05a0b65fa692e060f2"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "fizz_buzz:0", "got": "'1 2 Fizz 4 Buzz Fizz '\n", "source": "fizz_buzz(1,7)\n", "truncated": false, "want": "'1 2 Fizz 4 Buzz Fizz 7 '\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "comparison_boundary", "seed": 7, "span": {"col_offset": 17, "end_byte": 1578, "lineno": 45, "node": "Compare", "node_col_offset": 10, "node_end_col_offset": 30, "node_end_lineno": 45, "node_lineno": 45, "op_index": 0, "original_text": "<=", "replacement_text": "<", "start_byte": 1576}}, "public_tests": {"examples": [{"example_id": "fizz_buzz:0", "source": "fizz_buzz(1,7)\n", "want": "'1 2 Fizz 4 Buzz Fizz 7 '\n"}, {"example_id": "fizz_buzz:1", "source": "fizz_buzz(1,0)\n", "want": "Traceback (most recent call last):\n ...\nValueError: Iterations must be done more than 0 times to play FizzBuzz\n"}, {"example_id": "fizz_buzz:2", "source": "fizz_buzz(-5,5)\n", "want": "Traceback (most recent call last):\n ...\nValueError: starting number must be\n and integer and be more than 0\n"}, {"example_id": "fizz_buzz:3", "source": "fizz_buzz(10,-5)\n", "want": "Traceback (most recent call last):\n ...\nValueError: Iterations must be done more than 0 times to play FizzBuzz\n"}, {"example_id": "fizz_buzz:4", "source": "fizz_buzz(1.5,5)\n", "want": "Traceback (most recent call last):\n ...\nValueError: starting number must be\n and integer and be more than 0\n"}, {"example_id": "fizz_buzz:5", "source": "fizz_buzz(1,5.5)\n", "want": "Traceback (most recent call last):\n ...\nValueError: iterations must be defined as integers\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-6fc9cec4c577d7b7", "tree_sha256": "6eae7f855ccf9e8fb01603b186694ff1945f82c96b6e70b04cad9fdd552ac6bc", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:dynamic_programming/fizz_buzz.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def factorial(number: int) -> int:\n \"\"\"\n Calculate the factorial of specified number (n!).\n\n >>> import math\n >>> all(factorial(i) == math.factorial(i) for i in range(20))\n True\n >>> factorial(0.1)\n Traceback (most recent call last):\n ...\n ValueError: factorial() only accepts integral values\n >>> factorial(-1)\n Traceback (most recent call last):\n ...\n ValueError: factorial() not defined for negative values\n >>> factorial(1)\n 1\n >>> factorial(6)\n 720\n >>> factorial(0)\n 1\n \"\"\"\n if number != int(number):\n raise ValueError(\"factorial() only accepts integral values\")\n if number < 0:\n raise ValueError(\"factorial() not defined for negative values\")\n value = 1\n for i in range(1, number + 1):\n value *= i\n return value\n"}, "sha256": "a82829b49c3fea28a514363892e0a2754119afc9d6b34f18a9059d51aeaa66c3"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "a82829b49c3fea28a514363892e0a2754119afc9d6b34f18a9059d51aeaa66c3", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "6c819038615d668f5fac5de380713f56f746eb06d1b1b5117dcb0167a75dc798", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00047"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00047", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 15, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def factorial(number: int) -> int:\n \"\"\"\n Calculate the factorial of specified number (n!).\n\n >>> import math\n >>> all(factorial(i) == math.factorial(i) for i in range(20))\n True\n >>> factorial(0.1)\n Traceback (most recent call last):\n ...\n ValueError: factorial() only accepts integral values\n >>> factorial(-1)\n Traceback (most recent call last):\n ...\n ValueError: factorial() not defined for negative values\n >>> factorial(1)\n 1\n >>> factorial(6)\n 720\n >>> factorial(0)\n 1\n \"\"\"\n if number != int(number):\n raise ValueError(\"factorial() only accepts integral values\")\n if number < 0:\n raise ValueError(\"factorial() not defined for negative values\")\n value = 1\n for i in range(1, number + 1):\n value //= i\n return value\n"}, "sha256": "1735a246fd5239c72a9a2947cee461d38d80b52e312b0f31c29585077de89e12"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "factorial:1", "got": "False\n", "source": "all(factorial(i) == math.factorial(i) for i in range(20))\n", "truncated": false, "want": "True\n"}, {"example_id": "factorial:5", "got": "0\n", "source": "factorial(6)\n", "truncated": false, "want": "720\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 14, "end_byte": 803, "lineno": 29, "node": "AugAssign", "node_col_offset": 8, "node_end_col_offset": 18, "node_end_lineno": 29, "node_lineno": 29, "op_index": 0, "original_text": "*=", "replacement_text": "//=", "start_byte": 801}}, "public_tests": {"examples": [{"example_id": "factorial:0", "source": "import math\n", "want": ""}, {"example_id": "factorial:1", "source": "all(factorial(i) == math.factorial(i) for i in range(20))\n", "want": "True\n"}, {"example_id": "factorial:2", "source": "factorial(0.1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: factorial() only accepts integral values\n"}, {"example_id": "factorial:3", "source": "factorial(-1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: factorial() not defined for negative values\n"}, {"example_id": "factorial:4", "source": "factorial(1)\n", "want": "1\n"}, {"example_id": "factorial:5", "source": "factorial(6)\n", "want": "720\n"}, {"example_id": "factorial:6", "source": "factorial(0)\n", "want": "1\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-5978d4171e6ba63e", "tree_sha256": "a82829b49c3fea28a514363892e0a2754119afc9d6b34f18a9059d51aeaa66c3", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/factorial.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def dp_count(s, n):\n \"\"\"\n >>> dp_count([1, 2, 3], 4)\n 4\n >>> dp_count([1, 2, 3], 7)\n 8\n >>> dp_count([2, 5, 3, 6], 10)\n 5\n >>> dp_count([10], 99)\n 0\n >>> dp_count([4, 5, 6], 0)\n 1\n >>> dp_count([1, 2, 3], -5)\n 0\n \"\"\"\n if n < 0:\n return 0\n # table[i] represents the number of ways to get to amount i\n table = [0] * (n + 1)\n\n # There is exactly 1 way to get to zero(You pick no coins).\n table[0] = 1\n\n # Pick all coins one by one and update table[] values\n # after the index greater than or equal to the value of the\n # picked coin\n for coin_val in s:\n for j in range(coin_val, n + 1):\n table[j] += table[j - coin_val]\n\n return table[n]\n"}, "sha256": "7ea75676cd3234bfcc2c42137d13111e5cb80fdfee7a435967fe7a8449857f6a"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "7ea75676cd3234bfcc2c42137d13111e5cb80fdfee7a435967fe7a8449857f6a", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "8b07875cc64bfa55bc9a0f68e9313d7efc2e5a653cb3ced235a801302cc517cb", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00051"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00051", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def dp_count(s, n):\n \"\"\"\n >>> dp_count([1, 2, 3], 4)\n 4\n >>> dp_count([1, 2, 3], 7)\n 8\n >>> dp_count([2, 5, 3, 6], 10)\n 5\n >>> dp_count([10], 99)\n 0\n >>> dp_count([4, 5, 6], 0)\n 1\n >>> dp_count([1, 2, 3], -5)\n 0\n \"\"\"\n if n < 0:\n return -1\n # table[i] represents the number of ways to get to amount i\n table = [0] * (n + 1)\n\n # There is exactly 1 way to get to zero(You pick no coins).\n table[0] = 1\n\n # Pick all coins one by one and update table[] values\n # after the index greater than or equal to the value of the\n # picked coin\n for coin_val in s:\n for j in range(coin_val, n + 1):\n table[j] += table[j - coin_val]\n\n return table[n]\n"}, "sha256": "ca8cae7cdf04e76b2db2e36b4423bd66630faeeecab75eac74db0edaecc00531"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "dp_count:5", "got": "-1\n", "source": "dp_count([1, 2, 3], -5)\n", "truncated": false, "want": "0\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 15, "end_byte": 289, "lineno": 17, "node": "Return", "node_col_offset": 8, "node_end_col_offset": 16, "node_end_lineno": 17, "node_lineno": 17, "op_index": 0, "original_text": "0", "replacement_text": "-1", "start_byte": 288}}, "public_tests": {"examples": [{"example_id": "dp_count:0", "source": "dp_count([1, 2, 3], 4)\n", "want": "4\n"}, {"example_id": "dp_count:1", "source": "dp_count([1, 2, 3], 7)\n", "want": "8\n"}, {"example_id": "dp_count:2", "source": "dp_count([2, 5, 3, 6], 10)\n", "want": "5\n"}, {"example_id": "dp_count:3", "source": "dp_count([10], 99)\n", "want": "0\n"}, {"example_id": "dp_count:4", "source": "dp_count([4, 5, 6], 0)\n", "want": "1\n"}, {"example_id": "dp_count:5", "source": "dp_count([1, 2, 3], -5)\n", "want": "0\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-837a23c4a34bc805", "tree_sha256": "7ea75676cd3234bfcc2c42137d13111e5cb80fdfee7a435967fe7a8449857f6a", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:dynamic_programming/minimum_coin_change.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def greatest_common_divisor(a: int, b: int) -> int:\n \"\"\"\n Calculate Greatest Common Divisor (GCD).\n >>> greatest_common_divisor(24, 40)\n 8\n >>> greatest_common_divisor(1, 1)\n 1\n >>> greatest_common_divisor(1, 800)\n 1\n >>> greatest_common_divisor(11, 37)\n 1\n >>> greatest_common_divisor(3, 5)\n 1\n >>> greatest_common_divisor(16, 4)\n 4\n >>> greatest_common_divisor(-3, 9)\n 3\n >>> greatest_common_divisor(9, -3)\n 3\n >>> greatest_common_divisor(3, -9)\n 3\n >>> greatest_common_divisor(-3, -9)\n 3\n >>> greatest_common_divisor(0, 0)\n 0\n \"\"\"\n return abs(b) if a == 0 else greatest_common_divisor(b % a, a)\n"}, "sha256": "c83b231cabe16db1ee264bbab4da1750cb72d603a68112a349ee3b152d638e16"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "c83b231cabe16db1ee264bbab4da1750cb72d603a68112a349ee3b152d638e16", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "5aa1c9e17c4dcf92aede46aef6b3400d99bd657437d3bd8d9e08ef081a92b353", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00053"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00053", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def greatest_common_divisor(a: int, b: int) -> int:\n \"\"\"\n Calculate Greatest Common Divisor (GCD).\n >>> greatest_common_divisor(24, 40)\n 8\n >>> greatest_common_divisor(1, 1)\n 1\n >>> greatest_common_divisor(1, 800)\n 1\n >>> greatest_common_divisor(11, 37)\n 1\n >>> greatest_common_divisor(3, 5)\n 1\n >>> greatest_common_divisor(16, 4)\n 4\n >>> greatest_common_divisor(-3, 9)\n 3\n >>> greatest_common_divisor(9, -3)\n 3\n >>> greatest_common_divisor(3, -9)\n 3\n >>> greatest_common_divisor(-3, -9)\n 3\n >>> greatest_common_divisor(0, 0)\n 0\n \"\"\"\n return (abs(b) if a == 0 else greatest_common_divisor(b % a, a)) + 1\n"}, "sha256": "e3506f8f9af33a5f9c746b5e743bdc658e5017fad502b73b980054c905835598"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "greatest_common_divisor:0", "got": "12\n", "source": "greatest_common_divisor(24, 40)\n", "truncated": false, "want": "8\n"}, {"example_id": "greatest_common_divisor:1", "got": "3\n", "source": "greatest_common_divisor(1, 1)\n", "truncated": false, "want": "1\n"}, {"example_id": "greatest_common_divisor:2", "got": "3\n", "source": "greatest_common_divisor(1, 800)\n", "truncated": false, "want": "1\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 675, "lineno": 27, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 66, "node_end_lineno": 27, "node_lineno": 27, "op_index": 0, "original_text": "abs(b) if a == 0 else greatest_common_divisor(b % a, a)", "replacement_text": "(abs(b) if a == 0 else greatest_common_divisor(b % a, a)) + 1", "start_byte": 620}}, "public_tests": {"examples": [{"example_id": "greatest_common_divisor:0", "source": "greatest_common_divisor(24, 40)\n", "want": "8\n"}, {"example_id": "greatest_common_divisor:1", "source": "greatest_common_divisor(1, 1)\n", "want": "1\n"}, {"example_id": "greatest_common_divisor:2", "source": "greatest_common_divisor(1, 800)\n", "want": "1\n"}, {"example_id": "greatest_common_divisor:3", "source": "greatest_common_divisor(11, 37)\n", "want": "1\n"}, {"example_id": "greatest_common_divisor:4", "source": "greatest_common_divisor(3, 5)\n", "want": "1\n"}, {"example_id": "greatest_common_divisor:5", "source": "greatest_common_divisor(16, 4)\n", "want": "4\n"}, {"example_id": "greatest_common_divisor:6", "source": "greatest_common_divisor(-3, 9)\n", "want": "3\n"}, {"example_id": "greatest_common_divisor:7", "source": "greatest_common_divisor(9, -3)\n", "want": "3\n"}, {"example_id": "greatest_common_divisor:8", "source": "greatest_common_divisor(3, -9)\n", "want": "3\n"}, {"example_id": "greatest_common_divisor:9", "source": "greatest_common_divisor(-3, -9)\n", "want": "3\n"}, {"example_id": "greatest_common_divisor:10", "source": "greatest_common_divisor(0, 0)\n", "want": "0\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-fe0a440000419c59", "tree_sha256": "c83b231cabe16db1ee264bbab4da1750cb72d603a68112a349ee3b152d638e16", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/greatest_common_divisor.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def linear_search(sequence: list, target: int) -> int:\n \"\"\"A pure Python implementation of a linear search algorithm\n\n :param sequence: a collection with comparable items (sorting is not required for\n linear search)\n :param target: item value to search\n :return: index of found item or -1 if item is not found\n\n Examples:\n >>> linear_search([0, 5, 7, 10, 15], 0)\n 0\n >>> linear_search([0, 5, 7, 10, 15], 15)\n 4\n >>> linear_search([0, 5, 7, 10, 15], 5)\n 1\n >>> linear_search([0, 5, 7, 10, 15], 6)\n -1\n \"\"\"\n for index, item in enumerate(sequence):\n if item == target:\n return index\n return -1\n"}, "sha256": "59b7579268bcab0ebb7aafd8c3fa78f6b1edcdf49913430e709de7a547165c25"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "59b7579268bcab0ebb7aafd8c3fa78f6b1edcdf49913430e709de7a547165c25", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "293280071f1bab7bc3d626c9a22504dea9f49098c367b2562d63b17bdead0197", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00054"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00054", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def linear_search(sequence: list, target: int) -> int:\n \"\"\"A pure Python implementation of a linear search algorithm\n\n :param sequence: a collection with comparable items (sorting is not required for\n linear search)\n :param target: item value to search\n :return: index of found item or -1 if item is not found\n\n Examples:\n >>> linear_search([0, 5, 7, 10, 15], 0)\n 0\n >>> linear_search([0, 5, 7, 10, 15], 15)\n 4\n >>> linear_search([0, 5, 7, 10, 15], 5)\n 1\n >>> linear_search([0, 5, 7, 10, 15], 6)\n -1\n \"\"\"\n for index, item in enumerate(sequence):\n if item != target:\n return index\n return -1\n"}, "sha256": "de4c03c6092f949cc46df000ea20505d917507940d9fbbf1610bd71f30f3d539"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "linear_search:0", "got": "1\n", "source": "linear_search([0, 5, 7, 10, 15], 0)\n", "truncated": false, "want": "0\n"}, {"example_id": "linear_search:1", "got": "0\n", "source": "linear_search([0, 5, 7, 10, 15], 15)\n", "truncated": false, "want": "4\n"}, {"example_id": "linear_search:2", "got": "0\n", "source": "linear_search([0, 5, 7, 10, 15], 5)\n", "truncated": false, "want": "1\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "boolean_condition", "seed": 7, "span": {"col_offset": 16, "end_byte": 616, "lineno": 20, "node": "Compare", "node_col_offset": 11, "node_end_col_offset": 25, "node_end_lineno": 20, "node_lineno": 20, "op_index": 0, "original_text": "==", "replacement_text": "!=", "start_byte": 614}}, "public_tests": {"examples": [{"example_id": "linear_search:0", "source": "linear_search([0, 5, 7, 10, 15], 0)\n", "want": "0\n"}, {"example_id": "linear_search:1", "source": "linear_search([0, 5, 7, 10, 15], 15)\n", "want": "4\n"}, {"example_id": "linear_search:2", "source": "linear_search([0, 5, 7, 10, 15], 5)\n", "want": "1\n"}, {"example_id": "linear_search:3", "source": "linear_search([0, 5, 7, 10, 15], 6)\n", "want": "-1\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-159a27a5b7de59c9", "tree_sha256": "59b7579268bcab0ebb7aafd8c3fa78f6b1edcdf49913430e709de7a547165c25", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:searches/linear_search.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "import re\n\n\ndef indian_phone_validator(phone: str) -> bool:\n \"\"\"\n Determine whether the string is a valid phone number or not\n :param phone:\n :return: Boolean\n >>> indian_phone_validator(\"+91123456789\")\n False\n >>> indian_phone_validator(\"+919876543210\")\n True\n >>> indian_phone_validator(\"01234567896\")\n False\n >>> indian_phone_validator(\"919876543218\")\n True\n >>> indian_phone_validator(\"+91-1234567899\")\n False\n >>> indian_phone_validator(\"+91-9876543218\")\n True\n \"\"\"\n pat = re.compile(r\"^(\\+91[\\-\\s]?)?[0]?(91)?[789]\\d{9}$\")\n if match := re.search(pat, phone):\n return match.string == phone\n return False\n"}, "sha256": "5f5871fd39f9468f352fc5f003985517b20ecf99e646279baa6ee1f231a1bdcf"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "5f5871fd39f9468f352fc5f003985517b20ecf99e646279baa6ee1f231a1bdcf", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "e097ec28f84c39d6ae3987370e5e93e5ab7da7d061a68844b2643e41cecc3c93", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00056"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00056", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 22, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "import re\n\n\ndef indian_phone_validator(phone: str) -> bool:\n \"\"\"\n Determine whether the string is a valid phone number or not\n :param phone:\n :return: Boolean\n >>> indian_phone_validator(\"+91123456789\")\n False\n >>> indian_phone_validator(\"+919876543210\")\n True\n >>> indian_phone_validator(\"01234567896\")\n False\n >>> indian_phone_validator(\"919876543218\")\n True\n >>> indian_phone_validator(\"+91-1234567899\")\n False\n >>> indian_phone_validator(\"+91-9876543218\")\n True\n \"\"\"\n pat = re.compile(r\"^(\\+91[\\-\\s]?)?[0]?(91)?[789]\\d{9}$\")\n if match := re.search(pat, phone):\n return not match.string == phone\n return False\n"}, "sha256": "253d9a825ff500210cd9e0c129ecb14d841e3354c0558469c0c9886e5ee4dd91"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "indian_phone_validator:1", "got": "False\n", "source": "indian_phone_validator(\"+919876543210\")\n", "truncated": false, "want": "True\n"}, {"example_id": "indian_phone_validator:3", "got": "False\n", "source": "indian_phone_validator(\"919876543218\")\n", "truncated": false, "want": "True\n"}, {"example_id": "indian_phone_validator:5", "got": "False\n", "source": "indian_phone_validator(\"+91-9876543218\")\n", "truncated": false, "want": "True\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 15, "end_byte": 658, "lineno": 24, "node": "Return", "node_col_offset": 8, "node_end_col_offset": 36, "node_end_lineno": 24, "node_lineno": 24, "op_index": 0, "original_text": "match.string == phone", "replacement_text": "not match.string == phone", "start_byte": 637}}, "public_tests": {"examples": [{"example_id": "indian_phone_validator:0", "source": "indian_phone_validator(\"+91123456789\")\n", "want": "False\n"}, {"example_id": "indian_phone_validator:1", "source": "indian_phone_validator(\"+919876543210\")\n", "want": "True\n"}, {"example_id": "indian_phone_validator:2", "source": "indian_phone_validator(\"01234567896\")\n", "want": "False\n"}, {"example_id": "indian_phone_validator:3", "source": "indian_phone_validator(\"919876543218\")\n", "want": "True\n"}, {"example_id": "indian_phone_validator:4", "source": "indian_phone_validator(\"+91-1234567899\")\n", "want": "False\n"}, {"example_id": "indian_phone_validator:5", "source": "indian_phone_validator(\"+91-9876543218\")\n", "want": "True\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-fbd873dbb015f82b", "tree_sha256": "5f5871fd39f9468f352fc5f003985517b20ecf99e646279baa6ee1f231a1bdcf", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:strings/indian_phone_validator.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def longest_common_substring(text1: str, text2: str) -> str:\n \"\"\"\n Finds the longest common substring between two strings.\n\n >>> longest_common_substring(\"\", \"\")\n ''\n >>> longest_common_substring(\"a\",\"\")\n ''\n >>> longest_common_substring(\"\", \"a\")\n ''\n >>> longest_common_substring(\"a\", \"a\")\n 'a'\n >>> longest_common_substring(\"abcdef\", \"bcd\")\n 'bcd'\n >>> longest_common_substring(\"abcdef\", \"xabded\")\n 'ab'\n >>> longest_common_substring(\"GeeksforGeeks\", \"GeeksQuiz\")\n 'Geeks'\n >>> longest_common_substring(\"abcdxyz\", \"xyzabcd\")\n 'abcd'\n >>> longest_common_substring(\"zxabcdezy\", \"yzabcdezx\")\n 'abcdez'\n >>> longest_common_substring(\"OldSite:GeeksforGeeks.org\", \"NewSite:GeeksQuiz.com\")\n 'Site:Geeks'\n >>> longest_common_substring(1, 1)\n Traceback (most recent call last):\n ...\n ValueError: longest_common_substring() takes two strings for inputs\n \"\"\"\n\n if not (isinstance(text1, str) and isinstance(text2, str)):\n raise ValueError(\"longest_common_substring() takes two strings for inputs\")\n\n if not text1 or not text2:\n return \"\"\n\n text1_length = len(text1)\n text2_length = len(text2)\n\n dp = [[0] * (text2_length + 1) for _ in range(text1_length + 1)]\n end_pos = 0\n max_length = 0\n\n for i in range(1, text1_length + 1):\n for j in range(1, text2_length + 1):\n if text1[i - 1] == text2[j - 1]:\n dp[i][j] = 1 + dp[i - 1][j - 1]\n if dp[i][j] > max_length:\n end_pos = i\n max_length = dp[i][j]\n\n return text1[end_pos - max_length : end_pos]\n"}, "sha256": "f6eaa2ceec5a3aaf169265eb8837401706ff6dee1fad2b89def197e13f94fcd4"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "f6eaa2ceec5a3aaf169265eb8837401706ff6dee1fad2b89def197e13f94fcd4", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "d80aa83753e1e3d2c87e8315be73c2892d71ff922e6829813a8288c1ffb92ccd", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00060"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00060", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def longest_common_substring(text1: str, text2: str) -> str:\n \"\"\"\n Finds the longest common substring between two strings.\n\n >>> longest_common_substring(\"\", \"\")\n ''\n >>> longest_common_substring(\"a\",\"\")\n ''\n >>> longest_common_substring(\"\", \"a\")\n ''\n >>> longest_common_substring(\"a\", \"a\")\n 'a'\n >>> longest_common_substring(\"abcdef\", \"bcd\")\n 'bcd'\n >>> longest_common_substring(\"abcdef\", \"xabded\")\n 'ab'\n >>> longest_common_substring(\"GeeksforGeeks\", \"GeeksQuiz\")\n 'Geeks'\n >>> longest_common_substring(\"abcdxyz\", \"xyzabcd\")\n 'abcd'\n >>> longest_common_substring(\"zxabcdezy\", \"yzabcdezx\")\n 'abcdez'\n >>> longest_common_substring(\"OldSite:GeeksforGeeks.org\", \"NewSite:GeeksQuiz.com\")\n 'Site:Geeks'\n >>> longest_common_substring(1, 1)\n Traceback (most recent call last):\n ...\n ValueError: longest_common_substring() takes two strings for inputs\n \"\"\"\n\n if not (isinstance(text1, str) and isinstance(text2, str)):\n raise ValueError(\"longest_common_substring() takes two strings for inputs\")\n\n if not text1 or not text2:\n return \"\"\n\n text1_length = len(text1)\n text2_length = len(text2)\n\n dp = [[0] * (text2_length + 1) for _ in range(text1_length + 1)]\n end_pos = 0\n max_length = 0\n\n for i in range(2, text1_length + 1):\n for j in range(1, text2_length + 1):\n if text1[i - 1] == text2[j - 1]:\n dp[i][j] = 1 + dp[i - 1][j - 1]\n if dp[i][j] > max_length:\n end_pos = i\n max_length = dp[i][j]\n\n return text1[end_pos - max_length : end_pos]\n"}, "sha256": "737a8283537156ae591201272aa3f134a418a272b17a735d2e8b0215c78733fe"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "longest_common_substring:3", "got": "''\n", "source": "longest_common_substring(\"a\", \"a\")\n", "truncated": false, "want": "'a'\n"}, {"example_id": "longest_common_substring:5", "got": "'de'\n", "source": "longest_common_substring(\"abcdef\", \"xabded\")\n", "truncated": false, "want": "'ab'\n"}, {"example_id": "longest_common_substring:7", "got": "'bcd'\n", "source": "longest_common_substring(\"abcdxyz\", \"xyzabcd\")\n", "truncated": false, "want": "'abcd'\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "off_by_one", "seed": 7, "span": {"col_offset": 19, "end_byte": 1321, "lineno": 44, "node": "Constant", "node_col_offset": 19, "node_end_col_offset": 20, "node_end_lineno": 44, "node_lineno": 44, "op_index": 0, "original_text": "1", "replacement_text": "2", "start_byte": 1320}}, "public_tests": {"examples": [{"example_id": "longest_common_substring:0", "source": "longest_common_substring(\"\", \"\")\n", "want": "''\n"}, {"example_id": "longest_common_substring:1", "source": "longest_common_substring(\"a\",\"\")\n", "want": "''\n"}, {"example_id": "longest_common_substring:2", "source": "longest_common_substring(\"\", \"a\")\n", "want": "''\n"}, {"example_id": "longest_common_substring:3", "source": "longest_common_substring(\"a\", \"a\")\n", "want": "'a'\n"}, {"example_id": "longest_common_substring:4", "source": "longest_common_substring(\"abcdef\", \"bcd\")\n", "want": "'bcd'\n"}, {"example_id": "longest_common_substring:5", "source": "longest_common_substring(\"abcdef\", \"xabded\")\n", "want": "'ab'\n"}, {"example_id": "longest_common_substring:6", "source": "longest_common_substring(\"GeeksforGeeks\", \"GeeksQuiz\")\n", "want": "'Geeks'\n"}, {"example_id": "longest_common_substring:7", "source": "longest_common_substring(\"abcdxyz\", \"xyzabcd\")\n", "want": "'abcd'\n"}, {"example_id": "longest_common_substring:8", "source": "longest_common_substring(\"zxabcdezy\", \"yzabcdezx\")\n", "want": "'abcdez'\n"}, {"example_id": "longest_common_substring:9", "source": "longest_common_substring(\"OldSite:GeeksforGeeks.org\", \"NewSite:GeeksQuiz.com\")\n", "want": "'Site:Geeks'\n"}, {"example_id": "longest_common_substring:10", "source": "longest_common_substring(1, 1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: longest_common_substring() takes two strings for inputs\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-897ba5b9527073b7", "tree_sha256": "f6eaa2ceec5a3aaf169265eb8837401706ff6dee1fad2b89def197e13f94fcd4", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:dynamic_programming/longest_common_substring.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "from __future__ import annotations\n\n\ndef maximum_non_adjacent_sum(nums: list[int]) -> int:\n \"\"\"\n Find the maximum non-adjacent sum of the integers in the nums input list\n\n >>> maximum_non_adjacent_sum([1, 2, 3])\n 4\n >>> maximum_non_adjacent_sum([1, 5, 3, 7, 2, 2, 6])\n 18\n >>> maximum_non_adjacent_sum([-1, -5, -3, -7, -2, -2, -6])\n 0\n >>> maximum_non_adjacent_sum([499, 500, -3, -7, -2, -2, -6])\n 500\n \"\"\"\n if not nums:\n return 0\n max_including = nums[0]\n max_excluding = 0\n for num in nums[1:]:\n max_including, max_excluding = (\n max_excluding + num,\n max(max_including, max_excluding),\n )\n return max(max_excluding, max_including)\n"}, "sha256": "dc59aad3f504e26529c6a1d813ab10ff5c3b0a0b9fb77e77ca08c3ef759be8aa"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "dc59aad3f504e26529c6a1d813ab10ff5c3b0a0b9fb77e77ca08c3ef759be8aa", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "c23a2322d3a314803047f984144e25ea210e3809172453795d771c08ada9eb40", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00062"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00062", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 23, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "from __future__ import annotations\n\n\ndef maximum_non_adjacent_sum(nums: list[int]) -> int:\n \"\"\"\n Find the maximum non-adjacent sum of the integers in the nums input list\n\n >>> maximum_non_adjacent_sum([1, 2, 3])\n 4\n >>> maximum_non_adjacent_sum([1, 5, 3, 7, 2, 2, 6])\n 18\n >>> maximum_non_adjacent_sum([-1, -5, -3, -7, -2, -2, -6])\n 0\n >>> maximum_non_adjacent_sum([499, 500, -3, -7, -2, -2, -6])\n 500\n \"\"\"\n if nums:\n return 0\n max_including = nums[0]\n max_excluding = 0\n for num in nums[1:]:\n max_including, max_excluding = (\n max_excluding + num,\n max(max_including, max_excluding),\n )\n return max(max_excluding, max_including)\n"}, "sha256": "6d58af4e517451052459d6e165569f01d22e12957d7080a8829c1c0a60476f07"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "maximum_non_adjacent_sum:0", "got": "0\n", "source": "maximum_non_adjacent_sum([1, 2, 3])\n", "truncated": false, "want": "4\n"}, {"example_id": "maximum_non_adjacent_sum:1", "got": "0\n", "source": "maximum_non_adjacent_sum([1, 5, 3, 7, 2, 2, 6])\n", "truncated": false, "want": "18\n"}, {"example_id": "maximum_non_adjacent_sum:3", "got": "0\n", "source": "maximum_non_adjacent_sum([499, 500, -3, -7, -2, -2, -6])\n", "truncated": false, "want": "500\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "boolean_condition", "seed": 7, "span": {"col_offset": 7, "end_byte": 451, "lineno": 17, "node": "UnaryOp", "node_col_offset": 7, "node_end_col_offset": 15, "node_end_lineno": 17, "node_lineno": 17, "op_index": 0, "original_text": "not ", "replacement_text": "", "start_byte": 447}}, "public_tests": {"examples": [{"example_id": "maximum_non_adjacent_sum:0", "source": "maximum_non_adjacent_sum([1, 2, 3])\n", "want": "4\n"}, {"example_id": "maximum_non_adjacent_sum:1", "source": "maximum_non_adjacent_sum([1, 5, 3, 7, 2, 2, 6])\n", "want": "18\n"}, {"example_id": "maximum_non_adjacent_sum:2", "source": "maximum_non_adjacent_sum([-1, -5, -3, -7, -2, -2, -6])\n", "want": "0\n"}, {"example_id": "maximum_non_adjacent_sum:3", "source": "maximum_non_adjacent_sum([499, 500, -3, -7, -2, -2, -6])\n", "want": "500\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-b8479c6c36cb0cc5", "tree_sha256": "dc59aad3f504e26529c6a1d813ab10ff5c3b0a0b9fb77e77ca08c3ef759be8aa", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:dynamic_programming/max_non_adjacent_sum.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def shell_sort(collection: list[int]) -> list[int]:\n \"\"\"Pure implementation of shell sort algorithm in Python\n :param collection: Some mutable ordered collection with heterogeneous\n comparable items inside\n :return: the same collection ordered by ascending\n\n >>> shell_sort([0, 5, 3, 2, 2])\n [0, 2, 2, 3, 5]\n >>> shell_sort([])\n []\n >>> shell_sort([-2, -5, -45])\n [-45, -5, -2]\n \"\"\"\n # Marcin Ciura's gap sequence\n\n gaps = [701, 301, 132, 57, 23, 10, 4, 1]\n for gap in gaps:\n for i in range(gap, len(collection)):\n insert_value = collection[i]\n j = i\n while j >= gap and collection[j - gap] > insert_value:\n collection[j] = collection[j - gap]\n j -= gap\n if j != i:\n collection[j] = insert_value\n return collection\n"}, "sha256": "3e2cd2cdfd6d39b7290cef1118a94443146331076cbf532196d48499964ab6fb"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "3e2cd2cdfd6d39b7290cef1118a94443146331076cbf532196d48499964ab6fb", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "7433c54a732079ff7b4d4b565a63c1724e1d8d5159122e3193b9a77d32b8043d", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00063"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00063", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 12, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def shell_sort(collection: list[int]) -> list[int]:\n \"\"\"Pure implementation of shell sort algorithm in Python\n :param collection: Some mutable ordered collection with heterogeneous\n comparable items inside\n :return: the same collection ordered by ascending\n\n >>> shell_sort([0, 5, 3, 2, 2])\n [0, 2, 2, 3, 5]\n >>> shell_sort([])\n []\n >>> shell_sort([-2, -5, -45])\n [-45, -5, -2]\n \"\"\"\n # Marcin Ciura's gap sequence\n\n gaps = [701, 301, 132, 57, 23, 10, 4, 1]\n for gap in gaps:\n for i in range(gap, len(collection)):\n insert_value = collection[i]\n j = i\n while j >= gap and collection[j - gap] > insert_value:\n collection[j] = collection[j + gap]\n j -= gap\n if j != i:\n collection[j] = insert_value\n return collection\n"}, "sha256": "12ac11ff4d363ffa22cabf32b9917137f6abc26a7b63c4f2acf996b98f8b1a7f"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "shell_sort:0", "got": "[0, 3, 2, 2, 2]\n", "source": "shell_sort([0, 5, 3, 2, 2])\n", "truncated": false, "want": "[0, 2, 2, 3, 5]\n"}, {"example_id": "shell_sort:2", "got": "[-5, -45, -45]\n", "source": "shell_sort([-2, -5, -45])\n", "truncated": false, "want": "[-45, -5, -2]\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 45, "end_byte": 737, "lineno": 22, "node": "BinOp", "node_col_offset": 43, "node_end_col_offset": 50, "node_end_lineno": 22, "node_lineno": 22, "op_index": 0, "original_text": "-", "replacement_text": "+", "start_byte": 736}}, "public_tests": {"examples": [{"example_id": "shell_sort:0", "source": "shell_sort([0, 5, 3, 2, 2])\n", "want": "[0, 2, 2, 3, 5]\n"}, {"example_id": "shell_sort:1", "source": "shell_sort([])\n", "want": "[]\n"}, {"example_id": "shell_sort:2", "source": "shell_sort([-2, -5, -45])\n", "want": "[-45, -5, -2]\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-8eb38222a7e98b7f", "tree_sha256": "3e2cd2cdfd6d39b7290cef1118a94443146331076cbf532196d48499964ab6fb", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:sorts/shell_sort.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def alt_ipv4_to_decimal(ipv4_address: str) -> int:\n \"\"\"\n >>> alt_ipv4_to_decimal(\"192.168.0.1\")\n 3232235521\n >>> alt_ipv4_to_decimal(\"10.0.0.255\")\n 167772415\n \"\"\"\n return int(\"0x\" + \"\".join(f\"{int(i):02x}\" for i in ipv4_address.split(\".\")), 16)\n"}, "sha256": "d66f8c83e7b6984120b2625b3f92388f98dd5c68dca943625694dd8138880698"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "d66f8c83e7b6984120b2625b3f92388f98dd5c68dca943625694dd8138880698", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "5145b4eee4798fe0915cc7f28bcec900d96ce842690347af1b5f73e74316eca5", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00067"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00067", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 7, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def alt_ipv4_to_decimal(ipv4_address: str) -> int:\n \"\"\"\n >>> alt_ipv4_to_decimal(\"192.168.0.1\")\n 3232235521\n >>> alt_ipv4_to_decimal(\"10.0.0.255\")\n 167772415\n \"\"\"\n return int(\"0x\" + \"\".join(f\"{int(i):02x}\" for i in ipv4_address.split(\".\")), 16) - 1\n"}, "sha256": "ac1493229a9102baad7e748e0d3fbdf4f4517715f99e0ca763c61a25535e0571"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "alt_ipv4_to_decimal:0", "got": "3232235520\n", "source": "alt_ipv4_to_decimal(\"192.168.0.1\")\n", "truncated": false, "want": "3232235521\n"}, {"example_id": "alt_ipv4_to_decimal:1", "got": "167772414\n", "source": "alt_ipv4_to_decimal(\"10.0.0.255\")\n", "truncated": false, "want": "167772415\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 265, "lineno": 8, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 84, "node_end_lineno": 8, "node_lineno": 8, "op_index": 0, "original_text": "int(\"0x\" + \"\".join(f\"{int(i):02x}\" for i in ipv4_address.split(\".\")), 16)", "replacement_text": "int(\"0x\" + \"\".join(f\"{int(i):02x}\" for i in ipv4_address.split(\".\")), 16) - 1", "start_byte": 192}}, "public_tests": {"examples": [{"example_id": "alt_ipv4_to_decimal:0", "source": "alt_ipv4_to_decimal(\"192.168.0.1\")\n", "want": "3232235521\n"}, {"example_id": "alt_ipv4_to_decimal:1", "source": "alt_ipv4_to_decimal(\"10.0.0.255\")\n", "want": "167772415\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-8b1387aa93347e64", "tree_sha256": "d66f8c83e7b6984120b2625b3f92388f98dd5c68dca943625694dd8138880698", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:conversions/ipv4_conversion.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def dodecahedron_surface_area(edge: float) -> float:\n \"\"\"\n Calculates the surface area of a regular dodecahedron\n a = 3 * ((25 + 10 * (5** (1 / 2))) ** (1 / 2 )) * (e**2)\n where:\n a --> is the area of the dodecahedron\n e --> is the length of the edge\n reference-->\"Dodecahedron\" Study.com\n \n\n :param edge: length of the edge of the dodecahedron\n :type edge: float\n :return: the surface area of the dodecahedron as a float\n\n\n Tests:\n >>> dodecahedron_surface_area(5)\n 516.1432201766901\n >>> dodecahedron_surface_area(10)\n 2064.5728807067603\n >>> dodecahedron_surface_area(-1)\n Traceback (most recent call last):\n ...\n ValueError: Length must be a positive.\n \"\"\"\n\n if edge <= 0 or not isinstance(edge, int):\n raise ValueError(\"Length must be a positive.\")\n return 3 * ((25 + 10 * (5 ** (1 / 2))) ** (1 / 2)) * (edge**2)\n"}, "sha256": "9b17e915b8b585a3e1ef545dfbd09d22ddc9b869db74be722cf0d9210c191179"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "9b17e915b8b585a3e1ef545dfbd09d22ddc9b869db74be722cf0d9210c191179", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "df2c1b2f9fe1164613da6856975f18f7c549e2274eaad9d141c2d13700f11e07", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00070"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00070", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 12, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def dodecahedron_surface_area(edge: float) -> float:\n \"\"\"\n Calculates the surface area of a regular dodecahedron\n a = 3 * ((25 + 10 * (5** (1 / 2))) ** (1 / 2 )) * (e**2)\n where:\n a --> is the area of the dodecahedron\n e --> is the length of the edge\n reference-->\"Dodecahedron\" Study.com\n \n\n :param edge: length of the edge of the dodecahedron\n :type edge: float\n :return: the surface area of the dodecahedron as a float\n\n\n Tests:\n >>> dodecahedron_surface_area(5)\n 516.1432201766901\n >>> dodecahedron_surface_area(10)\n 2064.5728807067603\n >>> dodecahedron_surface_area(-1)\n Traceback (most recent call last):\n ...\n ValueError: Length must be a positive.\n \"\"\"\n\n if edge <= 0 or not isinstance(edge, int):\n raise ValueError(\"Length must be a positive.\")\n return 3 * ((25 + 10 * (5 ** (1 / 2))) ** (1 / 2)) * (edge**2) - 1\n"}, "sha256": "1d3f2b82f66c97476cfeaddc75af25222d7379e6c3d0685ffbb55282d76bfc22"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "dodecahedron_surface_area:0", "got": "515.1432201766901\n", "source": "dodecahedron_surface_area(5)\n", "truncated": false, "want": "516.1432201766901\n"}, {"example_id": "dodecahedron_surface_area:1", "got": "2063.5728807067603\n", "source": "dodecahedron_surface_area(10)\n", "truncated": false, "want": "2064.5728807067603\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 976, "lineno": 29, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 66, "node_end_lineno": 29, "node_lineno": 29, "op_index": 0, "original_text": "3 * ((25 + 10 * (5 ** (1 / 2))) ** (1 / 2)) * (edge**2)", "replacement_text": "3 * ((25 + 10 * (5 ** (1 / 2))) ** (1 / 2)) * (edge**2) - 1", "start_byte": 921}}, "public_tests": {"examples": [{"example_id": "dodecahedron_surface_area:0", "source": "dodecahedron_surface_area(5)\n", "want": "516.1432201766901\n"}, {"example_id": "dodecahedron_surface_area:1", "source": "dodecahedron_surface_area(10)\n", "want": "2064.5728807067603\n"}, {"example_id": "dodecahedron_surface_area:2", "source": "dodecahedron_surface_area(-1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: Length must be a positive.\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-b2c789719ab12cbe", "tree_sha256": "9b17e915b8b585a3e1ef545dfbd09d22ddc9b869db74be722cf0d9210c191179", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/dodecahedron.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def prime_sieve_eratosthenes(num: int) -> list[int]:\n \"\"\"\n Print the prime numbers up to n\n\n >>> prime_sieve_eratosthenes(10)\n [2, 3, 5, 7]\n >>> prime_sieve_eratosthenes(20)\n [2, 3, 5, 7, 11, 13, 17, 19]\n >>> prime_sieve_eratosthenes(2)\n [2]\n >>> prime_sieve_eratosthenes(1)\n []\n >>> prime_sieve_eratosthenes(-1)\n Traceback (most recent call last):\n ...\n ValueError: Input must be a positive integer\n \"\"\"\n\n if num <= 0:\n raise ValueError(\"Input must be a positive integer\")\n\n primes = [True] * (num + 1)\n\n p = 2\n while p * p <= num:\n if primes[p]:\n for i in range(p * p, num + 1, p):\n primes[i] = False\n p += 1\n\n return [prime for prime in range(2, num + 1) if primes[prime]]\n"}, "sha256": "a20b6a49b623f1f6feebbdc84e00db7525a42e74620b4493e0e260267877dd10"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "a20b6a49b623f1f6feebbdc84e00db7525a42e74620b4493e0e260267877dd10", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "dbeaa2aa05f51d6f05b05e1251e5069fb6d696bc1372f1f7430278b7123b8244", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00071"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00071", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 19, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def prime_sieve_eratosthenes(num: int) -> list[int]:\n \"\"\"\n Print the prime numbers up to n\n\n >>> prime_sieve_eratosthenes(10)\n [2, 3, 5, 7]\n >>> prime_sieve_eratosthenes(20)\n [2, 3, 5, 7, 11, 13, 17, 19]\n >>> prime_sieve_eratosthenes(2)\n [2]\n >>> prime_sieve_eratosthenes(1)\n []\n >>> prime_sieve_eratosthenes(-1)\n Traceback (most recent call last):\n ...\n ValueError: Input must be a positive integer\n \"\"\"\n\n if num <= 0:\n raise ValueError(\"Input must be a positive integer\")\n\n primes = [True] * (num + 1)\n\n p = 2\n while p // p <= num:\n if primes[p]:\n for i in range(p * p, num + 1, p):\n primes[i] = False\n p += 1\n\n return [prime for prime in range(2, num + 1) if primes[prime]]\n"}, "sha256": "4797ad3e7007294df61ef9cb5dbd6ac8b3a143b7d1e4b51e2befeee8feb83cbe"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "prime_sieve_eratosthenes:0", "got": "IndexError: list index out of range", "source": "prime_sieve_eratosthenes(10)\n", "truncated": false, "want": "[2, 3, 5, 7]\n"}, {"example_id": "prime_sieve_eratosthenes:1", "got": "IndexError: list index out of range", "source": "prime_sieve_eratosthenes(20)\n", "truncated": false, "want": "[2, 3, 5, 7, 11, 13, 17, 19]\n"}, {"example_id": "prime_sieve_eratosthenes:2", "got": "IndexError: list index out of range", "source": "prime_sieve_eratosthenes(2)\n", "truncated": false, "want": "[2]\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 12, "end_byte": 586, "lineno": 25, "node": "BinOp", "node_col_offset": 10, "node_end_col_offset": 15, "node_end_lineno": 25, "node_lineno": 25, "op_index": 0, "original_text": "*", "replacement_text": "//", "start_byte": 585}}, "public_tests": {"examples": [{"example_id": "prime_sieve_eratosthenes:0", "source": "prime_sieve_eratosthenes(10)\n", "want": "[2, 3, 5, 7]\n"}, {"example_id": "prime_sieve_eratosthenes:1", "source": "prime_sieve_eratosthenes(20)\n", "want": "[2, 3, 5, 7, 11, 13, 17, 19]\n"}, {"example_id": "prime_sieve_eratosthenes:2", "source": "prime_sieve_eratosthenes(2)\n", "want": "[2]\n"}, {"example_id": "prime_sieve_eratosthenes:3", "source": "prime_sieve_eratosthenes(1)\n", "want": "[]\n"}, {"example_id": "prime_sieve_eratosthenes:4", "source": "prime_sieve_eratosthenes(-1)\n", "want": "Traceback (most recent call last):\n...\nValueError: Input must be a positive integer\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-d80635f9d9c760f1", "tree_sha256": "a20b6a49b623f1f6feebbdc84e00db7525a42e74620b4493e0e260267877dd10", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/prime_sieve_eratosthenes.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def longest_palindromic_subsequence(input_string: str) -> int:\n \"\"\"\n This function returns the longest palindromic subsequence in a string\n >>> longest_palindromic_subsequence(\"bbbab\")\n 4\n >>> longest_palindromic_subsequence(\"bbabcbcab\")\n 7\n \"\"\"\n n = len(input_string)\n rev = input_string[::-1]\n m = len(rev)\n dp = [[-1] * (m + 1) for i in range(n + 1)]\n for i in range(n + 1):\n dp[i][0] = 0\n for i in range(m + 1):\n dp[0][i] = 0\n\n # create and initialise dp array\n for i in range(1, n + 1):\n for j in range(1, m + 1):\n # If characters at i and j are the same\n # include them in the palindromic subsequence\n if input_string[i - 1] == rev[j - 1]:\n dp[i][j] = 1 + dp[i - 1][j - 1]\n else:\n dp[i][j] = max(dp[i - 1][j], dp[i][j - 1])\n\n return dp[n][m]\n"}, "sha256": "d834746e5333956adb3dda1228ed1a408e53d29a913d5771fa18932616ada95b"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "d834746e5333956adb3dda1228ed1a408e53d29a913d5771fa18932616ada95b", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "5233a047f4ee54e2e6f10f6c07ee3cd06830ee9ecaa9e98ba9541fba1b35021c", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00072"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00072", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 10, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def longest_palindromic_subsequence(input_string: str) -> int:\n \"\"\"\n This function returns the longest palindromic subsequence in a string\n >>> longest_palindromic_subsequence(\"bbbab\")\n 4\n >>> longest_palindromic_subsequence(\"bbabcbcab\")\n 7\n \"\"\"\n n = len(input_string)\n rev = input_string[::-1]\n m = len(rev)\n dp = [[-1] * (m + 1) for i in range(n + 1)]\n for i in range(n + 1):\n dp[i][0] = 0\n for i in range(m + 1):\n dp[0][i] = 0\n\n # create and initialise dp array\n for i in range(1, n + 1):\n for j in range(1, m + 1):\n # If characters at i and j are the same\n # include them in the palindromic subsequence\n if input_string[i + 1] == rev[j - 1]:\n dp[i][j] = 1 + dp[i - 1][j - 1]\n else:\n dp[i][j] = max(dp[i - 1][j], dp[i][j - 1])\n\n return dp[n][m]\n"}, "sha256": "53daa6d88fa336772349f02d22bd1cc4206ba0315a26625dcff8acd83564e1d0"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "longest_palindromic_subsequence:0", "got": "IndexError: string index out of range", "source": "longest_palindromic_subsequence(\"bbbab\")\n", "truncated": false, "want": "4\n"}, {"example_id": "longest_palindromic_subsequence:1", "got": "IndexError: string index out of range", "source": "longest_palindromic_subsequence(\"bbabcbcab\")\n", "truncated": false, "want": "7\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 30, "end_byte": 726, "lineno": 23, "node": "BinOp", "node_col_offset": 28, "node_end_col_offset": 33, "node_end_lineno": 23, "node_lineno": 23, "op_index": 0, "original_text": "-", "replacement_text": "+", "start_byte": 725}}, "public_tests": {"examples": [{"example_id": "longest_palindromic_subsequence:0", "source": "longest_palindromic_subsequence(\"bbbab\")\n", "want": "4\n"}, {"example_id": "longest_palindromic_subsequence:1", "source": "longest_palindromic_subsequence(\"bbabcbcab\")\n", "want": "7\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-5ed3a41ff605bd3d", "tree_sha256": "d834746e5333956adb3dda1228ed1a408e53d29a913d5771fa18932616ada95b", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:dynamic_programming/longest_palindromic_subsequence.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def exchange_sort(numbers: list[int]) -> list[int]:\n \"\"\"\n Uses exchange sort to sort a list of numbers.\n Source: https://en.wikipedia.org/wiki/Sorting_algorithm#Exchange_sort\n >>> exchange_sort([5, 4, 3, 2, 1])\n [1, 2, 3, 4, 5]\n >>> exchange_sort([-1, -2, -3])\n [-3, -2, -1]\n >>> exchange_sort([1, 2, 3, 4, 5])\n [1, 2, 3, 4, 5]\n >>> exchange_sort([0, 10, -2, 5, 3])\n [-2, 0, 3, 5, 10]\n >>> exchange_sort([])\n []\n \"\"\"\n numbers_length = len(numbers)\n for i in range(numbers_length):\n for j in range(i + 1, numbers_length):\n if numbers[j] < numbers[i]:\n numbers[i], numbers[j] = numbers[j], numbers[i]\n return numbers\n"}, "sha256": "61785d9a9741708a7acbcbb962099fa55296e2beddb75a76128b1871fe414c82"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "61785d9a9741708a7acbcbb962099fa55296e2beddb75a76128b1871fe414c82", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "731904de39e65b67148df681ca38035ea9f07701738714a57d3a8539a0937b16", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00074"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00074", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 20, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def exchange_sort(numbers: list[int]) -> list[int]:\n \"\"\"\n Uses exchange sort to sort a list of numbers.\n Source: https://en.wikipedia.org/wiki/Sorting_algorithm#Exchange_sort\n >>> exchange_sort([5, 4, 3, 2, 1])\n [1, 2, 3, 4, 5]\n >>> exchange_sort([-1, -2, -3])\n [-3, -2, -1]\n >>> exchange_sort([1, 2, 3, 4, 5])\n [1, 2, 3, 4, 5]\n >>> exchange_sort([0, 10, -2, 5, 3])\n [-2, 0, 3, 5, 10]\n >>> exchange_sort([])\n []\n \"\"\"\n numbers_length = len(numbers)\n for i in range(numbers_length):\n for j in range(i - 1, numbers_length):\n if numbers[j] < numbers[i]:\n numbers[i], numbers[j] = numbers[j], numbers[i]\n return numbers\n"}, "sha256": "1007635ba37383053c7bafa7c1011a72d0ad74b38e7480f23734c620d8cbaae1"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "exchange_sort:0", "got": "[4, 3, 2, 5, 1]\n", "source": "exchange_sort([5, 4, 3, 2, 1])\n", "truncated": false, "want": "[1, 2, 3, 4, 5]\n"}, {"example_id": "exchange_sort:1", "got": "[-2, -1, -3]\n", "source": "exchange_sort([-1, -2, -3])\n", "truncated": false, "want": "[-3, -2, -1]\n"}, {"example_id": "exchange_sort:2", "got": "[2, 3, 4, 5, 1]\n", "source": "exchange_sort([1, 2, 3, 4, 5])\n", "truncated": false, "want": "[1, 2, 3, 4, 5]\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 25, "end_byte": 555, "lineno": 18, "node": "BinOp", "node_col_offset": 23, "node_end_col_offset": 28, "node_end_lineno": 18, "node_lineno": 18, "op_index": 0, "original_text": "+", "replacement_text": "-", "start_byte": 554}}, "public_tests": {"examples": [{"example_id": "exchange_sort:0", "source": "exchange_sort([5, 4, 3, 2, 1])\n", "want": "[1, 2, 3, 4, 5]\n"}, {"example_id": "exchange_sort:1", "source": "exchange_sort([-1, -2, -3])\n", "want": "[-3, -2, -1]\n"}, {"example_id": "exchange_sort:2", "source": "exchange_sort([1, 2, 3, 4, 5])\n", "want": "[1, 2, 3, 4, 5]\n"}, {"example_id": "exchange_sort:3", "source": "exchange_sort([0, 10, -2, 5, 3])\n", "want": "[-2, 0, 3, 5, 10]\n"}, {"example_id": "exchange_sort:4", "source": "exchange_sort([])\n", "want": "[]\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-5d44e21186f10b72", "tree_sha256": "61785d9a9741708a7acbcbb962099fa55296e2beddb75a76128b1871fe414c82", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:sorts/exchange_sort.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def double_factorial_recursive(n: int) -> int:\n \"\"\"\n Compute double factorial using recursive method.\n Recursion can be costly for large numbers.\n\n To learn about the theory behind this algorithm:\n https://en.wikipedia.org/wiki/Double_factorial\n\n >>> from math import prod\n >>> all(double_factorial_recursive(i) == prod(range(i, 0, -2)) for i in range(20))\n True\n >>> double_factorial_recursive(0.1)\n Traceback (most recent call last):\n ...\n ValueError: double_factorial_recursive() only accepts integral values\n >>> double_factorial_recursive(-1)\n Traceback (most recent call last):\n ...\n ValueError: double_factorial_recursive() not defined for negative values\n \"\"\"\n if not isinstance(n, int):\n raise ValueError(\"double_factorial_recursive() only accepts integral values\")\n if n < 0:\n raise ValueError(\"double_factorial_recursive() not defined for negative values\")\n return 1 if n <= 1 else n * double_factorial_recursive(n - 2)\n"}, "sha256": "069399f6174c92987d8133c899a484524be56beacc8b734902313f11ccba0142"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "069399f6174c92987d8133c899a484524be56beacc8b734902313f11ccba0142", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "bd566a8b1226f57c8f23fcdc1373171506eded3745bc5f6a1cd101fe27317ce4", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00075"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00075", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 5, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def double_factorial_recursive(n: int) -> int:\n \"\"\"\n Compute double factorial using recursive method.\n Recursion can be costly for large numbers.\n\n To learn about the theory behind this algorithm:\n https://en.wikipedia.org/wiki/Double_factorial\n\n >>> from math import prod\n >>> all(double_factorial_recursive(i) == prod(range(i, 0, -2)) for i in range(20))\n True\n >>> double_factorial_recursive(0.1)\n Traceback (most recent call last):\n ...\n ValueError: double_factorial_recursive() only accepts integral values\n >>> double_factorial_recursive(-1)\n Traceback (most recent call last):\n ...\n ValueError: double_factorial_recursive() not defined for negative values\n \"\"\"\n if not isinstance(n, int):\n raise ValueError(\"double_factorial_recursive() only accepts integral values\")\n if n <= 0:\n raise ValueError(\"double_factorial_recursive() not defined for negative values\")\n return 1 if n <= 1 else n * double_factorial_recursive(n - 2)\n"}, "sha256": "e62e655084a94edc0acd9ee83c837ad0e3405631609a8b717e49cd49e9b2c4d6"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "double_factorial_recursive:1", "got": "ValueError: double_factorial_recursive() not defined for negative values", "source": "all(double_factorial_recursive(i) == prod(range(i, 0, -2)) for i in range(20))\n", "truncated": false, "want": "True\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "comparison_boundary", "seed": 7, "span": {"col_offset": 9, "end_byte": 854, "lineno": 23, "node": "Compare", "node_col_offset": 7, "node_end_col_offset": 12, "node_end_lineno": 23, "node_lineno": 23, "op_index": 0, "original_text": "<", "replacement_text": "<=", "start_byte": 853}}, "public_tests": {"examples": [{"example_id": "double_factorial_recursive:0", "source": "from math import prod\n", "want": ""}, {"example_id": "double_factorial_recursive:1", "source": "all(double_factorial_recursive(i) == prod(range(i, 0, -2)) for i in range(20))\n", "want": "True\n"}, {"example_id": "double_factorial_recursive:2", "source": "double_factorial_recursive(0.1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: double_factorial_recursive() only accepts integral values\n"}, {"example_id": "double_factorial_recursive:3", "source": "double_factorial_recursive(-1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: double_factorial_recursive() not defined for negative values\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-26eb465e5814e599", "tree_sha256": "069399f6174c92987d8133c899a484524be56beacc8b734902313f11ccba0142", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/double_factorial.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def count_vowels_and_consonants(text: str) -> tuple[int, int]:\n \"\"\"\n Count the number of vowels and consonants in a given string.\n\n This function ignores non-alphabetic characters.\n\n Args:\n text (str): Input string.\n\n Returns:\n tuple[int, int]: A tuple containing (vowel_count,\n consonant_count).\n Examples:\n >>> count_vowels_and_consonants(\"Hello World\")\n (3, 7)\n >>> count_vowels_and_consonants(\"AEIOU\")\n (5, 0)\n >>> count_vowels_and_consonants(\"bcdf\")\n (0, 4)\n >>> count_vowels_and_consonants(\"\")\n (0, 0)\n \"\"\"\n vowels = set(\"aeiouAEIOU\")\n vowel_count = 0\n consonant_count = 0\n\n for char in text:\n if char.isalpha():\n if char in vowels:\n vowel_count += 1\n else:\n consonant_count += 1\n\n return vowel_count, consonant_count\n"}, "sha256": "e06c1ac685930125f8499c079d1398f7eb85ba1db7dc5030007eba2a6dd67a81"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "e06c1ac685930125f8499c079d1398f7eb85ba1db7dc5030007eba2a6dd67a81", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "0ce3ba4fc5d8591bf984ebb2fb5c47918e0ab538d5fee5e076c2ed2827e869a6", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00076"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00076", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 15, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def count_vowels_and_consonants(text: str) -> tuple[int, int]:\n \"\"\"\n Count the number of vowels and consonants in a given string.\n\n This function ignores non-alphabetic characters.\n\n Args:\n text (str): Input string.\n\n Returns:\n tuple[int, int]: A tuple containing (vowel_count,\n consonant_count).\n Examples:\n >>> count_vowels_and_consonants(\"Hello World\")\n (3, 7)\n >>> count_vowels_and_consonants(\"AEIOU\")\n (5, 0)\n >>> count_vowels_and_consonants(\"bcdf\")\n (0, 4)\n >>> count_vowels_and_consonants(\"\")\n (0, 0)\n \"\"\"\n vowels = set(\"aeiouAEIOU\")\n vowel_count = 0\n consonant_count = 0\n\n for char in text:\n if char.isalpha():\n if char in vowels:\n vowel_count -= 1\n else:\n consonant_count += 1\n\n return vowel_count, consonant_count\n"}, "sha256": "82d93d6f1d03aa278470e7089b48772a993fb3c1892737b19510657bebe4b0ba"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "count_vowels_and_consonants:0", "got": "(-3, 7)\n", "source": "count_vowels_and_consonants(\"Hello World\")\n", "truncated": false, "want": "(3, 7)\n"}, {"example_id": "count_vowels_and_consonants:1", "got": "(-5, 0)\n", "source": "count_vowels_and_consonants(\"AEIOU\")\n", "truncated": false, "want": "(5, 0)\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 28, "end_byte": 818, "lineno": 30, "node": "AugAssign", "node_col_offset": 16, "node_end_col_offset": 32, "node_end_lineno": 30, "node_lineno": 30, "op_index": 0, "original_text": "+=", "replacement_text": "-=", "start_byte": 816}}, "public_tests": {"examples": [{"example_id": "count_vowels_and_consonants:0", "source": "count_vowels_and_consonants(\"Hello World\")\n", "want": "(3, 7)\n"}, {"example_id": "count_vowels_and_consonants:1", "source": "count_vowels_and_consonants(\"AEIOU\")\n", "want": "(5, 0)\n"}, {"example_id": "count_vowels_and_consonants:2", "source": "count_vowels_and_consonants(\"bcdf\")\n", "want": "(0, 4)\n"}, {"example_id": "count_vowels_and_consonants:3", "source": "count_vowels_and_consonants(\"\")\n", "want": "(0, 0)\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-8838c78676ad28d6", "tree_sha256": "e06c1ac685930125f8499c079d1398f7eb85ba1db7dc5030007eba2a6dd67a81", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:strings/count_vowels_consonants.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def moles_to_volume(pressure: float, moles: float, temperature: float) -> float:\n \"\"\"\n Convert moles to volume.\n Ideal gas laws are used.\n Temperature is taken in kelvin.\n Volume is taken in litres.\n Pressure has atm as SI unit.\n\n Wikipedia reference: https://en.wikipedia.org/wiki/Gas_laws\n Wikipedia reference: https://en.wikipedia.org/wiki/Pressure\n Wikipedia reference: https://en.wikipedia.org/wiki/Temperature\n\n >>> moles_to_volume(0.82, 3, 300)\n 90\n >>> moles_to_volume(8.2, 5, 200)\n 10\n \"\"\"\n return round(float((moles * 0.0821 * temperature) / (pressure)))\n"}, "sha256": "03704e7cb7003462f130a9f4be4768b87164bfcdc3834d639bb5cc66f17704b0"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "03704e7cb7003462f130a9f4be4768b87164bfcdc3834d639bb5cc66f17704b0", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "7706aa57db15e8367810884b51ef36f5d2361445172dc511a8ecdab4fbd0677c", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00078"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00078", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def moles_to_volume(pressure: float, moles: float, temperature: float) -> float:\n \"\"\"\n Convert moles to volume.\n Ideal gas laws are used.\n Temperature is taken in kelvin.\n Volume is taken in litres.\n Pressure has atm as SI unit.\n\n Wikipedia reference: https://en.wikipedia.org/wiki/Gas_laws\n Wikipedia reference: https://en.wikipedia.org/wiki/Pressure\n Wikipedia reference: https://en.wikipedia.org/wiki/Temperature\n\n >>> moles_to_volume(0.82, 3, 300)\n 90\n >>> moles_to_volume(8.2, 5, 200)\n 10\n \"\"\"\n return round(float((moles * 0.0821 * temperature) / (pressure))) + 1\n"}, "sha256": "ac0fb83f4f5c5f1f8972b9cd9353dc6e290b83241e46a9627f2ff2030559604c"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "moles_to_volume:0", "got": "91\n", "source": "moles_to_volume(0.82, 3, 300)\n", "truncated": false, "want": "90\n"}, {"example_id": "moles_to_volume:1", "got": "11\n", "source": "moles_to_volume(8.2, 5, 200)\n", "truncated": false, "want": "10\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 631, "lineno": 18, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 68, "node_end_lineno": 18, "node_lineno": 18, "op_index": 0, "original_text": "round(float((moles * 0.0821 * temperature) / (pressure)))", "replacement_text": "round(float((moles * 0.0821 * temperature) / (pressure))) + 1", "start_byte": 574}}, "public_tests": {"examples": [{"example_id": "moles_to_volume:0", "source": "moles_to_volume(0.82, 3, 300)\n", "want": "90\n"}, {"example_id": "moles_to_volume:1", "source": "moles_to_volume(8.2, 5, 200)\n", "want": "10\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-1b3ddf3b9f300ebb", "tree_sha256": "03704e7cb7003462f130a9f4be4768b87164bfcdc3834d639bb5cc66f17704b0", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:conversions/molecular_chemistry.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def shell_sort(collection: list[int]) -> list[int]:\n \"\"\"Pure implementation of shell sort algorithm in Python\n :param collection: Some mutable ordered collection with heterogeneous\n comparable items inside\n :return: the same collection ordered by ascending\n\n >>> shell_sort([0, 5, 3, 2, 2])\n [0, 2, 2, 3, 5]\n >>> shell_sort([])\n []\n >>> shell_sort([-2, -5, -45])\n [-45, -5, -2]\n \"\"\"\n # Marcin Ciura's gap sequence\n\n gaps = [701, 301, 132, 57, 23, 10, 4, 1]\n for gap in gaps:\n for i in range(gap, len(collection)):\n insert_value = collection[i]\n j = i\n while j >= gap and collection[j - gap] > insert_value:\n collection[j] = collection[j - gap]\n j -= gap\n if j != i:\n collection[j] = insert_value\n return collection\n"}, "sha256": "3e2cd2cdfd6d39b7290cef1118a94443146331076cbf532196d48499964ab6fb"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "3e2cd2cdfd6d39b7290cef1118a94443146331076cbf532196d48499964ab6fb", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "d624bd3b8f393d0696d3a34dc0b85d60c790421ce4b355c92da3e67a1d7c1314", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00080"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00080", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 12, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def shell_sort(collection: list[int]) -> list[int]:\n \"\"\"Pure implementation of shell sort algorithm in Python\n :param collection: Some mutable ordered collection with heterogeneous\n comparable items inside\n :return: the same collection ordered by ascending\n\n >>> shell_sort([0, 5, 3, 2, 2])\n [0, 2, 2, 3, 5]\n >>> shell_sort([])\n []\n >>> shell_sort([-2, -5, -45])\n [-45, -5, -2]\n \"\"\"\n # Marcin Ciura's gap sequence\n\n gaps = [701, 301, 132, 57, 23, 10, 4, 1]\n for gap in gaps:\n for i in range(gap, len(collection)):\n insert_value = collection[i]\n j = i\n while j > gap and collection[j - gap] > insert_value:\n collection[j] = collection[j - gap]\n j -= gap\n if j != i:\n collection[j] = insert_value\n return collection\n"}, "sha256": "cdfc98a4eb98e1689c82695c723882360624c59e3e8e8713bcee34ba96dc98f8"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "shell_sort:2", "got": "[-2, -45, -5]\n", "source": "shell_sort([-2, -5, -45])\n", "truncated": false, "want": "[-45, -5, -2]\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "comparison_boundary", "seed": 7, "span": {"col_offset": 20, "end_byte": 646, "lineno": 21, "node": "Compare", "node_col_offset": 18, "node_end_col_offset": 26, "node_end_lineno": 21, "node_lineno": 21, "op_index": 0, "original_text": ">=", "replacement_text": ">", "start_byte": 644}}, "public_tests": {"examples": [{"example_id": "shell_sort:0", "source": "shell_sort([0, 5, 3, 2, 2])\n", "want": "[0, 2, 2, 3, 5]\n"}, {"example_id": "shell_sort:1", "source": "shell_sort([])\n", "want": "[]\n"}, {"example_id": "shell_sort:2", "source": "shell_sort([-2, -5, -45])\n", "want": "[-45, -5, -2]\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-8eb38222a7e98b7f", "tree_sha256": "3e2cd2cdfd6d39b7290cef1118a94443146331076cbf532196d48499964ab6fb", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:sorts/shell_sort.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def is_match(string: str, pattern: str) -> bool:\n \"\"\"\n >>> is_match(\"\", \"\")\n True\n >>> is_match(\"aa\", \"a\")\n False\n >>> is_match(\"abc\", \"abc\")\n True\n >>> is_match(\"abc\", \"*c\")\n True\n >>> is_match(\"abc\", \"a*\")\n True\n >>> is_match(\"abc\", \"*a*\")\n True\n >>> is_match(\"abc\", \"?b?\")\n True\n >>> is_match(\"abc\", \"*?\")\n True\n >>> is_match(\"abc\", \"a*d\")\n False\n >>> is_match(\"abc\", \"a*c?\")\n False\n >>> is_match('baaabab','*****ba*****ba')\n False\n >>> is_match('baaabab','*****ba*****ab')\n True\n >>> is_match('aa','*')\n True\n \"\"\"\n dp = [[False] * (len(pattern) + 1) for _ in string + \"1\"]\n dp[0][0] = True\n # Fill in the first row\n for j, char in enumerate(pattern, 1):\n if char == \"*\":\n dp[0][j] = dp[0][j - 1]\n # Fill in the rest of the DP table\n for i, s_char in enumerate(string, 1):\n for j, p_char in enumerate(pattern, 1):\n if p_char in (s_char, \"?\"):\n dp[i][j] = dp[i - 1][j - 1]\n elif pattern[j - 1] == \"*\":\n dp[i][j] = dp[i - 1][j] or dp[i][j - 1]\n return dp[len(string)][len(pattern)]\n"}, "sha256": "e0370d02e48206b51a35ae0fa4b9386720d7ba86b679e9a26aea084b369a270d"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "e0370d02e48206b51a35ae0fa4b9386720d7ba86b679e9a26aea084b369a270d", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "947568a7b0bf3d84cc8fa7eed99db3475a4b9504019a34534c7c3e9f8ed3559f", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00081"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00081", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def is_match(string: str, pattern: str) -> bool:\n \"\"\"\n >>> is_match(\"\", \"\")\n True\n >>> is_match(\"aa\", \"a\")\n False\n >>> is_match(\"abc\", \"abc\")\n True\n >>> is_match(\"abc\", \"*c\")\n True\n >>> is_match(\"abc\", \"a*\")\n True\n >>> is_match(\"abc\", \"*a*\")\n True\n >>> is_match(\"abc\", \"?b?\")\n True\n >>> is_match(\"abc\", \"*?\")\n True\n >>> is_match(\"abc\", \"a*d\")\n False\n >>> is_match(\"abc\", \"a*c?\")\n False\n >>> is_match('baaabab','*****ba*****ba')\n False\n >>> is_match('baaabab','*****ba*****ab')\n True\n >>> is_match('aa','*')\n True\n \"\"\"\n dp = [[False] // (len(pattern) + 1) for _ in string + \"1\"]\n dp[0][0] = True\n # Fill in the first row\n for j, char in enumerate(pattern, 1):\n if char == \"*\":\n dp[0][j] = dp[0][j - 1]\n # Fill in the rest of the DP table\n for i, s_char in enumerate(string, 1):\n for j, p_char in enumerate(pattern, 1):\n if p_char in (s_char, \"?\"):\n dp[i][j] = dp[i - 1][j - 1]\n elif pattern[j - 1] == \"*\":\n dp[i][j] = dp[i - 1][j] or dp[i][j - 1]\n return dp[len(string)][len(pattern)]\n"}, "sha256": "eda2daa5f3649a6b285410444966a1b50aeb6279d0243f8aaf41372731dfc06a"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "is_match:0", "got": "TypeError: unsupported operand type(s) for //: 'list' and 'int'", "source": "is_match(\"\", \"\")\n", "truncated": false, "want": "True\n"}, {"example_id": "is_match:1", "got": "TypeError: unsupported operand type(s) for //: 'list' and 'int'", "source": "is_match(\"aa\", \"a\")\n", "truncated": false, "want": "False\n"}, {"example_id": "is_match:2", "got": "TypeError: unsupported operand type(s) for //: 'list' and 'int'", "source": "is_match(\"abc\", \"abc\")\n", "truncated": false, "want": "True\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 18, "end_byte": 621, "lineno": 30, "node": "BinOp", "node_col_offset": 10, "node_end_col_offset": 38, "node_end_lineno": 30, "node_lineno": 30, "op_index": 0, "original_text": "*", "replacement_text": "//", "start_byte": 620}}, "public_tests": {"examples": [{"example_id": "is_match:0", "source": "is_match(\"\", \"\")\n", "want": "True\n"}, {"example_id": "is_match:1", "source": "is_match(\"aa\", \"a\")\n", "want": "False\n"}, {"example_id": "is_match:2", "source": "is_match(\"abc\", \"abc\")\n", "want": "True\n"}, {"example_id": "is_match:3", "source": "is_match(\"abc\", \"*c\")\n", "want": "True\n"}, {"example_id": "is_match:4", "source": "is_match(\"abc\", \"a*\")\n", "want": "True\n"}, {"example_id": "is_match:5", "source": "is_match(\"abc\", \"*a*\")\n", "want": "True\n"}, {"example_id": "is_match:6", "source": "is_match(\"abc\", \"?b?\")\n", "want": "True\n"}, {"example_id": "is_match:7", "source": "is_match(\"abc\", \"*?\")\n", "want": "True\n"}, {"example_id": "is_match:8", "source": "is_match(\"abc\", \"a*d\")\n", "want": "False\n"}, {"example_id": "is_match:9", "source": "is_match(\"abc\", \"a*c?\")\n", "want": "False\n"}, {"example_id": "is_match:10", "source": "is_match('baaabab','*****ba*****ba')\n", "want": "False\n"}, {"example_id": "is_match:11", "source": "is_match('baaabab','*****ba*****ab')\n", "want": "True\n"}, {"example_id": "is_match:12", "source": "is_match('aa','*')\n", "want": "True\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-b12fd0f3948b94ef", "tree_sha256": "e0370d02e48206b51a35ae0fa4b9386720d7ba86b679e9a26aea084b369a270d", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:dynamic_programming/wildcard_matching.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def is_contains_unique_chars(input_str: str) -> bool:\n \"\"\"\n Check if all characters in the string is unique or not.\n >>> is_contains_unique_chars(\"I_love.py\")\n True\n >>> is_contains_unique_chars(\"I don't love Python\")\n False\n\n Time complexity: O(n)\n Space complexity: O(1) 19320 bytes as we are having 144697 characters in unicode\n \"\"\"\n\n # Each bit will represent each unicode character\n # For example 65th bit representing 'A'\n # https://stackoverflow.com/a/12811293\n bitmap = 0\n for ch in input_str:\n ch_unicode = ord(ch)\n ch_bit_index_on = pow(2, ch_unicode)\n\n # If we already turned on bit for current character's unicode\n if bitmap >> ch_unicode & 1 == 1:\n return False\n bitmap |= ch_bit_index_on\n return True\n"}, "sha256": "735532da92292c793741fed624079f43127da045cd122b0036fbd642d988eb47"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "735532da92292c793741fed624079f43127da045cd122b0036fbd642d988eb47", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "8459ac9a66327197835a771873f241535c6f8e359d04756e19dc5e30f792a536", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00082"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00082", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 10, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def is_contains_unique_chars(input_str: str) -> bool:\n \"\"\"\n Check if all characters in the string is unique or not.\n >>> is_contains_unique_chars(\"I_love.py\")\n True\n >>> is_contains_unique_chars(\"I don't love Python\")\n False\n\n Time complexity: O(n)\n Space complexity: O(1) 19320 bytes as we are having 144697 characters in unicode\n \"\"\"\n\n # Each bit will represent each unicode character\n # For example 65th bit representing 'A'\n # https://stackoverflow.com/a/12811293\n bitmap = 0\n for ch in input_str:\n ch_unicode = ord(ch)\n ch_bit_index_on = pow(2, ch_unicode)\n\n # If we already turned on bit for current character's unicode\n if bitmap >> ch_unicode & 1 == 1:\n return True\n bitmap |= ch_bit_index_on\n return True\n"}, "sha256": "ba0356779e57dc8e4dd1302eaee97759e2bbd3825b1e14709077c8251686ceec"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "is_contains_unique_chars:1", "got": "True\n", "source": "is_contains_unique_chars(\"I don't love Python\")\n", "truncated": false, "want": "False\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 19, "end_byte": 755, "lineno": 23, "node": "Return", "node_col_offset": 12, "node_end_col_offset": 24, "node_end_lineno": 23, "node_lineno": 23, "op_index": 0, "original_text": "False", "replacement_text": "True", "start_byte": 750}}, "public_tests": {"examples": [{"example_id": "is_contains_unique_chars:0", "source": "is_contains_unique_chars(\"I_love.py\")\n", "want": "True\n"}, {"example_id": "is_contains_unique_chars:1", "source": "is_contains_unique_chars(\"I don't love Python\")\n", "want": "False\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-e2e296ecf11eeb82", "tree_sha256": "735532da92292c793741fed624079f43127da045cd122b0036fbd642d988eb47", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:strings/is_contains_unique_chars.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def integer_square_root(num: int) -> int:\n \"\"\"\n Returns the integer square root of a non-negative integer num.\n Args:\n num: A non-negative integer.\n Returns:\n The integer square root of num.\n Raises:\n ValueError: If num is not an integer or is negative.\n >>> [integer_square_root(i) for i in range(18)]\n [0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4]\n >>> integer_square_root(625)\n 25\n >>> integer_square_root(2_147_483_647)\n 46340\n >>> from math import isqrt\n >>> all(integer_square_root(i) == isqrt(i) for i in range(20))\n True\n >>> integer_square_root(-1)\n Traceback (most recent call last):\n ...\n ValueError: num must be non-negative integer\n >>> integer_square_root(1.5)\n Traceback (most recent call last):\n ...\n ValueError: num must be non-negative integer\n >>> integer_square_root(\"0\")\n Traceback (most recent call last):\n ...\n ValueError: num must be non-negative integer\n \"\"\"\n if not isinstance(num, int) or num < 0:\n raise ValueError(\"num must be non-negative integer\")\n\n if num < 2:\n return num\n\n left_bound = 0\n right_bound = num // 2\n\n while left_bound <= right_bound:\n mid = left_bound + (right_bound - left_bound) // 2\n mid_squared = mid * mid\n if mid_squared == num:\n return mid\n\n if mid_squared < num:\n left_bound = mid + 1\n else:\n right_bound = mid - 1\n\n return right_bound\n"}, "sha256": "896595028d147c2a075ef76d86129ebcbb41c6612b2308f13a68fe4cf4e13e3c"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "896595028d147c2a075ef76d86129ebcbb41c6612b2308f13a68fe4cf4e13e3c", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "eb3182c3443bf6a4264a45a283afdcc91f323b7ce6f82cfe5748dd9da6b809fc", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00084"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00084", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 15, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def integer_square_root(num: int) -> int:\n \"\"\"\n Returns the integer square root of a non-negative integer num.\n Args:\n num: A non-negative integer.\n Returns:\n The integer square root of num.\n Raises:\n ValueError: If num is not an integer or is negative.\n >>> [integer_square_root(i) for i in range(18)]\n [0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4]\n >>> integer_square_root(625)\n 25\n >>> integer_square_root(2_147_483_647)\n 46340\n >>> from math import isqrt\n >>> all(integer_square_root(i) == isqrt(i) for i in range(20))\n True\n >>> integer_square_root(-1)\n Traceback (most recent call last):\n ...\n ValueError: num must be non-negative integer\n >>> integer_square_root(1.5)\n Traceback (most recent call last):\n ...\n ValueError: num must be non-negative integer\n >>> integer_square_root(\"0\")\n Traceback (most recent call last):\n ...\n ValueError: num must be non-negative integer\n \"\"\"\n if not isinstance(num, int) or num < 0:\n raise ValueError(\"num must be non-negative integer\")\n\n if num < 2:\n return num\n\n left_bound = 0\n right_bound = num // 2\n\n while left_bound <= right_bound:\n mid = left_bound + (right_bound - left_bound) // 2\n mid_squared = mid // mid\n if mid_squared == num:\n return mid\n\n if mid_squared < num:\n left_bound = mid + 1\n else:\n right_bound = mid - 1\n\n return right_bound\n"}, "sha256": "ee51ba2e116214317a2fb7615a0c01462e70e8ab560a2465ef734cc967563f8b"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "integer_square_root:0", "got": "ZeroDivisionError: integer division or modulo by zero", "source": "[integer_square_root(i) for i in range(18)]\n", "truncated": false, "want": "[0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4]\n"}, {"example_id": "integer_square_root:1", "got": "312\n", "source": "integer_square_root(625)\n", "truncated": false, "want": "25\n"}, {"example_id": "integer_square_root:2", "got": "1073741823\n", "source": "integer_square_root(2_147_483_647)\n", "truncated": false, "want": "46340\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 26, "end_byte": 1319, "lineno": 43, "node": "BinOp", "node_col_offset": 22, "node_end_col_offset": 31, "node_end_lineno": 43, "node_lineno": 43, "op_index": 0, "original_text": "*", "replacement_text": "//", "start_byte": 1318}}, "public_tests": {"examples": [{"example_id": "integer_square_root:0", "source": "[integer_square_root(i) for i in range(18)]\n", "want": "[0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4]\n"}, {"example_id": "integer_square_root:1", "source": "integer_square_root(625)\n", "want": "25\n"}, {"example_id": "integer_square_root:2", "source": "integer_square_root(2_147_483_647)\n", "want": "46340\n"}, {"example_id": "integer_square_root:3", "source": "from math import isqrt\n", "want": ""}, {"example_id": "integer_square_root:4", "source": "all(integer_square_root(i) == isqrt(i) for i in range(20))\n", "want": "True\n"}, {"example_id": "integer_square_root:5", "source": "integer_square_root(-1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: num must be non-negative integer\n"}, {"example_id": "integer_square_root:6", "source": "integer_square_root(1.5)\n", "want": "Traceback (most recent call last):\n ...\nValueError: num must be non-negative integer\n"}, {"example_id": "integer_square_root:7", "source": "integer_square_root(\"0\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: num must be non-negative integer\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-9152d246c868deb6", "tree_sha256": "896595028d147c2a075ef76d86129ebcbb41c6612b2308f13a68fe4cf4e13e3c", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/integer_square_root.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def decimal_isolate(number: float, digit_amount: int) -> float:\n \"\"\"\n Isolates the decimal part of a number.\n If digitAmount > 0 round to that decimal place, else print the entire decimal.\n >>> decimal_isolate(1.53, 0)\n 0.53\n >>> decimal_isolate(35.345, 1)\n 0.3\n >>> decimal_isolate(35.345, 2)\n 0.34\n >>> decimal_isolate(35.345, 3)\n 0.345\n >>> decimal_isolate(-14.789, 3)\n -0.789\n >>> decimal_isolate(0, 2)\n 0\n >>> decimal_isolate(-14.123, 1)\n -0.1\n >>> decimal_isolate(-14.123, 2)\n -0.12\n >>> decimal_isolate(-14.123, 3)\n -0.123\n \"\"\"\n if digit_amount > 0:\n return round(number - int(number), digit_amount)\n return number - int(number)\n"}, "sha256": "c6fd9f5b4393e64b11c3bd495074a1dadc06d7bea6e867f003ee005c4e78dc67"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "c6fd9f5b4393e64b11c3bd495074a1dadc06d7bea6e867f003ee005c4e78dc67", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "509e8adbecbd9c91de22eb70021eff8bb14f3fd0fc4bc3591e817d4448ad06c4", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00085"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00085", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def decimal_isolate(number: float, digit_amount: int) -> float:\n \"\"\"\n Isolates the decimal part of a number.\n If digitAmount > 0 round to that decimal place, else print the entire decimal.\n >>> decimal_isolate(1.53, 0)\n 0.53\n >>> decimal_isolate(35.345, 1)\n 0.3\n >>> decimal_isolate(35.345, 2)\n 0.34\n >>> decimal_isolate(35.345, 3)\n 0.345\n >>> decimal_isolate(-14.789, 3)\n -0.789\n >>> decimal_isolate(0, 2)\n 0\n >>> decimal_isolate(-14.123, 1)\n -0.1\n >>> decimal_isolate(-14.123, 2)\n -0.12\n >>> decimal_isolate(-14.123, 3)\n -0.123\n \"\"\"\n if digit_amount > 1:\n return round(number - int(number), digit_amount)\n return number - int(number)\n"}, "sha256": "9ac8a55f14dadb1a7828a2c82b5cc8501cba53792d6d8f3bb56f3bfb2815f8de"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "decimal_isolate:1", "got": "0.34499999999999886\n", "source": "decimal_isolate(35.345, 1)\n", "truncated": false, "want": "0.3\n"}, {"example_id": "decimal_isolate:6", "got": "-0.12299999999999933\n", "source": "decimal_isolate(-14.123, 1)\n", "truncated": false, "want": "-0.1\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "off_by_one", "seed": 7, "span": {"col_offset": 22, "end_byte": 624, "lineno": 24, "node": "Constant", "node_col_offset": 22, "node_end_col_offset": 23, "node_end_lineno": 24, "node_lineno": 24, "op_index": 0, "original_text": "0", "replacement_text": "1", "start_byte": 623}}, "public_tests": {"examples": [{"example_id": "decimal_isolate:0", "source": "decimal_isolate(1.53, 0)\n", "want": "0.53\n"}, {"example_id": "decimal_isolate:1", "source": "decimal_isolate(35.345, 1)\n", "want": "0.3\n"}, {"example_id": "decimal_isolate:2", "source": "decimal_isolate(35.345, 2)\n", "want": "0.34\n"}, {"example_id": "decimal_isolate:3", "source": "decimal_isolate(35.345, 3)\n", "want": "0.345\n"}, {"example_id": "decimal_isolate:4", "source": "decimal_isolate(-14.789, 3)\n", "want": "-0.789\n"}, {"example_id": "decimal_isolate:5", "source": "decimal_isolate(0, 2)\n", "want": "0\n"}, {"example_id": "decimal_isolate:6", "source": "decimal_isolate(-14.123, 1)\n", "want": "-0.1\n"}, {"example_id": "decimal_isolate:7", "source": "decimal_isolate(-14.123, 2)\n", "want": "-0.12\n"}, {"example_id": "decimal_isolate:8", "source": "decimal_isolate(-14.123, 3)\n", "want": "-0.123\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-2ec787c93a7d5b77", "tree_sha256": "c6fd9f5b4393e64b11c3bd495074a1dadc06d7bea6e867f003ee005c4e78dc67", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/decimal_isolate.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def octal_to_hex(octal: str) -> str:\n \"\"\"\n Convert an Octal number to Hexadecimal number.\n For more information: https://en.wikipedia.org/wiki/Octal\n\n >>> octal_to_hex(\"100\")\n '0x40'\n >>> octal_to_hex(\"235\")\n '0x9D'\n >>> octal_to_hex(17)\n Traceback (most recent call last):\n ...\n TypeError: Expected a string as input\n >>> octal_to_hex(\"Av\")\n Traceback (most recent call last):\n ...\n ValueError: Not a Valid Octal Number\n >>> octal_to_hex(\"\")\n Traceback (most recent call last):\n ...\n ValueError: Empty string was passed to the function\n \"\"\"\n\n if not isinstance(octal, str):\n raise TypeError(\"Expected a string as input\")\n if octal.startswith(\"0o\"):\n octal = octal[2:]\n if octal == \"\":\n raise ValueError(\"Empty string was passed to the function\")\n if any(char not in \"01234567\" for char in octal):\n raise ValueError(\"Not a Valid Octal Number\")\n\n decimal = 0\n for char in octal:\n decimal <<= 3\n decimal |= int(char)\n\n hex_char = \"0123456789ABCDEF\"\n\n revhex = \"\"\n while decimal:\n revhex += hex_char[decimal & 15]\n decimal >>= 4\n\n return \"0x\" + revhex[::-1]\n"}, "sha256": "60cade18c59e6d2f94becc790bba720ecd3fc3ef964c38789825cff97fa020c3"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "60cade18c59e6d2f94becc790bba720ecd3fc3ef964c38789825cff97fa020c3", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "f379755e664b43364dc628e5c5ebd32f1d52239ff3b6c3408becbd13da640051", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00086"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00086", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 8, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def octal_to_hex(octal: str) -> str:\n \"\"\"\n Convert an Octal number to Hexadecimal number.\n For more information: https://en.wikipedia.org/wiki/Octal\n\n >>> octal_to_hex(\"100\")\n '0x40'\n >>> octal_to_hex(\"235\")\n '0x9D'\n >>> octal_to_hex(17)\n Traceback (most recent call last):\n ...\n TypeError: Expected a string as input\n >>> octal_to_hex(\"Av\")\n Traceback (most recent call last):\n ...\n ValueError: Not a Valid Octal Number\n >>> octal_to_hex(\"\")\n Traceback (most recent call last):\n ...\n ValueError: Empty string was passed to the function\n \"\"\"\n\n if not isinstance(octal, str):\n raise TypeError(\"Expected a string as input\")\n if octal.startswith(\"0o\"):\n octal = octal[2:]\n if octal == \"\":\n raise ValueError(\"Empty string was passed to the function\")\n if any(char not in \"01234567\" for char in octal):\n raise ValueError(\"Not a Valid Octal Number\")\n\n decimal = 0\n for char in octal:\n decimal <<= 3\n decimal |= int(char)\n\n hex_char = \"0123456789ABCDEF\"\n\n revhex = \"\"\n while decimal:\n revhex += hex_char[decimal & 15]\n decimal >>= 4\n\n return \"0x\" - revhex[::-1]\n"}, "sha256": "46e7a3708161c4c767e4f56c25be15442dec4ef7d0f248423fb18d6db8d11413"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "octal_to_hex:0", "got": "TypeError: unsupported operand type(s) for -: 'str' and 'str'", "source": "octal_to_hex(\"100\")\n", "truncated": false, "want": "'0x40'\n"}, {"example_id": "octal_to_hex:1", "got": "TypeError: unsupported operand type(s) for -: 'str' and 'str'", "source": "octal_to_hex(\"235\")\n", "truncated": false, "want": "'0x9D'\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 16, "end_byte": 1199, "lineno": 45, "node": "BinOp", "node_col_offset": 11, "node_end_col_offset": 30, "node_end_lineno": 45, "node_lineno": 45, "op_index": 0, "original_text": "+", "replacement_text": "-", "start_byte": 1198}}, "public_tests": {"examples": [{"example_id": "octal_to_hex:0", "source": "octal_to_hex(\"100\")\n", "want": "'0x40'\n"}, {"example_id": "octal_to_hex:1", "source": "octal_to_hex(\"235\")\n", "want": "'0x9D'\n"}, {"example_id": "octal_to_hex:2", "source": "octal_to_hex(17)\n", "want": "Traceback (most recent call last):\n ...\nTypeError: Expected a string as input\n"}, {"example_id": "octal_to_hex:3", "source": "octal_to_hex(\"Av\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: Not a Valid Octal Number\n"}, {"example_id": "octal_to_hex:4", "source": "octal_to_hex(\"\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: Empty string was passed to the function\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-bbcdd5ef8b93b6b6", "tree_sha256": "60cade18c59e6d2f94becc790bba720ecd3fc3ef964c38789825cff97fa020c3", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:conversions/octal_to_hexadecimal.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def twos_complement(number: int) -> str:\n \"\"\"\n Take in a negative integer 'number'.\n Return the two's complement representation of 'number'.\n\n >>> twos_complement(0)\n '0b0'\n >>> twos_complement(-1)\n '0b11'\n >>> twos_complement(-5)\n '0b1011'\n >>> twos_complement(-17)\n '0b101111'\n >>> twos_complement(-207)\n '0b100110001'\n >>> twos_complement(1)\n Traceback (most recent call last):\n ...\n ValueError: input must be a negative integer\n \"\"\"\n if number > 0:\n raise ValueError(\"input must be a negative integer\")\n binary_number_length = len(bin(number)[3:])\n twos_complement_number = bin(abs(number) - (1 << binary_number_length))[3:]\n twos_complement_number = (\n (\n \"1\"\n + \"0\" * (binary_number_length - len(twos_complement_number))\n + twos_complement_number\n )\n if number < 0\n else \"0\"\n )\n return \"0b\" + twos_complement_number\n"}, "sha256": "02c57a24afbb9617aca776a6015ca3fe45480e9e0371baf1f8ce571e4788dfad"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "02c57a24afbb9617aca776a6015ca3fe45480e9e0371baf1f8ce571e4788dfad", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "764cccf4be751436a2d3192b819c47d5d1a06a3c49e1279e9b1ff599ed49e87d", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00089"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00089", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 21, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def twos_complement(number: int) -> str:\n \"\"\"\n Take in a negative integer 'number'.\n Return the two's complement representation of 'number'.\n\n >>> twos_complement(0)\n '0b0'\n >>> twos_complement(-1)\n '0b11'\n >>> twos_complement(-5)\n '0b1011'\n >>> twos_complement(-17)\n '0b101111'\n >>> twos_complement(-207)\n '0b100110001'\n >>> twos_complement(1)\n Traceback (most recent call last):\n ...\n ValueError: input must be a negative integer\n \"\"\"\n if number > 0:\n raise ValueError(\"input must be a negative integer\")\n binary_number_length = len(bin(number)[2:])\n twos_complement_number = bin(abs(number) - (1 << binary_number_length))[3:]\n twos_complement_number = (\n (\n \"1\"\n + \"0\" * (binary_number_length - len(twos_complement_number))\n + twos_complement_number\n )\n if number < 0\n else \"0\"\n )\n return \"0b\" + twos_complement_number\n"}, "sha256": "08131135878f7da59134d3ceafb8034cd9c8aa3b9a72d1a90921468ad586cadd"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "twos_complement:1", "got": "'0b111'\n", "source": "twos_complement(-1)\n", "truncated": false, "want": "'0b11'\n"}, {"example_id": "twos_complement:2", "got": "'0b11011'\n", "source": "twos_complement(-5)\n", "truncated": false, "want": "'0b1011'\n"}, {"example_id": "twos_complement:3", "got": "'0b1101111'\n", "source": "twos_complement(-17)\n", "truncated": false, "want": "'0b101111'\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "off_by_one", "seed": 7, "span": {"col_offset": 43, "end_byte": 619, "lineno": 23, "node": "Constant", "node_col_offset": 43, "node_end_col_offset": 44, "node_end_lineno": 23, "node_lineno": 23, "op_index": 0, "original_text": "3", "replacement_text": "2", "start_byte": 618}}, "public_tests": {"examples": [{"example_id": "twos_complement:0", "source": "twos_complement(0)\n", "want": "'0b0'\n"}, {"example_id": "twos_complement:1", "source": "twos_complement(-1)\n", "want": "'0b11'\n"}, {"example_id": "twos_complement:2", "source": "twos_complement(-5)\n", "want": "'0b1011'\n"}, {"example_id": "twos_complement:3", "source": "twos_complement(-17)\n", "want": "'0b101111'\n"}, {"example_id": "twos_complement:4", "source": "twos_complement(-207)\n", "want": "'0b100110001'\n"}, {"example_id": "twos_complement:5", "source": "twos_complement(1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: input must be a negative integer\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-e8fe05398e7f20e0", "tree_sha256": "02c57a24afbb9617aca776a6015ca3fe45480e9e0371baf1f8ce571e4788dfad", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:bit_manipulation/binary_twos_complement.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def binary_count_setbits(a: int) -> int:\n \"\"\"\n Take in 1 integer, return a number that is\n the number of 1's in binary representation of that number.\n\n >>> binary_count_setbits(25)\n 3\n >>> binary_count_setbits(36)\n 2\n >>> binary_count_setbits(16)\n 1\n >>> binary_count_setbits(58)\n 4\n >>> binary_count_setbits(4294967295)\n 32\n >>> binary_count_setbits(0)\n 0\n >>> binary_count_setbits(-10)\n Traceback (most recent call last):\n ...\n ValueError: Input value must be a positive integer\n >>> binary_count_setbits(0.8)\n Traceback (most recent call last):\n ...\n TypeError: Input value must be a 'int' type\n >>> binary_count_setbits(\"0\")\n Traceback (most recent call last):\n ...\n TypeError: '<' not supported between instances of 'str' and 'int'\n \"\"\"\n if a < 0:\n raise ValueError(\"Input value must be a positive integer\")\n elif isinstance(a, float):\n raise TypeError(\"Input value must be a 'int' type\")\n return bin(a).count(\"1\")\n"}, "sha256": "17af49a439d7715b4c411122212d610ff64d43c9590b8f7851ba87302bf64fbf"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "17af49a439d7715b4c411122212d610ff64d43c9590b8f7851ba87302bf64fbf", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "d52f4904b1bf7d6ad00d01efa2b8ad7a75adc624e08d42f5a08237a7a3fc79a8", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00090"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00090", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def binary_count_setbits(a: int) -> int:\n \"\"\"\n Take in 1 integer, return a number that is\n the number of 1's in binary representation of that number.\n\n >>> binary_count_setbits(25)\n 3\n >>> binary_count_setbits(36)\n 2\n >>> binary_count_setbits(16)\n 1\n >>> binary_count_setbits(58)\n 4\n >>> binary_count_setbits(4294967295)\n 32\n >>> binary_count_setbits(0)\n 0\n >>> binary_count_setbits(-10)\n Traceback (most recent call last):\n ...\n ValueError: Input value must be a positive integer\n >>> binary_count_setbits(0.8)\n Traceback (most recent call last):\n ...\n TypeError: Input value must be a 'int' type\n >>> binary_count_setbits(\"0\")\n Traceback (most recent call last):\n ...\n TypeError: '<' not supported between instances of 'str' and 'int'\n \"\"\"\n if a <= 0:\n raise ValueError(\"Input value must be a positive integer\")\n elif isinstance(a, float):\n raise TypeError(\"Input value must be a 'int' type\")\n return bin(a).count(\"1\")\n"}, "sha256": "d91b56949eab838af6da101c423495565a0654eafb61b0c5bdd0444fca20fda6"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "binary_count_setbits:5", "got": "ValueError: Input value must be a positive integer", "source": "binary_count_setbits(0)\n", "truncated": false, "want": "0\n"}, {"example_id": "binary_count_setbits:8", "got": "TypeError: '<=' not supported between instances of 'str' and 'int'", "source": "binary_count_setbits(\"0\")\n", "truncated": false, "want": "Traceback (most recent call last):\n ...\nTypeError: '<' not supported between instances of 'str' and 'int'\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "comparison_boundary", "seed": 7, "span": {"col_offset": 9, "end_byte": 848, "lineno": 31, "node": "Compare", "node_col_offset": 7, "node_end_col_offset": 12, "node_end_lineno": 31, "node_lineno": 31, "op_index": 0, "original_text": "<", "replacement_text": "<=", "start_byte": 847}}, "public_tests": {"examples": [{"example_id": "binary_count_setbits:0", "source": "binary_count_setbits(25)\n", "want": "3\n"}, {"example_id": "binary_count_setbits:1", "source": "binary_count_setbits(36)\n", "want": "2\n"}, {"example_id": "binary_count_setbits:2", "source": "binary_count_setbits(16)\n", "want": "1\n"}, {"example_id": "binary_count_setbits:3", "source": "binary_count_setbits(58)\n", "want": "4\n"}, {"example_id": "binary_count_setbits:4", "source": "binary_count_setbits(4294967295)\n", "want": "32\n"}, {"example_id": "binary_count_setbits:5", "source": "binary_count_setbits(0)\n", "want": "0\n"}, {"example_id": "binary_count_setbits:6", "source": "binary_count_setbits(-10)\n", "want": "Traceback (most recent call last):\n ...\nValueError: Input value must be a positive integer\n"}, {"example_id": "binary_count_setbits:7", "source": "binary_count_setbits(0.8)\n", "want": "Traceback (most recent call last):\n ...\nTypeError: Input value must be a 'int' type\n"}, {"example_id": "binary_count_setbits:8", "source": "binary_count_setbits(\"0\")\n", "want": "Traceback (most recent call last):\n ...\nTypeError: '<' not supported between instances of 'str' and 'int'\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-5811ec8749219449", "tree_sha256": "17af49a439d7715b4c411122212d610ff64d43c9590b8f7851ba87302bf64fbf", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:bit_manipulation/binary_count_setbits.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def is_contains_unique_chars(input_str: str) -> bool:\n \"\"\"\n Check if all characters in the string is unique or not.\n >>> is_contains_unique_chars(\"I_love.py\")\n True\n >>> is_contains_unique_chars(\"I don't love Python\")\n False\n\n Time complexity: O(n)\n Space complexity: O(1) 19320 bytes as we are having 144697 characters in unicode\n \"\"\"\n\n # Each bit will represent each unicode character\n # For example 65th bit representing 'A'\n # https://stackoverflow.com/a/12811293\n bitmap = 0\n for ch in input_str:\n ch_unicode = ord(ch)\n ch_bit_index_on = pow(2, ch_unicode)\n\n # If we already turned on bit for current character's unicode\n if bitmap >> ch_unicode & 1 == 1:\n return False\n bitmap |= ch_bit_index_on\n return True\n"}, "sha256": "735532da92292c793741fed624079f43127da045cd122b0036fbd642d988eb47"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "735532da92292c793741fed624079f43127da045cd122b0036fbd642d988eb47", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "fcbdf4126c4136809e40b61e271f38c780081cc29e1e27ebe0c0c7013a6be769", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00091"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00091", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 10, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def is_contains_unique_chars(input_str: str) -> bool:\n \"\"\"\n Check if all characters in the string is unique or not.\n >>> is_contains_unique_chars(\"I_love.py\")\n True\n >>> is_contains_unique_chars(\"I don't love Python\")\n False\n\n Time complexity: O(n)\n Space complexity: O(1) 19320 bytes as we are having 144697 characters in unicode\n \"\"\"\n\n # Each bit will represent each unicode character\n # For example 65th bit representing 'A'\n # https://stackoverflow.com/a/12811293\n bitmap = 0\n for ch in input_str:\n ch_unicode = ord(ch)\n ch_bit_index_on = pow(2, ch_unicode)\n\n # If we already turned on bit for current character's unicode\n if bitmap >> ch_unicode & 1 != 1:\n return False\n bitmap |= ch_bit_index_on\n return True\n"}, "sha256": "9a0368bd47213565b7b9c766ec7636c45006653ca2bd7b0f3840f38e71eb1b4d"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "is_contains_unique_chars:0", "got": "False\n", "source": "is_contains_unique_chars(\"I_love.py\")\n", "truncated": false, "want": "True\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "boolean_condition", "seed": 7, "span": {"col_offset": 36, "end_byte": 727, "lineno": 22, "node": "Compare", "node_col_offset": 11, "node_end_col_offset": 40, "node_end_lineno": 22, "node_lineno": 22, "op_index": 0, "original_text": "==", "replacement_text": "!=", "start_byte": 725}}, "public_tests": {"examples": [{"example_id": "is_contains_unique_chars:0", "source": "is_contains_unique_chars(\"I_love.py\")\n", "want": "True\n"}, {"example_id": "is_contains_unique_chars:1", "source": "is_contains_unique_chars(\"I don't love Python\")\n", "want": "False\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-e2e296ecf11eeb82", "tree_sha256": "735532da92292c793741fed624079f43127da045cd122b0036fbd642d988eb47", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:strings/is_contains_unique_chars.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def moles_to_pressure(volume: float, moles: float, temperature: float) -> float:\n \"\"\"\n Convert moles to pressure.\n Ideal gas laws are used.\n Temperature is taken in kelvin.\n Volume is taken in litres.\n Pressure has atm as SI unit.\n\n Wikipedia reference: https://en.wikipedia.org/wiki/Gas_laws\n Wikipedia reference: https://en.wikipedia.org/wiki/Pressure\n Wikipedia reference: https://en.wikipedia.org/wiki/Temperature\n\n >>> moles_to_pressure(0.82, 3, 300)\n 90\n >>> moles_to_pressure(8.2, 5, 200)\n 10\n \"\"\"\n return round(float((moles * 0.0821 * temperature) / (volume)))\n"}, "sha256": "e0f7f867691cd80f9a47a0e482cb40d3e5dda6d7e3c8feff30319559480f85ad"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "e0f7f867691cd80f9a47a0e482cb40d3e5dda6d7e3c8feff30319559480f85ad", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "6ebcda0fbfce0c41170aac3bfa7970a2ce471fb8781f2fbd49d5825a3804d640", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00092"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00092", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def moles_to_pressure(volume: float, moles: float, temperature: float) -> float:\n \"\"\"\n Convert moles to pressure.\n Ideal gas laws are used.\n Temperature is taken in kelvin.\n Volume is taken in litres.\n Pressure has atm as SI unit.\n\n Wikipedia reference: https://en.wikipedia.org/wiki/Gas_laws\n Wikipedia reference: https://en.wikipedia.org/wiki/Pressure\n Wikipedia reference: https://en.wikipedia.org/wiki/Temperature\n\n >>> moles_to_pressure(0.82, 3, 300)\n 90\n >>> moles_to_pressure(8.2, 5, 200)\n 10\n \"\"\"\n return round(float((moles // 0.0821 * temperature) / (volume)))\n"}, "sha256": "a2d5902250b42a647c13b071597e247aa38b2f577a946ad8742e126c60bbe37b"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "moles_to_pressure:0", "got": "13171\n", "source": "moles_to_pressure(0.82, 3, 300)\n", "truncated": false, "want": "90\n"}, {"example_id": "moles_to_pressure:1", "got": "1463\n", "source": "moles_to_pressure(8.2, 5, 200)\n", "truncated": false, "want": "10\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 30, "end_byte": 600, "lineno": 18, "node": "BinOp", "node_col_offset": 24, "node_end_col_offset": 38, "node_end_lineno": 18, "node_lineno": 18, "op_index": 0, "original_text": "*", "replacement_text": "//", "start_byte": 599}}, "public_tests": {"examples": [{"example_id": "moles_to_pressure:0", "source": "moles_to_pressure(0.82, 3, 300)\n", "want": "90\n"}, {"example_id": "moles_to_pressure:1", "source": "moles_to_pressure(8.2, 5, 200)\n", "want": "10\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-6d62a38627cc4a04", "tree_sha256": "e0f7f867691cd80f9a47a0e482cb40d3e5dda6d7e3c8feff30319559480f85ad", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:conversions/molecular_chemistry.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def max_product_subarray(numbers: list[int]) -> int:\n \"\"\"\n Returns the maximum product that can be obtained by multiplying a\n contiguous subarray of the given integer list `numbers`.\n\n Example:\n\n >>> max_product_subarray([2, 3, -2, 4])\n 6\n >>> max_product_subarray((-2, 0, -1))\n 0\n >>> max_product_subarray([2, 3, -2, 4, -1])\n 48\n >>> max_product_subarray([-1])\n -1\n >>> max_product_subarray([0])\n 0\n >>> max_product_subarray([])\n 0\n >>> max_product_subarray(\"\")\n 0\n >>> max_product_subarray(None)\n 0\n >>> max_product_subarray([2, 3, -2, 4.5, -1])\n Traceback (most recent call last):\n ...\n ValueError: numbers must be an iterable of integers\n >>> max_product_subarray(\"ABC\")\n Traceback (most recent call last):\n ...\n ValueError: numbers must be an iterable of integers\n \"\"\"\n if not numbers:\n return 0\n\n if not isinstance(numbers, (list, tuple)) or not all(\n isinstance(number, int) for number in numbers\n ):\n raise ValueError(\"numbers must be an iterable of integers\")\n\n max_till_now = min_till_now = max_prod = numbers[0]\n\n for i in range(1, len(numbers)):\n # update the maximum and minimum subarray products\n number = numbers[i]\n if number < 0:\n max_till_now, min_till_now = min_till_now, max_till_now\n max_till_now = max(number, max_till_now * number)\n min_till_now = min(number, min_till_now * number)\n\n # update the maximum product found till now\n max_prod = max(max_prod, max_till_now)\n\n return max_prod\n"}, "sha256": "4b40e662312e163ac4cab83e65ac057c0594660c847a0c87381a17345f830f8f"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "4b40e662312e163ac4cab83e65ac057c0594660c847a0c87381a17345f830f8f", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "b442d67a35067b9ee58c7dfacbbae5aeaa07bb61ebbaa0d18c52b5f69f3c95ad", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00095"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00095", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def max_product_subarray(numbers: list[int]) -> int:\n \"\"\"\n Returns the maximum product that can be obtained by multiplying a\n contiguous subarray of the given integer list `numbers`.\n\n Example:\n\n >>> max_product_subarray([2, 3, -2, 4])\n 6\n >>> max_product_subarray((-2, 0, -1))\n 0\n >>> max_product_subarray([2, 3, -2, 4, -1])\n 48\n >>> max_product_subarray([-1])\n -1\n >>> max_product_subarray([0])\n 0\n >>> max_product_subarray([])\n 0\n >>> max_product_subarray(\"\")\n 0\n >>> max_product_subarray(None)\n 0\n >>> max_product_subarray([2, 3, -2, 4.5, -1])\n Traceback (most recent call last):\n ...\n ValueError: numbers must be an iterable of integers\n >>> max_product_subarray(\"ABC\")\n Traceback (most recent call last):\n ...\n ValueError: numbers must be an iterable of integers\n \"\"\"\n if not numbers:\n return 0\n\n if not isinstance(numbers, (list, tuple)) or not all(\n isinstance(number, int) for number in numbers\n ):\n raise ValueError(\"numbers must be an iterable of integers\")\n\n max_till_now = min_till_now = max_prod = numbers[0]\n\n for i in range(1, len(numbers)):\n # update the maximum and minimum subarray products\n number = numbers[i]\n if number < 0:\n max_till_now, min_till_now = min_till_now, max_till_now\n max_till_now = max(number, max_till_now * number)\n min_till_now = min(number, min_till_now // number)\n\n # update the maximum product found till now\n max_prod = max(max_prod, max_till_now)\n\n return max_prod\n"}, "sha256": "4713976652a2c044332c9ba7c9873bc053660b7925e89844b821ad1d1fd4bcc4"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "max_product_subarray:1", "got": "ZeroDivisionError: integer division or modulo by zero", "source": "max_product_subarray((-2, 0, -1))\n", "truncated": false, "want": "0\n"}, {"example_id": "max_product_subarray:2", "got": "6\n", "source": "max_product_subarray([2, 3, -2, 4, -1])\n", "truncated": false, "want": "48\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 48, "end_byte": 1474, "lineno": 49, "node": "BinOp", "node_col_offset": 35, "node_end_col_offset": 56, "node_end_lineno": 49, "node_lineno": 49, "op_index": 0, "original_text": "*", "replacement_text": "//", "start_byte": 1473}}, "public_tests": {"examples": [{"example_id": "max_product_subarray:0", "source": "max_product_subarray([2, 3, -2, 4])\n", "want": "6\n"}, {"example_id": "max_product_subarray:1", "source": "max_product_subarray((-2, 0, -1))\n", "want": "0\n"}, {"example_id": "max_product_subarray:2", "source": "max_product_subarray([2, 3, -2, 4, -1])\n", "want": "48\n"}, {"example_id": "max_product_subarray:3", "source": "max_product_subarray([-1])\n", "want": "-1\n"}, {"example_id": "max_product_subarray:4", "source": "max_product_subarray([0])\n", "want": "0\n"}, {"example_id": "max_product_subarray:5", "source": "max_product_subarray([])\n", "want": "0\n"}, {"example_id": "max_product_subarray:6", "source": "max_product_subarray(\"\")\n", "want": "0\n"}, {"example_id": "max_product_subarray:7", "source": "max_product_subarray(None)\n", "want": "0\n"}, {"example_id": "max_product_subarray:8", "source": "max_product_subarray([2, 3, -2, 4.5, -1])\n", "want": "Traceback (most recent call last):\n ...\nValueError: numbers must be an iterable of integers\n"}, {"example_id": "max_product_subarray:9", "source": "max_product_subarray(\"ABC\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: numbers must be an iterable of integers\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-50db357a25d0a946", "tree_sha256": "4b40e662312e163ac4cab83e65ac057c0594660c847a0c87381a17345f830f8f", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:dynamic_programming/max_product_subarray.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def is_bit_set(number: int, position: int) -> bool:\n \"\"\"\n Is the bit at position set?\n\n Details: Shift the bit at position to be the first (smallest) bit.\n Then check if the first bit is set by anding the shifted number with 1.\n\n >>> is_bit_set(0b1010, 0)\n False\n >>> is_bit_set(0b1010, 1)\n True\n >>> is_bit_set(0b1010, 2)\n False\n >>> is_bit_set(0b1010, 3)\n True\n >>> is_bit_set(0b0, 17)\n False\n \"\"\"\n return ((number >> position) & 1) == 1\n"}, "sha256": "d6f63aa4e9bdb9c5a57a851f92c6406124356841c11101f459f054a5cf57bc48"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "d6f63aa4e9bdb9c5a57a851f92c6406124356841c11101f459f054a5cf57bc48", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "9956de142ec12027c53bbacd1de13de42739fca3089e79831a21e3cbe29bb4b6", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00096"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00096", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def is_bit_set(number: int, position: int) -> bool:\n \"\"\"\n Is the bit at position set?\n\n Details: Shift the bit at position to be the first (smallest) bit.\n Then check if the first bit is set by anding the shifted number with 1.\n\n >>> is_bit_set(0b1010, 0)\n False\n >>> is_bit_set(0b1010, 1)\n True\n >>> is_bit_set(0b1010, 2)\n False\n >>> is_bit_set(0b1010, 3)\n True\n >>> is_bit_set(0b0, 17)\n False\n \"\"\"\n return ((number >> position) & 1) != 1\n"}, "sha256": "1860b234f409542e15d694af0ef1c0734f6a4c8e8fa841f8f35bc24ddc35395a"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "is_bit_set:0", "got": "True\n", "source": "is_bit_set(0b1010, 0)\n", "truncated": false, "want": "False\n"}, {"example_id": "is_bit_set:1", "got": "False\n", "source": "is_bit_set(0b1010, 1)\n", "truncated": false, "want": "True\n"}, {"example_id": "is_bit_set:2", "got": "True\n", "source": "is_bit_set(0b1010, 2)\n", "truncated": false, "want": "False\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "boolean_condition", "seed": 7, "span": {"col_offset": 38, "end_byte": 485, "lineno": 19, "node": "Compare", "node_col_offset": 11, "node_end_col_offset": 42, "node_end_lineno": 19, "node_lineno": 19, "op_index": 0, "original_text": "==", "replacement_text": "!=", "start_byte": 483}}, "public_tests": {"examples": [{"example_id": "is_bit_set:0", "source": "is_bit_set(0b1010, 0)\n", "want": "False\n"}, {"example_id": "is_bit_set:1", "source": "is_bit_set(0b1010, 1)\n", "want": "True\n"}, {"example_id": "is_bit_set:2", "source": "is_bit_set(0b1010, 2)\n", "want": "False\n"}, {"example_id": "is_bit_set:3", "source": "is_bit_set(0b1010, 3)\n", "want": "True\n"}, {"example_id": "is_bit_set:4", "source": "is_bit_set(0b0, 17)\n", "want": "False\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-36a5168b87a800bd", "tree_sha256": "d6f63aa4e9bdb9c5a57a851f92c6406124356841c11101f459f054a5cf57bc48", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:bit_manipulation/single_bit_manipulation_operations.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def dp_count(s, n):\n \"\"\"\n >>> dp_count([1, 2, 3], 4)\n 4\n >>> dp_count([1, 2, 3], 7)\n 8\n >>> dp_count([2, 5, 3, 6], 10)\n 5\n >>> dp_count([10], 99)\n 0\n >>> dp_count([4, 5, 6], 0)\n 1\n >>> dp_count([1, 2, 3], -5)\n 0\n \"\"\"\n if n < 0:\n return 0\n # table[i] represents the number of ways to get to amount i\n table = [0] * (n + 1)\n\n # There is exactly 1 way to get to zero(You pick no coins).\n table[0] = 1\n\n # Pick all coins one by one and update table[] values\n # after the index greater than or equal to the value of the\n # picked coin\n for coin_val in s:\n for j in range(coin_val, n + 1):\n table[j] += table[j - coin_val]\n\n return table[n]\n"}, "sha256": "7ea75676cd3234bfcc2c42137d13111e5cb80fdfee7a435967fe7a8449857f6a"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "7ea75676cd3234bfcc2c42137d13111e5cb80fdfee7a435967fe7a8449857f6a", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "34e644c5d143d6db8ae684077102ff5c9864ca04ab8c42858947df1aac64c654", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00097"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00097", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def dp_count(s, n):\n \"\"\"\n >>> dp_count([1, 2, 3], 4)\n 4\n >>> dp_count([1, 2, 3], 7)\n 8\n >>> dp_count([2, 5, 3, 6], 10)\n 5\n >>> dp_count([10], 99)\n 0\n >>> dp_count([4, 5, 6], 0)\n 1\n >>> dp_count([1, 2, 3], -5)\n 0\n \"\"\"\n if n <= 0:\n return 0\n # table[i] represents the number of ways to get to amount i\n table = [0] * (n + 1)\n\n # There is exactly 1 way to get to zero(You pick no coins).\n table[0] = 1\n\n # Pick all coins one by one and update table[] values\n # after the index greater than or equal to the value of the\n # picked coin\n for coin_val in s:\n for j in range(coin_val, n + 1):\n table[j] += table[j - coin_val]\n\n return table[n]\n"}, "sha256": "c238a223f00a57677b32376a442be39183dd8598f2e46118884186cb55943fa6"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "dp_count:4", "got": "0\n", "source": "dp_count([4, 5, 6], 0)\n", "truncated": false, "want": "1\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "comparison_boundary", "seed": 7, "span": {"col_offset": 9, "end_byte": 269, "lineno": 16, "node": "Compare", "node_col_offset": 7, "node_end_col_offset": 12, "node_end_lineno": 16, "node_lineno": 16, "op_index": 0, "original_text": "<", "replacement_text": "<=", "start_byte": 268}}, "public_tests": {"examples": [{"example_id": "dp_count:0", "source": "dp_count([1, 2, 3], 4)\n", "want": "4\n"}, {"example_id": "dp_count:1", "source": "dp_count([1, 2, 3], 7)\n", "want": "8\n"}, {"example_id": "dp_count:2", "source": "dp_count([2, 5, 3, 6], 10)\n", "want": "5\n"}, {"example_id": "dp_count:3", "source": "dp_count([10], 99)\n", "want": "0\n"}, {"example_id": "dp_count:4", "source": "dp_count([4, 5, 6], 0)\n", "want": "1\n"}, {"example_id": "dp_count:5", "source": "dp_count([1, 2, 3], -5)\n", "want": "0\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-837a23c4a34bc805", "tree_sha256": "7ea75676cd3234bfcc2c42137d13111e5cb80fdfee7a435967fe7a8449857f6a", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:dynamic_programming/minimum_coin_change.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def octal_to_hex(octal: str) -> str:\n \"\"\"\n Convert an Octal number to Hexadecimal number.\n For more information: https://en.wikipedia.org/wiki/Octal\n\n >>> octal_to_hex(\"100\")\n '0x40'\n >>> octal_to_hex(\"235\")\n '0x9D'\n >>> octal_to_hex(17)\n Traceback (most recent call last):\n ...\n TypeError: Expected a string as input\n >>> octal_to_hex(\"Av\")\n Traceback (most recent call last):\n ...\n ValueError: Not a Valid Octal Number\n >>> octal_to_hex(\"\")\n Traceback (most recent call last):\n ...\n ValueError: Empty string was passed to the function\n \"\"\"\n\n if not isinstance(octal, str):\n raise TypeError(\"Expected a string as input\")\n if octal.startswith(\"0o\"):\n octal = octal[2:]\n if octal == \"\":\n raise ValueError(\"Empty string was passed to the function\")\n if any(char not in \"01234567\" for char in octal):\n raise ValueError(\"Not a Valid Octal Number\")\n\n decimal = 0\n for char in octal:\n decimal <<= 3\n decimal |= int(char)\n\n hex_char = \"0123456789ABCDEF\"\n\n revhex = \"\"\n while decimal:\n revhex += hex_char[decimal & 15]\n decimal >>= 4\n\n return \"0x\" + revhex[::-1]\n"}, "sha256": "60cade18c59e6d2f94becc790bba720ecd3fc3ef964c38789825cff97fa020c3"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "60cade18c59e6d2f94becc790bba720ecd3fc3ef964c38789825cff97fa020c3", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "d8894f75e20550d9f9e5b95b45dc16c1e70503d27248e3599aad78c7c63a2148", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00098"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00098", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 8, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def octal_to_hex(octal: str) -> str:\n \"\"\"\n Convert an Octal number to Hexadecimal number.\n For more information: https://en.wikipedia.org/wiki/Octal\n\n >>> octal_to_hex(\"100\")\n '0x40'\n >>> octal_to_hex(\"235\")\n '0x9D'\n >>> octal_to_hex(17)\n Traceback (most recent call last):\n ...\n TypeError: Expected a string as input\n >>> octal_to_hex(\"Av\")\n Traceback (most recent call last):\n ...\n ValueError: Not a Valid Octal Number\n >>> octal_to_hex(\"\")\n Traceback (most recent call last):\n ...\n ValueError: Empty string was passed to the function\n \"\"\"\n\n if not isinstance(octal, str):\n raise TypeError(\"Expected a string as input\")\n if octal.startswith(\"0o\"):\n octal = octal[2:]\n if octal == \"\":\n raise ValueError(\"Empty string was passed to the function\")\n if any(char not in \"01234567\" for char in octal):\n raise ValueError(\"Not a Valid Octal Number\")\n\n decimal = 0\n for char in octal:\n decimal <<= 3\n decimal |= int(char)\n\n hex_char = \"0123456789ABCDEF\"\n\n revhex = \"\"\n while decimal:\n revhex -= hex_char[decimal & 15]\n decimal >>= 4\n\n return \"0x\" + revhex[::-1]\n"}, "sha256": "2355b28af5f309306002d813a60a1a7245a921f8af6854afa1fe7af8d4691b82"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "octal_to_hex:0", "got": "TypeError: unsupported operand type(s) for -=: 'str' and 'str'", "source": "octal_to_hex(\"100\")\n", "truncated": false, "want": "'0x40'\n"}, {"example_id": "octal_to_hex:1", "got": "TypeError: unsupported operand type(s) for -=: 'str' and 'str'", "source": "octal_to_hex(\"235\")\n", "truncated": false, "want": "'0x9D'\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 15, "end_byte": 1135, "lineno": 42, "node": "AugAssign", "node_col_offset": 8, "node_end_col_offset": 40, "node_end_lineno": 42, "node_lineno": 42, "op_index": 0, "original_text": "+=", "replacement_text": "-=", "start_byte": 1133}}, "public_tests": {"examples": [{"example_id": "octal_to_hex:0", "source": "octal_to_hex(\"100\")\n", "want": "'0x40'\n"}, {"example_id": "octal_to_hex:1", "source": "octal_to_hex(\"235\")\n", "want": "'0x9D'\n"}, {"example_id": "octal_to_hex:2", "source": "octal_to_hex(17)\n", "want": "Traceback (most recent call last):\n ...\nTypeError: Expected a string as input\n"}, {"example_id": "octal_to_hex:3", "source": "octal_to_hex(\"Av\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: Not a Valid Octal Number\n"}, {"example_id": "octal_to_hex:4", "source": "octal_to_hex(\"\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: Empty string was passed to the function\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-bbcdd5ef8b93b6b6", "tree_sha256": "60cade18c59e6d2f94becc790bba720ecd3fc3ef964c38789825cff97fa020c3", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:conversions/octal_to_hexadecimal.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def is_sum_subset(arr: list[int], required_sum: int) -> bool:\n \"\"\"\n >>> is_sum_subset([2, 4, 6, 8], 5)\n False\n >>> is_sum_subset([2, 4, 6, 8], 14)\n True\n \"\"\"\n # a subset value says 1 if that subset sum can be formed else 0\n # initially no subsets can be formed hence False/0\n arr_len = len(arr)\n subset = [[False] * (required_sum + 1) for _ in range(arr_len + 1)]\n\n # for each arr value, a sum of zero(0) can be formed by not taking any element\n # hence True/1\n for i in range(arr_len + 1):\n subset[i][0] = True\n\n # sum is not zero and set is empty then false\n for i in range(1, required_sum + 1):\n subset[0][i] = False\n\n for i in range(1, arr_len + 1):\n for j in range(1, required_sum + 1):\n if arr[i - 1] > j:\n subset[i][j] = subset[i - 1][j]\n if arr[i - 1] <= j:\n subset[i][j] = subset[i - 1][j] or subset[i - 1][j - arr[i - 1]]\n\n return subset[arr_len][required_sum]\n"}, "sha256": "d0c89f241da7c4644d5db2c26a6ae923c08ef848110942ba3a2f8fcdb0244f04"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "d0c89f241da7c4644d5db2c26a6ae923c08ef848110942ba3a2f8fcdb0244f04", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "4d65f3bc7ac08bb522085200b04c30d9a897c457edd568a35fe10390b7f2c89e", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00101"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00101", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def is_sum_subset(arr: list[int], required_sum: int) -> bool:\n \"\"\"\n >>> is_sum_subset([2, 4, 6, 8], 5)\n False\n >>> is_sum_subset([2, 4, 6, 8], 14)\n True\n \"\"\"\n # a subset value says 1 if that subset sum can be formed else 0\n # initially no subsets can be formed hence False/0\n arr_len = len(arr)\n subset = [[False] * (required_sum + 1) for _ in range(arr_len + 1)]\n\n # for each arr value, a sum of zero(0) can be formed by not taking any element\n # hence True/1\n for i in range(arr_len + 1):\n subset[i][0] = True\n\n # sum is not zero and set is empty then false\n for i in range(1, required_sum + 1):\n subset[0][i] = False\n\n for i in range(1, arr_len + 1):\n for j in range(1, required_sum + 1):\n if arr[i - 1] > j:\n subset[i][j] = subset[i - 1][j]\n if arr[i - 1] <= j:\n subset[i][j] = subset[i - 1][j] or subset[i - 1][j - arr[i - 1]]\n\n return not subset[arr_len][required_sum]\n"}, "sha256": "41d9bd3ca0ec1d13f0c6a209b72c63f6b224b286296e05868943de6275948d7b"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "is_sum_subset:0", "got": "True\n", "source": "is_sum_subset([2, 4, 6, 8], 5)\n", "truncated": false, "want": "False\n"}, {"example_id": "is_sum_subset:1", "got": "False\n", "source": "is_sum_subset([2, 4, 6, 8], 14)\n", "truncated": false, "want": "True\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 994, "lineno": 29, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 40, "node_end_lineno": 29, "node_lineno": 29, "op_index": 0, "original_text": "subset[arr_len][required_sum]", "replacement_text": "not subset[arr_len][required_sum]", "start_byte": 965}}, "public_tests": {"examples": [{"example_id": "is_sum_subset:0", "source": "is_sum_subset([2, 4, 6, 8], 5)\n", "want": "False\n"}, {"example_id": "is_sum_subset:1", "source": "is_sum_subset([2, 4, 6, 8], 14)\n", "want": "True\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-a26d6d8b61519d88", "tree_sha256": "d0c89f241da7c4644d5db2c26a6ae923c08ef848110942ba3a2f8fcdb0244f04", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:dynamic_programming/sum_of_subset.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def binary_multiply(a: int, b: int) -> int:\n \"\"\"\n Multiply 'a' and 'b' using bitwise multiplication.\n\n Parameters:\n a (int): The first number.\n b (int): The second number.\n\n Returns:\n int: a * b\n\n Examples:\n >>> binary_multiply(2, 3)\n 6\n >>> binary_multiply(5, 0)\n 0\n >>> binary_multiply(3, 4)\n 12\n >>> binary_multiply(10, 5)\n 50\n >>> binary_multiply(0, 5)\n 0\n >>> binary_multiply(2, 1)\n 2\n >>> binary_multiply(1, 10)\n 10\n \"\"\"\n res = 0\n while b > 0:\n if b & 1:\n res += a\n\n a += a\n b >>= 1\n\n return res\n"}, "sha256": "3b5642598f0b27ec0f9fa1b70a173a8314b94e1a9c3903a131d73586c398a06a"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "3b5642598f0b27ec0f9fa1b70a173a8314b94e1a9c3903a131d73586c398a06a", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "dc51f6cd42d214923ab951ee5134b66e823ea77b29e1754db8b9d88a0195f95c", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00102"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00102", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def binary_multiply(a: int, b: int) -> int:\n \"\"\"\n Multiply 'a' and 'b' using bitwise multiplication.\n\n Parameters:\n a (int): The first number.\n b (int): The second number.\n\n Returns:\n int: a * b\n\n Examples:\n >>> binary_multiply(2, 3)\n 6\n >>> binary_multiply(5, 0)\n 0\n >>> binary_multiply(3, 4)\n 12\n >>> binary_multiply(10, 5)\n 50\n >>> binary_multiply(0, 5)\n 0\n >>> binary_multiply(2, 1)\n 2\n >>> binary_multiply(1, 10)\n 10\n \"\"\"\n res = 0\n while b > 1:\n if b & 1:\n res += a\n\n a += a\n b >>= 1\n\n return res\n"}, "sha256": "dc146f8f0a7e6c21273dd7923f61670f6b095c1ad1a792143ccaed2677ced65f"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "binary_multiply:0", "got": "2\n", "source": "binary_multiply(2, 3)\n", "truncated": false, "want": "6\n"}, {"example_id": "binary_multiply:2", "got": "0\n", "source": "binary_multiply(3, 4)\n", "truncated": false, "want": "12\n"}, {"example_id": "binary_multiply:3", "got": "10\n", "source": "binary_multiply(10, 5)\n", "truncated": false, "want": "50\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "off_by_one", "seed": 7, "span": {"col_offset": 14, "end_byte": 523, "lineno": 29, "node": "Constant", "node_col_offset": 14, "node_end_col_offset": 15, "node_end_lineno": 29, "node_lineno": 29, "op_index": 0, "original_text": "0", "replacement_text": "1", "start_byte": 522}}, "public_tests": {"examples": [{"example_id": "binary_multiply:0", "source": "binary_multiply(2, 3)\n", "want": "6\n"}, {"example_id": "binary_multiply:1", "source": "binary_multiply(5, 0)\n", "want": "0\n"}, {"example_id": "binary_multiply:2", "source": "binary_multiply(3, 4)\n", "want": "12\n"}, {"example_id": "binary_multiply:3", "source": "binary_multiply(10, 5)\n", "want": "50\n"}, {"example_id": "binary_multiply:4", "source": "binary_multiply(0, 5)\n", "want": "0\n"}, {"example_id": "binary_multiply:5", "source": "binary_multiply(2, 1)\n", "want": "2\n"}, {"example_id": "binary_multiply:6", "source": "binary_multiply(1, 10)\n", "want": "10\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-fb34ae6c155777a0", "tree_sha256": "3b5642598f0b27ec0f9fa1b70a173a8314b94e1a9c3903a131d73586c398a06a", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/binary_multiplication.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "from __future__ import annotations\n\n\ndef unique_prime_factors(n: int) -> list[int]:\n \"\"\"\n Returns unique prime factors of n as a list.\n\n >>> unique_prime_factors(0)\n []\n >>> unique_prime_factors(100)\n [2, 5]\n >>> unique_prime_factors(2560)\n [2, 5]\n >>> unique_prime_factors(10**-2)\n []\n >>> unique_prime_factors(0.02)\n []\n >>> unique_prime_factors(10**241)\n [2, 5]\n >>> unique_prime_factors(10**-354)\n []\n >>> unique_prime_factors('hello')\n Traceback (most recent call last):\n ...\n TypeError: '<=' not supported between instances of 'int' and 'str'\n >>> unique_prime_factors([1,2,'hello'])\n Traceback (most recent call last):\n ...\n TypeError: '<=' not supported between instances of 'int' and 'list'\n \"\"\"\n i = 2\n factors = []\n while i * i <= n:\n if not n % i:\n while not n % i:\n n //= i\n factors.append(i)\n i += 1\n if n > 1:\n factors.append(n)\n return factors\n"}, "sha256": "b5fdaeea227d14de76a346cf26b797996de459fe1737db9200a4f042cb65d72a"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "b5fdaeea227d14de76a346cf26b797996de459fe1737db9200a4f042cb65d72a", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "0ddc70230149021bf2f72bcac1a752d44496d5e1bd2d628db8fde91473f3c1f1", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00103"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00103", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "from __future__ import annotations\n\n\ndef unique_prime_factors(n: int) -> list[int]:\n \"\"\"\n Returns unique prime factors of n as a list.\n\n >>> unique_prime_factors(0)\n []\n >>> unique_prime_factors(100)\n [2, 5]\n >>> unique_prime_factors(2560)\n [2, 5]\n >>> unique_prime_factors(10**-2)\n []\n >>> unique_prime_factors(0.02)\n []\n >>> unique_prime_factors(10**241)\n [2, 5]\n >>> unique_prime_factors(10**-354)\n []\n >>> unique_prime_factors('hello')\n Traceback (most recent call last):\n ...\n TypeError: '<=' not supported between instances of 'int' and 'str'\n >>> unique_prime_factors([1,2,'hello'])\n Traceback (most recent call last):\n ...\n TypeError: '<=' not supported between instances of 'int' and 'list'\n \"\"\"\n i = 2\n factors = []\n while i * i <= n:\n if not n % i:\n while not n % i:\n n //= i\n factors.append(i)\n i += 1\n if n >= 1:\n factors.append(n)\n return factors\n"}, "sha256": "9fe2a0b94fe6bac3226a197f5048adf20a05e993ca79653460c879d3957dd70a"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "unique_prime_factors:1", "got": "[2, 5, 1]\n", "source": "unique_prime_factors(100)\n", "truncated": false, "want": "[2, 5]\n"}, {"example_id": "unique_prime_factors:5", "got": "[2, 5, 1]\n", "source": "unique_prime_factors(10**241)\n", "truncated": false, "want": "[2, 5]\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "comparison_boundary", "seed": 7, "span": {"col_offset": 9, "end_byte": 967, "lineno": 39, "node": "Compare", "node_col_offset": 7, "node_end_col_offset": 12, "node_end_lineno": 39, "node_lineno": 39, "op_index": 0, "original_text": ">", "replacement_text": ">=", "start_byte": 966}}, "public_tests": {"examples": [{"example_id": "unique_prime_factors:0", "source": "unique_prime_factors(0)\n", "want": "[]\n"}, {"example_id": "unique_prime_factors:1", "source": "unique_prime_factors(100)\n", "want": "[2, 5]\n"}, {"example_id": "unique_prime_factors:2", "source": "unique_prime_factors(2560)\n", "want": "[2, 5]\n"}, {"example_id": "unique_prime_factors:3", "source": "unique_prime_factors(10**-2)\n", "want": "[]\n"}, {"example_id": "unique_prime_factors:4", "source": "unique_prime_factors(0.02)\n", "want": "[]\n"}, {"example_id": "unique_prime_factors:5", "source": "unique_prime_factors(10**241)\n", "want": "[2, 5]\n"}, {"example_id": "unique_prime_factors:6", "source": "unique_prime_factors(10**-354)\n", "want": "[]\n"}, {"example_id": "unique_prime_factors:7", "source": "unique_prime_factors('hello')\n", "want": "Traceback (most recent call last):\n ...\nTypeError: '<=' not supported between instances of 'int' and 'str'\n"}, {"example_id": "unique_prime_factors:8", "source": "unique_prime_factors([1,2,'hello'])\n", "want": "Traceback (most recent call last):\n ...\nTypeError: '<=' not supported between instances of 'int' and 'list'\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-52bd7ff7bd30675a", "tree_sha256": "b5fdaeea227d14de76a346cf26b797996de459fe1737db9200a4f042cb65d72a", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/prime_factors.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def set_bit(number: int, position: int) -> int:\n \"\"\"\n Set the bit at position to 1.\n\n Details: perform bitwise or for given number and X.\n Where X is a number with all the bits - zeroes and bit on given\n position - one.\n\n >>> set_bit(0b1101, 1) # 0b1111\n 15\n >>> set_bit(0b0, 5) # 0b100000\n 32\n >>> set_bit(0b1111, 1) # 0b1111\n 15\n \"\"\"\n return number | (1 << position)\n"}, "sha256": "fdf4b6d2dc7d3933d0e9809c0813a0430ebf2556cc2dbc0a0739c0258dcb099a"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "fdf4b6d2dc7d3933d0e9809c0813a0430ebf2556cc2dbc0a0739c0258dcb099a", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "48f0f5d945091c705c88cb166c6c60cba895597cb64c2183d4164e370de731fa", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00104"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00104", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def set_bit(number: int, position: int) -> int:\n \"\"\"\n Set the bit at position to 1.\n\n Details: perform bitwise or for given number and X.\n Where X is a number with all the bits - zeroes and bit on given\n position - one.\n\n >>> set_bit(0b1101, 1) # 0b1111\n 15\n >>> set_bit(0b0, 5) # 0b100000\n 32\n >>> set_bit(0b1111, 1) # 0b1111\n 15\n \"\"\"\n return (number | (1 << position)) - 1\n"}, "sha256": "d0e6710be80d781c02bee04abaf4e1c01176b5a54bdf97db7f91ca36703e4f99"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "set_bit:0", "got": "14\n", "source": "set_bit(0b1101, 1) # 0b1111\n", "truncated": false, "want": "15\n"}, {"example_id": "set_bit:1", "got": "31\n", "source": "set_bit(0b0, 5) # 0b100000\n", "truncated": false, "want": "32\n"}, {"example_id": "set_bit:2", "got": "14\n", "source": "set_bit(0b1111, 1) # 0b1111\n", "truncated": false, "want": "15\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 407, "lineno": 16, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 35, "node_end_lineno": 16, "node_lineno": 16, "op_index": 0, "original_text": "number | (1 << position)", "replacement_text": "(number | (1 << position)) - 1", "start_byte": 383}}, "public_tests": {"examples": [{"example_id": "set_bit:0", "source": "set_bit(0b1101, 1) # 0b1111\n", "want": "15\n"}, {"example_id": "set_bit:1", "source": "set_bit(0b0, 5) # 0b100000\n", "want": "32\n"}, {"example_id": "set_bit:2", "source": "set_bit(0b1111, 1) # 0b1111\n", "want": "15\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-5ddfe6c99257693a", "tree_sha256": "fdf4b6d2dc7d3933d0e9809c0813a0430ebf2556cc2dbc0a0739c0258dcb099a", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:bit_manipulation/single_bit_manipulation_operations.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def decimal_isolate(number: float, digit_amount: int) -> float:\n \"\"\"\n Isolates the decimal part of a number.\n If digitAmount > 0 round to that decimal place, else print the entire decimal.\n >>> decimal_isolate(1.53, 0)\n 0.53\n >>> decimal_isolate(35.345, 1)\n 0.3\n >>> decimal_isolate(35.345, 2)\n 0.34\n >>> decimal_isolate(35.345, 3)\n 0.345\n >>> decimal_isolate(-14.789, 3)\n -0.789\n >>> decimal_isolate(0, 2)\n 0\n >>> decimal_isolate(-14.123, 1)\n -0.1\n >>> decimal_isolate(-14.123, 2)\n -0.12\n >>> decimal_isolate(-14.123, 3)\n -0.123\n \"\"\"\n if digit_amount > 0:\n return round(number - int(number), digit_amount)\n return number - int(number)\n"}, "sha256": "c6fd9f5b4393e64b11c3bd495074a1dadc06d7bea6e867f003ee005c4e78dc67"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "c6fd9f5b4393e64b11c3bd495074a1dadc06d7bea6e867f003ee005c4e78dc67", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "4f0744700af62cbc025a8ad081e049b116b6e83fdd970bab7ece6b3d50bd9966", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00106"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00106", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def decimal_isolate(number: float, digit_amount: int) -> float:\n \"\"\"\n Isolates the decimal part of a number.\n If digitAmount > 0 round to that decimal place, else print the entire decimal.\n >>> decimal_isolate(1.53, 0)\n 0.53\n >>> decimal_isolate(35.345, 1)\n 0.3\n >>> decimal_isolate(35.345, 2)\n 0.34\n >>> decimal_isolate(35.345, 3)\n 0.345\n >>> decimal_isolate(-14.789, 3)\n -0.789\n >>> decimal_isolate(0, 2)\n 0\n >>> decimal_isolate(-14.123, 1)\n -0.1\n >>> decimal_isolate(-14.123, 2)\n -0.12\n >>> decimal_isolate(-14.123, 3)\n -0.123\n \"\"\"\n if digit_amount >= 0:\n return round(number - int(number), digit_amount)\n return number - int(number)\n"}, "sha256": "443a4a31713b47f0cea3dac726b7dd41f4180255665de3f84d1b4c6d264bc5e7"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "decimal_isolate:0", "got": "1.0\n", "source": "decimal_isolate(1.53, 0)\n", "truncated": false, "want": "0.53\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "comparison_boundary", "seed": 7, "span": {"col_offset": 20, "end_byte": 622, "lineno": 24, "node": "Compare", "node_col_offset": 7, "node_end_col_offset": 23, "node_end_lineno": 24, "node_lineno": 24, "op_index": 0, "original_text": ">", "replacement_text": ">=", "start_byte": 621}}, "public_tests": {"examples": [{"example_id": "decimal_isolate:0", "source": "decimal_isolate(1.53, 0)\n", "want": "0.53\n"}, {"example_id": "decimal_isolate:1", "source": "decimal_isolate(35.345, 1)\n", "want": "0.3\n"}, {"example_id": "decimal_isolate:2", "source": "decimal_isolate(35.345, 2)\n", "want": "0.34\n"}, {"example_id": "decimal_isolate:3", "source": "decimal_isolate(35.345, 3)\n", "want": "0.345\n"}, {"example_id": "decimal_isolate:4", "source": "decimal_isolate(-14.789, 3)\n", "want": "-0.789\n"}, {"example_id": "decimal_isolate:5", "source": "decimal_isolate(0, 2)\n", "want": "0\n"}, {"example_id": "decimal_isolate:6", "source": "decimal_isolate(-14.123, 1)\n", "want": "-0.1\n"}, {"example_id": "decimal_isolate:7", "source": "decimal_isolate(-14.123, 2)\n", "want": "-0.12\n"}, {"example_id": "decimal_isolate:8", "source": "decimal_isolate(-14.123, 3)\n", "want": "-0.123\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-2ec787c93a7d5b77", "tree_sha256": "c6fd9f5b4393e64b11c3bd495074a1dadc06d7bea6e867f003ee005c4e78dc67", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/decimal_isolate.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def longest_common_substring(text1: str, text2: str) -> str:\n \"\"\"\n Finds the longest common substring between two strings.\n\n >>> longest_common_substring(\"\", \"\")\n ''\n >>> longest_common_substring(\"a\",\"\")\n ''\n >>> longest_common_substring(\"\", \"a\")\n ''\n >>> longest_common_substring(\"a\", \"a\")\n 'a'\n >>> longest_common_substring(\"abcdef\", \"bcd\")\n 'bcd'\n >>> longest_common_substring(\"abcdef\", \"xabded\")\n 'ab'\n >>> longest_common_substring(\"GeeksforGeeks\", \"GeeksQuiz\")\n 'Geeks'\n >>> longest_common_substring(\"abcdxyz\", \"xyzabcd\")\n 'abcd'\n >>> longest_common_substring(\"zxabcdezy\", \"yzabcdezx\")\n 'abcdez'\n >>> longest_common_substring(\"OldSite:GeeksforGeeks.org\", \"NewSite:GeeksQuiz.com\")\n 'Site:Geeks'\n >>> longest_common_substring(1, 1)\n Traceback (most recent call last):\n ...\n ValueError: longest_common_substring() takes two strings for inputs\n \"\"\"\n\n if not (isinstance(text1, str) and isinstance(text2, str)):\n raise ValueError(\"longest_common_substring() takes two strings for inputs\")\n\n if not text1 or not text2:\n return \"\"\n\n text1_length = len(text1)\n text2_length = len(text2)\n\n dp = [[0] * (text2_length + 1) for _ in range(text1_length + 1)]\n end_pos = 0\n max_length = 0\n\n for i in range(1, text1_length + 1):\n for j in range(1, text2_length + 1):\n if text1[i - 1] == text2[j - 1]:\n dp[i][j] = 1 + dp[i - 1][j - 1]\n if dp[i][j] > max_length:\n end_pos = i\n max_length = dp[i][j]\n\n return text1[end_pos - max_length : end_pos]\n"}, "sha256": "f6eaa2ceec5a3aaf169265eb8837401706ff6dee1fad2b89def197e13f94fcd4"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "f6eaa2ceec5a3aaf169265eb8837401706ff6dee1fad2b89def197e13f94fcd4", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "b15e00bd257332d72ca10066f4feb2917352eca10777c616492a97fb9fbfb639", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00109"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00109", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def longest_common_substring(text1: str, text2: str) -> str:\n \"\"\"\n Finds the longest common substring between two strings.\n\n >>> longest_common_substring(\"\", \"\")\n ''\n >>> longest_common_substring(\"a\",\"\")\n ''\n >>> longest_common_substring(\"\", \"a\")\n ''\n >>> longest_common_substring(\"a\", \"a\")\n 'a'\n >>> longest_common_substring(\"abcdef\", \"bcd\")\n 'bcd'\n >>> longest_common_substring(\"abcdef\", \"xabded\")\n 'ab'\n >>> longest_common_substring(\"GeeksforGeeks\", \"GeeksQuiz\")\n 'Geeks'\n >>> longest_common_substring(\"abcdxyz\", \"xyzabcd\")\n 'abcd'\n >>> longest_common_substring(\"zxabcdezy\", \"yzabcdezx\")\n 'abcdez'\n >>> longest_common_substring(\"OldSite:GeeksforGeeks.org\", \"NewSite:GeeksQuiz.com\")\n 'Site:Geeks'\n >>> longest_common_substring(1, 1)\n Traceback (most recent call last):\n ...\n ValueError: longest_common_substring() takes two strings for inputs\n \"\"\"\n\n if not (isinstance(text1, str) and isinstance(text2, str)):\n raise ValueError(\"longest_common_substring() takes two strings for inputs\")\n\n if not text1 or not text2:\n return \"\"\n\n text1_length = len(text1)\n text2_length = len(text2)\n\n dp = [[0] * (text2_length + 1) for _ in range(text1_length + 1)]\n end_pos = 0\n max_length = 0\n\n for i in range(1, text1_length - 1):\n for j in range(1, text2_length + 1):\n if text1[i - 1] == text2[j - 1]:\n dp[i][j] = 1 + dp[i - 1][j - 1]\n if dp[i][j] > max_length:\n end_pos = i\n max_length = dp[i][j]\n\n return text1[end_pos - max_length : end_pos]\n"}, "sha256": "af95bdd82b30ac5cd11939c824eb3934ff05d8478e840ca8cbd4e12f309ec34a"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "longest_common_substring:3", "got": "''\n", "source": "longest_common_substring(\"a\", \"a\")\n", "truncated": false, "want": "'a'\n"}, {"example_id": "longest_common_substring:8", "got": "'abcde'\n", "source": "longest_common_substring(\"zxabcdezy\", \"yzabcdezx\")\n", "truncated": false, "want": "'abcdez'\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 35, "end_byte": 1337, "lineno": 44, "node": "BinOp", "node_col_offset": 22, "node_end_col_offset": 38, "node_end_lineno": 44, "node_lineno": 44, "op_index": 0, "original_text": "+", "replacement_text": "-", "start_byte": 1336}}, "public_tests": {"examples": [{"example_id": "longest_common_substring:0", "source": "longest_common_substring(\"\", \"\")\n", "want": "''\n"}, {"example_id": "longest_common_substring:1", "source": "longest_common_substring(\"a\",\"\")\n", "want": "''\n"}, {"example_id": "longest_common_substring:2", "source": "longest_common_substring(\"\", \"a\")\n", "want": "''\n"}, {"example_id": "longest_common_substring:3", "source": "longest_common_substring(\"a\", \"a\")\n", "want": "'a'\n"}, {"example_id": "longest_common_substring:4", "source": "longest_common_substring(\"abcdef\", \"bcd\")\n", "want": "'bcd'\n"}, {"example_id": "longest_common_substring:5", "source": "longest_common_substring(\"abcdef\", \"xabded\")\n", "want": "'ab'\n"}, {"example_id": "longest_common_substring:6", "source": "longest_common_substring(\"GeeksforGeeks\", \"GeeksQuiz\")\n", "want": "'Geeks'\n"}, {"example_id": "longest_common_substring:7", "source": "longest_common_substring(\"abcdxyz\", \"xyzabcd\")\n", "want": "'abcd'\n"}, {"example_id": "longest_common_substring:8", "source": "longest_common_substring(\"zxabcdezy\", \"yzabcdezx\")\n", "want": "'abcdez'\n"}, {"example_id": "longest_common_substring:9", "source": "longest_common_substring(\"OldSite:GeeksforGeeks.org\", \"NewSite:GeeksQuiz.com\")\n", "want": "'Site:Geeks'\n"}, {"example_id": "longest_common_substring:10", "source": "longest_common_substring(1, 1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: longest_common_substring() takes two strings for inputs\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-897ba5b9527073b7", "tree_sha256": "f6eaa2ceec5a3aaf169265eb8837401706ff6dee1fad2b89def197e13f94fcd4", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:dynamic_programming/longest_common_substring.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def reverse_bit(number: int) -> int:\n \"\"\"\n Take in a 32 bit integer, reverse its bits, return a 32 bit integer result\n\n >>> reverse_bit(25)\n 2550136832\n >>> reverse_bit(37)\n 2751463424\n >>> reverse_bit(21)\n 2818572288\n >>> reverse_bit(58)\n 1543503872\n >>> reverse_bit(0)\n 0\n >>> reverse_bit(256)\n 8388608\n >>> reverse_bit(2550136832)\n 25\n >>> reverse_bit(-1)\n Traceback (most recent call last):\n ...\n ValueError: The value of input must be non-negative\n\n >>> reverse_bit(1.1)\n Traceback (most recent call last):\n ...\n TypeError: Input value must be an 'int' type\n\n >>> reverse_bit(\"0\")\n Traceback (most recent call last):\n ...\n TypeError: Input value must be an 'int' type\n \"\"\"\n if not isinstance(number, int):\n raise TypeError(\"Input value must be an 'int' type\")\n if number < 0:\n raise ValueError(\"The value of input must be non-negative\")\n\n result = 0\n # iterator over [0 to 31], since we are dealing with a 32 bit integer\n for _ in range(32):\n # left shift the bits by unity\n result <<= 1\n # get the end bit\n end_bit = number & 1\n # right shift the bits by unity\n number >>= 1\n # add that bit to our answer\n result |= end_bit\n return result\n"}, "sha256": "36fc1ffd87fe0d8c48f3f346239905909f9046b08b39f46c90b9348cff790b85"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "36fc1ffd87fe0d8c48f3f346239905909f9046b08b39f46c90b9348cff790b85", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "fe1b33fad3628b504d95362cb5f0d84e3c3ab201a744a7b78900a74e6c67fa5d", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00110"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00110", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def reverse_bit(number: int) -> int:\n \"\"\"\n Take in a 32 bit integer, reverse its bits, return a 32 bit integer result\n\n >>> reverse_bit(25)\n 2550136832\n >>> reverse_bit(37)\n 2751463424\n >>> reverse_bit(21)\n 2818572288\n >>> reverse_bit(58)\n 1543503872\n >>> reverse_bit(0)\n 0\n >>> reverse_bit(256)\n 8388608\n >>> reverse_bit(2550136832)\n 25\n >>> reverse_bit(-1)\n Traceback (most recent call last):\n ...\n ValueError: The value of input must be non-negative\n\n >>> reverse_bit(1.1)\n Traceback (most recent call last):\n ...\n TypeError: Input value must be an 'int' type\n\n >>> reverse_bit(\"0\")\n Traceback (most recent call last):\n ...\n TypeError: Input value must be an 'int' type\n \"\"\"\n if not isinstance(number, int):\n raise TypeError(\"Input value must be an 'int' type\")\n if number <= 0:\n raise ValueError(\"The value of input must be non-negative\")\n\n result = 0\n # iterator over [0 to 31], since we are dealing with a 32 bit integer\n for _ in range(32):\n # left shift the bits by unity\n result <<= 1\n # get the end bit\n end_bit = number & 1\n # right shift the bits by unity\n number >>= 1\n # add that bit to our answer\n result |= end_bit\n return result\n"}, "sha256": "d6e5c92e72717ed40a65175e69f54f78a030706eb307cf87ac44f8c9474478d8"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "reverse_bit:4", "got": "ValueError: The value of input must be non-negative", "source": "reverse_bit(0)\n", "truncated": false, "want": "0\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "comparison_boundary", "seed": 7, "span": {"col_offset": 14, "end_byte": 889, "lineno": 36, "node": "Compare", "node_col_offset": 7, "node_end_col_offset": 17, "node_end_lineno": 36, "node_lineno": 36, "op_index": 0, "original_text": "<", "replacement_text": "<=", "start_byte": 888}}, "public_tests": {"examples": [{"example_id": "reverse_bit:0", "source": "reverse_bit(25)\n", "want": "2550136832\n"}, {"example_id": "reverse_bit:1", "source": "reverse_bit(37)\n", "want": "2751463424\n"}, {"example_id": "reverse_bit:2", "source": "reverse_bit(21)\n", "want": "2818572288\n"}, {"example_id": "reverse_bit:3", "source": "reverse_bit(58)\n", "want": "1543503872\n"}, {"example_id": "reverse_bit:4", "source": "reverse_bit(0)\n", "want": "0\n"}, {"example_id": "reverse_bit:5", "source": "reverse_bit(256)\n", "want": "8388608\n"}, {"example_id": "reverse_bit:6", "source": "reverse_bit(2550136832)\n", "want": "25\n"}, {"example_id": "reverse_bit:7", "source": "reverse_bit(-1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: The value of input must be non-negative\n"}, {"example_id": "reverse_bit:8", "source": "reverse_bit(1.1)\n", "want": "Traceback (most recent call last):\n ...\nTypeError: Input value must be an 'int' type\n"}, {"example_id": "reverse_bit:9", "source": "reverse_bit(\"0\")\n", "want": "Traceback (most recent call last):\n ...\nTypeError: Input value must be an 'int' type\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-16be69ecdffea114", "tree_sha256": "36fc1ffd87fe0d8c48f3f346239905909f9046b08b39f46c90b9348cff790b85", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:bit_manipulation/reverse_bits.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def get_1s_count(number: int) -> int:\n \"\"\"\n Count the number of set bits in a 32 bit integer using Brian Kernighan's way.\n Ref - https://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetKernighan\n >>> get_1s_count(25)\n 3\n >>> get_1s_count(37)\n 3\n >>> get_1s_count(21)\n 3\n >>> get_1s_count(58)\n 4\n >>> get_1s_count(0)\n 0\n >>> get_1s_count(256)\n 1\n >>> get_1s_count(-1)\n Traceback (most recent call last):\n ...\n ValueError: Input must be a non-negative integer\n >>> get_1s_count(0.8)\n Traceback (most recent call last):\n ...\n ValueError: Input must be a non-negative integer\n >>> get_1s_count(\"25\")\n Traceback (most recent call last):\n ...\n ValueError: Input must be a non-negative integer\n \"\"\"\n if not isinstance(number, int) or number < 0:\n raise ValueError(\"Input must be a non-negative integer\")\n\n count = 0\n while number:\n # This way we arrive at next set bit (next 1) instead of looping\n # through each bit and checking for 1s hence the\n # loop won't run 32 times it will only run the number of `1` times\n number &= number - 1\n count += 1\n return count\n"}, "sha256": "835a37970043464eb9a953ee9a7d481a8b11e916037312711872f871fdc5a3e4"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "835a37970043464eb9a953ee9a7d481a8b11e916037312711872f871fdc5a3e4", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "7414a5f9c4c3cc5c957c46089a4502cbc79fbccdc809bea41e41b42b1d36f53a", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00111"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00111", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def get_1s_count(number: int) -> int:\n \"\"\"\n Count the number of set bits in a 32 bit integer using Brian Kernighan's way.\n Ref - https://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetKernighan\n >>> get_1s_count(25)\n 3\n >>> get_1s_count(37)\n 3\n >>> get_1s_count(21)\n 3\n >>> get_1s_count(58)\n 4\n >>> get_1s_count(0)\n 0\n >>> get_1s_count(256)\n 1\n >>> get_1s_count(-1)\n Traceback (most recent call last):\n ...\n ValueError: Input must be a non-negative integer\n >>> get_1s_count(0.8)\n Traceback (most recent call last):\n ...\n ValueError: Input must be a non-negative integer\n >>> get_1s_count(\"25\")\n Traceback (most recent call last):\n ...\n ValueError: Input must be a non-negative integer\n \"\"\"\n if not isinstance(number, int) or number < 1:\n raise ValueError(\"Input must be a non-negative integer\")\n\n count = 0\n while number:\n # This way we arrive at next set bit (next 1) instead of looping\n # through each bit and checking for 1s hence the\n # loop won't run 32 times it will only run the number of `1` times\n number &= number - 1\n count += 1\n return count\n"}, "sha256": "f34e7557463e2ea4e888adf2d147d35168b1c72e85cafa95cf8854676dc69b9d"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "get_1s_count:4", "got": "ValueError: Input must be a non-negative integer", "source": "get_1s_count(0)\n", "truncated": false, "want": "0\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "off_by_one", "seed": 7, "span": {"col_offset": 47, "end_byte": 845, "lineno": 30, "node": "Constant", "node_col_offset": 47, "node_end_col_offset": 48, "node_end_lineno": 30, "node_lineno": 30, "op_index": 0, "original_text": "0", "replacement_text": "1", "start_byte": 844}}, "public_tests": {"examples": [{"example_id": "get_1s_count:0", "source": "get_1s_count(25)\n", "want": "3\n"}, {"example_id": "get_1s_count:1", "source": "get_1s_count(37)\n", "want": "3\n"}, {"example_id": "get_1s_count:2", "source": "get_1s_count(21)\n", "want": "3\n"}, {"example_id": "get_1s_count:3", "source": "get_1s_count(58)\n", "want": "4\n"}, {"example_id": "get_1s_count:4", "source": "get_1s_count(0)\n", "want": "0\n"}, {"example_id": "get_1s_count:5", "source": "get_1s_count(256)\n", "want": "1\n"}, {"example_id": "get_1s_count:6", "source": "get_1s_count(-1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: Input must be a non-negative integer\n"}, {"example_id": "get_1s_count:7", "source": "get_1s_count(0.8)\n", "want": "Traceback (most recent call last):\n ...\nValueError: Input must be a non-negative integer\n"}, {"example_id": "get_1s_count:8", "source": "get_1s_count(\"25\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: Input must be a non-negative integer\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-8ad53ec0378e635f", "tree_sha256": "835a37970043464eb9a953ee9a7d481a8b11e916037312711872f871fdc5a3e4", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:bit_manipulation/count_1s_brian_kernighan_method.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def molarity_to_normality(nfactor: int, moles: float, volume: float) -> float:\n \"\"\"\n Convert molarity to normality.\n Volume is taken in litres.\n\n Wikipedia reference: https://en.wikipedia.org/wiki/Equivalent_concentration\n Wikipedia reference: https://en.wikipedia.org/wiki/Molar_concentration\n\n >>> molarity_to_normality(2, 3.1, 0.31)\n 20\n >>> molarity_to_normality(4, 11.4, 5.7)\n 8\n \"\"\"\n return round(float(moles / volume) * nfactor)\n"}, "sha256": "be633d84ab3b14ea94a52dc2ec579984845bdf59f3157625459e9961105040a9"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "be633d84ab3b14ea94a52dc2ec579984845bdf59f3157625459e9961105040a9", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "b2ca93c4a154a5f8047e596fff9f90e7910b9efd89da5e1334a679fce7d3f21d", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00112"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00112", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def molarity_to_normality(nfactor: int, moles: float, volume: float) -> float:\n \"\"\"\n Convert molarity to normality.\n Volume is taken in litres.\n\n Wikipedia reference: https://en.wikipedia.org/wiki/Equivalent_concentration\n Wikipedia reference: https://en.wikipedia.org/wiki/Molar_concentration\n\n >>> molarity_to_normality(2, 3.1, 0.31)\n 20\n >>> molarity_to_normality(4, 11.4, 5.7)\n 8\n \"\"\"\n return round(float(moles / volume) // nfactor)\n"}, "sha256": "031e9dbcfb7d4cbe45db9203f94c4e58d8406ec72a6a87dcf39977814fb2263c"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "molarity_to_normality:0", "got": "5\n", "source": "molarity_to_normality(2, 3.1, 0.31)\n", "truncated": false, "want": "20\n"}, {"example_id": "molarity_to_normality:1", "got": "0\n", "source": "molarity_to_normality(4, 11.4, 5.7)\n", "truncated": false, "want": "8\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 39, "end_byte": 473, "lineno": 14, "node": "BinOp", "node_col_offset": 17, "node_end_col_offset": 48, "node_end_lineno": 14, "node_lineno": 14, "op_index": 0, "original_text": "*", "replacement_text": "//", "start_byte": 472}}, "public_tests": {"examples": [{"example_id": "molarity_to_normality:0", "source": "molarity_to_normality(2, 3.1, 0.31)\n", "want": "20\n"}, {"example_id": "molarity_to_normality:1", "source": "molarity_to_normality(4, 11.4, 5.7)\n", "want": "8\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-1e9e0bc1d6a36151", "tree_sha256": "be633d84ab3b14ea94a52dc2ec579984845bdf59f3157625459e9961105040a9", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:conversions/molecular_chemistry.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def tribonacci(num: int) -> list[int]:\n \"\"\"\n Given a number, return first n Tribonacci Numbers.\n >>> tribonacci(5)\n [0, 0, 1, 1, 2]\n >>> tribonacci(8)\n [0, 0, 1, 1, 2, 4, 7, 13]\n \"\"\"\n dp = [0] * num\n dp[2] = 1\n\n for i in range(3, num):\n dp[i] = dp[i - 1] + dp[i - 2] + dp[i - 3]\n\n return dp\n"}, "sha256": "11c2f747774fd48844149a993e711eeceb7ec74681cda482ebc8721e18981331"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "11c2f747774fd48844149a993e711eeceb7ec74681cda482ebc8721e18981331", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "ca80b66148614f4a34c8b6d5ca40f417409ffaa73c392c16d034cf4b840e332d", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00113"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00113", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 10, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def tribonacci(num: int) -> list[int]:\n \"\"\"\n Given a number, return first n Tribonacci Numbers.\n >>> tribonacci(5)\n [0, 0, 1, 1, 2]\n >>> tribonacci(8)\n [0, 0, 1, 1, 2, 4, 7, 13]\n \"\"\"\n dp = [0] * num\n dp[2] = 1\n\n for i in range(3, num):\n dp[i] = dp[i - 1] + dp[i - 2] + dp[i + 3]\n\n return dp\n"}, "sha256": "97524761a6b45d9a20e0f1f46c98378b8c8fcac621e7b90d205b74bd6718835e"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "tribonacci:0", "got": "IndexError: list index out of range", "source": "tribonacci(5)\n", "truncated": false, "want": "[0, 0, 1, 1, 2]\n"}, {"example_id": "tribonacci:1", "got": "IndexError: list index out of range", "source": "tribonacci(8)\n", "truncated": false, "want": "[0, 0, 1, 1, 2, 4, 7, 13]\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 45, "end_byte": 312, "lineno": 13, "node": "BinOp", "node_col_offset": 43, "node_end_col_offset": 48, "node_end_lineno": 13, "node_lineno": 13, "op_index": 0, "original_text": "-", "replacement_text": "+", "start_byte": 311}}, "public_tests": {"examples": [{"example_id": "tribonacci:0", "source": "tribonacci(5)\n", "want": "[0, 0, 1, 1, 2]\n"}, {"example_id": "tribonacci:1", "source": "tribonacci(8)\n", "want": "[0, 0, 1, 1, 2, 4, 7, 13]\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-9bec4770d14b620a", "tree_sha256": "11c2f747774fd48844149a993e711eeceb7ec74681cda482ebc8721e18981331", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:dynamic_programming/tribonacci.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def recursive_match(text: str, pattern: str) -> bool:\n r\"\"\"\n Recursive matching algorithm.\n\n | Time complexity: O(2^(\\|text\\| + \\|pattern\\|))\n | Space complexity: Recursion depth is O(\\|text\\| + \\|pattern\\|).\n\n :param text: Text to match.\n :param pattern: Pattern to match.\n :return: ``True`` if `text` matches `pattern`, ``False`` otherwise.\n\n >>> recursive_match('abc', 'a.c')\n True\n >>> recursive_match('abc', 'af*.c')\n True\n >>> recursive_match('abc', 'a.c*')\n True\n >>> recursive_match('abc', 'a.c*d')\n False\n >>> recursive_match('aa', '.*')\n True\n \"\"\"\n if not pattern:\n return not text\n\n if not text:\n return pattern[-1] == \"*\" and recursive_match(text, pattern[:-2])\n\n if text[-1] == pattern[-1] or pattern[-1] == \".\":\n return recursive_match(text[:-1], pattern[:-1])\n\n if pattern[-1] == \"*\":\n return recursive_match(text[:-1], pattern) or recursive_match(\n text, pattern[:-2]\n )\n\n return False\n"}, "sha256": "1f82e3f4da0f07b9810389e10824eb042c55d072ea567453c7579b2a0b260572"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "1f82e3f4da0f07b9810389e10824eb042c55d072ea567453c7579b2a0b260572", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "88102a5c15cc2ce8feb1c842ea4f9df44af5f7b3e0adb1cea5133378fed78c7a", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00116"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00116", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def recursive_match(text: str, pattern: str) -> bool:\n r\"\"\"\n Recursive matching algorithm.\n\n | Time complexity: O(2^(\\|text\\| + \\|pattern\\|))\n | Space complexity: Recursion depth is O(\\|text\\| + \\|pattern\\|).\n\n :param text: Text to match.\n :param pattern: Pattern to match.\n :return: ``True`` if `text` matches `pattern`, ``False`` otherwise.\n\n >>> recursive_match('abc', 'a.c')\n True\n >>> recursive_match('abc', 'af*.c')\n True\n >>> recursive_match('abc', 'a.c*')\n True\n >>> recursive_match('abc', 'a.c*d')\n False\n >>> recursive_match('aa', '.*')\n True\n \"\"\"\n if not pattern:\n return not text\n\n if not text:\n return pattern[-1] == \"*\" and recursive_match(text, pattern[:-2])\n\n if text[-1] == pattern[-1] or pattern[-1] == \".\":\n return recursive_match(text[:-1], pattern[:-1])\n\n if pattern[-1] == \"*\":\n return not (recursive_match(text[:-1], pattern) or recursive_match(\n text, pattern[:-2]\n ))\n\n return False\n"}, "sha256": "79e371847872c679299ab431e663ac5c489bc9d51284818429e02d4e43c5962e"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "recursive_match:1", "got": "False\n", "source": "recursive_match('abc', 'af*.c')\n", "truncated": false, "want": "True\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 15, "end_byte": 998, "lineno": 33, "node": "Return", "node_col_offset": 8, "node_end_col_offset": 9, "node_end_lineno": 35, "node_lineno": 33, "op_index": 0, "original_text": "recursive_match(text[:-1], pattern) or recursive_match(\n text, pattern[:-2]\n )", "replacement_text": "not (recursive_match(text[:-1], pattern) or recursive_match(\n text, pattern[:-2]\n ))", "start_byte": 902}}, "public_tests": {"examples": [{"example_id": "recursive_match:0", "source": "recursive_match('abc', 'a.c')\n", "want": "True\n"}, {"example_id": "recursive_match:1", "source": "recursive_match('abc', 'af*.c')\n", "want": "True\n"}, {"example_id": "recursive_match:2", "source": "recursive_match('abc', 'a.c*')\n", "want": "True\n"}, {"example_id": "recursive_match:3", "source": "recursive_match('abc', 'a.c*d')\n", "want": "False\n"}, {"example_id": "recursive_match:4", "source": "recursive_match('aa', '.*')\n", "want": "True\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-28728404dc8fe4df", "tree_sha256": "1f82e3f4da0f07b9810389e10824eb042c55d072ea567453c7579b2a0b260572", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:dynamic_programming/regex_match.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def longest_common_subsequence(x: str, y: str):\n \"\"\"\n Finds the longest common subsequence between two strings. Also returns the\n The subsequence found\n\n Parameters\n ----------\n\n x: str, one of the strings\n y: str, the other string\n\n Returns\n -------\n L[m][n]: int, the length of the longest subsequence. Also equal to len(seq)\n Seq: str, the subsequence found\n\n >>> longest_common_subsequence(\"programming\", \"gaming\")\n (6, 'gaming')\n >>> longest_common_subsequence(\"physics\", \"smartphone\")\n (2, 'ph')\n >>> longest_common_subsequence(\"computer\", \"food\")\n (1, 'o')\n >>> longest_common_subsequence(\"\", \"abc\") # One string is empty\n (0, '')\n >>> longest_common_subsequence(\"abc\", \"\") # Other string is empty\n (0, '')\n >>> longest_common_subsequence(\"\", \"\") # Both strings are empty\n (0, '')\n >>> longest_common_subsequence(\"abc\", \"def\") # No common subsequence\n (0, '')\n >>> longest_common_subsequence(\"abc\", \"abc\") # Identical strings\n (3, 'abc')\n >>> longest_common_subsequence(\"a\", \"a\") # Single character match\n (1, 'a')\n >>> longest_common_subsequence(\"a\", \"b\") # Single character no match\n (0, '')\n >>> longest_common_subsequence(\"abcdef\", \"ace\") # Interleaved subsequence\n (3, 'ace')\n >>> longest_common_subsequence(\"ABCD\", \"ACBD\") # No repeated characters\n (3, 'ABD')\n \"\"\"\n # find the length of strings\n\n assert x is not None\n assert y is not None\n\n m = len(x)\n n = len(y)\n\n # declaring the array for storing the dp values\n dp = [[0] * (n + 1) for _ in range(m + 1)]\n\n for i in range(1, m + 1):\n for j in range(1, n + 1):\n match = 1 if x[i - 1] == y[j - 1] else 0\n\n dp[i][j] = max(dp[i - 1][j], dp[i][j - 1], dp[i - 1][j - 1] + match)\n\n seq = \"\"\n i, j = m, n\n while i > 0 and j > 0:\n match = 1 if x[i - 1] == y[j - 1] else 0\n\n if dp[i][j] == dp[i - 1][j - 1] + match:\n if match == 1:\n seq = x[i - 1] + seq\n i -= 1\n j -= 1\n elif dp[i][j] == dp[i - 1][j]:\n i -= 1\n else:\n j -= 1\n\n return dp[m][n], seq\n"}, "sha256": "b57beb30e6898f2174b9fb6ece9661384657c70995b79a47ac73992a0abcd6a3"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "b57beb30e6898f2174b9fb6ece9661384657c70995b79a47ac73992a0abcd6a3", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "a23f1f2c7d9dbe808a754e9ac5466bf396f8881705bc4a75022acf5c374771f3", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00117"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00117", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def longest_common_subsequence(x: str, y: str):\n \"\"\"\n Finds the longest common subsequence between two strings. Also returns the\n The subsequence found\n\n Parameters\n ----------\n\n x: str, one of the strings\n y: str, the other string\n\n Returns\n -------\n L[m][n]: int, the length of the longest subsequence. Also equal to len(seq)\n Seq: str, the subsequence found\n\n >>> longest_common_subsequence(\"programming\", \"gaming\")\n (6, 'gaming')\n >>> longest_common_subsequence(\"physics\", \"smartphone\")\n (2, 'ph')\n >>> longest_common_subsequence(\"computer\", \"food\")\n (1, 'o')\n >>> longest_common_subsequence(\"\", \"abc\") # One string is empty\n (0, '')\n >>> longest_common_subsequence(\"abc\", \"\") # Other string is empty\n (0, '')\n >>> longest_common_subsequence(\"\", \"\") # Both strings are empty\n (0, '')\n >>> longest_common_subsequence(\"abc\", \"def\") # No common subsequence\n (0, '')\n >>> longest_common_subsequence(\"abc\", \"abc\") # Identical strings\n (3, 'abc')\n >>> longest_common_subsequence(\"a\", \"a\") # Single character match\n (1, 'a')\n >>> longest_common_subsequence(\"a\", \"b\") # Single character no match\n (0, '')\n >>> longest_common_subsequence(\"abcdef\", \"ace\") # Interleaved subsequence\n (3, 'ace')\n >>> longest_common_subsequence(\"ABCD\", \"ACBD\") # No repeated characters\n (3, 'ABD')\n \"\"\"\n # find the length of strings\n\n assert x is not None\n assert y is not None\n\n m = len(x)\n n = len(y)\n\n # declaring the array for storing the dp values\n dp = [[0] * (n + 1) for _ in range(m + 1)]\n\n for i in range(1, m + 1):\n for j in range(1, n + 1):\n match = 1 if x[i - 1] == y[j - 1] else 0\n\n dp[i][j] = max(dp[i - 1][j], dp[i][j - 1], dp[i - 1][j - 1] + match)\n\n seq = \"\"\n i, j = m, n\n while i > 0 and j > 1:\n match = 1 if x[i - 1] == y[j - 1] else 0\n\n if dp[i][j] == dp[i - 1][j - 1] + match:\n if match == 1:\n seq = x[i - 1] + seq\n i -= 1\n j -= 1\n elif dp[i][j] == dp[i - 1][j]:\n i -= 1\n else:\n j -= 1\n\n return dp[m][n], seq\n"}, "sha256": "91ca9f34c2039d70a988af25b1ccfa9c0e9f6beb5ea448405f6a3ab5d670cbd2"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "longest_common_subsequence:0", "got": "(6, 'aming')\n", "source": "longest_common_subsequence(\"programming\", \"gaming\")\n", "truncated": false, "want": "(6, 'gaming')\n"}, {"example_id": "longest_common_subsequence:7", "got": "(3, 'bc')\n", "source": "longest_common_subsequence(\"abc\", \"abc\") # Identical strings\n", "truncated": false, "want": "(3, 'abc')\n"}, {"example_id": "longest_common_subsequence:8", "got": "(1, '')\n", "source": "longest_common_subsequence(\"a\", \"a\") # Single character match\n", "truncated": false, "want": "(1, 'a')\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "off_by_one", "seed": 7, "span": {"col_offset": 24, "end_byte": 1865, "lineno": 61, "node": "Constant", "node_col_offset": 24, "node_end_col_offset": 25, "node_end_lineno": 61, "node_lineno": 61, "op_index": 0, "original_text": "0", "replacement_text": "1", "start_byte": 1864}}, "public_tests": {"examples": [{"example_id": "longest_common_subsequence:0", "source": "longest_common_subsequence(\"programming\", \"gaming\")\n", "want": "(6, 'gaming')\n"}, {"example_id": "longest_common_subsequence:1", "source": "longest_common_subsequence(\"physics\", \"smartphone\")\n", "want": "(2, 'ph')\n"}, {"example_id": "longest_common_subsequence:2", "source": "longest_common_subsequence(\"computer\", \"food\")\n", "want": "(1, 'o')\n"}, {"example_id": "longest_common_subsequence:3", "source": "longest_common_subsequence(\"\", \"abc\") # One string is empty\n", "want": "(0, '')\n"}, {"example_id": "longest_common_subsequence:4", "source": "longest_common_subsequence(\"abc\", \"\") # Other string is empty\n", "want": "(0, '')\n"}, {"example_id": "longest_common_subsequence:5", "source": "longest_common_subsequence(\"\", \"\") # Both strings are empty\n", "want": "(0, '')\n"}, {"example_id": "longest_common_subsequence:6", "source": "longest_common_subsequence(\"abc\", \"def\") # No common subsequence\n", "want": "(0, '')\n"}, {"example_id": "longest_common_subsequence:7", "source": "longest_common_subsequence(\"abc\", \"abc\") # Identical strings\n", "want": "(3, 'abc')\n"}, {"example_id": "longest_common_subsequence:8", "source": "longest_common_subsequence(\"a\", \"a\") # Single character match\n", "want": "(1, 'a')\n"}, {"example_id": "longest_common_subsequence:9", "source": "longest_common_subsequence(\"a\", \"b\") # Single character no match\n", "want": "(0, '')\n"}, {"example_id": "longest_common_subsequence:10", "source": "longest_common_subsequence(\"abcdef\", \"ace\") # Interleaved subsequence\n", "want": "(3, 'ace')\n"}, {"example_id": "longest_common_subsequence:11", "source": "longest_common_subsequence(\"ABCD\", \"ACBD\") # No repeated characters\n", "want": "(3, 'ABD')\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-2325d19d958de463", "tree_sha256": "b57beb30e6898f2174b9fb6ece9661384657c70995b79a47ac73992a0abcd6a3", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:dynamic_programming/longest_common_subsequence.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def longest_common_substring(text1: str, text2: str) -> str:\n \"\"\"\n Finds the longest common substring between two strings.\n\n >>> longest_common_substring(\"\", \"\")\n ''\n >>> longest_common_substring(\"a\",\"\")\n ''\n >>> longest_common_substring(\"\", \"a\")\n ''\n >>> longest_common_substring(\"a\", \"a\")\n 'a'\n >>> longest_common_substring(\"abcdef\", \"bcd\")\n 'bcd'\n >>> longest_common_substring(\"abcdef\", \"xabded\")\n 'ab'\n >>> longest_common_substring(\"GeeksforGeeks\", \"GeeksQuiz\")\n 'Geeks'\n >>> longest_common_substring(\"abcdxyz\", \"xyzabcd\")\n 'abcd'\n >>> longest_common_substring(\"zxabcdezy\", \"yzabcdezx\")\n 'abcdez'\n >>> longest_common_substring(\"OldSite:GeeksforGeeks.org\", \"NewSite:GeeksQuiz.com\")\n 'Site:Geeks'\n >>> longest_common_substring(1, 1)\n Traceback (most recent call last):\n ...\n ValueError: longest_common_substring() takes two strings for inputs\n \"\"\"\n\n if not (isinstance(text1, str) and isinstance(text2, str)):\n raise ValueError(\"longest_common_substring() takes two strings for inputs\")\n\n if not text1 or not text2:\n return \"\"\n\n text1_length = len(text1)\n text2_length = len(text2)\n\n dp = [[0] * (text2_length + 1) for _ in range(text1_length + 1)]\n end_pos = 0\n max_length = 0\n\n for i in range(1, text1_length + 1):\n for j in range(1, text2_length + 1):\n if text1[i - 1] == text2[j - 1]:\n dp[i][j] = 1 + dp[i - 1][j - 1]\n if dp[i][j] > max_length:\n end_pos = i\n max_length = dp[i][j]\n\n return text1[end_pos - max_length : end_pos]\n"}, "sha256": "f6eaa2ceec5a3aaf169265eb8837401706ff6dee1fad2b89def197e13f94fcd4"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "f6eaa2ceec5a3aaf169265eb8837401706ff6dee1fad2b89def197e13f94fcd4", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "7ed2f4b549ec9368f40efecc7cd6b99c40729c7135f90944983daa2e8ee48d27", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00118"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00118", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def longest_common_substring(text1: str, text2: str) -> str:\n \"\"\"\n Finds the longest common substring between two strings.\n\n >>> longest_common_substring(\"\", \"\")\n ''\n >>> longest_common_substring(\"a\",\"\")\n ''\n >>> longest_common_substring(\"\", \"a\")\n ''\n >>> longest_common_substring(\"a\", \"a\")\n 'a'\n >>> longest_common_substring(\"abcdef\", \"bcd\")\n 'bcd'\n >>> longest_common_substring(\"abcdef\", \"xabded\")\n 'ab'\n >>> longest_common_substring(\"GeeksforGeeks\", \"GeeksQuiz\")\n 'Geeks'\n >>> longest_common_substring(\"abcdxyz\", \"xyzabcd\")\n 'abcd'\n >>> longest_common_substring(\"zxabcdezy\", \"yzabcdezx\")\n 'abcdez'\n >>> longest_common_substring(\"OldSite:GeeksforGeeks.org\", \"NewSite:GeeksQuiz.com\")\n 'Site:Geeks'\n >>> longest_common_substring(1, 1)\n Traceback (most recent call last):\n ...\n ValueError: longest_common_substring() takes two strings for inputs\n \"\"\"\n\n if not (isinstance(text1, str) and isinstance(text2, str)):\n raise ValueError(\"longest_common_substring() takes two strings for inputs\")\n\n if not text1 or not text2:\n return \"\"\n\n text1_length = len(text1)\n text2_length = len(text2)\n\n dp = [[0] * (text2_length + 1) for _ in range(text1_length + 1)]\n end_pos = 0\n max_length = 0\n\n for i in range(1, text1_length + 1):\n for j in range(1, text2_length + 1):\n if text1[i - 1] == text2[j - 1]:\n dp[i][j] = 1 - dp[i - 1][j - 1]\n if dp[i][j] > max_length:\n end_pos = i\n max_length = dp[i][j]\n\n return text1[end_pos - max_length : end_pos]\n"}, "sha256": "66767c981c5fc8d04c827d1a884ed7aa0e6b873227ba1bfe4854e3da678585ba"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "longest_common_substring:4", "got": "'b'\n", "source": "longest_common_substring(\"abcdef\", \"bcd\")\n", "truncated": false, "want": "'bcd'\n"}, {"example_id": "longest_common_substring:5", "got": "'a'\n", "source": "longest_common_substring(\"abcdef\", \"xabded\")\n", "truncated": false, "want": "'ab'\n"}, {"example_id": "longest_common_substring:6", "got": "'G'\n", "source": "longest_common_substring(\"GeeksforGeeks\", \"GeeksQuiz\")\n", "truncated": false, "want": "'Geeks'\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 29, "end_byte": 1462, "lineno": 47, "node": "BinOp", "node_col_offset": 27, "node_end_col_offset": 47, "node_end_lineno": 47, "node_lineno": 47, "op_index": 0, "original_text": "+", "replacement_text": "-", "start_byte": 1461}}, "public_tests": {"examples": [{"example_id": "longest_common_substring:0", "source": "longest_common_substring(\"\", \"\")\n", "want": "''\n"}, {"example_id": "longest_common_substring:1", "source": "longest_common_substring(\"a\",\"\")\n", "want": "''\n"}, {"example_id": "longest_common_substring:2", "source": "longest_common_substring(\"\", \"a\")\n", "want": "''\n"}, {"example_id": "longest_common_substring:3", "source": "longest_common_substring(\"a\", \"a\")\n", "want": "'a'\n"}, {"example_id": "longest_common_substring:4", "source": "longest_common_substring(\"abcdef\", \"bcd\")\n", "want": "'bcd'\n"}, {"example_id": "longest_common_substring:5", "source": "longest_common_substring(\"abcdef\", \"xabded\")\n", "want": "'ab'\n"}, {"example_id": "longest_common_substring:6", "source": "longest_common_substring(\"GeeksforGeeks\", \"GeeksQuiz\")\n", "want": "'Geeks'\n"}, {"example_id": "longest_common_substring:7", "source": "longest_common_substring(\"abcdxyz\", \"xyzabcd\")\n", "want": "'abcd'\n"}, {"example_id": "longest_common_substring:8", "source": "longest_common_substring(\"zxabcdezy\", \"yzabcdezx\")\n", "want": "'abcdez'\n"}, {"example_id": "longest_common_substring:9", "source": "longest_common_substring(\"OldSite:GeeksforGeeks.org\", \"NewSite:GeeksQuiz.com\")\n", "want": "'Site:Geeks'\n"}, {"example_id": "longest_common_substring:10", "source": "longest_common_substring(1, 1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: longest_common_substring() takes two strings for inputs\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-897ba5b9527073b7", "tree_sha256": "f6eaa2ceec5a3aaf169265eb8837401706ff6dee1fad2b89def197e13f94fcd4", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:dynamic_programming/longest_common_substring.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def molarity_to_normality(nfactor: int, moles: float, volume: float) -> float:\n \"\"\"\n Convert molarity to normality.\n Volume is taken in litres.\n\n Wikipedia reference: https://en.wikipedia.org/wiki/Equivalent_concentration\n Wikipedia reference: https://en.wikipedia.org/wiki/Molar_concentration\n\n >>> molarity_to_normality(2, 3.1, 0.31)\n 20\n >>> molarity_to_normality(4, 11.4, 5.7)\n 8\n \"\"\"\n return round(float(moles / volume) * nfactor)\n"}, "sha256": "be633d84ab3b14ea94a52dc2ec579984845bdf59f3157625459e9961105040a9"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "be633d84ab3b14ea94a52dc2ec579984845bdf59f3157625459e9961105040a9", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "1b27c2529ac24b15a51d3e9da15fba14c15fa4b871c1bdf2b9275800a82bf68e", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00120"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00120", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def molarity_to_normality(nfactor: int, moles: float, volume: float) -> float:\n \"\"\"\n Convert molarity to normality.\n Volume is taken in litres.\n\n Wikipedia reference: https://en.wikipedia.org/wiki/Equivalent_concentration\n Wikipedia reference: https://en.wikipedia.org/wiki/Molar_concentration\n\n >>> molarity_to_normality(2, 3.1, 0.31)\n 20\n >>> molarity_to_normality(4, 11.4, 5.7)\n 8\n \"\"\"\n return round(float(moles / volume) * nfactor) + 1\n"}, "sha256": "139213f8bfcac7e2656334bd9d9b5f8237282c02b2ef0734955f2f942afbdc85"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "molarity_to_normality:0", "got": "21\n", "source": "molarity_to_normality(2, 3.1, 0.31)\n", "truncated": false, "want": "20\n"}, {"example_id": "molarity_to_normality:1", "got": "9\n", "source": "molarity_to_normality(4, 11.4, 5.7)\n", "truncated": false, "want": "8\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 482, "lineno": 14, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 49, "node_end_lineno": 14, "node_lineno": 14, "op_index": 0, "original_text": "round(float(moles / volume) * nfactor)", "replacement_text": "round(float(moles / volume) * nfactor) + 1", "start_byte": 444}}, "public_tests": {"examples": [{"example_id": "molarity_to_normality:0", "source": "molarity_to_normality(2, 3.1, 0.31)\n", "want": "20\n"}, {"example_id": "molarity_to_normality:1", "source": "molarity_to_normality(4, 11.4, 5.7)\n", "want": "8\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-1e9e0bc1d6a36151", "tree_sha256": "be633d84ab3b14ea94a52dc2ec579984845bdf59f3157625459e9961105040a9", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:conversions/molecular_chemistry.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "from __future__ import annotations\n\n\ndef extended_euclid(a: int, b: int) -> tuple[int, int]:\n \"\"\"\n >>> extended_euclid(10, 6)\n (-1, 2)\n\n >>> extended_euclid(7, 5)\n (-2, 3)\n\n \"\"\"\n if b == 0:\n return (1, 0)\n (x, y) = extended_euclid(b, a % b)\n k = a // b\n return (y, x - k * y)\n"}, "sha256": "a52b4940880d732c6e9bcb022b4d04f0128cfd70e75b063028f33d34a35adcc6"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "a52b4940880d732c6e9bcb022b4d04f0128cfd70e75b063028f33d34a35adcc6", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "98706e53a62a17ff16e498780267ee46e2af3e93a3b286ddf481aa00247cde97", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00121"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00121", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "from __future__ import annotations\n\n\ndef extended_euclid(a: int, b: int) -> tuple[int, int]:\n \"\"\"\n >>> extended_euclid(10, 6)\n (-1, 2)\n\n >>> extended_euclid(7, 5)\n (-2, 3)\n\n \"\"\"\n if b != 0:\n return (1, 0)\n (x, y) = extended_euclid(b, a % b)\n k = a // b\n return (y, x - k * y)\n"}, "sha256": "d5e4f98b02fdcd0f6743d9b9eefbaa3deedc16d6027d632a67803df38a806ccf"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "extended_euclid:0", "got": "(1, 0)\n", "source": "extended_euclid(10, 6)\n", "truncated": false, "want": "(-1, 2)\n"}, {"example_id": "extended_euclid:1", "got": "(1, 0)\n", "source": "extended_euclid(7, 5)\n", "truncated": false, "want": "(-2, 3)\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "boolean_condition", "seed": 7, "span": {"col_offset": 9, "end_byte": 207, "lineno": 13, "node": "Compare", "node_col_offset": 7, "node_end_col_offset": 13, "node_end_lineno": 13, "node_lineno": 13, "op_index": 0, "original_text": "==", "replacement_text": "!=", "start_byte": 205}}, "public_tests": {"examples": [{"example_id": "extended_euclid:0", "source": "extended_euclid(10, 6)\n", "want": "(-1, 2)\n"}, {"example_id": "extended_euclid:1", "source": "extended_euclid(7, 5)\n", "want": "(-2, 3)\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-9e6b9d20e65cdf89", "tree_sha256": "a52b4940880d732c6e9bcb022b4d04f0128cfd70e75b063028f33d34a35adcc6", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/chinese_remainder_theorem.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def octal_to_binary(octal_number: str) -> str:\n \"\"\"\n Convert an Octal number to Binary.\n\n >>> octal_to_binary(\"17\")\n '001111'\n >>> octal_to_binary(\"7\")\n '111'\n >>> octal_to_binary(\"Av\")\n Traceback (most recent call last):\n ...\n ValueError: Non-octal value was passed to the function\n >>> octal_to_binary(\"@#\")\n Traceback (most recent call last):\n ...\n ValueError: Non-octal value was passed to the function\n >>> octal_to_binary(\"\")\n Traceback (most recent call last):\n ...\n ValueError: Empty string was passed to the function\n \"\"\"\n if not octal_number:\n raise ValueError(\"Empty string was passed to the function\")\n\n binary_number = \"\"\n octal_digits = \"01234567\"\n for digit in octal_number:\n if digit not in octal_digits:\n raise ValueError(\"Non-octal value was passed to the function\")\n\n binary_digit = \"\"\n value = int(digit)\n for _ in range(3):\n binary_digit = str(value % 2) + binary_digit\n value //= 2\n binary_number += binary_digit\n\n return binary_number\n"}, "sha256": "6df38b1302b901a7facaeda582fd59268709b889c15def0cf5e04e0532c9d6ae"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "6df38b1302b901a7facaeda582fd59268709b889c15def0cf5e04e0532c9d6ae", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "00d79f039796e99d28ef53d5c75cb943cd7c47d5635fcd5903799625afc03657", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00122"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00122", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 6, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def octal_to_binary(octal_number: str) -> str:\n \"\"\"\n Convert an Octal number to Binary.\n\n >>> octal_to_binary(\"17\")\n '001111'\n >>> octal_to_binary(\"7\")\n '111'\n >>> octal_to_binary(\"Av\")\n Traceback (most recent call last):\n ...\n ValueError: Non-octal value was passed to the function\n >>> octal_to_binary(\"@#\")\n Traceback (most recent call last):\n ...\n ValueError: Non-octal value was passed to the function\n >>> octal_to_binary(\"\")\n Traceback (most recent call last):\n ...\n ValueError: Empty string was passed to the function\n \"\"\"\n if octal_number:\n raise ValueError(\"Empty string was passed to the function\")\n\n binary_number = \"\"\n octal_digits = \"01234567\"\n for digit in octal_number:\n if digit not in octal_digits:\n raise ValueError(\"Non-octal value was passed to the function\")\n\n binary_digit = \"\"\n value = int(digit)\n for _ in range(3):\n binary_digit = str(value % 2) + binary_digit\n value //= 2\n binary_number += binary_digit\n\n return binary_number\n"}, "sha256": "5ef68c7518193657ec7fb0e24d7b75bbc7fb370d83ae209eba967185005409d4"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "octal_to_binary:0", "got": "ValueError: Empty string was passed to the function", "source": "octal_to_binary(\"17\")\n", "truncated": false, "want": "'001111'\n"}, {"example_id": "octal_to_binary:1", "got": "ValueError: Empty string was passed to the function", "source": "octal_to_binary(\"7\")\n", "truncated": false, "want": "'111'\n"}, {"example_id": "octal_to_binary:2", "got": "ValueError: Empty string was passed to the function", "source": "octal_to_binary(\"Av\")\n", "truncated": false, "want": "Traceback (most recent call last):\n ...\nValueError: Non-octal value was passed to the function\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "boolean_condition", "seed": 7, "span": {"col_offset": 7, "end_byte": 611, "lineno": 22, "node": "UnaryOp", "node_col_offset": 7, "node_end_col_offset": 23, "node_end_lineno": 22, "node_lineno": 22, "op_index": 0, "original_text": "not ", "replacement_text": "", "start_byte": 607}}, "public_tests": {"examples": [{"example_id": "octal_to_binary:0", "source": "octal_to_binary(\"17\")\n", "want": "'001111'\n"}, {"example_id": "octal_to_binary:1", "source": "octal_to_binary(\"7\")\n", "want": "'111'\n"}, {"example_id": "octal_to_binary:2", "source": "octal_to_binary(\"Av\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: Non-octal value was passed to the function\n"}, {"example_id": "octal_to_binary:3", "source": "octal_to_binary(\"@#\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: Non-octal value was passed to the function\n"}, {"example_id": "octal_to_binary:4", "source": "octal_to_binary(\"\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: Empty string was passed to the function\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-264c9e6434108710", "tree_sha256": "6df38b1302b901a7facaeda582fd59268709b889c15def0cf5e04e0532c9d6ae", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:conversions/octal_to_binary.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "from itertools import compress, repeat\nfrom math import ceil, sqrt\n\n\ndef odd_sieve(num: int) -> list[int]:\n \"\"\"\n Returns the prime numbers < `num`. The prime numbers are calculated using an\n odd sieve implementation of the Sieve of Eratosthenes algorithm\n (see for reference https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes).\n\n >>> odd_sieve(2)\n []\n >>> odd_sieve(3)\n [2]\n >>> odd_sieve(10)\n [2, 3, 5, 7]\n >>> odd_sieve(20)\n [2, 3, 5, 7, 11, 13, 17, 19]\n \"\"\"\n\n if num <= 2:\n return []\n if num == 3:\n return [2]\n\n # Odd sieve for numbers in range [3, num - 1]\n sieve = bytearray(b\"\\x01\") * ((num >> 1) - 1)\n\n for i in range(3, int(sqrt(num)) + 1, 2):\n if sieve[(i >> 1) - 1]:\n i_squared = i**2\n sieve[(i_squared >> 1) - 1 :: i] = repeat(\n 0, ceil((num - i_squared) / (i << 1))\n )\n\n return [2, *list(compress(range(3, num, 2), sieve))]\n"}, "sha256": "c2dad96a6a816866e5996f8381f3b58ac8fc017a0ea79656cb93870dfd476020"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "c2dad96a6a816866e5996f8381f3b58ac8fc017a0ea79656cb93870dfd476020", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "abcd27bf501a191eb149d63a13e7531e27df1cffd65ea6594a61037702c8a698", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00126"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00126", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 22, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "from itertools import compress, repeat\nfrom math import ceil, sqrt\n\n\ndef odd_sieve(num: int) -> list[int]:\n \"\"\"\n Returns the prime numbers < `num`. The prime numbers are calculated using an\n odd sieve implementation of the Sieve of Eratosthenes algorithm\n (see for reference https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes).\n\n >>> odd_sieve(2)\n []\n >>> odd_sieve(3)\n [2]\n >>> odd_sieve(10)\n [2, 3, 5, 7]\n >>> odd_sieve(20)\n [2, 3, 5, 7, 11, 13, 17, 19]\n \"\"\"\n\n if num < 2:\n return []\n if num == 3:\n return [2]\n\n # Odd sieve for numbers in range [3, num - 1]\n sieve = bytearray(b\"\\x01\") * ((num >> 1) - 1)\n\n for i in range(3, int(sqrt(num)) + 1, 2):\n if sieve[(i >> 1) - 1]:\n i_squared = i**2\n sieve[(i_squared >> 1) - 1 :: i] = repeat(\n 0, ceil((num - i_squared) / (i << 1))\n )\n\n return [2, *list(compress(range(3, num, 2), sieve))]\n"}, "sha256": "74229af249fc69bfd97736a8e6bb6bdc8bc29c3fb2559d70a97e0341e46780a5"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "odd_sieve:0", "got": "[2]\n", "source": "odd_sieve(2)\n", "truncated": false, "want": "[]\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "comparison_boundary", "seed": 7, "span": {"col_offset": 11, "end_byte": 515, "lineno": 21, "node": "Compare", "node_col_offset": 7, "node_end_col_offset": 15, "node_end_lineno": 21, "node_lineno": 21, "op_index": 0, "original_text": "<=", "replacement_text": "<", "start_byte": 513}}, "public_tests": {"examples": [{"example_id": "odd_sieve:0", "source": "odd_sieve(2)\n", "want": "[]\n"}, {"example_id": "odd_sieve:1", "source": "odd_sieve(3)\n", "want": "[2]\n"}, {"example_id": "odd_sieve:2", "source": "odd_sieve(10)\n", "want": "[2, 3, 5, 7]\n"}, {"example_id": "odd_sieve:3", "source": "odd_sieve(20)\n", "want": "[2, 3, 5, 7, 11, 13, 17, 19]\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-ecc0f5732f2269a9", "tree_sha256": "c2dad96a6a816866e5996f8381f3b58ac8fc017a0ea79656cb93870dfd476020", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/odd_sieve.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def double_factorial_recursive(n: int) -> int:\n \"\"\"\n Compute double factorial using recursive method.\n Recursion can be costly for large numbers.\n\n To learn about the theory behind this algorithm:\n https://en.wikipedia.org/wiki/Double_factorial\n\n >>> from math import prod\n >>> all(double_factorial_recursive(i) == prod(range(i, 0, -2)) for i in range(20))\n True\n >>> double_factorial_recursive(0.1)\n Traceback (most recent call last):\n ...\n ValueError: double_factorial_recursive() only accepts integral values\n >>> double_factorial_recursive(-1)\n Traceback (most recent call last):\n ...\n ValueError: double_factorial_recursive() not defined for negative values\n \"\"\"\n if not isinstance(n, int):\n raise ValueError(\"double_factorial_recursive() only accepts integral values\")\n if n < 0:\n raise ValueError(\"double_factorial_recursive() not defined for negative values\")\n return 1 if n <= 1 else n * double_factorial_recursive(n - 2)\n"}, "sha256": "069399f6174c92987d8133c899a484524be56beacc8b734902313f11ccba0142"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "069399f6174c92987d8133c899a484524be56beacc8b734902313f11ccba0142", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "935a4137f8b2cf91c93ef6bc1c58191a8630f0873169ee86530f970adb924dcf", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00127"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00127", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 5, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def double_factorial_recursive(n: int) -> int:\n \"\"\"\n Compute double factorial using recursive method.\n Recursion can be costly for large numbers.\n\n To learn about the theory behind this algorithm:\n https://en.wikipedia.org/wiki/Double_factorial\n\n >>> from math import prod\n >>> all(double_factorial_recursive(i) == prod(range(i, 0, -2)) for i in range(20))\n True\n >>> double_factorial_recursive(0.1)\n Traceback (most recent call last):\n ...\n ValueError: double_factorial_recursive() only accepts integral values\n >>> double_factorial_recursive(-1)\n Traceback (most recent call last):\n ...\n ValueError: double_factorial_recursive() not defined for negative values\n \"\"\"\n if isinstance(n, int):\n raise ValueError(\"double_factorial_recursive() only accepts integral values\")\n if n < 0:\n raise ValueError(\"double_factorial_recursive() not defined for negative values\")\n return 1 if n <= 1 else n * double_factorial_recursive(n - 2)\n"}, "sha256": "146284c556513247de89984cae022ccdb69d98671331a24e6644620ab9e2ff34"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "double_factorial_recursive:1", "got": "ValueError: double_factorial_recursive() only accepts integral values", "source": "all(double_factorial_recursive(i) == prod(range(i, 0, -2)) for i in range(20))\n", "truncated": false, "want": "True\n"}, {"example_id": "double_factorial_recursive:2", "got": "1\n", "source": "double_factorial_recursive(0.1)\n", "truncated": false, "want": "Traceback (most recent call last):\n ...\nValueError: double_factorial_recursive() only accepts integral values\n"}, {"example_id": "double_factorial_recursive:3", "got": "ValueError: double_factorial_recursive() only accepts integral values", "source": "double_factorial_recursive(-1)\n", "truncated": false, "want": "Traceback (most recent call last):\n ...\nValueError: double_factorial_recursive() not defined for negative values\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "boolean_condition", "seed": 7, "span": {"col_offset": 7, "end_byte": 738, "lineno": 21, "node": "UnaryOp", "node_col_offset": 7, "node_end_col_offset": 29, "node_end_lineno": 21, "node_lineno": 21, "op_index": 0, "original_text": "not ", "replacement_text": "", "start_byte": 734}}, "public_tests": {"examples": [{"example_id": "double_factorial_recursive:0", "source": "from math import prod\n", "want": ""}, {"example_id": "double_factorial_recursive:1", "source": "all(double_factorial_recursive(i) == prod(range(i, 0, -2)) for i in range(20))\n", "want": "True\n"}, {"example_id": "double_factorial_recursive:2", "source": "double_factorial_recursive(0.1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: double_factorial_recursive() only accepts integral values\n"}, {"example_id": "double_factorial_recursive:3", "source": "double_factorial_recursive(-1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: double_factorial_recursive() not defined for negative values\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-26eb465e5814e599", "tree_sha256": "069399f6174c92987d8133c899a484524be56beacc8b734902313f11ccba0142", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/double_factorial.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def snake_to_camel_case(input_str: str, use_pascal: bool = False) -> str:\n \"\"\"\n Transforms a snake_case given string to camelCase (or PascalCase if indicated)\n (defaults to not use Pascal)\n\n >>> snake_to_camel_case(\"some_random_string\")\n 'someRandomString'\n\n >>> snake_to_camel_case(\"some_random_string\", use_pascal=True)\n 'SomeRandomString'\n\n >>> snake_to_camel_case(\"some_random_string_with_numbers_123\")\n 'someRandomStringWithNumbers123'\n\n >>> snake_to_camel_case(\"some_random_string_with_numbers_123\", use_pascal=True)\n 'SomeRandomStringWithNumbers123'\n\n >>> snake_to_camel_case(123)\n Traceback (most recent call last):\n ...\n ValueError: Expected string as input, found \n\n >>> snake_to_camel_case(\"some_string\", use_pascal=\"True\")\n Traceback (most recent call last):\n ...\n ValueError: Expected boolean as use_pascal parameter, found \n \"\"\"\n\n if not isinstance(input_str, str):\n msg = f\"Expected string as input, found {type(input_str)}\"\n raise ValueError(msg)\n if not isinstance(use_pascal, bool):\n msg = f\"Expected boolean as use_pascal parameter, found {type(use_pascal)}\"\n raise ValueError(msg)\n\n words = input_str.split(\"_\")\n\n start_index = 0 if use_pascal else 1\n\n words_to_capitalize = words[start_index:]\n\n capitalized_words = [word[0].upper() + word[1:] for word in words_to_capitalize]\n\n initial_word = \"\" if use_pascal else words[0]\n\n return \"\".join([initial_word, *capitalized_words])\n"}, "sha256": "b78569cdb0c51be6fac4a0f3bf11e9e3c5f719f9221e97b8ab91482097a186fb"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "b78569cdb0c51be6fac4a0f3bf11e9e3c5f719f9221e97b8ab91482097a186fb", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "6c2431efd0b94daf20cc3071d34e44728712a85bb59d4f7d3df2dd4bd60ceeac", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00128"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00128", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 10, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def snake_to_camel_case(input_str: str, use_pascal: bool = False) -> str:\n \"\"\"\n Transforms a snake_case given string to camelCase (or PascalCase if indicated)\n (defaults to not use Pascal)\n\n >>> snake_to_camel_case(\"some_random_string\")\n 'someRandomString'\n\n >>> snake_to_camel_case(\"some_random_string\", use_pascal=True)\n 'SomeRandomString'\n\n >>> snake_to_camel_case(\"some_random_string_with_numbers_123\")\n 'someRandomStringWithNumbers123'\n\n >>> snake_to_camel_case(\"some_random_string_with_numbers_123\", use_pascal=True)\n 'SomeRandomStringWithNumbers123'\n\n >>> snake_to_camel_case(123)\n Traceback (most recent call last):\n ...\n ValueError: Expected string as input, found \n\n >>> snake_to_camel_case(\"some_string\", use_pascal=\"True\")\n Traceback (most recent call last):\n ...\n ValueError: Expected boolean as use_pascal parameter, found \n \"\"\"\n\n if not isinstance(input_str, str):\n msg = f\"Expected string as input, found {type(input_str)}\"\n raise ValueError(msg)\n if not isinstance(use_pascal, bool):\n msg = f\"Expected boolean as use_pascal parameter, found {type(use_pascal)}\"\n raise ValueError(msg)\n\n words = input_str.split(\"_\")\n\n start_index = 0 if use_pascal else 1\n\n words_to_capitalize = words[start_index:]\n\n capitalized_words = [word[0].upper() - word[1:] for word in words_to_capitalize]\n\n initial_word = \"\" if use_pascal else words[0]\n\n return \"\".join([initial_word, *capitalized_words])\n"}, "sha256": "59bd3214adea855ed2a96997a3e4f3c4ebb223d1a2e755d27a588729362f3840"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "snake_to_camel_case:0", "got": "TypeError: unsupported operand type(s) for -: 'str' and 'str'", "source": "snake_to_camel_case(\"some_random_string\")\n", "truncated": false, "want": "'someRandomString'\n"}, {"example_id": "snake_to_camel_case:1", "got": "TypeError: unsupported operand type(s) for -: 'str' and 'str'", "source": "snake_to_camel_case(\"some_random_string\", use_pascal=True)\n", "truncated": false, "want": "'SomeRandomString'\n"}, {"example_id": "snake_to_camel_case:2", "got": "TypeError: unsupported operand type(s) for -: 'str' and 'str'", "source": "snake_to_camel_case(\"some_random_string_with_numbers_123\")\n", "truncated": false, "want": "'someRandomStringWithNumbers123'\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 41, "end_byte": 1395, "lineno": 42, "node": "BinOp", "node_col_offset": 25, "node_end_col_offset": 51, "node_end_lineno": 42, "node_lineno": 42, "op_index": 0, "original_text": "+", "replacement_text": "-", "start_byte": 1394}}, "public_tests": {"examples": [{"example_id": "snake_to_camel_case:0", "source": "snake_to_camel_case(\"some_random_string\")\n", "want": "'someRandomString'\n"}, {"example_id": "snake_to_camel_case:1", "source": "snake_to_camel_case(\"some_random_string\", use_pascal=True)\n", "want": "'SomeRandomString'\n"}, {"example_id": "snake_to_camel_case:2", "source": "snake_to_camel_case(\"some_random_string_with_numbers_123\")\n", "want": "'someRandomStringWithNumbers123'\n"}, {"example_id": "snake_to_camel_case:3", "source": "snake_to_camel_case(\"some_random_string_with_numbers_123\", use_pascal=True)\n", "want": "'SomeRandomStringWithNumbers123'\n"}, {"example_id": "snake_to_camel_case:4", "source": "snake_to_camel_case(123)\n", "want": "Traceback (most recent call last):\n ...\nValueError: Expected string as input, found \n"}, {"example_id": "snake_to_camel_case:5", "source": "snake_to_camel_case(\"some_string\", use_pascal=\"True\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: Expected boolean as use_pascal parameter, found \n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-c20f24441cc2d3d5", "tree_sha256": "b78569cdb0c51be6fac4a0f3bf11e9e3c5f719f9221e97b8ab91482097a186fb", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:strings/snake_case_to_camel_pascal_case.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def is_sum_subset(arr: list[int], required_sum: int) -> bool:\n \"\"\"\n >>> is_sum_subset([2, 4, 6, 8], 5)\n False\n >>> is_sum_subset([2, 4, 6, 8], 14)\n True\n \"\"\"\n # a subset value says 1 if that subset sum can be formed else 0\n # initially no subsets can be formed hence False/0\n arr_len = len(arr)\n subset = [[False] * (required_sum + 1) for _ in range(arr_len + 1)]\n\n # for each arr value, a sum of zero(0) can be formed by not taking any element\n # hence True/1\n for i in range(arr_len + 1):\n subset[i][0] = True\n\n # sum is not zero and set is empty then false\n for i in range(1, required_sum + 1):\n subset[0][i] = False\n\n for i in range(1, arr_len + 1):\n for j in range(1, required_sum + 1):\n if arr[i - 1] > j:\n subset[i][j] = subset[i - 1][j]\n if arr[i - 1] <= j:\n subset[i][j] = subset[i - 1][j] or subset[i - 1][j - arr[i - 1]]\n\n return subset[arr_len][required_sum]\n"}, "sha256": "d0c89f241da7c4644d5db2c26a6ae923c08ef848110942ba3a2f8fcdb0244f04"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "d0c89f241da7c4644d5db2c26a6ae923c08ef848110942ba3a2f8fcdb0244f04", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "76664ec2dd3e23cfa7f27b3ab99f02b9107a420a8d87f354baf5f0ae3e042ddf", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00129"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00129", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def is_sum_subset(arr: list[int], required_sum: int) -> bool:\n \"\"\"\n >>> is_sum_subset([2, 4, 6, 8], 5)\n False\n >>> is_sum_subset([2, 4, 6, 8], 14)\n True\n \"\"\"\n # a subset value says 1 if that subset sum can be formed else 0\n # initially no subsets can be formed hence False/0\n arr_len = len(arr)\n subset = [[False] * (required_sum + 1) for _ in range(arr_len + 1)]\n\n # for each arr value, a sum of zero(0) can be formed by not taking any element\n # hence True/1\n for i in range(arr_len + 1):\n subset[i][0] = True\n\n # sum is not zero and set is empty then false\n for i in range(1, required_sum + 1):\n subset[0][i] = False\n\n for i in range(1, arr_len + 1):\n for j in range(1, required_sum - 1):\n if arr[i - 1] > j:\n subset[i][j] = subset[i - 1][j]\n if arr[i - 1] <= j:\n subset[i][j] = subset[i - 1][j] or subset[i - 1][j - arr[i - 1]]\n\n return subset[arr_len][required_sum]\n"}, "sha256": "cd0e6454317a1b7a45242cbc6d3677ca79cc26b0754e97b1d87dede2f5806b70"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "is_sum_subset:1", "got": "False\n", "source": "is_sum_subset([2, 4, 6, 8], 14)\n", "truncated": false, "want": "True\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 39, "end_byte": 756, "lineno": 23, "node": "BinOp", "node_col_offset": 26, "node_end_col_offset": 42, "node_end_lineno": 23, "node_lineno": 23, "op_index": 0, "original_text": "+", "replacement_text": "-", "start_byte": 755}}, "public_tests": {"examples": [{"example_id": "is_sum_subset:0", "source": "is_sum_subset([2, 4, 6, 8], 5)\n", "want": "False\n"}, {"example_id": "is_sum_subset:1", "source": "is_sum_subset([2, 4, 6, 8], 14)\n", "want": "True\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-a26d6d8b61519d88", "tree_sha256": "d0c89f241da7c4644d5db2c26a6ae923c08ef848110942ba3a2f8fcdb0244f04", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:dynamic_programming/sum_of_subset.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def get_index_of_rightmost_set_bit(number: int) -> int:\n \"\"\"\n Take in a positive integer 'number'.\n Returns the zero-based index of first set bit in that 'number' from right.\n Returns -1, If no set bit found.\n\n >>> get_index_of_rightmost_set_bit(0)\n -1\n >>> get_index_of_rightmost_set_bit(5)\n 0\n >>> get_index_of_rightmost_set_bit(36)\n 2\n >>> get_index_of_rightmost_set_bit(8)\n 3\n >>> get_index_of_rightmost_set_bit(-18)\n Traceback (most recent call last):\n ...\n ValueError: Input must be a non-negative integer\n >>> get_index_of_rightmost_set_bit('test')\n Traceback (most recent call last):\n ...\n ValueError: Input must be a non-negative integer\n >>> get_index_of_rightmost_set_bit(1.25)\n Traceback (most recent call last):\n ...\n ValueError: Input must be a non-negative integer\n \"\"\"\n\n if not isinstance(number, int) or number < 0:\n raise ValueError(\"Input must be a non-negative integer\")\n\n intermediate = number & ~(number - 1)\n index = 0\n while intermediate:\n intermediate >>= 1\n index += 1\n return index - 1\n"}, "sha256": "ee1faa17f7263b9d65d2fa1d3d2d1dbb8ed9246d71ffe014fedc8e1c50801fb9"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "ee1faa17f7263b9d65d2fa1d3d2d1dbb8ed9246d71ffe014fedc8e1c50801fb9", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "b94f0452985ab4fab8262d47dd800f72115ca929ce7a1e024cff981f9770a97b", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00130"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00130", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def get_index_of_rightmost_set_bit(number: int) -> int:\n \"\"\"\n Take in a positive integer 'number'.\n Returns the zero-based index of first set bit in that 'number' from right.\n Returns -1, If no set bit found.\n\n >>> get_index_of_rightmost_set_bit(0)\n -1\n >>> get_index_of_rightmost_set_bit(5)\n 0\n >>> get_index_of_rightmost_set_bit(36)\n 2\n >>> get_index_of_rightmost_set_bit(8)\n 3\n >>> get_index_of_rightmost_set_bit(-18)\n Traceback (most recent call last):\n ...\n ValueError: Input must be a non-negative integer\n >>> get_index_of_rightmost_set_bit('test')\n Traceback (most recent call last):\n ...\n ValueError: Input must be a non-negative integer\n >>> get_index_of_rightmost_set_bit(1.25)\n Traceback (most recent call last):\n ...\n ValueError: Input must be a non-negative integer\n \"\"\"\n\n if not isinstance(number, int) or number < 1:\n raise ValueError(\"Input must be a non-negative integer\")\n\n intermediate = number & ~(number - 1)\n index = 0\n while intermediate:\n intermediate >>= 1\n index += 1\n return index - 1\n"}, "sha256": "cad91496db8a489381ea6b44a8b173385cd3f98d4844055d3a1814671063926f"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "get_index_of_rightmost_set_bit:0", "got": "ValueError: Input must be a non-negative integer", "source": "get_index_of_rightmost_set_bit(0)\n", "truncated": false, "want": "-1\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "off_by_one", "seed": 7, "span": {"col_offset": 47, "end_byte": 921, "lineno": 29, "node": "Constant", "node_col_offset": 47, "node_end_col_offset": 48, "node_end_lineno": 29, "node_lineno": 29, "op_index": 0, "original_text": "0", "replacement_text": "1", "start_byte": 920}}, "public_tests": {"examples": [{"example_id": "get_index_of_rightmost_set_bit:0", "source": "get_index_of_rightmost_set_bit(0)\n", "want": "-1\n"}, {"example_id": "get_index_of_rightmost_set_bit:1", "source": "get_index_of_rightmost_set_bit(5)\n", "want": "0\n"}, {"example_id": "get_index_of_rightmost_set_bit:2", "source": "get_index_of_rightmost_set_bit(36)\n", "want": "2\n"}, {"example_id": "get_index_of_rightmost_set_bit:3", "source": "get_index_of_rightmost_set_bit(8)\n", "want": "3\n"}, {"example_id": "get_index_of_rightmost_set_bit:4", "source": "get_index_of_rightmost_set_bit(-18)\n", "want": "Traceback (most recent call last):\n ...\nValueError: Input must be a non-negative integer\n"}, {"example_id": "get_index_of_rightmost_set_bit:5", "source": "get_index_of_rightmost_set_bit('test')\n", "want": "Traceback (most recent call last):\n ...\nValueError: Input must be a non-negative integer\n"}, {"example_id": "get_index_of_rightmost_set_bit:6", "source": "get_index_of_rightmost_set_bit(1.25)\n", "want": "Traceback (most recent call last):\n ...\nValueError: Input must be a non-negative integer\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-b3c1a976472238e9", "tree_sha256": "ee1faa17f7263b9d65d2fa1d3d2d1dbb8ed9246d71ffe014fedc8e1c50801fb9", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:bit_manipulation/index_of_rightmost_set_bit.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def binary_count_setbits(a: int) -> int:\n \"\"\"\n Take in 1 integer, return a number that is\n the number of 1's in binary representation of that number.\n\n >>> binary_count_setbits(25)\n 3\n >>> binary_count_setbits(36)\n 2\n >>> binary_count_setbits(16)\n 1\n >>> binary_count_setbits(58)\n 4\n >>> binary_count_setbits(4294967295)\n 32\n >>> binary_count_setbits(0)\n 0\n >>> binary_count_setbits(-10)\n Traceback (most recent call last):\n ...\n ValueError: Input value must be a positive integer\n >>> binary_count_setbits(0.8)\n Traceback (most recent call last):\n ...\n TypeError: Input value must be a 'int' type\n >>> binary_count_setbits(\"0\")\n Traceback (most recent call last):\n ...\n TypeError: '<' not supported between instances of 'str' and 'int'\n \"\"\"\n if a < 0:\n raise ValueError(\"Input value must be a positive integer\")\n elif isinstance(a, float):\n raise TypeError(\"Input value must be a 'int' type\")\n return bin(a).count(\"1\")\n"}, "sha256": "17af49a439d7715b4c411122212d610ff64d43c9590b8f7851ba87302bf64fbf"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "17af49a439d7715b4c411122212d610ff64d43c9590b8f7851ba87302bf64fbf", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "0fba5510ebec88de7a43bcbd41f437d2b60fc50bee51776e7c90a8c4723856e0", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00133"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00133", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def binary_count_setbits(a: int) -> int:\n \"\"\"\n Take in 1 integer, return a number that is\n the number of 1's in binary representation of that number.\n\n >>> binary_count_setbits(25)\n 3\n >>> binary_count_setbits(36)\n 2\n >>> binary_count_setbits(16)\n 1\n >>> binary_count_setbits(58)\n 4\n >>> binary_count_setbits(4294967295)\n 32\n >>> binary_count_setbits(0)\n 0\n >>> binary_count_setbits(-10)\n Traceback (most recent call last):\n ...\n ValueError: Input value must be a positive integer\n >>> binary_count_setbits(0.8)\n Traceback (most recent call last):\n ...\n TypeError: Input value must be a 'int' type\n >>> binary_count_setbits(\"0\")\n Traceback (most recent call last):\n ...\n TypeError: '<' not supported between instances of 'str' and 'int'\n \"\"\"\n if a < 1:\n raise ValueError(\"Input value must be a positive integer\")\n elif isinstance(a, float):\n raise TypeError(\"Input value must be a 'int' type\")\n return bin(a).count(\"1\")\n"}, "sha256": "971e63b1c47ad36c03388996eda51aeccfb7622c3f3ee690c2fbf6a3731a1bf6"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "binary_count_setbits:5", "got": "ValueError: Input value must be a positive integer", "source": "binary_count_setbits(0)\n", "truncated": false, "want": "0\n"}, {"example_id": "binary_count_setbits:7", "got": "ValueError: Input value must be a positive integer", "source": "binary_count_setbits(0.8)\n", "truncated": false, "want": "Traceback (most recent call last):\n ...\nTypeError: Input value must be a 'int' type\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "off_by_one", "seed": 7, "span": {"col_offset": 11, "end_byte": 850, "lineno": 31, "node": "Constant", "node_col_offset": 11, "node_end_col_offset": 12, "node_end_lineno": 31, "node_lineno": 31, "op_index": 0, "original_text": "0", "replacement_text": "1", "start_byte": 849}}, "public_tests": {"examples": [{"example_id": "binary_count_setbits:0", "source": "binary_count_setbits(25)\n", "want": "3\n"}, {"example_id": "binary_count_setbits:1", "source": "binary_count_setbits(36)\n", "want": "2\n"}, {"example_id": "binary_count_setbits:2", "source": "binary_count_setbits(16)\n", "want": "1\n"}, {"example_id": "binary_count_setbits:3", "source": "binary_count_setbits(58)\n", "want": "4\n"}, {"example_id": "binary_count_setbits:4", "source": "binary_count_setbits(4294967295)\n", "want": "32\n"}, {"example_id": "binary_count_setbits:5", "source": "binary_count_setbits(0)\n", "want": "0\n"}, {"example_id": "binary_count_setbits:6", "source": "binary_count_setbits(-10)\n", "want": "Traceback (most recent call last):\n ...\nValueError: Input value must be a positive integer\n"}, {"example_id": "binary_count_setbits:7", "source": "binary_count_setbits(0.8)\n", "want": "Traceback (most recent call last):\n ...\nTypeError: Input value must be a 'int' type\n"}, {"example_id": "binary_count_setbits:8", "source": "binary_count_setbits(\"0\")\n", "want": "Traceback (most recent call last):\n ...\nTypeError: '<' not supported between instances of 'str' and 'int'\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-5811ec8749219449", "tree_sha256": "17af49a439d7715b4c411122212d610ff64d43c9590b8f7851ba87302bf64fbf", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:bit_manipulation/binary_count_setbits.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def is_sum_subset(arr: list[int], required_sum: int) -> bool:\n \"\"\"\n >>> is_sum_subset([2, 4, 6, 8], 5)\n False\n >>> is_sum_subset([2, 4, 6, 8], 14)\n True\n \"\"\"\n # a subset value says 1 if that subset sum can be formed else 0\n # initially no subsets can be formed hence False/0\n arr_len = len(arr)\n subset = [[False] * (required_sum + 1) for _ in range(arr_len + 1)]\n\n # for each arr value, a sum of zero(0) can be formed by not taking any element\n # hence True/1\n for i in range(arr_len + 1):\n subset[i][0] = True\n\n # sum is not zero and set is empty then false\n for i in range(1, required_sum + 1):\n subset[0][i] = False\n\n for i in range(1, arr_len + 1):\n for j in range(1, required_sum + 1):\n if arr[i - 1] > j:\n subset[i][j] = subset[i - 1][j]\n if arr[i - 1] <= j:\n subset[i][j] = subset[i - 1][j] or subset[i - 1][j - arr[i - 1]]\n\n return subset[arr_len][required_sum]\n"}, "sha256": "d0c89f241da7c4644d5db2c26a6ae923c08ef848110942ba3a2f8fcdb0244f04"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "d0c89f241da7c4644d5db2c26a6ae923c08ef848110942ba3a2f8fcdb0244f04", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "1cc3d881334e0fd44bd33379d82b62116b54b9ec98b27887557442a761f074b0", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00135"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00135", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def is_sum_subset(arr: list[int], required_sum: int) -> bool:\n \"\"\"\n >>> is_sum_subset([2, 4, 6, 8], 5)\n False\n >>> is_sum_subset([2, 4, 6, 8], 14)\n True\n \"\"\"\n # a subset value says 1 if that subset sum can be formed else 0\n # initially no subsets can be formed hence False/0\n arr_len = len(arr)\n subset = [[False] * (required_sum + 1) for _ in range(arr_len + 1)]\n\n # for each arr value, a sum of zero(0) can be formed by not taking any element\n # hence True/1\n for i in range(arr_len + 1):\n subset[i][0] = True\n\n # sum is not zero and set is empty then false\n for i in range(1, required_sum + 1):\n subset[0][i] = False\n\n for i in range(1, arr_len + 1):\n for j in range(1, required_sum + 1):\n if arr[i - 1] > j:\n subset[i][j] = subset[i - 1][j]\n if arr[i - 1] < j:\n subset[i][j] = subset[i - 1][j] or subset[i - 1][j - arr[i - 1]]\n\n return subset[arr_len][required_sum]\n"}, "sha256": "b66fd32c2d4912cd6d007051dac428328b4e13342f6d049e50f124df2f6f104e"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "is_sum_subset:1", "got": "False\n", "source": "is_sum_subset([2, 4, 6, 8], 14)\n", "truncated": false, "want": "True\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "comparison_boundary", "seed": 7, "span": {"col_offset": 26, "end_byte": 868, "lineno": 26, "node": "Compare", "node_col_offset": 15, "node_end_col_offset": 30, "node_end_lineno": 26, "node_lineno": 26, "op_index": 0, "original_text": "<=", "replacement_text": "<", "start_byte": 866}}, "public_tests": {"examples": [{"example_id": "is_sum_subset:0", "source": "is_sum_subset([2, 4, 6, 8], 5)\n", "want": "False\n"}, {"example_id": "is_sum_subset:1", "source": "is_sum_subset([2, 4, 6, 8], 14)\n", "want": "True\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-a26d6d8b61519d88", "tree_sha256": "d0c89f241da7c4644d5db2c26a6ae923c08ef848110942ba3a2f8fcdb0244f04", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:dynamic_programming/sum_of_subset.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "from math import log2\n\n\ndef binary_count_trailing_zeros(a: int) -> int:\n \"\"\"\n Take in 1 integer, return a number that is\n the number of trailing zeros in binary representation of that number.\n\n >>> binary_count_trailing_zeros(25)\n 0\n >>> binary_count_trailing_zeros(36)\n 2\n >>> binary_count_trailing_zeros(16)\n 4\n >>> binary_count_trailing_zeros(58)\n 1\n >>> binary_count_trailing_zeros(4294967296)\n 32\n >>> binary_count_trailing_zeros(0)\n 0\n >>> binary_count_trailing_zeros(-10)\n Traceback (most recent call last):\n ...\n ValueError: Input value must be a positive integer\n >>> binary_count_trailing_zeros(0.8)\n Traceback (most recent call last):\n ...\n TypeError: Input value must be a 'int' type\n >>> binary_count_trailing_zeros(\"0\")\n Traceback (most recent call last):\n ...\n TypeError: '<' not supported between instances of 'str' and 'int'\n \"\"\"\n if a < 0:\n raise ValueError(\"Input value must be a positive integer\")\n elif isinstance(a, float):\n raise TypeError(\"Input value must be a 'int' type\")\n return 0 if (a == 0) else int(log2(a & -a))\n"}, "sha256": "63ced0d798f166667ac192c0e1cc4fb5ba91fe5f5fba53702565095a5f38b9ff"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "63ced0d798f166667ac192c0e1cc4fb5ba91fe5f5fba53702565095a5f38b9ff", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "46c4ea45e019b5ad9a4c47a10d5e565f17988247479756475926d103f52d6bf5", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00138"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00138", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "from math import log2\n\n\ndef binary_count_trailing_zeros(a: int) -> int:\n \"\"\"\n Take in 1 integer, return a number that is\n the number of trailing zeros in binary representation of that number.\n\n >>> binary_count_trailing_zeros(25)\n 0\n >>> binary_count_trailing_zeros(36)\n 2\n >>> binary_count_trailing_zeros(16)\n 4\n >>> binary_count_trailing_zeros(58)\n 1\n >>> binary_count_trailing_zeros(4294967296)\n 32\n >>> binary_count_trailing_zeros(0)\n 0\n >>> binary_count_trailing_zeros(-10)\n Traceback (most recent call last):\n ...\n ValueError: Input value must be a positive integer\n >>> binary_count_trailing_zeros(0.8)\n Traceback (most recent call last):\n ...\n TypeError: Input value must be a 'int' type\n >>> binary_count_trailing_zeros(\"0\")\n Traceback (most recent call last):\n ...\n TypeError: '<' not supported between instances of 'str' and 'int'\n \"\"\"\n if a < 0:\n raise ValueError(\"Input value must be a positive integer\")\n elif isinstance(a, float):\n raise TypeError(\"Input value must be a 'int' type\")\n return (0 if (a == 0) else int(log2(a & -a))) - 1\n"}, "sha256": "1d23f29292279bd16288d6e78c5362c9e8a26c16099c866832ecd69f905c477d"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "binary_count_trailing_zeros:0", "got": "-1\n", "source": "binary_count_trailing_zeros(25)\n", "truncated": false, "want": "0\n"}, {"example_id": "binary_count_trailing_zeros:1", "got": "1\n", "source": "binary_count_trailing_zeros(36)\n", "truncated": false, "want": "2\n"}, {"example_id": "binary_count_trailing_zeros:2", "got": "3\n", "source": "binary_count_trailing_zeros(16)\n", "truncated": false, "want": "4\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 1162, "lineno": 38, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 47, "node_end_lineno": 38, "node_lineno": 38, "op_index": 0, "original_text": "0 if (a == 0) else int(log2(a & -a))", "replacement_text": "(0 if (a == 0) else int(log2(a & -a))) - 1", "start_byte": 1126}}, "public_tests": {"examples": [{"example_id": "binary_count_trailing_zeros:0", "source": "binary_count_trailing_zeros(25)\n", "want": "0\n"}, {"example_id": "binary_count_trailing_zeros:1", "source": "binary_count_trailing_zeros(36)\n", "want": "2\n"}, {"example_id": "binary_count_trailing_zeros:2", "source": "binary_count_trailing_zeros(16)\n", "want": "4\n"}, {"example_id": "binary_count_trailing_zeros:3", "source": "binary_count_trailing_zeros(58)\n", "want": "1\n"}, {"example_id": "binary_count_trailing_zeros:4", "source": "binary_count_trailing_zeros(4294967296)\n", "want": "32\n"}, {"example_id": "binary_count_trailing_zeros:5", "source": "binary_count_trailing_zeros(0)\n", "want": "0\n"}, {"example_id": "binary_count_trailing_zeros:6", "source": "binary_count_trailing_zeros(-10)\n", "want": "Traceback (most recent call last):\n ...\nValueError: Input value must be a positive integer\n"}, {"example_id": "binary_count_trailing_zeros:7", "source": "binary_count_trailing_zeros(0.8)\n", "want": "Traceback (most recent call last):\n ...\nTypeError: Input value must be a 'int' type\n"}, {"example_id": "binary_count_trailing_zeros:8", "source": "binary_count_trailing_zeros(\"0\")\n", "want": "Traceback (most recent call last):\n ...\nTypeError: '<' not supported between instances of 'str' and 'int'\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-aae4be0f0fe76bd1", "tree_sha256": "63ced0d798f166667ac192c0e1cc4fb5ba91fe5f5fba53702565095a5f38b9ff", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:bit_manipulation/binary_count_trailing_zeros.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "from __future__ import annotations\n\n\ndef median(nums: list) -> int | float:\n \"\"\"\n Find median of a list of numbers.\n Wiki: https://en.wikipedia.org/wiki/Median\n\n >>> median([0])\n 0\n >>> median([4, 1, 3, 2])\n 2.5\n >>> median([2, 70, 6, 50, 20, 8, 4])\n 8\n\n Args:\n nums: List of nums\n\n Returns:\n Median.\n \"\"\"\n # The sorted function returns list[SupportsRichComparisonT@sorted]\n # which does not support `+`\n sorted_list: list[int] = sorted(nums)\n length = len(sorted_list)\n mid_index = length >> 1\n return (\n (sorted_list[mid_index] + sorted_list[mid_index - 1]) / 2\n if length % 2 == 0\n else sorted_list[mid_index]\n )\n"}, "sha256": "a4134519b4951bdefe24eb39869ee4a7767cb37ffa01c0bedb56f5c5ad5aa22f"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "a4134519b4951bdefe24eb39869ee4a7767cb37ffa01c0bedb56f5c5ad5aa22f", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "ff579e32ad928fa3732335c391c0f97828a222ad79af1d346c0e4e6b54777bcc", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00139"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00139", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 14, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "from __future__ import annotations\n\n\ndef median(nums: list) -> int | float:\n \"\"\"\n Find median of a list of numbers.\n Wiki: https://en.wikipedia.org/wiki/Median\n\n >>> median([0])\n 0\n >>> median([4, 1, 3, 2])\n 2.5\n >>> median([2, 70, 6, 50, 20, 8, 4])\n 8\n\n Args:\n nums: List of nums\n\n Returns:\n Median.\n \"\"\"\n # The sorted function returns list[SupportsRichComparisonT@sorted]\n # which does not support `+`\n sorted_list: list[int] = sorted(nums)\n length = len(sorted_list)\n mid_index = length >> 1\n return (\n (sorted_list[mid_index] + sorted_list[mid_index - 1]) / 2\n if length % 2 == 1\n else sorted_list[mid_index]\n )\n"}, "sha256": "70fa4f80cc11df5e72d121b42ccdfb2b7432a96711ba81efb4dc9c8a7b1f9119"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "median:0", "got": "0.0\n", "source": "median([0])\n", "truncated": false, "want": "0\n"}, {"example_id": "median:1", "got": "3\n", "source": "median([4, 1, 3, 2])\n", "truncated": false, "want": "2.5\n"}, {"example_id": "median:2", "got": "7.0\n", "source": "median([2, 70, 6, 50, 20, 8, 4])\n", "truncated": false, "want": "8\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "off_by_one", "seed": 7, "span": {"col_offset": 25, "end_byte": 665, "lineno": 29, "node": "Constant", "node_col_offset": 25, "node_end_col_offset": 26, "node_end_lineno": 29, "node_lineno": 29, "op_index": 0, "original_text": "0", "replacement_text": "1", "start_byte": 664}}, "public_tests": {"examples": [{"example_id": "median:0", "source": "median([0])\n", "want": "0\n"}, {"example_id": "median:1", "source": "median([4, 1, 3, 2])\n", "want": "2.5\n"}, {"example_id": "median:2", "source": "median([2, 70, 6, 50, 20, 8, 4])\n", "want": "8\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-cb3326ea15027b87", "tree_sha256": "a4134519b4951bdefe24eb39869ee4a7767cb37ffa01c0bedb56f5c5ad5aa22f", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/average_median.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "from __future__ import annotations\n\n\ndef min_steps_to_one(number: int) -> int:\n \"\"\"\n Minimum steps to 1 implemented using tabulation.\n >>> min_steps_to_one(10)\n 3\n >>> min_steps_to_one(15)\n 4\n >>> min_steps_to_one(6)\n 2\n\n :param number:\n :return int:\n \"\"\"\n\n if number <= 0:\n msg = f\"n must be greater than 0. Got n = {number}\"\n raise ValueError(msg)\n\n table = [number + 1] * (number + 1)\n\n # starting position\n table[1] = 0\n for i in range(1, number):\n table[i + 1] = min(table[i + 1], table[i] + 1)\n # check if out of bounds\n if i * 2 <= number:\n table[i * 2] = min(table[i * 2], table[i] + 1)\n # check if out of bounds\n if i * 3 <= number:\n table[i * 3] = min(table[i * 3], table[i] + 1)\n return table[number]\n"}, "sha256": "8f7dc7f0e47aba4fd16ee6b30635fbe6e5be44561c293a6506fa4b8e6831184f"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "8f7dc7f0e47aba4fd16ee6b30635fbe6e5be44561c293a6506fa4b8e6831184f", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "c0b97f063e6f570b5254c6ac7ee6002b79f3c4685502e282b841b77edd4327fd", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00142"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00142", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 15, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "from __future__ import annotations\n\n\ndef min_steps_to_one(number: int) -> int:\n \"\"\"\n Minimum steps to 1 implemented using tabulation.\n >>> min_steps_to_one(10)\n 3\n >>> min_steps_to_one(15)\n 4\n >>> min_steps_to_one(6)\n 2\n\n :param number:\n :return int:\n \"\"\"\n\n if number <= 0:\n msg = f\"n must be greater than 0. Got n = {number}\"\n raise ValueError(msg)\n\n table = [number + 1] * (number + 1)\n\n # starting position\n table[1] = 0\n for i in range(1, number):\n table[i + 1] = min(table[i - 1], table[i] + 1)\n # check if out of bounds\n if i * 2 <= number:\n table[i * 2] = min(table[i * 2], table[i] + 1)\n # check if out of bounds\n if i * 3 <= number:\n table[i * 3] = min(table[i * 3], table[i] + 1)\n return table[number]\n"}, "sha256": "66a449c832c8c81dce9405a275fc35dfe2dfeb4138944b988e88c49379eeadcb"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "min_steps_to_one:0", "got": "1\n", "source": "min_steps_to_one(10)\n", "truncated": false, "want": "3\n"}, {"example_id": "min_steps_to_one:1", "got": "0\n", "source": "min_steps_to_one(15)\n", "truncated": false, "want": "4\n"}, {"example_id": "min_steps_to_one:2", "got": "1\n", "source": "min_steps_to_one(6)\n", "truncated": false, "want": "2\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 35, "end_byte": 550, "lineno": 27, "node": "BinOp", "node_col_offset": 33, "node_end_col_offset": 38, "node_end_lineno": 27, "node_lineno": 27, "op_index": 0, "original_text": "+", "replacement_text": "-", "start_byte": 549}}, "public_tests": {"examples": [{"example_id": "min_steps_to_one:0", "source": "min_steps_to_one(10)\n", "want": "3\n"}, {"example_id": "min_steps_to_one:1", "source": "min_steps_to_one(15)\n", "want": "4\n"}, {"example_id": "min_steps_to_one:2", "source": "min_steps_to_one(6)\n", "want": "2\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-03c5bb9898030c3e", "tree_sha256": "8f7dc7f0e47aba4fd16ee6b30635fbe6e5be44561c293a6506fa4b8e6831184f", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:dynamic_programming/minimum_steps_to_one.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def decimal_to_negative_base_2(num: int) -> int:\n \"\"\"\n This function returns the number negative base 2\n of the decimal number of the input data.\n\n Args:\n int: The decimal number to convert.\n\n Returns:\n int: The negative base 2 number.\n\n Examples:\n >>> decimal_to_negative_base_2(0)\n 0\n >>> decimal_to_negative_base_2(-19)\n 111101\n >>> decimal_to_negative_base_2(4)\n 100\n >>> decimal_to_negative_base_2(7)\n 11011\n \"\"\"\n if num == 0:\n return 0\n ans = \"\"\n while num != 0:\n num, rem = divmod(num, -2)\n if rem < 0:\n rem += 2\n num += 1\n ans = str(rem) + ans\n return int(ans)\n"}, "sha256": "34f3860c63da8675a104dd5f4b5ed941cf7c9fa33f066e0b881a822527f10296"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "34f3860c63da8675a104dd5f4b5ed941cf7c9fa33f066e0b881a822527f10296", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "d0a03080ca846c51ef3a11ea60e8c22d294822724704ab32b3a206c4186e01af", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00143"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00143", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def decimal_to_negative_base_2(num: int) -> int:\n \"\"\"\n This function returns the number negative base 2\n of the decimal number of the input data.\n\n Args:\n int: The decimal number to convert.\n\n Returns:\n int: The negative base 2 number.\n\n Examples:\n >>> decimal_to_negative_base_2(0)\n 0\n >>> decimal_to_negative_base_2(-19)\n 111101\n >>> decimal_to_negative_base_2(4)\n 100\n >>> decimal_to_negative_base_2(7)\n 11011\n \"\"\"\n if num == 0:\n return 0\n ans = \"\"\n while num != 1:\n num, rem = divmod(num, -2)\n if rem < 0:\n rem += 2\n num += 1\n ans = str(rem) + ans\n return int(ans)\n"}, "sha256": "8693b4d67270fce26757a54ed3c4ca86f154b5064c00b73c863251cc98b0cf03"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "decimal_to_negative_base_2:1", "got": "11101\n", "source": "decimal_to_negative_base_2(-19)\n", "truncated": false, "want": "111101\n"}, {"example_id": "decimal_to_negative_base_2:2", "got": "0\n", "source": "decimal_to_negative_base_2(4)\n", "truncated": false, "want": "100\n"}, {"example_id": "decimal_to_negative_base_2:3", "got": "1011\n", "source": "decimal_to_negative_base_2(7)\n", "truncated": false, "want": "11011\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "off_by_one", "seed": 7, "span": {"col_offset": 17, "end_byte": 578, "lineno": 25, "node": "Constant", "node_col_offset": 17, "node_end_col_offset": 18, "node_end_lineno": 25, "node_lineno": 25, "op_index": 0, "original_text": "0", "replacement_text": "1", "start_byte": 577}}, "public_tests": {"examples": [{"example_id": "decimal_to_negative_base_2:0", "source": "decimal_to_negative_base_2(0)\n", "want": "0\n"}, {"example_id": "decimal_to_negative_base_2:1", "source": "decimal_to_negative_base_2(-19)\n", "want": "111101\n"}, {"example_id": "decimal_to_negative_base_2:2", "source": "decimal_to_negative_base_2(4)\n", "want": "100\n"}, {"example_id": "decimal_to_negative_base_2:3", "source": "decimal_to_negative_base_2(7)\n", "want": "11011\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-483bcdc4ee29d0ea", "tree_sha256": "34f3860c63da8675a104dd5f4b5ed941cf7c9fa33f066e0b881a822527f10296", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/base_neg2_conversion.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def is_ip_v4_address_valid(ip: str) -> bool:\n \"\"\"\n print \"Valid IP address\" If IP is valid.\n or\n print \"Invalid IP address\" If IP is invalid.\n\n >>> is_ip_v4_address_valid(\"192.168.0.23\")\n True\n\n >>> is_ip_v4_address_valid(\"192.256.15.8\")\n False\n\n >>> is_ip_v4_address_valid(\"172.100.0.8\")\n True\n\n >>> is_ip_v4_address_valid(\"255.256.0.256\")\n False\n\n >>> is_ip_v4_address_valid(\"1.2.33333333.4\")\n False\n\n >>> is_ip_v4_address_valid(\"1.2.-3.4\")\n False\n\n >>> is_ip_v4_address_valid(\"1.2.3\")\n False\n\n >>> is_ip_v4_address_valid(\"1.2.3.4.5\")\n False\n\n >>> is_ip_v4_address_valid(\"1.2.A.4\")\n False\n\n >>> is_ip_v4_address_valid(\"0.0.0.0\")\n True\n\n >>> is_ip_v4_address_valid(\"1.2.3.\")\n False\n\n >>> is_ip_v4_address_valid(\"1.2.3.05\")\n False\n \"\"\"\n octets = ip.split(\".\")\n if len(octets) != 4:\n return False\n\n for octet in octets:\n if not octet.isdigit():\n return False\n\n number = int(octet)\n if len(str(number)) != len(octet):\n return False\n\n if not 0 <= number <= 255:\n return False\n\n return True\n"}, "sha256": "fb8e89711b766b4feec1dcb5813e8a6cc863abc08458486fa392adbdbc3eb808"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "fb8e89711b766b4feec1dcb5813e8a6cc863abc08458486fa392adbdbc3eb808", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "bf4edeca8cf40d7dbf37aca672458796ec2b22b490e9c15063d598698d2bcf6b", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00146"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00146", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def is_ip_v4_address_valid(ip: str) -> bool:\n \"\"\"\n print \"Valid IP address\" If IP is valid.\n or\n print \"Invalid IP address\" If IP is invalid.\n\n >>> is_ip_v4_address_valid(\"192.168.0.23\")\n True\n\n >>> is_ip_v4_address_valid(\"192.256.15.8\")\n False\n\n >>> is_ip_v4_address_valid(\"172.100.0.8\")\n True\n\n >>> is_ip_v4_address_valid(\"255.256.0.256\")\n False\n\n >>> is_ip_v4_address_valid(\"1.2.33333333.4\")\n False\n\n >>> is_ip_v4_address_valid(\"1.2.-3.4\")\n False\n\n >>> is_ip_v4_address_valid(\"1.2.3\")\n False\n\n >>> is_ip_v4_address_valid(\"1.2.3.4.5\")\n False\n\n >>> is_ip_v4_address_valid(\"1.2.A.4\")\n False\n\n >>> is_ip_v4_address_valid(\"0.0.0.0\")\n True\n\n >>> is_ip_v4_address_valid(\"1.2.3.\")\n False\n\n >>> is_ip_v4_address_valid(\"1.2.3.05\")\n False\n \"\"\"\n octets = ip.split(\".\")\n if len(octets) != 4:\n return False\n\n for octet in octets:\n if not octet.isdigit():\n return False\n\n number = int(octet)\n if len(str(number)) != len(octet):\n return False\n\n if 0 <= number <= 255:\n return False\n\n return True\n"}, "sha256": "89fd45312318e5c45b4c931f5faa7114896aea1725f5bdc4cbf1bab9e10bd18c"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "is_ip_v4_address_valid:0", "got": "False\n", "source": "is_ip_v4_address_valid(\"192.168.0.23\")\n", "truncated": false, "want": "True\n"}, {"example_id": "is_ip_v4_address_valid:2", "got": "False\n", "source": "is_ip_v4_address_valid(\"172.100.0.8\")\n", "truncated": false, "want": "True\n"}, {"example_id": "is_ip_v4_address_valid:9", "got": "False\n", "source": "is_ip_v4_address_valid(\"0.0.0.0\")\n", "truncated": false, "want": "True\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "boolean_condition", "seed": 7, "span": {"col_offset": 11, "end_byte": 1092, "lineno": 55, "node": "UnaryOp", "node_col_offset": 11, "node_end_col_offset": 33, "node_end_lineno": 55, "node_lineno": 55, "op_index": 0, "original_text": "not ", "replacement_text": "", "start_byte": 1088}}, "public_tests": {"examples": [{"example_id": "is_ip_v4_address_valid:0", "source": "is_ip_v4_address_valid(\"192.168.0.23\")\n", "want": "True\n"}, {"example_id": "is_ip_v4_address_valid:1", "source": "is_ip_v4_address_valid(\"192.256.15.8\")\n", "want": "False\n"}, {"example_id": "is_ip_v4_address_valid:2", "source": "is_ip_v4_address_valid(\"172.100.0.8\")\n", "want": "True\n"}, {"example_id": "is_ip_v4_address_valid:3", "source": "is_ip_v4_address_valid(\"255.256.0.256\")\n", "want": "False\n"}, {"example_id": "is_ip_v4_address_valid:4", "source": "is_ip_v4_address_valid(\"1.2.33333333.4\")\n", "want": "False\n"}, {"example_id": "is_ip_v4_address_valid:5", "source": "is_ip_v4_address_valid(\"1.2.-3.4\")\n", "want": "False\n"}, {"example_id": "is_ip_v4_address_valid:6", "source": "is_ip_v4_address_valid(\"1.2.3\")\n", "want": "False\n"}, {"example_id": "is_ip_v4_address_valid:7", "source": "is_ip_v4_address_valid(\"1.2.3.4.5\")\n", "want": "False\n"}, {"example_id": "is_ip_v4_address_valid:8", "source": "is_ip_v4_address_valid(\"1.2.A.4\")\n", "want": "False\n"}, {"example_id": "is_ip_v4_address_valid:9", "source": "is_ip_v4_address_valid(\"0.0.0.0\")\n", "want": "True\n"}, {"example_id": "is_ip_v4_address_valid:10", "source": "is_ip_v4_address_valid(\"1.2.3.\")\n", "want": "False\n"}, {"example_id": "is_ip_v4_address_valid:11", "source": "is_ip_v4_address_valid(\"1.2.3.05\")\n", "want": "False\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-da10533e56215ca5", "tree_sha256": "fb8e89711b766b4feec1dcb5813e8a6cc863abc08458486fa392adbdbc3eb808", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/is_ip_v4_address_valid.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def longest_common_subsequence(x: str, y: str):\n \"\"\"\n Finds the longest common subsequence between two strings. Also returns the\n The subsequence found\n\n Parameters\n ----------\n\n x: str, one of the strings\n y: str, the other string\n\n Returns\n -------\n L[m][n]: int, the length of the longest subsequence. Also equal to len(seq)\n Seq: str, the subsequence found\n\n >>> longest_common_subsequence(\"programming\", \"gaming\")\n (6, 'gaming')\n >>> longest_common_subsequence(\"physics\", \"smartphone\")\n (2, 'ph')\n >>> longest_common_subsequence(\"computer\", \"food\")\n (1, 'o')\n >>> longest_common_subsequence(\"\", \"abc\") # One string is empty\n (0, '')\n >>> longest_common_subsequence(\"abc\", \"\") # Other string is empty\n (0, '')\n >>> longest_common_subsequence(\"\", \"\") # Both strings are empty\n (0, '')\n >>> longest_common_subsequence(\"abc\", \"def\") # No common subsequence\n (0, '')\n >>> longest_common_subsequence(\"abc\", \"abc\") # Identical strings\n (3, 'abc')\n >>> longest_common_subsequence(\"a\", \"a\") # Single character match\n (1, 'a')\n >>> longest_common_subsequence(\"a\", \"b\") # Single character no match\n (0, '')\n >>> longest_common_subsequence(\"abcdef\", \"ace\") # Interleaved subsequence\n (3, 'ace')\n >>> longest_common_subsequence(\"ABCD\", \"ACBD\") # No repeated characters\n (3, 'ABD')\n \"\"\"\n # find the length of strings\n\n assert x is not None\n assert y is not None\n\n m = len(x)\n n = len(y)\n\n # declaring the array for storing the dp values\n dp = [[0] * (n + 1) for _ in range(m + 1)]\n\n for i in range(1, m + 1):\n for j in range(1, n + 1):\n match = 1 if x[i - 1] == y[j - 1] else 0\n\n dp[i][j] = max(dp[i - 1][j], dp[i][j - 1], dp[i - 1][j - 1] + match)\n\n seq = \"\"\n i, j = m, n\n while i > 0 and j > 0:\n match = 1 if x[i - 1] == y[j - 1] else 0\n\n if dp[i][j] == dp[i - 1][j - 1] + match:\n if match == 1:\n seq = x[i - 1] + seq\n i -= 1\n j -= 1\n elif dp[i][j] == dp[i - 1][j]:\n i -= 1\n else:\n j -= 1\n\n return dp[m][n], seq\n"}, "sha256": "b57beb30e6898f2174b9fb6ece9661384657c70995b79a47ac73992a0abcd6a3"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "b57beb30e6898f2174b9fb6ece9661384657c70995b79a47ac73992a0abcd6a3", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "a6006015e0210421753551c24f37952decaad8046be42d746c28bf7cafb4a4ba", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00148"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00148", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def longest_common_subsequence(x: str, y: str):\n \"\"\"\n Finds the longest common subsequence between two strings. Also returns the\n The subsequence found\n\n Parameters\n ----------\n\n x: str, one of the strings\n y: str, the other string\n\n Returns\n -------\n L[m][n]: int, the length of the longest subsequence. Also equal to len(seq)\n Seq: str, the subsequence found\n\n >>> longest_common_subsequence(\"programming\", \"gaming\")\n (6, 'gaming')\n >>> longest_common_subsequence(\"physics\", \"smartphone\")\n (2, 'ph')\n >>> longest_common_subsequence(\"computer\", \"food\")\n (1, 'o')\n >>> longest_common_subsequence(\"\", \"abc\") # One string is empty\n (0, '')\n >>> longest_common_subsequence(\"abc\", \"\") # Other string is empty\n (0, '')\n >>> longest_common_subsequence(\"\", \"\") # Both strings are empty\n (0, '')\n >>> longest_common_subsequence(\"abc\", \"def\") # No common subsequence\n (0, '')\n >>> longest_common_subsequence(\"abc\", \"abc\") # Identical strings\n (3, 'abc')\n >>> longest_common_subsequence(\"a\", \"a\") # Single character match\n (1, 'a')\n >>> longest_common_subsequence(\"a\", \"b\") # Single character no match\n (0, '')\n >>> longest_common_subsequence(\"abcdef\", \"ace\") # Interleaved subsequence\n (3, 'ace')\n >>> longest_common_subsequence(\"ABCD\", \"ACBD\") # No repeated characters\n (3, 'ABD')\n \"\"\"\n # find the length of strings\n\n assert x is not None\n assert y is not None\n\n m = len(x)\n n = len(y)\n\n # declaring the array for storing the dp values\n dp = [[0] * (n + 1) for _ in range(m + 1)]\n\n for i in range(1, m + 1):\n for j in range(1, n + 1):\n match = 1 if x[i - 1] == y[j - 1] else 0\n\n dp[i][j] = max(dp[i - 1][j], dp[i][j - 1], dp[i - 1][j - 1] + match)\n\n seq = \"\"\n i, j = m, n\n while i >= 0 and j > 0:\n match = 1 if x[i - 1] == y[j - 1] else 0\n\n if dp[i][j] == dp[i - 1][j - 1] + match:\n if match == 1:\n seq = x[i - 1] + seq\n i -= 1\n j -= 1\n elif dp[i][j] == dp[i - 1][j]:\n i -= 1\n else:\n j -= 1\n\n return dp[m][n], seq\n"}, "sha256": "edc5d49b73923e6f19634ed960ab6ba276bfe2258b5701cd2d20c368de9f9ec7"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "longest_common_subsequence:3", "got": "IndexError: string index out of range", "source": "longest_common_subsequence(\"\", \"abc\") # One string is empty\n", "truncated": false, "want": "(0, '')\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "comparison_boundary", "seed": 7, "span": {"col_offset": 12, "end_byte": 1853, "lineno": 61, "node": "Compare", "node_col_offset": 10, "node_end_col_offset": 15, "node_end_lineno": 61, "node_lineno": 61, "op_index": 0, "original_text": ">", "replacement_text": ">=", "start_byte": 1852}}, "public_tests": {"examples": [{"example_id": "longest_common_subsequence:0", "source": "longest_common_subsequence(\"programming\", \"gaming\")\n", "want": "(6, 'gaming')\n"}, {"example_id": "longest_common_subsequence:1", "source": "longest_common_subsequence(\"physics\", \"smartphone\")\n", "want": "(2, 'ph')\n"}, {"example_id": "longest_common_subsequence:2", "source": "longest_common_subsequence(\"computer\", \"food\")\n", "want": "(1, 'o')\n"}, {"example_id": "longest_common_subsequence:3", "source": "longest_common_subsequence(\"\", \"abc\") # One string is empty\n", "want": "(0, '')\n"}, {"example_id": "longest_common_subsequence:4", "source": "longest_common_subsequence(\"abc\", \"\") # Other string is empty\n", "want": "(0, '')\n"}, {"example_id": "longest_common_subsequence:5", "source": "longest_common_subsequence(\"\", \"\") # Both strings are empty\n", "want": "(0, '')\n"}, {"example_id": "longest_common_subsequence:6", "source": "longest_common_subsequence(\"abc\", \"def\") # No common subsequence\n", "want": "(0, '')\n"}, {"example_id": "longest_common_subsequence:7", "source": "longest_common_subsequence(\"abc\", \"abc\") # Identical strings\n", "want": "(3, 'abc')\n"}, {"example_id": "longest_common_subsequence:8", "source": "longest_common_subsequence(\"a\", \"a\") # Single character match\n", "want": "(1, 'a')\n"}, {"example_id": "longest_common_subsequence:9", "source": "longest_common_subsequence(\"a\", \"b\") # Single character no match\n", "want": "(0, '')\n"}, {"example_id": "longest_common_subsequence:10", "source": "longest_common_subsequence(\"abcdef\", \"ace\") # Interleaved subsequence\n", "want": "(3, 'ace')\n"}, {"example_id": "longest_common_subsequence:11", "source": "longest_common_subsequence(\"ABCD\", \"ACBD\") # No repeated characters\n", "want": "(3, 'ABD')\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-2325d19d958de463", "tree_sha256": "b57beb30e6898f2174b9fb6ece9661384657c70995b79a47ac73992a0abcd6a3", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:dynamic_programming/longest_common_subsequence.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def bitwise_addition_recursive(number: int, other_number: int) -> int:\n \"\"\"\n >>> bitwise_addition_recursive(4, 5)\n 9\n >>> bitwise_addition_recursive(8, 9)\n 17\n >>> bitwise_addition_recursive(0, 4)\n 4\n >>> bitwise_addition_recursive(4.5, 9)\n Traceback (most recent call last):\n ...\n TypeError: Both arguments MUST be integers!\n >>> bitwise_addition_recursive('4', 9)\n Traceback (most recent call last):\n ...\n TypeError: Both arguments MUST be integers!\n >>> bitwise_addition_recursive('4.5', 9)\n Traceback (most recent call last):\n ...\n TypeError: Both arguments MUST be integers!\n >>> bitwise_addition_recursive(-1, 9)\n Traceback (most recent call last):\n ...\n ValueError: Both arguments MUST be non-negative!\n >>> bitwise_addition_recursive(1, -9)\n Traceback (most recent call last):\n ...\n ValueError: Both arguments MUST be non-negative!\n \"\"\"\n\n if not isinstance(number, int) or not isinstance(other_number, int):\n raise TypeError(\"Both arguments MUST be integers!\")\n\n if number < 0 or other_number < 0:\n raise ValueError(\"Both arguments MUST be non-negative!\")\n\n bitwise_sum = number ^ other_number\n carry = number & other_number\n\n if carry == 0:\n return bitwise_sum\n\n return bitwise_addition_recursive(bitwise_sum, carry << 1)\n"}, "sha256": "8eb7e75a87473accb1f793b97d8b0005f4a3f1e34e5e27d45a8969229dc38f22"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "8eb7e75a87473accb1f793b97d8b0005f4a3f1e34e5e27d45a8969229dc38f22", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "c3ecbb5aee6997f968218062a0c89b7bf59536053364b7d5c219c5a7c0d7a1dd", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00149"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00149", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def bitwise_addition_recursive(number: int, other_number: int) -> int:\n \"\"\"\n >>> bitwise_addition_recursive(4, 5)\n 9\n >>> bitwise_addition_recursive(8, 9)\n 17\n >>> bitwise_addition_recursive(0, 4)\n 4\n >>> bitwise_addition_recursive(4.5, 9)\n Traceback (most recent call last):\n ...\n TypeError: Both arguments MUST be integers!\n >>> bitwise_addition_recursive('4', 9)\n Traceback (most recent call last):\n ...\n TypeError: Both arguments MUST be integers!\n >>> bitwise_addition_recursive('4.5', 9)\n Traceback (most recent call last):\n ...\n TypeError: Both arguments MUST be integers!\n >>> bitwise_addition_recursive(-1, 9)\n Traceback (most recent call last):\n ...\n ValueError: Both arguments MUST be non-negative!\n >>> bitwise_addition_recursive(1, -9)\n Traceback (most recent call last):\n ...\n ValueError: Both arguments MUST be non-negative!\n \"\"\"\n\n if isinstance(number, int) or not isinstance(other_number, int):\n raise TypeError(\"Both arguments MUST be integers!\")\n\n if number < 0 or other_number < 0:\n raise ValueError(\"Both arguments MUST be non-negative!\")\n\n bitwise_sum = number ^ other_number\n carry = number & other_number\n\n if carry == 0:\n return bitwise_sum\n\n return bitwise_addition_recursive(bitwise_sum, carry << 1)\n"}, "sha256": "ecf996b61aa9661249a95459e87eb5a8ff6bd211bdc64daaf7fbda0d54dfec3e"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "bitwise_addition_recursive:0", "got": "TypeError: Both arguments MUST be integers!", "source": "bitwise_addition_recursive(4, 5)\n", "truncated": false, "want": "9\n"}, {"example_id": "bitwise_addition_recursive:1", "got": "TypeError: Both arguments MUST be integers!", "source": "bitwise_addition_recursive(8, 9)\n", "truncated": false, "want": "17\n"}, {"example_id": "bitwise_addition_recursive:2", "got": "TypeError: Both arguments MUST be integers!", "source": "bitwise_addition_recursive(0, 4)\n", "truncated": false, "want": "4\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "boolean_condition", "seed": 7, "span": {"col_offset": 7, "end_byte": 961, "lineno": 31, "node": "UnaryOp", "node_col_offset": 7, "node_end_col_offset": 34, "node_end_lineno": 31, "node_lineno": 31, "op_index": 0, "original_text": "not ", "replacement_text": "", "start_byte": 957}}, "public_tests": {"examples": [{"example_id": "bitwise_addition_recursive:0", "source": "bitwise_addition_recursive(4, 5)\n", "want": "9\n"}, {"example_id": "bitwise_addition_recursive:1", "source": "bitwise_addition_recursive(8, 9)\n", "want": "17\n"}, {"example_id": "bitwise_addition_recursive:2", "source": "bitwise_addition_recursive(0, 4)\n", "want": "4\n"}, {"example_id": "bitwise_addition_recursive:3", "source": "bitwise_addition_recursive(4.5, 9)\n", "want": "Traceback (most recent call last):\n ...\nTypeError: Both arguments MUST be integers!\n"}, {"example_id": "bitwise_addition_recursive:4", "source": "bitwise_addition_recursive('4', 9)\n", "want": "Traceback (most recent call last):\n ...\nTypeError: Both arguments MUST be integers!\n"}, {"example_id": "bitwise_addition_recursive:5", "source": "bitwise_addition_recursive('4.5', 9)\n", "want": "Traceback (most recent call last):\n ...\nTypeError: Both arguments MUST be integers!\n"}, {"example_id": "bitwise_addition_recursive:6", "source": "bitwise_addition_recursive(-1, 9)\n", "want": "Traceback (most recent call last):\n ...\nValueError: Both arguments MUST be non-negative!\n"}, {"example_id": "bitwise_addition_recursive:7", "source": "bitwise_addition_recursive(1, -9)\n", "want": "Traceback (most recent call last):\n ...\nValueError: Both arguments MUST be non-negative!\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-db03a6eedc40c569", "tree_sha256": "8eb7e75a87473accb1f793b97d8b0005f4a3f1e34e5e27d45a8969229dc38f22", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:bit_manipulation/bitwise_addition_recursive.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def factorial(number: int) -> int:\n \"\"\"\n Calculate the factorial of specified number (n!).\n\n >>> import math\n >>> all(factorial(i) == math.factorial(i) for i in range(20))\n True\n >>> factorial(0.1)\n Traceback (most recent call last):\n ...\n ValueError: factorial() only accepts integral values\n >>> factorial(-1)\n Traceback (most recent call last):\n ...\n ValueError: factorial() not defined for negative values\n >>> factorial(1)\n 1\n >>> factorial(6)\n 720\n >>> factorial(0)\n 1\n \"\"\"\n if number != int(number):\n raise ValueError(\"factorial() only accepts integral values\")\n if number < 0:\n raise ValueError(\"factorial() not defined for negative values\")\n value = 1\n for i in range(1, number + 1):\n value *= i\n return value\n"}, "sha256": "a82829b49c3fea28a514363892e0a2754119afc9d6b34f18a9059d51aeaa66c3"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "a82829b49c3fea28a514363892e0a2754119afc9d6b34f18a9059d51aeaa66c3", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "25a9adbdc922ae0889c9e46c8692164ce55dd36c99074a91c4cc36996c8a5365", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00150"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00150", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 15, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def factorial(number: int) -> int:\n \"\"\"\n Calculate the factorial of specified number (n!).\n\n >>> import math\n >>> all(factorial(i) == math.factorial(i) for i in range(20))\n True\n >>> factorial(0.1)\n Traceback (most recent call last):\n ...\n ValueError: factorial() only accepts integral values\n >>> factorial(-1)\n Traceback (most recent call last):\n ...\n ValueError: factorial() not defined for negative values\n >>> factorial(1)\n 1\n >>> factorial(6)\n 720\n >>> factorial(0)\n 1\n \"\"\"\n if number != int(number):\n raise ValueError(\"factorial() only accepts integral values\")\n if number <= 0:\n raise ValueError(\"factorial() not defined for negative values\")\n value = 1\n for i in range(1, number + 1):\n value *= i\n return value\n"}, "sha256": "de8a44bda3e6d481ab01722d93d610abdc7cdcb89f509715bb3783727ccaee05"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "factorial:1", "got": "ValueError: factorial() not defined for negative values", "source": "all(factorial(i) == math.factorial(i) for i in range(20))\n", "truncated": false, "want": "True\n"}, {"example_id": "factorial:6", "got": "ValueError: factorial() not defined for negative values", "source": "factorial(0)\n", "truncated": false, "want": "1\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "comparison_boundary", "seed": 7, "span": {"col_offset": 14, "end_byte": 662, "lineno": 25, "node": "Compare", "node_col_offset": 7, "node_end_col_offset": 17, "node_end_lineno": 25, "node_lineno": 25, "op_index": 0, "original_text": "<", "replacement_text": "<=", "start_byte": 661}}, "public_tests": {"examples": [{"example_id": "factorial:0", "source": "import math\n", "want": ""}, {"example_id": "factorial:1", "source": "all(factorial(i) == math.factorial(i) for i in range(20))\n", "want": "True\n"}, {"example_id": "factorial:2", "source": "factorial(0.1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: factorial() only accepts integral values\n"}, {"example_id": "factorial:3", "source": "factorial(-1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: factorial() not defined for negative values\n"}, {"example_id": "factorial:4", "source": "factorial(1)\n", "want": "1\n"}, {"example_id": "factorial:5", "source": "factorial(6)\n", "want": "720\n"}, {"example_id": "factorial:6", "source": "factorial(0)\n", "want": "1\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-5978d4171e6ba63e", "tree_sha256": "a82829b49c3fea28a514363892e0a2754119afc9d6b34f18a9059d51aeaa66c3", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/factorial.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def double_factorial_iterative(num: int) -> int:\n \"\"\"\n Compute double factorial using iterative method.\n\n To learn about the theory behind this algorithm:\n https://en.wikipedia.org/wiki/Double_factorial\n\n >>> from math import prod\n >>> all(double_factorial_iterative(i) == prod(range(i, 0, -2)) for i in range(20))\n True\n >>> double_factorial_iterative(0.1)\n Traceback (most recent call last):\n ...\n ValueError: double_factorial_iterative() only accepts integral values\n >>> double_factorial_iterative(-1)\n Traceback (most recent call last):\n ...\n ValueError: double_factorial_iterative() not defined for negative values\n \"\"\"\n if not isinstance(num, int):\n raise ValueError(\"double_factorial_iterative() only accepts integral values\")\n if num < 0:\n raise ValueError(\"double_factorial_iterative() not defined for negative values\")\n value = 1\n for i in range(num, 0, -2):\n value *= i\n return value\n"}, "sha256": "1a95c2cb9681d4d1537a2fe5acef9e86bc756d3292ce947895fdd0b6e44246cb"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "1a95c2cb9681d4d1537a2fe5acef9e86bc756d3292ce947895fdd0b6e44246cb", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "e799623aaf9ca0f070cce9023f63614ce3bd28d8d971639d2854a3e3a704c75a", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00151"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00151", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 4, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def double_factorial_iterative(num: int) -> int:\n \"\"\"\n Compute double factorial using iterative method.\n\n To learn about the theory behind this algorithm:\n https://en.wikipedia.org/wiki/Double_factorial\n\n >>> from math import prod\n >>> all(double_factorial_iterative(i) == prod(range(i, 0, -2)) for i in range(20))\n True\n >>> double_factorial_iterative(0.1)\n Traceback (most recent call last):\n ...\n ValueError: double_factorial_iterative() only accepts integral values\n >>> double_factorial_iterative(-1)\n Traceback (most recent call last):\n ...\n ValueError: double_factorial_iterative() not defined for negative values\n \"\"\"\n if not isinstance(num, int):\n raise ValueError(\"double_factorial_iterative() only accepts integral values\")\n if num <= 0:\n raise ValueError(\"double_factorial_iterative() not defined for negative values\")\n value = 1\n for i in range(num, 0, -2):\n value *= i\n return value\n"}, "sha256": "26999601c362989e0e9215aabbdf468cd1c98615ff9eda8072ead1bc1420f1e9"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "double_factorial_iterative:1", "got": "ValueError: double_factorial_iterative() not defined for negative values", "source": "all(double_factorial_iterative(i) == prod(range(i, 0, -2)) for i in range(20))\n", "truncated": false, "want": "True\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "comparison_boundary", "seed": 7, "span": {"col_offset": 11, "end_byte": 813, "lineno": 22, "node": "Compare", "node_col_offset": 7, "node_end_col_offset": 14, "node_end_lineno": 22, "node_lineno": 22, "op_index": 0, "original_text": "<", "replacement_text": "<=", "start_byte": 812}}, "public_tests": {"examples": [{"example_id": "double_factorial_iterative:0", "source": "from math import prod\n", "want": ""}, {"example_id": "double_factorial_iterative:1", "source": "all(double_factorial_iterative(i) == prod(range(i, 0, -2)) for i in range(20))\n", "want": "True\n"}, {"example_id": "double_factorial_iterative:2", "source": "double_factorial_iterative(0.1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: double_factorial_iterative() only accepts integral values\n"}, {"example_id": "double_factorial_iterative:3", "source": "double_factorial_iterative(-1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: double_factorial_iterative() not defined for negative values\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-41c38d4874279fc0", "tree_sha256": "1a95c2cb9681d4d1537a2fe5acef9e86bc756d3292ce947895fdd0b6e44246cb", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/double_factorial.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def sum_of_series(first_term: int, common_diff: int, num_of_terms: int) -> float:\n \"\"\"\n Find the sum of n terms in an arithmetic progression.\n\n >>> sum_of_series(1, 1, 10)\n 55.0\n >>> sum_of_series(1, 10, 100)\n 49600.0\n \"\"\"\n total = (num_of_terms / 2) * (2 * first_term + (num_of_terms - 1) * common_diff)\n # formula for sum of series\n return total\n"}, "sha256": "5274639e3fe46c7b9d296294131476bc50d3dfde5124cfc301303c1e7ee1fe63"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "5274639e3fe46c7b9d296294131476bc50d3dfde5124cfc301303c1e7ee1fe63", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "f753562b340153efd087b1d6d9432f012cbad64a2c8e938bea9afae4a2b55b54", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00153"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00153", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def sum_of_series(first_term: int, common_diff: int, num_of_terms: int) -> float:\n \"\"\"\n Find the sum of n terms in an arithmetic progression.\n\n >>> sum_of_series(1, 1, 10)\n 55.0\n >>> sum_of_series(1, 10, 100)\n 49600.0\n \"\"\"\n total = (num_of_terms / 2) * (2 * first_term + (num_of_terms - 1) * common_diff)\n # formula for sum of series\n return total + 1\n"}, "sha256": "170441f4a0000fcb5cfba9d1c172788aca9112148ed01b4f40fa0e3366416e97"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "sum_of_series:0", "got": "56.0\n", "source": "sum_of_series(1, 1, 10)\n", "truncated": false, "want": "55.0\n"}, {"example_id": "sum_of_series:1", "got": "49601.0\n", "source": "sum_of_series(1, 10, 100)\n", "truncated": false, "want": "49600.0\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 377, "lineno": 12, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 16, "node_end_lineno": 12, "node_lineno": 12, "op_index": 0, "original_text": "total", "replacement_text": "total + 1", "start_byte": 372}}, "public_tests": {"examples": [{"example_id": "sum_of_series:0", "source": "sum_of_series(1, 1, 10)\n", "want": "55.0\n"}, {"example_id": "sum_of_series:1", "source": "sum_of_series(1, 10, 100)\n", "want": "49600.0\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-12589f23c8294445", "tree_sha256": "5274639e3fe46c7b9d296294131476bc50d3dfde5124cfc301303c1e7ee1fe63", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/sum_of_arithmetic_series.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def octal_to_binary(octal_number: str) -> str:\n \"\"\"\n Convert an Octal number to Binary.\n\n >>> octal_to_binary(\"17\")\n '001111'\n >>> octal_to_binary(\"7\")\n '111'\n >>> octal_to_binary(\"Av\")\n Traceback (most recent call last):\n ...\n ValueError: Non-octal value was passed to the function\n >>> octal_to_binary(\"@#\")\n Traceback (most recent call last):\n ...\n ValueError: Non-octal value was passed to the function\n >>> octal_to_binary(\"\")\n Traceback (most recent call last):\n ...\n ValueError: Empty string was passed to the function\n \"\"\"\n if not octal_number:\n raise ValueError(\"Empty string was passed to the function\")\n\n binary_number = \"\"\n octal_digits = \"01234567\"\n for digit in octal_number:\n if digit not in octal_digits:\n raise ValueError(\"Non-octal value was passed to the function\")\n\n binary_digit = \"\"\n value = int(digit)\n for _ in range(3):\n binary_digit = str(value % 2) + binary_digit\n value //= 2\n binary_number += binary_digit\n\n return binary_number\n"}, "sha256": "6df38b1302b901a7facaeda582fd59268709b889c15def0cf5e04e0532c9d6ae"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "6df38b1302b901a7facaeda582fd59268709b889c15def0cf5e04e0532c9d6ae", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "5bf9d7096d58922874f0e3ac0cba551b06638fd0b939c42367c00dce71035c06", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00155"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00155", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 6, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def octal_to_binary(octal_number: str) -> str:\n \"\"\"\n Convert an Octal number to Binary.\n\n >>> octal_to_binary(\"17\")\n '001111'\n >>> octal_to_binary(\"7\")\n '111'\n >>> octal_to_binary(\"Av\")\n Traceback (most recent call last):\n ...\n ValueError: Non-octal value was passed to the function\n >>> octal_to_binary(\"@#\")\n Traceback (most recent call last):\n ...\n ValueError: Non-octal value was passed to the function\n >>> octal_to_binary(\"\")\n Traceback (most recent call last):\n ...\n ValueError: Empty string was passed to the function\n \"\"\"\n if not octal_number:\n raise ValueError(\"Empty string was passed to the function\")\n\n binary_number = \"\"\n octal_digits = \"01234567\"\n for digit in octal_number:\n if digit not in octal_digits:\n raise ValueError(\"Non-octal value was passed to the function\")\n\n binary_digit = \"\"\n value = int(digit)\n for _ in range(4):\n binary_digit = str(value % 2) + binary_digit\n value //= 2\n binary_number += binary_digit\n\n return binary_number\n"}, "sha256": "3f12a72c4e27fccf04f1dcf2e26e9a7866665229845714c154084cb8e5b11f47"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "octal_to_binary:0", "got": "'00010111'\n", "source": "octal_to_binary(\"17\")\n", "truncated": false, "want": "'001111'\n"}, {"example_id": "octal_to_binary:1", "got": "'0111'\n", "source": "octal_to_binary(\"7\")\n", "truncated": false, "want": "'111'\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "off_by_one", "seed": 7, "span": {"col_offset": 23, "end_byte": 969, "lineno": 33, "node": "Constant", "node_col_offset": 23, "node_end_col_offset": 24, "node_end_lineno": 33, "node_lineno": 33, "op_index": 0, "original_text": "3", "replacement_text": "4", "start_byte": 968}}, "public_tests": {"examples": [{"example_id": "octal_to_binary:0", "source": "octal_to_binary(\"17\")\n", "want": "'001111'\n"}, {"example_id": "octal_to_binary:1", "source": "octal_to_binary(\"7\")\n", "want": "'111'\n"}, {"example_id": "octal_to_binary:2", "source": "octal_to_binary(\"Av\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: Non-octal value was passed to the function\n"}, {"example_id": "octal_to_binary:3", "source": "octal_to_binary(\"@#\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: Non-octal value was passed to the function\n"}, {"example_id": "octal_to_binary:4", "source": "octal_to_binary(\"\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: Empty string was passed to the function\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-264c9e6434108710", "tree_sha256": "6df38b1302b901a7facaeda582fd59268709b889c15def0cf5e04e0532c9d6ae", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:conversions/octal_to_binary.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def perfect_square_binary_search(n: int) -> bool:\n \"\"\"\n Check if a number is perfect square using binary search.\n Time complexity : O(Log(n))\n Space complexity: O(1)\n\n >>> perfect_square_binary_search(9)\n True\n >>> perfect_square_binary_search(16)\n True\n >>> perfect_square_binary_search(1)\n True\n >>> perfect_square_binary_search(0)\n True\n >>> perfect_square_binary_search(10)\n False\n >>> perfect_square_binary_search(-1)\n False\n >>> perfect_square_binary_search(1.1)\n False\n >>> perfect_square_binary_search(\"a\")\n Traceback (most recent call last):\n ...\n TypeError: '<=' not supported between instances of 'int' and 'str'\n >>> perfect_square_binary_search(None)\n Traceback (most recent call last):\n ...\n TypeError: '<=' not supported between instances of 'int' and 'NoneType'\n >>> perfect_square_binary_search([])\n Traceback (most recent call last):\n ...\n TypeError: '<=' not supported between instances of 'int' and 'list'\n \"\"\"\n left = 0\n right = n\n while left <= right:\n mid = (left + right) // 2\n if mid**2 == n:\n return True\n elif mid**2 > n:\n right = mid - 1\n else:\n left = mid + 1\n return False\n"}, "sha256": "fdd79d1c55e1abf785f4e12bdee3e97183e851891fcc72392250dd63e543ed57"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "fdd79d1c55e1abf785f4e12bdee3e97183e851891fcc72392250dd63e543ed57", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "abf5112481d2750a1dbd3f1c2de530af003e64b0a582c843a6e0d9fb149cb893", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00157"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00157", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def perfect_square_binary_search(n: int) -> bool:\n \"\"\"\n Check if a number is perfect square using binary search.\n Time complexity : O(Log(n))\n Space complexity: O(1)\n\n >>> perfect_square_binary_search(9)\n True\n >>> perfect_square_binary_search(16)\n True\n >>> perfect_square_binary_search(1)\n True\n >>> perfect_square_binary_search(0)\n True\n >>> perfect_square_binary_search(10)\n False\n >>> perfect_square_binary_search(-1)\n False\n >>> perfect_square_binary_search(1.1)\n False\n >>> perfect_square_binary_search(\"a\")\n Traceback (most recent call last):\n ...\n TypeError: '<=' not supported between instances of 'int' and 'str'\n >>> perfect_square_binary_search(None)\n Traceback (most recent call last):\n ...\n TypeError: '<=' not supported between instances of 'int' and 'NoneType'\n >>> perfect_square_binary_search([])\n Traceback (most recent call last):\n ...\n TypeError: '<=' not supported between instances of 'int' and 'list'\n \"\"\"\n left = 0\n right = n\n while left <= right:\n mid = (left + right) // 2\n if mid**2 == n:\n return False\n elif mid**2 > n:\n right = mid - 1\n else:\n left = mid + 1\n return False\n"}, "sha256": "03c9ea1108c9d4e35d677ccd38ce6e5bade27065dcce13d037e2c6ae0508b51f"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "perfect_square_binary_search:0", "got": "False\n", "source": "perfect_square_binary_search(9)\n", "truncated": false, "want": "True\n"}, {"example_id": "perfect_square_binary_search:1", "got": "False\n", "source": "perfect_square_binary_search(16)\n", "truncated": false, "want": "True\n"}, {"example_id": "perfect_square_binary_search:2", "got": "False\n", "source": "perfect_square_binary_search(1)\n", "truncated": false, "want": "True\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 19, "end_byte": 1169, "lineno": 39, "node": "Return", "node_col_offset": 12, "node_end_col_offset": 23, "node_end_lineno": 39, "node_lineno": 39, "op_index": 0, "original_text": "True", "replacement_text": "False", "start_byte": 1165}}, "public_tests": {"examples": [{"example_id": "perfect_square_binary_search:0", "source": "perfect_square_binary_search(9)\n", "want": "True\n"}, {"example_id": "perfect_square_binary_search:1", "source": "perfect_square_binary_search(16)\n", "want": "True\n"}, {"example_id": "perfect_square_binary_search:2", "source": "perfect_square_binary_search(1)\n", "want": "True\n"}, {"example_id": "perfect_square_binary_search:3", "source": "perfect_square_binary_search(0)\n", "want": "True\n"}, {"example_id": "perfect_square_binary_search:4", "source": "perfect_square_binary_search(10)\n", "want": "False\n"}, {"example_id": "perfect_square_binary_search:5", "source": "perfect_square_binary_search(-1)\n", "want": "False\n"}, {"example_id": "perfect_square_binary_search:6", "source": "perfect_square_binary_search(1.1)\n", "want": "False\n"}, {"example_id": "perfect_square_binary_search:7", "source": "perfect_square_binary_search(\"a\")\n", "want": "Traceback (most recent call last):\n ...\nTypeError: '<=' not supported between instances of 'int' and 'str'\n"}, {"example_id": "perfect_square_binary_search:8", "source": "perfect_square_binary_search(None)\n", "want": "Traceback (most recent call last):\n ...\nTypeError: '<=' not supported between instances of 'int' and 'NoneType'\n"}, {"example_id": "perfect_square_binary_search:9", "source": "perfect_square_binary_search([])\n", "want": "Traceback (most recent call last):\n ...\nTypeError: '<=' not supported between instances of 'int' and 'list'\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-daa2defee986b883", "tree_sha256": "fdd79d1c55e1abf785f4e12bdee3e97183e851891fcc72392250dd63e543ed57", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/perfect_square.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def pressure_and_volume_to_temperature(\n pressure: float, moles: float, volume: float\n) -> float:\n \"\"\"\n Convert pressure and volume to temperature.\n Ideal gas laws are used.\n Temperature is taken in kelvin.\n Volume is taken in litres.\n Pressure has atm as SI unit.\n\n Wikipedia reference: https://en.wikipedia.org/wiki/Gas_laws\n Wikipedia reference: https://en.wikipedia.org/wiki/Pressure\n Wikipedia reference: https://en.wikipedia.org/wiki/Temperature\n\n >>> pressure_and_volume_to_temperature(0.82, 1, 2)\n 20\n >>> pressure_and_volume_to_temperature(8.2, 5, 3)\n 60\n \"\"\"\n return round(float((pressure * volume) / (0.0821 * moles)))\n"}, "sha256": "dade0c4eff301e200870e4aed3c97afc2c49dd93b27511efa239c11ee1f0e620"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "dade0c4eff301e200870e4aed3c97afc2c49dd93b27511efa239c11ee1f0e620", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "70a443da11dd0dd876108d070ae9e48cc569f3e4bc54b2d8863296855a5aa1c7", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00158"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00158", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def pressure_and_volume_to_temperature(\n pressure: float, moles: float, volume: float\n) -> float:\n \"\"\"\n Convert pressure and volume to temperature.\n Ideal gas laws are used.\n Temperature is taken in kelvin.\n Volume is taken in litres.\n Pressure has atm as SI unit.\n\n Wikipedia reference: https://en.wikipedia.org/wiki/Gas_laws\n Wikipedia reference: https://en.wikipedia.org/wiki/Pressure\n Wikipedia reference: https://en.wikipedia.org/wiki/Temperature\n\n >>> pressure_and_volume_to_temperature(0.82, 1, 2)\n 20\n >>> pressure_and_volume_to_temperature(8.2, 5, 3)\n 60\n \"\"\"\n return round(float((pressure * volume) / (0.0821 * moles))) + 1\n"}, "sha256": "e9a3041927061bde13558c08cdd05ae9e27232c52d612f2d7fda86925a6e99ab"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "pressure_and_volume_to_temperature:0", "got": "21\n", "source": "pressure_and_volume_to_temperature(0.82, 1, 2)\n", "truncated": false, "want": "20\n"}, {"example_id": "pressure_and_volume_to_temperature:1", "got": "61\n", "source": "pressure_and_volume_to_temperature(8.2, 5, 3)\n", "truncated": false, "want": "60\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 699, "lineno": 20, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 63, "node_end_lineno": 20, "node_lineno": 20, "op_index": 0, "original_text": "round(float((pressure * volume) / (0.0821 * moles)))", "replacement_text": "round(float((pressure * volume) / (0.0821 * moles))) + 1", "start_byte": 647}}, "public_tests": {"examples": [{"example_id": "pressure_and_volume_to_temperature:0", "source": "pressure_and_volume_to_temperature(0.82, 1, 2)\n", "want": "20\n"}, {"example_id": "pressure_and_volume_to_temperature:1", "source": "pressure_and_volume_to_temperature(8.2, 5, 3)\n", "want": "60\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-abc1ba08d917454e", "tree_sha256": "dade0c4eff301e200870e4aed3c97afc2c49dd93b27511efa239c11ee1f0e620", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:conversions/molecular_chemistry.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "from __future__ import annotations\n\n\ndef find_min_iterative(nums: list[int | float]) -> int | float:\n \"\"\"\n Find Minimum Number in a List\n :param nums: contains elements\n :return: min number in list\n\n >>> for nums in ([3, 2, 1], [-3, -2, -1], [3, -3, 0], [3.0, 3.1, 2.9]):\n ... find_min_iterative(nums) == min(nums)\n True\n True\n True\n True\n >>> find_min_iterative([0, 1, 2, 3, 4, 5, -3, 24, -56])\n -56\n >>> find_min_iterative([])\n Traceback (most recent call last):\n ...\n ValueError: find_min_iterative() arg is an empty sequence\n \"\"\"\n if len(nums) == 0:\n raise ValueError(\"find_min_iterative() arg is an empty sequence\")\n min_num = nums[0]\n for num in nums:\n min_num = min(min_num, num)\n return min_num\n"}, "sha256": "5e54489d71f71ee97a772a4ecb3b0bb5c3a842eafc1f19c0bafc8247fde6ec72"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "5e54489d71f71ee97a772a4ecb3b0bb5c3a842eafc1f19c0bafc8247fde6ec72", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "c786b3f5f967b4d53862ec16f478ea2c0abde37e39ffa091264f741212905b27", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00160"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00160", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 6, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "from __future__ import annotations\n\n\ndef find_min_iterative(nums: list[int | float]) -> int | float:\n \"\"\"\n Find Minimum Number in a List\n :param nums: contains elements\n :return: min number in list\n\n >>> for nums in ([3, 2, 1], [-3, -2, -1], [3, -3, 0], [3.0, 3.1, 2.9]):\n ... find_min_iterative(nums) == min(nums)\n True\n True\n True\n True\n >>> find_min_iterative([0, 1, 2, 3, 4, 5, -3, 24, -56])\n -56\n >>> find_min_iterative([])\n Traceback (most recent call last):\n ...\n ValueError: find_min_iterative() arg is an empty sequence\n \"\"\"\n if len(nums) != 0:\n raise ValueError(\"find_min_iterative() arg is an empty sequence\")\n min_num = nums[0]\n for num in nums:\n min_num = min(min_num, num)\n return min_num\n"}, "sha256": "dc98b8d721a55c463687b21cf786a860528a5375308809e2b0d4cc797e1520f0"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "find_min_iterative:0", "got": "ValueError: find_min_iterative() arg is an empty sequence", "source": "for nums in ([3, 2, 1], [-3, -2, -1], [3, -3, 0], [3.0, 3.1, 2.9]):\n find_min_iterative(nums) == min(nums)\n", "truncated": false, "want": "True\nTrue\nTrue\nTrue\n"}, {"example_id": "find_min_iterative:1", "got": "ValueError: find_min_iterative() arg is an empty sequence", "source": "find_min_iterative([0, 1, 2, 3, 4, 5, -3, 24, -56])\n", "truncated": false, "want": "-56\n"}, {"example_id": "find_min_iterative:2", "got": "IndexError: list index out of range", "source": "find_min_iterative([])\n", "truncated": false, "want": "Traceback (most recent call last):\n ...\nValueError: find_min_iterative() arg is an empty sequence\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "boolean_condition", "seed": 7, "span": {"col_offset": 17, "end_byte": 612, "lineno": 23, "node": "Compare", "node_col_offset": 7, "node_end_col_offset": 21, "node_end_lineno": 23, "node_lineno": 23, "op_index": 0, "original_text": "==", "replacement_text": "!=", "start_byte": 610}}, "public_tests": {"examples": [{"example_id": "find_min_iterative:0", "source": "for nums in ([3, 2, 1], [-3, -2, -1], [3, -3, 0], [3.0, 3.1, 2.9]):\n find_min_iterative(nums) == min(nums)\n", "want": "True\nTrue\nTrue\nTrue\n"}, {"example_id": "find_min_iterative:1", "source": "find_min_iterative([0, 1, 2, 3, 4, 5, -3, 24, -56])\n", "want": "-56\n"}, {"example_id": "find_min_iterative:2", "source": "find_min_iterative([])\n", "want": "Traceback (most recent call last):\n ...\nValueError: find_min_iterative() arg is an empty sequence\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-7925d0ccda1b659e", "tree_sha256": "5e54489d71f71ee97a772a4ecb3b0bb5c3a842eafc1f19c0bafc8247fde6ec72", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/find_min.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def recursive_match(text: str, pattern: str) -> bool:\n r\"\"\"\n Recursive matching algorithm.\n\n | Time complexity: O(2^(\\|text\\| + \\|pattern\\|))\n | Space complexity: Recursion depth is O(\\|text\\| + \\|pattern\\|).\n\n :param text: Text to match.\n :param pattern: Pattern to match.\n :return: ``True`` if `text` matches `pattern`, ``False`` otherwise.\n\n >>> recursive_match('abc', 'a.c')\n True\n >>> recursive_match('abc', 'af*.c')\n True\n >>> recursive_match('abc', 'a.c*')\n True\n >>> recursive_match('abc', 'a.c*d')\n False\n >>> recursive_match('aa', '.*')\n True\n \"\"\"\n if not pattern:\n return not text\n\n if not text:\n return pattern[-1] == \"*\" and recursive_match(text, pattern[:-2])\n\n if text[-1] == pattern[-1] or pattern[-1] == \".\":\n return recursive_match(text[:-1], pattern[:-1])\n\n if pattern[-1] == \"*\":\n return recursive_match(text[:-1], pattern) or recursive_match(\n text, pattern[:-2]\n )\n\n return False\n"}, "sha256": "1f82e3f4da0f07b9810389e10824eb042c55d072ea567453c7579b2a0b260572"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "1f82e3f4da0f07b9810389e10824eb042c55d072ea567453c7579b2a0b260572", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "7ecffb389c282351572805bb5d0c15e54ceb98fa6ca268fbbb8de476dd4d3fbc", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00162"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00162", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def recursive_match(text: str, pattern: str) -> bool:\n r\"\"\"\n Recursive matching algorithm.\n\n | Time complexity: O(2^(\\|text\\| + \\|pattern\\|))\n | Space complexity: Recursion depth is O(\\|text\\| + \\|pattern\\|).\n\n :param text: Text to match.\n :param pattern: Pattern to match.\n :return: ``True`` if `text` matches `pattern`, ``False`` otherwise.\n\n >>> recursive_match('abc', 'a.c')\n True\n >>> recursive_match('abc', 'af*.c')\n True\n >>> recursive_match('abc', 'a.c*')\n True\n >>> recursive_match('abc', 'a.c*d')\n False\n >>> recursive_match('aa', '.*')\n True\n \"\"\"\n if not pattern:\n return not text\n\n if not text:\n return not (pattern[-1] == \"*\" and recursive_match(text, pattern[:-2]))\n\n if text[-1] == pattern[-1] or pattern[-1] == \".\":\n return recursive_match(text[:-1], pattern[:-1])\n\n if pattern[-1] == \"*\":\n return recursive_match(text[:-1], pattern) or recursive_match(\n text, pattern[:-2]\n )\n\n return False\n"}, "sha256": "a137d0c2ff323a8d656ad8d9b5b0cac64867dd195a6ed9249df2e3a2173a6b76"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "recursive_match:4", "got": "False\n", "source": "recursive_match('aa', '.*')\n", "truncated": false, "want": "True\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 15, "end_byte": 747, "lineno": 27, "node": "Return", "node_col_offset": 8, "node_end_col_offset": 73, "node_end_lineno": 27, "node_lineno": 27, "op_index": 0, "original_text": "pattern[-1] == \"*\" and recursive_match(text, pattern[:-2])", "replacement_text": "not (pattern[-1] == \"*\" and recursive_match(text, pattern[:-2]))", "start_byte": 689}}, "public_tests": {"examples": [{"example_id": "recursive_match:0", "source": "recursive_match('abc', 'a.c')\n", "want": "True\n"}, {"example_id": "recursive_match:1", "source": "recursive_match('abc', 'af*.c')\n", "want": "True\n"}, {"example_id": "recursive_match:2", "source": "recursive_match('abc', 'a.c*')\n", "want": "True\n"}, {"example_id": "recursive_match:3", "source": "recursive_match('abc', 'a.c*d')\n", "want": "False\n"}, {"example_id": "recursive_match:4", "source": "recursive_match('aa', '.*')\n", "want": "True\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-28728404dc8fe4df", "tree_sha256": "1f82e3f4da0f07b9810389e10824eb042c55d072ea567453c7579b2a0b260572", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:dynamic_programming/regex_match.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def median_of_five(arr: list) -> int:\n \"\"\"\n Return the median of the input list\n :param arr: Array to find median of\n :return: median of arr\n\n >>> median_of_five([2, 4, 5, 7, 899])\n 5\n >>> median_of_five([5, 7, 899, 54, 32])\n 32\n >>> median_of_five([5, 4, 3, 2])\n 4\n >>> median_of_five([3, 5, 7, 10, 2])\n 5\n \"\"\"\n arr = sorted(arr)\n return arr[len(arr) // 2]\n"}, "sha256": "2210d5fb42ce245b3ed0c90b8089b39c8fcddd59914d691ef148c9e48f0620ed"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "2210d5fb42ce245b3ed0c90b8089b39c8fcddd59914d691ef148c9e48f0620ed", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "d79305c9ddf4271b16835b7a7afcaa484b863bab3fae94893537b13a27332593", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00163"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00163", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 21, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def median_of_five(arr: list) -> int:\n \"\"\"\n Return the median of the input list\n :param arr: Array to find median of\n :return: median of arr\n\n >>> median_of_five([2, 4, 5, 7, 899])\n 5\n >>> median_of_five([5, 7, 899, 54, 32])\n 32\n >>> median_of_five([5, 4, 3, 2])\n 4\n >>> median_of_five([3, 5, 7, 10, 2])\n 5\n \"\"\"\n arr = sorted(arr)\n return arr[len(arr) // 2] + 1\n"}, "sha256": "4b7fcd70e4623f0e2ca6b949a76838355add0b91064c65ecf1dd5cf35a419f3b"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "median_of_five:0", "got": "6\n", "source": "median_of_five([2, 4, 5, 7, 899])\n", "truncated": false, "want": "5\n"}, {"example_id": "median_of_five:1", "got": "33\n", "source": "median_of_five([5, 7, 899, 54, 32])\n", "truncated": false, "want": "32\n"}, {"example_id": "median_of_five:2", "got": "5\n", "source": "median_of_five([5, 4, 3, 2])\n", "truncated": false, "want": "4\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 402, "lineno": 17, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 29, "node_end_lineno": 17, "node_lineno": 17, "op_index": 0, "original_text": "arr[len(arr) // 2]", "replacement_text": "arr[len(arr) // 2] + 1", "start_byte": 384}}, "public_tests": {"examples": [{"example_id": "median_of_five:0", "source": "median_of_five([2, 4, 5, 7, 899])\n", "want": "5\n"}, {"example_id": "median_of_five:1", "source": "median_of_five([5, 7, 899, 54, 32])\n", "want": "32\n"}, {"example_id": "median_of_five:2", "source": "median_of_five([5, 4, 3, 2])\n", "want": "4\n"}, {"example_id": "median_of_five:3", "source": "median_of_five([3, 5, 7, 10, 2])\n", "want": "5\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-b4d0227a328df425", "tree_sha256": "2210d5fb42ce245b3ed0c90b8089b39c8fcddd59914d691ef148c9e48f0620ed", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:searches/median_of_medians.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def double_factorial_iterative(num: int) -> int:\n \"\"\"\n Compute double factorial using iterative method.\n\n To learn about the theory behind this algorithm:\n https://en.wikipedia.org/wiki/Double_factorial\n\n >>> from math import prod\n >>> all(double_factorial_iterative(i) == prod(range(i, 0, -2)) for i in range(20))\n True\n >>> double_factorial_iterative(0.1)\n Traceback (most recent call last):\n ...\n ValueError: double_factorial_iterative() only accepts integral values\n >>> double_factorial_iterative(-1)\n Traceback (most recent call last):\n ...\n ValueError: double_factorial_iterative() not defined for negative values\n \"\"\"\n if not isinstance(num, int):\n raise ValueError(\"double_factorial_iterative() only accepts integral values\")\n if num < 0:\n raise ValueError(\"double_factorial_iterative() not defined for negative values\")\n value = 1\n for i in range(num, 0, -2):\n value *= i\n return value\n"}, "sha256": "1a95c2cb9681d4d1537a2fe5acef9e86bc756d3292ce947895fdd0b6e44246cb"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "1a95c2cb9681d4d1537a2fe5acef9e86bc756d3292ce947895fdd0b6e44246cb", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "b1bd6605cacef36cfbe97015e619bfc457765228fc0f1df15feb410d75ec2431", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00164"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00164", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 4, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def double_factorial_iterative(num: int) -> int:\n \"\"\"\n Compute double factorial using iterative method.\n\n To learn about the theory behind this algorithm:\n https://en.wikipedia.org/wiki/Double_factorial\n\n >>> from math import prod\n >>> all(double_factorial_iterative(i) == prod(range(i, 0, -2)) for i in range(20))\n True\n >>> double_factorial_iterative(0.1)\n Traceback (most recent call last):\n ...\n ValueError: double_factorial_iterative() only accepts integral values\n >>> double_factorial_iterative(-1)\n Traceback (most recent call last):\n ...\n ValueError: double_factorial_iterative() not defined for negative values\n \"\"\"\n if not isinstance(num, int):\n raise ValueError(\"double_factorial_iterative() only accepts integral values\")\n if num < 0:\n raise ValueError(\"double_factorial_iterative() not defined for negative values\")\n value = 1\n for i in range(num, 0, -2):\n value *= i\n return not value\n"}, "sha256": "ee304791cefe01c58e6eceb0e0380b500680382775b34595b40a38418440768d"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "double_factorial_iterative:1", "got": "False\n", "source": "all(double_factorial_iterative(i) == prod(range(i, 0, -2)) for i in range(20))\n", "truncated": false, "want": "True\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 987, "lineno": 27, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 16, "node_end_lineno": 27, "node_lineno": 27, "op_index": 0, "original_text": "value", "replacement_text": "not value", "start_byte": 982}}, "public_tests": {"examples": [{"example_id": "double_factorial_iterative:0", "source": "from math import prod\n", "want": ""}, {"example_id": "double_factorial_iterative:1", "source": "all(double_factorial_iterative(i) == prod(range(i, 0, -2)) for i in range(20))\n", "want": "True\n"}, {"example_id": "double_factorial_iterative:2", "source": "double_factorial_iterative(0.1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: double_factorial_iterative() only accepts integral values\n"}, {"example_id": "double_factorial_iterative:3", "source": "double_factorial_iterative(-1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: double_factorial_iterative() not defined for negative values\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-41c38d4874279fc0", "tree_sha256": "1a95c2cb9681d4d1537a2fe5acef9e86bc756d3292ce947895fdd0b6e44246cb", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/double_factorial.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def reverse_bit(number: int) -> int:\n \"\"\"\n Take in a 32 bit integer, reverse its bits, return a 32 bit integer result\n\n >>> reverse_bit(25)\n 2550136832\n >>> reverse_bit(37)\n 2751463424\n >>> reverse_bit(21)\n 2818572288\n >>> reverse_bit(58)\n 1543503872\n >>> reverse_bit(0)\n 0\n >>> reverse_bit(256)\n 8388608\n >>> reverse_bit(2550136832)\n 25\n >>> reverse_bit(-1)\n Traceback (most recent call last):\n ...\n ValueError: The value of input must be non-negative\n\n >>> reverse_bit(1.1)\n Traceback (most recent call last):\n ...\n TypeError: Input value must be an 'int' type\n\n >>> reverse_bit(\"0\")\n Traceback (most recent call last):\n ...\n TypeError: Input value must be an 'int' type\n \"\"\"\n if not isinstance(number, int):\n raise TypeError(\"Input value must be an 'int' type\")\n if number < 0:\n raise ValueError(\"The value of input must be non-negative\")\n\n result = 0\n # iterator over [0 to 31], since we are dealing with a 32 bit integer\n for _ in range(32):\n # left shift the bits by unity\n result <<= 1\n # get the end bit\n end_bit = number & 1\n # right shift the bits by unity\n number >>= 1\n # add that bit to our answer\n result |= end_bit\n return result\n"}, "sha256": "36fc1ffd87fe0d8c48f3f346239905909f9046b08b39f46c90b9348cff790b85"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "36fc1ffd87fe0d8c48f3f346239905909f9046b08b39f46c90b9348cff790b85", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "88cbdc50d9ef4198bc81ec6d87d996b61446410c4b17d2f1b021b1331473e1b1", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00170"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00170", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def reverse_bit(number: int) -> int:\n \"\"\"\n Take in a 32 bit integer, reverse its bits, return a 32 bit integer result\n\n >>> reverse_bit(25)\n 2550136832\n >>> reverse_bit(37)\n 2751463424\n >>> reverse_bit(21)\n 2818572288\n >>> reverse_bit(58)\n 1543503872\n >>> reverse_bit(0)\n 0\n >>> reverse_bit(256)\n 8388608\n >>> reverse_bit(2550136832)\n 25\n >>> reverse_bit(-1)\n Traceback (most recent call last):\n ...\n ValueError: The value of input must be non-negative\n\n >>> reverse_bit(1.1)\n Traceback (most recent call last):\n ...\n TypeError: Input value must be an 'int' type\n\n >>> reverse_bit(\"0\")\n Traceback (most recent call last):\n ...\n TypeError: Input value must be an 'int' type\n \"\"\"\n if isinstance(number, int):\n raise TypeError(\"Input value must be an 'int' type\")\n if number < 0:\n raise ValueError(\"The value of input must be non-negative\")\n\n result = 0\n # iterator over [0 to 31], since we are dealing with a 32 bit integer\n for _ in range(32):\n # left shift the bits by unity\n result <<= 1\n # get the end bit\n end_bit = number & 1\n # right shift the bits by unity\n number >>= 1\n # add that bit to our answer\n result |= end_bit\n return result\n"}, "sha256": "5cc48ea017f3f01f50313120553fd1fb561509f94e217d9225f7d440158d7f9a"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "reverse_bit:0", "got": "TypeError: Input value must be an 'int' type", "source": "reverse_bit(25)\n", "truncated": false, "want": "2550136832\n"}, {"example_id": "reverse_bit:1", "got": "TypeError: Input value must be an 'int' type", "source": "reverse_bit(37)\n", "truncated": false, "want": "2751463424\n"}, {"example_id": "reverse_bit:2", "got": "TypeError: Input value must be an 'int' type", "source": "reverse_bit(21)\n", "truncated": false, "want": "2818572288\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "boolean_condition", "seed": 7, "span": {"col_offset": 7, "end_byte": 788, "lineno": 34, "node": "UnaryOp", "node_col_offset": 7, "node_end_col_offset": 34, "node_end_lineno": 34, "node_lineno": 34, "op_index": 0, "original_text": "not ", "replacement_text": "", "start_byte": 784}}, "public_tests": {"examples": [{"example_id": "reverse_bit:0", "source": "reverse_bit(25)\n", "want": "2550136832\n"}, {"example_id": "reverse_bit:1", "source": "reverse_bit(37)\n", "want": "2751463424\n"}, {"example_id": "reverse_bit:2", "source": "reverse_bit(21)\n", "want": "2818572288\n"}, {"example_id": "reverse_bit:3", "source": "reverse_bit(58)\n", "want": "1543503872\n"}, {"example_id": "reverse_bit:4", "source": "reverse_bit(0)\n", "want": "0\n"}, {"example_id": "reverse_bit:5", "source": "reverse_bit(256)\n", "want": "8388608\n"}, {"example_id": "reverse_bit:6", "source": "reverse_bit(2550136832)\n", "want": "25\n"}, {"example_id": "reverse_bit:7", "source": "reverse_bit(-1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: The value of input must be non-negative\n"}, {"example_id": "reverse_bit:8", "source": "reverse_bit(1.1)\n", "want": "Traceback (most recent call last):\n ...\nTypeError: Input value must be an 'int' type\n"}, {"example_id": "reverse_bit:9", "source": "reverse_bit(\"0\")\n", "want": "Traceback (most recent call last):\n ...\nTypeError: Input value must be an 'int' type\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-16be69ecdffea114", "tree_sha256": "36fc1ffd87fe0d8c48f3f346239905909f9046b08b39f46c90b9348cff790b85", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:bit_manipulation/reverse_bits.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def search(list_data: list, key: int, left: int = 0, right: int = 0) -> int:\n \"\"\"\n Iterate through the array to find the index of key using recursion.\n :param list_data: the list to be searched\n :param key: the key to be searched\n :param left: the index of first element\n :param right: the index of last element\n :return: the index of key value if found, -1 otherwise.\n\n >>> search(list(range(0, 11)), 5)\n 5\n >>> search([1, 2, 4, 5, 3], 4)\n 2\n >>> search([1, 2, 4, 5, 3], 6)\n -1\n >>> search([5], 5)\n 0\n >>> search([], 1)\n -1\n \"\"\"\n right = right or len(list_data) - 1\n if left > right:\n return -1\n elif list_data[left] == key:\n return left\n elif list_data[right] == key:\n return right\n else:\n return search(list_data, key, left + 1, right - 1)\n"}, "sha256": "efec43eb76f7f2a4ce21cfb1ff3dd44657f90c46134b8631d2dfa12188d7001d"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "efec43eb76f7f2a4ce21cfb1ff3dd44657f90c46134b8631d2dfa12188d7001d", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "e654d3a9c51527e87888271bc7fb0fdd8e0ba146f5fe423d0cebb65c53ffe2b1", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00172"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00172", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def search(list_data: list, key: int, left: int = 0, right: int = 0) -> int:\n \"\"\"\n Iterate through the array to find the index of key using recursion.\n :param list_data: the list to be searched\n :param key: the key to be searched\n :param left: the index of first element\n :param right: the index of last element\n :return: the index of key value if found, -1 otherwise.\n\n >>> search(list(range(0, 11)), 5)\n 5\n >>> search([1, 2, 4, 5, 3], 4)\n 2\n >>> search([1, 2, 4, 5, 3], 6)\n -1\n >>> search([5], 5)\n 0\n >>> search([], 1)\n -1\n \"\"\"\n right = right or len(list_data) - 1\n if left > right:\n return -1\n elif list_data[left] == key:\n return left\n elif list_data[right] != key:\n return right\n else:\n return search(list_data, key, left + 1, right - 1)\n"}, "sha256": "42350a190c6a2034f0c0dcad60b76cb8f1bd28ae0387bf0a512e5b2ad5a77620"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "search:0", "got": "10\n", "source": "search(list(range(0, 11)), 5)\n", "truncated": false, "want": "5\n"}, {"example_id": "search:1", "got": "4\n", "source": "search([1, 2, 4, 5, 3], 4)\n", "truncated": false, "want": "2\n"}, {"example_id": "search:2", "got": "4\n", "source": "search([1, 2, 4, 5, 3], 6)\n", "truncated": false, "want": "-1\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "boolean_condition", "seed": 7, "span": {"col_offset": 26, "end_byte": 744, "lineno": 26, "node": "Compare", "node_col_offset": 9, "node_end_col_offset": 32, "node_end_lineno": 26, "node_lineno": 26, "op_index": 0, "original_text": "==", "replacement_text": "!=", "start_byte": 742}}, "public_tests": {"examples": [{"example_id": "search:0", "source": "search(list(range(0, 11)), 5)\n", "want": "5\n"}, {"example_id": "search:1", "source": "search([1, 2, 4, 5, 3], 4)\n", "want": "2\n"}, {"example_id": "search:2", "source": "search([1, 2, 4, 5, 3], 6)\n", "want": "-1\n"}, {"example_id": "search:3", "source": "search([5], 5)\n", "want": "0\n"}, {"example_id": "search:4", "source": "search([], 1)\n", "want": "-1\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-2a8d3e103c1b87f2", "tree_sha256": "efec43eb76f7f2a4ce21cfb1ff3dd44657f90c46134b8631d2dfa12188d7001d", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:searches/double_linear_search_recursion.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def binary_coded_decimal(number: int) -> str:\n \"\"\"\n Find binary coded decimal (bcd) of integer base 10.\n Each digit of the number is represented by a 4-bit binary.\n Example:\n >>> binary_coded_decimal(-2)\n '0b0000'\n >>> binary_coded_decimal(-1)\n '0b0000'\n >>> binary_coded_decimal(0)\n '0b0000'\n >>> binary_coded_decimal(3)\n '0b0011'\n >>> binary_coded_decimal(2)\n '0b0010'\n >>> binary_coded_decimal(12)\n '0b00010010'\n >>> binary_coded_decimal(987)\n '0b100110000111'\n \"\"\"\n return \"0b\" + \"\".join(\n str(bin(int(digit)))[2:].zfill(4) for digit in str(max(0, number))\n )\n"}, "sha256": "8f9069b0999830445059a821dd81f7ce3586f0d4d8b24f4d34584e94a0fa0126"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "8f9069b0999830445059a821dd81f7ce3586f0d4d8b24f4d34584e94a0fa0126", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "4bebefff5cc33956dba4871432e191d531beb9b5fc8192bfdf60973b26709d28", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00175"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00175", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def binary_coded_decimal(number: int) -> str:\n \"\"\"\n Find binary coded decimal (bcd) of integer base 10.\n Each digit of the number is represented by a 4-bit binary.\n Example:\n >>> binary_coded_decimal(-2)\n '0b0000'\n >>> binary_coded_decimal(-1)\n '0b0000'\n >>> binary_coded_decimal(0)\n '0b0000'\n >>> binary_coded_decimal(3)\n '0b0011'\n >>> binary_coded_decimal(2)\n '0b0010'\n >>> binary_coded_decimal(12)\n '0b00010010'\n >>> binary_coded_decimal(987)\n '0b100110000111'\n \"\"\"\n return \"0b\" - \"\".join(\n str(bin(int(digit)))[2:].zfill(4) for digit in str(max(0, number))\n )\n"}, "sha256": "109a58c6189ccdcaa5b8ce82c37acaa7de1465d43d07669a10c36e5aa4ac8830"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "binary_coded_decimal:0", "got": "TypeError: unsupported operand type(s) for -: 'str' and 'str'", "source": "binary_coded_decimal(-2)\n", "truncated": false, "want": "'0b0000'\n"}, {"example_id": "binary_coded_decimal:1", "got": "TypeError: unsupported operand type(s) for -: 'str' and 'str'", "source": "binary_coded_decimal(-1)\n", "truncated": false, "want": "'0b0000'\n"}, {"example_id": "binary_coded_decimal:2", "got": "TypeError: unsupported operand type(s) for -: 'str' and 'str'", "source": "binary_coded_decimal(0)\n", "truncated": false, "want": "'0b0000'\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 16, "end_byte": 543, "lineno": 21, "node": "BinOp", "node_col_offset": 11, "node_end_col_offset": 5, "node_end_lineno": 23, "node_lineno": 21, "op_index": 0, "original_text": "+", "replacement_text": "-", "start_byte": 542}}, "public_tests": {"examples": [{"example_id": "binary_coded_decimal:0", "source": "binary_coded_decimal(-2)\n", "want": "'0b0000'\n"}, {"example_id": "binary_coded_decimal:1", "source": "binary_coded_decimal(-1)\n", "want": "'0b0000'\n"}, {"example_id": "binary_coded_decimal:2", "source": "binary_coded_decimal(0)\n", "want": "'0b0000'\n"}, {"example_id": "binary_coded_decimal:3", "source": "binary_coded_decimal(3)\n", "want": "'0b0011'\n"}, {"example_id": "binary_coded_decimal:4", "source": "binary_coded_decimal(2)\n", "want": "'0b0010'\n"}, {"example_id": "binary_coded_decimal:5", "source": "binary_coded_decimal(12)\n", "want": "'0b00010010'\n"}, {"example_id": "binary_coded_decimal:6", "source": "binary_coded_decimal(987)\n", "want": "'0b100110000111'\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-debab8b4fad77e2a", "tree_sha256": "8f9069b0999830445059a821dd81f7ce3586f0d4d8b24f4d34584e94a0fa0126", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:bit_manipulation/binary_coded_decimal.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def prefix_function(input_string: str) -> list:\n \"\"\"\n For the given string this function computes value for each index(i),\n which represents the longest coincidence of prefix and suffix\n for given substring (input_str[0...i])\n\n For the value of the first element the algorithm always returns 0\n\n >>> prefix_function(\"aabcdaabc\")\n [0, 1, 0, 0, 0, 1, 2, 3, 4]\n >>> prefix_function(\"asdasdad\")\n [0, 0, 0, 1, 2, 3, 4, 0]\n \"\"\"\n\n # list for the result values\n prefix_result = [0] * len(input_string)\n\n for i in range(1, len(input_string)):\n # use last results for better performance - dynamic programming\n j = prefix_result[i - 1]\n while j > 0 and input_string[i] != input_string[j]:\n j = prefix_result[j - 1]\n\n if input_string[i] == input_string[j]:\n j += 1\n prefix_result[i] = j\n\n return prefix_result\n"}, "sha256": "d158eaede6771376946604ff644ff0d5fa1b59cd425eed8d34bd013e43ea3d3d"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "d158eaede6771376946604ff644ff0d5fa1b59cd425eed8d34bd013e43ea3d3d", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "4cb4ae6003dce8365a7dae92e5b27851b1f4d9a1ed950b8a03f767d94508e925", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00176"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00176", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 10, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def prefix_function(input_string: str) -> list:\n \"\"\"\n For the given string this function computes value for each index(i),\n which represents the longest coincidence of prefix and suffix\n for given substring (input_str[0...i])\n\n For the value of the first element the algorithm always returns 0\n\n >>> prefix_function(\"aabcdaabc\")\n [0, 1, 0, 0, 0, 1, 2, 3, 4]\n >>> prefix_function(\"asdasdad\")\n [0, 0, 0, 1, 2, 3, 4, 0]\n \"\"\"\n\n # list for the result values\n prefix_result = [0] * len(input_string)\n\n for i in range(0, len(input_string)):\n # use last results for better performance - dynamic programming\n j = prefix_result[i - 1]\n while j > 0 and input_string[i] != input_string[j]:\n j = prefix_result[j - 1]\n\n if input_string[i] == input_string[j]:\n j += 1\n prefix_result[i] = j\n\n return prefix_result\n"}, "sha256": "04d87b6a208ea496075ec3589a33bd2b63d3137ab29bbd5da0d34a1927c1f29c"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "prefix_function:0", "got": "[1, 2, 3, 4, 5, 6, 7, 8, 9]\n", "source": "prefix_function(\"aabcdaabc\")\n", "truncated": false, "want": "[0, 1, 0, 0, 0, 1, 2, 3, 4]\n"}, {"example_id": "prefix_function:1", "got": "[1, 2, 3, 4, 5, 6, 7, 8]\n", "source": "prefix_function(\"asdasdad\")\n", "truncated": false, "want": "[0, 0, 0, 1, 2, 3, 4, 0]\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "off_by_one", "seed": 7, "span": {"col_offset": 19, "end_byte": 551, "lineno": 18, "node": "Constant", "node_col_offset": 19, "node_end_col_offset": 20, "node_end_lineno": 18, "node_lineno": 18, "op_index": 0, "original_text": "1", "replacement_text": "0", "start_byte": 550}}, "public_tests": {"examples": [{"example_id": "prefix_function:0", "source": "prefix_function(\"aabcdaabc\")\n", "want": "[0, 1, 0, 0, 0, 1, 2, 3, 4]\n"}, {"example_id": "prefix_function:1", "source": "prefix_function(\"asdasdad\")\n", "want": "[0, 0, 0, 1, 2, 3, 4, 0]\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-5c1d2aaf6e1fe5a5", "tree_sha256": "d158eaede6771376946604ff644ff0d5fa1b59cd425eed8d34bd013e43ea3d3d", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:strings/prefix_function.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def set_bit(number: int, position: int) -> int:\n \"\"\"\n Set the bit at position to 1.\n\n Details: perform bitwise or for given number and X.\n Where X is a number with all the bits - zeroes and bit on given\n position - one.\n\n >>> set_bit(0b1101, 1) # 0b1111\n 15\n >>> set_bit(0b0, 5) # 0b100000\n 32\n >>> set_bit(0b1111, 1) # 0b1111\n 15\n \"\"\"\n return number | (1 << position)\n"}, "sha256": "fdf4b6d2dc7d3933d0e9809c0813a0430ebf2556cc2dbc0a0739c0258dcb099a"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "fdf4b6d2dc7d3933d0e9809c0813a0430ebf2556cc2dbc0a0739c0258dcb099a", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "eec66fa32f000eda8726119212c7b911336ef11e43cfb7104986ef85ec4083c2", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00177"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00177", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def set_bit(number: int, position: int) -> int:\n \"\"\"\n Set the bit at position to 1.\n\n Details: perform bitwise or for given number and X.\n Where X is a number with all the bits - zeroes and bit on given\n position - one.\n\n >>> set_bit(0b1101, 1) # 0b1111\n 15\n >>> set_bit(0b0, 5) # 0b100000\n 32\n >>> set_bit(0b1111, 1) # 0b1111\n 15\n \"\"\"\n return (number | (1 << position)) + 1\n"}, "sha256": "3dbed77d432a20ba3137f5515dc830a55baeeac8ea4ac08cf1966d2d4f60355a"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "set_bit:0", "got": "16\n", "source": "set_bit(0b1101, 1) # 0b1111\n", "truncated": false, "want": "15\n"}, {"example_id": "set_bit:1", "got": "33\n", "source": "set_bit(0b0, 5) # 0b100000\n", "truncated": false, "want": "32\n"}, {"example_id": "set_bit:2", "got": "16\n", "source": "set_bit(0b1111, 1) # 0b1111\n", "truncated": false, "want": "15\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 407, "lineno": 16, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 35, "node_end_lineno": 16, "node_lineno": 16, "op_index": 0, "original_text": "number | (1 << position)", "replacement_text": "(number | (1 << position)) + 1", "start_byte": 383}}, "public_tests": {"examples": [{"example_id": "set_bit:0", "source": "set_bit(0b1101, 1) # 0b1111\n", "want": "15\n"}, {"example_id": "set_bit:1", "source": "set_bit(0b0, 5) # 0b100000\n", "want": "32\n"}, {"example_id": "set_bit:2", "source": "set_bit(0b1111, 1) # 0b1111\n", "want": "15\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-5ddfe6c99257693a", "tree_sha256": "fdf4b6d2dc7d3933d0e9809c0813a0430ebf2556cc2dbc0a0739c0258dcb099a", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:bit_manipulation/single_bit_manipulation_operations.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "from __future__ import annotations\n\n\ndef pigeon_sort(array: list[int]) -> list[int]:\n \"\"\"\n Implementation of pigeon hole sort algorithm\n :param array: Collection of comparable items\n :return: Collection sorted in ascending order\n >>> pigeon_sort([0, 5, 3, 2, 2])\n [0, 2, 2, 3, 5]\n >>> pigeon_sort([])\n []\n >>> pigeon_sort([-2, -5, -45])\n [-45, -5, -2]\n \"\"\"\n if len(array) == 0:\n return array\n\n _min, _max = min(array), max(array)\n\n # Compute the variables\n holes_range = _max - _min + 1\n holes, holes_repeat = [0] * holes_range, [0] * holes_range\n\n # Make the sorting.\n for i in array:\n index = i - _min\n holes[index] = i\n holes_repeat[index] += 1\n\n # Makes the array back by replacing the numbers.\n index = 0\n for i in range(holes_range):\n while holes_repeat[i] > 0:\n array[index] = holes[i]\n index += 1\n holes_repeat[i] -= 1\n\n # Returns the sorted array.\n return array\n"}, "sha256": "640d952d768d57e33fb1784c0ad2267d683bd5a9dfca5fd08a4130a76ca6e8b1"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "640d952d768d57e33fb1784c0ad2267d683bd5a9dfca5fd08a4130a76ca6e8b1", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "848151d5054b56125d5f6614f1340f3cf83c50415f1fbde252cbfe5751a635dd", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00178"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00178", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 11, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "from __future__ import annotations\n\n\ndef pigeon_sort(array: list[int]) -> list[int]:\n \"\"\"\n Implementation of pigeon hole sort algorithm\n :param array: Collection of comparable items\n :return: Collection sorted in ascending order\n >>> pigeon_sort([0, 5, 3, 2, 2])\n [0, 2, 2, 3, 5]\n >>> pigeon_sort([])\n []\n >>> pigeon_sort([-2, -5, -45])\n [-45, -5, -2]\n \"\"\"\n if len(array) == 0:\n return array\n\n _min, _max = min(array), max(array)\n\n # Compute the variables\n holes_range = _max - _min + 1\n holes, holes_repeat = [0] * holes_range, [0] * holes_range\n\n # Make the sorting.\n for i in array:\n index = i - _min\n holes[index] = i\n holes_repeat[index] += 1\n\n # Makes the array back by replacing the numbers.\n index = 0\n for i in range(holes_range):\n while holes_repeat[i] >= 0:\n array[index] = holes[i]\n index += 1\n holes_repeat[i] -= 1\n\n # Returns the sorted array.\n return array\n"}, "sha256": "fee8768469ebe5a5ba5f79a99f738255e39e5ad16a6d713061ecafaf759b342d"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "pigeon_sort:0", "got": "IndexError: list assignment index out of range", "source": "pigeon_sort([0, 5, 3, 2, 2])\n", "truncated": false, "want": "[0, 2, 2, 3, 5]\n"}, {"example_id": "pigeon_sort:2", "got": "IndexError: list assignment index out of range", "source": "pigeon_sort([-2, -5, -45])\n", "truncated": false, "want": "[-45, -5, -2]\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "comparison_boundary", "seed": 7, "span": {"col_offset": 30, "end_byte": 862, "lineno": 34, "node": "Compare", "node_col_offset": 14, "node_end_col_offset": 33, "node_end_lineno": 34, "node_lineno": 34, "op_index": 0, "original_text": ">", "replacement_text": ">=", "start_byte": 861}}, "public_tests": {"examples": [{"example_id": "pigeon_sort:0", "source": "pigeon_sort([0, 5, 3, 2, 2])\n", "want": "[0, 2, 2, 3, 5]\n"}, {"example_id": "pigeon_sort:1", "source": "pigeon_sort([])\n", "want": "[]\n"}, {"example_id": "pigeon_sort:2", "source": "pigeon_sort([-2, -5, -45])\n", "want": "[-45, -5, -2]\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-e923f0a8fc45fbad", "tree_sha256": "640d952d768d57e33fb1784c0ad2267d683bd5a9dfca5fd08a4130a76ca6e8b1", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:sorts/pigeon_sort.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def flip_bit(number: int, position: int) -> int:\n \"\"\"\n Flip the bit at position.\n\n Details: perform bitwise xor for given number and X.\n Where X is a number with all the bits - zeroes and bit on given\n position - one.\n\n >>> flip_bit(0b101, 1) # 0b111\n 7\n >>> flip_bit(0b101, 0) # 0b100\n 4\n \"\"\"\n return number ^ (1 << position)\n"}, "sha256": "e48b6a8b586ae0e460fa40788e990a9315655b4cf900cc636f60adbd202a0ccc"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "e48b6a8b586ae0e460fa40788e990a9315655b4cf900cc636f60adbd202a0ccc", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "dfedaae5de0fa7101735c02eed443bf30780fedbf7d417faa6f3c074caecd30c", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00179"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00179", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def flip_bit(number: int, position: int) -> int:\n \"\"\"\n Flip the bit at position.\n\n Details: perform bitwise xor for given number and X.\n Where X is a number with all the bits - zeroes and bit on given\n position - one.\n\n >>> flip_bit(0b101, 1) # 0b111\n 7\n >>> flip_bit(0b101, 0) # 0b100\n 4\n \"\"\"\n return (number ^ (1 << position)) + 1\n"}, "sha256": "2a2ab97c1a1856a618fcbee0c6a6eb9a7084fc517d4c32d8e76f82c34ada6169"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "flip_bit:0", "got": "8\n", "source": "flip_bit(0b101, 1) # 0b111\n", "truncated": false, "want": "7\n"}, {"example_id": "flip_bit:1", "got": "5\n", "source": "flip_bit(0b101, 0) # 0b100\n", "truncated": false, "want": "4\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 359, "lineno": 14, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 35, "node_end_lineno": 14, "node_lineno": 14, "op_index": 0, "original_text": "number ^ (1 << position)", "replacement_text": "(number ^ (1 << position)) + 1", "start_byte": 335}}, "public_tests": {"examples": [{"example_id": "flip_bit:0", "source": "flip_bit(0b101, 1) # 0b111\n", "want": "7\n"}, {"example_id": "flip_bit:1", "source": "flip_bit(0b101, 0) # 0b100\n", "want": "4\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-ce46c425b3855bea", "tree_sha256": "e48b6a8b586ae0e460fa40788e990a9315655b4cf900cc636f60adbd202a0ccc", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:bit_manipulation/single_bit_manipulation_operations.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def find_previous_power_of_two(number: int) -> int:\n \"\"\"\n Find the largest power of two that is less than or equal to a given integer.\n https://stackoverflow.com/questions/1322510\n\n >>> [find_previous_power_of_two(i) for i in range(18)]\n [0, 1, 2, 2, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 16, 16]\n >>> find_previous_power_of_two(-5)\n Traceback (most recent call last):\n ...\n ValueError: Input must be a non-negative integer\n >>> find_previous_power_of_two(10.5)\n Traceback (most recent call last):\n ...\n ValueError: Input must be a non-negative integer\n \"\"\"\n if not isinstance(number, int) or number < 0:\n raise ValueError(\"Input must be a non-negative integer\")\n if number == 0:\n return 0\n power = 1\n while power <= number:\n power <<= 1 # Equivalent to multiplying by 2\n return power >> 1 if number > 1 else 1\n"}, "sha256": "06cecf6bfadedc0dfa9be761a890f9128eb6fb9a4a1ed706ab29a544382eac4c"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "06cecf6bfadedc0dfa9be761a890f9128eb6fb9a4a1ed706ab29a544382eac4c", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "5e4c5bc684281966a3b2e0c67a0fec0fbf0a1ef51a4cce880b7839b68204c21f", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00181"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00181", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 4, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def find_previous_power_of_two(number: int) -> int:\n \"\"\"\n Find the largest power of two that is less than or equal to a given integer.\n https://stackoverflow.com/questions/1322510\n\n >>> [find_previous_power_of_two(i) for i in range(18)]\n [0, 1, 2, 2, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 16, 16]\n >>> find_previous_power_of_two(-5)\n Traceback (most recent call last):\n ...\n ValueError: Input must be a non-negative integer\n >>> find_previous_power_of_two(10.5)\n Traceback (most recent call last):\n ...\n ValueError: Input must be a non-negative integer\n \"\"\"\n if not isinstance(number, int) or number < 0:\n raise ValueError(\"Input must be a non-negative integer\")\n if number == 1:\n return 0\n power = 1\n while power <= number:\n power <<= 1 # Equivalent to multiplying by 2\n return power >> 1 if number > 1 else 1\n"}, "sha256": "01ca57a4698ec6f162bc8b74cb74c449a889cbaa355d6c9bf6dcdf60d084b797"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "find_previous_power_of_two:0", "got": "[1, 0, 2, 2, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 16, 16]\n", "source": "[find_previous_power_of_two(i) for i in range(18)]\n", "truncated": false, "want": "[0, 1, 2, 2, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 16, 16]\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "off_by_one", "seed": 7, "span": {"col_offset": 17, "end_byte": 739, "lineno": 19, "node": "Constant", "node_col_offset": 17, "node_end_col_offset": 18, "node_end_lineno": 19, "node_lineno": 19, "op_index": 0, "original_text": "0", "replacement_text": "1", "start_byte": 738}}, "public_tests": {"examples": [{"example_id": "find_previous_power_of_two:0", "source": "[find_previous_power_of_two(i) for i in range(18)]\n", "want": "[0, 1, 2, 2, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 16, 16]\n"}, {"example_id": "find_previous_power_of_two:1", "source": "find_previous_power_of_two(-5)\n", "want": "Traceback (most recent call last):\n ...\nValueError: Input must be a non-negative integer\n"}, {"example_id": "find_previous_power_of_two:2", "source": "find_previous_power_of_two(10.5)\n", "want": "Traceback (most recent call last):\n ...\nValueError: Input must be a non-negative integer\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-4640938b44d27661", "tree_sha256": "06cecf6bfadedc0dfa9be761a890f9128eb6fb9a4a1ed706ab29a544382eac4c", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:bit_manipulation/find_previous_power_of_two.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def ipv4_to_decimal(ipv4_address: str) -> int:\n \"\"\"\n Convert an IPv4 address to its decimal representation.\n\n Args:\n ip_address: A string representing an IPv4 address (e.g., \"192.168.0.1\").\n\n Returns:\n int: The decimal representation of the IP address.\n\n >>> ipv4_to_decimal(\"192.168.0.1\")\n 3232235521\n >>> ipv4_to_decimal(\"10.0.0.255\")\n 167772415\n >>> ipv4_to_decimal(\"10.0.255\")\n Traceback (most recent call last):\n ...\n ValueError: Invalid IPv4 address format\n >>> ipv4_to_decimal(\"10.0.0.256\")\n Traceback (most recent call last):\n ...\n ValueError: Invalid IPv4 octet 256\n \"\"\"\n\n octets = [int(octet) for octet in ipv4_address.split(\".\")]\n if len(octets) != 4:\n raise ValueError(\"Invalid IPv4 address format\")\n\n decimal_ipv4 = 0\n for octet in octets:\n if not 0 <= octet <= 255:\n raise ValueError(f\"Invalid IPv4 octet {octet}\") # noqa: EM102\n decimal_ipv4 = (decimal_ipv4 << 8) + int(octet)\n\n return decimal_ipv4\n"}, "sha256": "c5addf0c8bc971441899883d29d1096f60bbcd009fc78f57ea71f085e4379b20"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "c5addf0c8bc971441899883d29d1096f60bbcd009fc78f57ea71f085e4379b20", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "88a664b0470dd94a97ddd27b99588ae502f1dababdae8c7921133211dc09cae6", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00182"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00182", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 2, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def ipv4_to_decimal(ipv4_address: str) -> int:\n \"\"\"\n Convert an IPv4 address to its decimal representation.\n\n Args:\n ip_address: A string representing an IPv4 address (e.g., \"192.168.0.1\").\n\n Returns:\n int: The decimal representation of the IP address.\n\n >>> ipv4_to_decimal(\"192.168.0.1\")\n 3232235521\n >>> ipv4_to_decimal(\"10.0.0.255\")\n 167772415\n >>> ipv4_to_decimal(\"10.0.255\")\n Traceback (most recent call last):\n ...\n ValueError: Invalid IPv4 address format\n >>> ipv4_to_decimal(\"10.0.0.256\")\n Traceback (most recent call last):\n ...\n ValueError: Invalid IPv4 octet 256\n \"\"\"\n\n octets = [int(octet) for octet in ipv4_address.split(\".\")]\n if len(octets) != 4:\n raise ValueError(\"Invalid IPv4 address format\")\n\n decimal_ipv4 = 0\n for octet in octets:\n if not 0 <= octet < 255:\n raise ValueError(f\"Invalid IPv4 octet {octet}\") # noqa: EM102\n decimal_ipv4 = (decimal_ipv4 << 8) + int(octet)\n\n return decimal_ipv4\n"}, "sha256": "44ee4025c1076aff247ce81f893a42865419c699360db7fa41d0651d49a2b4e7"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "ipv4_to_decimal:1", "got": "ValueError: Invalid IPv4 octet 255", "source": "ipv4_to_decimal(\"10.0.0.255\")\n", "truncated": false, "want": "167772415\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "comparison_boundary", "seed": 7, "span": {"col_offset": 26, "end_byte": 873, "lineno": 31, "node": "Compare", "node_col_offset": 15, "node_end_col_offset": 32, "node_end_lineno": 31, "node_lineno": 31, "op_index": 1, "original_text": "<=", "replacement_text": "<", "start_byte": 871}}, "public_tests": {"examples": [{"example_id": "ipv4_to_decimal:0", "source": "ipv4_to_decimal(\"192.168.0.1\")\n", "want": "3232235521\n"}, {"example_id": "ipv4_to_decimal:1", "source": "ipv4_to_decimal(\"10.0.0.255\")\n", "want": "167772415\n"}, {"example_id": "ipv4_to_decimal:2", "source": "ipv4_to_decimal(\"10.0.255\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: Invalid IPv4 address format\n"}, {"example_id": "ipv4_to_decimal:3", "source": "ipv4_to_decimal(\"10.0.0.256\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: Invalid IPv4 octet 256\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-66a134cd57c5f051", "tree_sha256": "c5addf0c8bc971441899883d29d1096f60bbcd009fc78f57ea71f085e4379b20", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:conversions/ipv4_conversion.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def integer_square_root(num: int) -> int:\n \"\"\"\n Returns the integer square root of a non-negative integer num.\n Args:\n num: A non-negative integer.\n Returns:\n The integer square root of num.\n Raises:\n ValueError: If num is not an integer or is negative.\n >>> [integer_square_root(i) for i in range(18)]\n [0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4]\n >>> integer_square_root(625)\n 25\n >>> integer_square_root(2_147_483_647)\n 46340\n >>> from math import isqrt\n >>> all(integer_square_root(i) == isqrt(i) for i in range(20))\n True\n >>> integer_square_root(-1)\n Traceback (most recent call last):\n ...\n ValueError: num must be non-negative integer\n >>> integer_square_root(1.5)\n Traceback (most recent call last):\n ...\n ValueError: num must be non-negative integer\n >>> integer_square_root(\"0\")\n Traceback (most recent call last):\n ...\n ValueError: num must be non-negative integer\n \"\"\"\n if not isinstance(num, int) or num < 0:\n raise ValueError(\"num must be non-negative integer\")\n\n if num < 2:\n return num\n\n left_bound = 0\n right_bound = num // 2\n\n while left_bound <= right_bound:\n mid = left_bound + (right_bound - left_bound) // 2\n mid_squared = mid * mid\n if mid_squared == num:\n return mid\n\n if mid_squared < num:\n left_bound = mid + 1\n else:\n right_bound = mid - 1\n\n return right_bound\n"}, "sha256": "896595028d147c2a075ef76d86129ebcbb41c6612b2308f13a68fe4cf4e13e3c"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "896595028d147c2a075ef76d86129ebcbb41c6612b2308f13a68fe4cf4e13e3c", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "1f11a36ef9c1aabff7fddbb781a3db1538c48f391ba79d78b0963cdaeafb363c", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00184"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00184", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 15, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def integer_square_root(num: int) -> int:\n \"\"\"\n Returns the integer square root of a non-negative integer num.\n Args:\n num: A non-negative integer.\n Returns:\n The integer square root of num.\n Raises:\n ValueError: If num is not an integer or is negative.\n >>> [integer_square_root(i) for i in range(18)]\n [0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4]\n >>> integer_square_root(625)\n 25\n >>> integer_square_root(2_147_483_647)\n 46340\n >>> from math import isqrt\n >>> all(integer_square_root(i) == isqrt(i) for i in range(20))\n True\n >>> integer_square_root(-1)\n Traceback (most recent call last):\n ...\n ValueError: num must be non-negative integer\n >>> integer_square_root(1.5)\n Traceback (most recent call last):\n ...\n ValueError: num must be non-negative integer\n >>> integer_square_root(\"0\")\n Traceback (most recent call last):\n ...\n ValueError: num must be non-negative integer\n \"\"\"\n if not isinstance(num, int) or num < 0:\n raise ValueError(\"num must be non-negative integer\")\n\n if num < 2:\n return num\n\n left_bound = 0\n right_bound = num // 2\n\n while left_bound <= right_bound:\n mid = left_bound + (right_bound - left_bound) // 2\n mid_squared = mid * mid\n if mid_squared != num:\n return mid\n\n if mid_squared < num:\n left_bound = mid + 1\n else:\n right_bound = mid - 1\n\n return right_bound\n"}, "sha256": "be858af341efa9711d4442b58bb64aad8d5bacfba1e8534b286f336ad3034c78"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "integer_square_root:0", "got": "[0, 1, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 1, 4]\n", "source": "[integer_square_root(i) for i in range(18)]\n", "truncated": false, "want": "[0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4]\n"}, {"example_id": "integer_square_root:1", "got": "156\n", "source": "integer_square_root(625)\n", "truncated": false, "want": "25\n"}, {"example_id": "integer_square_root:2", "got": "536870911\n", "source": "integer_square_root(2_147_483_647)\n", "truncated": false, "want": "46340\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "boolean_condition", "seed": 7, "span": {"col_offset": 23, "end_byte": 1349, "lineno": 44, "node": "Compare", "node_col_offset": 11, "node_end_col_offset": 29, "node_end_lineno": 44, "node_lineno": 44, "op_index": 0, "original_text": "==", "replacement_text": "!=", "start_byte": 1347}}, "public_tests": {"examples": [{"example_id": "integer_square_root:0", "source": "[integer_square_root(i) for i in range(18)]\n", "want": "[0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4]\n"}, {"example_id": "integer_square_root:1", "source": "integer_square_root(625)\n", "want": "25\n"}, {"example_id": "integer_square_root:2", "source": "integer_square_root(2_147_483_647)\n", "want": "46340\n"}, {"example_id": "integer_square_root:3", "source": "from math import isqrt\n", "want": ""}, {"example_id": "integer_square_root:4", "source": "all(integer_square_root(i) == isqrt(i) for i in range(20))\n", "want": "True\n"}, {"example_id": "integer_square_root:5", "source": "integer_square_root(-1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: num must be non-negative integer\n"}, {"example_id": "integer_square_root:6", "source": "integer_square_root(1.5)\n", "want": "Traceback (most recent call last):\n ...\nValueError: num must be non-negative integer\n"}, {"example_id": "integer_square_root:7", "source": "integer_square_root(\"0\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: num must be non-negative integer\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-9152d246c868deb6", "tree_sha256": "896595028d147c2a075ef76d86129ebcbb41c6612b2308f13a68fe4cf4e13e3c", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/integer_square_root.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def average_absolute_deviation(nums: list[int]) -> float:\n \"\"\"\n Return the average absolute deviation of a list of numbers.\n Wiki: https://en.wikipedia.org/wiki/Average_absolute_deviation\n\n >>> average_absolute_deviation([0])\n 0.0\n >>> average_absolute_deviation([4, 1, 3, 2])\n 1.0\n >>> average_absolute_deviation([2, 70, 6, 50, 20, 8, 4, 0])\n 20.0\n >>> average_absolute_deviation([-20, 0, 30, 15])\n 16.25\n >>> average_absolute_deviation([])\n Traceback (most recent call last):\n ...\n ValueError: List is empty\n \"\"\"\n if not nums: # Makes sure that the list is not empty\n raise ValueError(\"List is empty\")\n\n average = sum(nums) / len(nums) # Calculate the average\n return sum(abs(x - average) for x in nums) / len(nums)\n"}, "sha256": "af7b3ac9f9a986451e7307febb1a058bac3f18db147345e307a1f04fc0e0a54a"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "af7b3ac9f9a986451e7307febb1a058bac3f18db147345e307a1f04fc0e0a54a", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "74a9c4edea5b0b46937531a3500011ff29efd34945774131bed8e3c2699993f8", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00185"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00185", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 20, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def average_absolute_deviation(nums: list[int]) -> float:\n \"\"\"\n Return the average absolute deviation of a list of numbers.\n Wiki: https://en.wikipedia.org/wiki/Average_absolute_deviation\n\n >>> average_absolute_deviation([0])\n 0.0\n >>> average_absolute_deviation([4, 1, 3, 2])\n 1.0\n >>> average_absolute_deviation([2, 70, 6, 50, 20, 8, 4, 0])\n 20.0\n >>> average_absolute_deviation([-20, 0, 30, 15])\n 16.25\n >>> average_absolute_deviation([])\n Traceback (most recent call last):\n ...\n ValueError: List is empty\n \"\"\"\n if nums: # Makes sure that the list is not empty\n raise ValueError(\"List is empty\")\n\n average = sum(nums) / len(nums) # Calculate the average\n return sum(abs(x - average) for x in nums) / len(nums)\n"}, "sha256": "e0babe302f337895439b53428e9433bff57693917c1f93341b4ab7e81d07d949"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "average_absolute_deviation:0", "got": "ValueError: List is empty", "source": "average_absolute_deviation([0])\n", "truncated": false, "want": "0.0\n"}, {"example_id": "average_absolute_deviation:1", "got": "ValueError: List is empty", "source": "average_absolute_deviation([4, 1, 3, 2])\n", "truncated": false, "want": "1.0\n"}, {"example_id": "average_absolute_deviation:2", "got": "ValueError: List is empty", "source": "average_absolute_deviation([2, 70, 6, 50, 20, 8, 4, 0])\n", "truncated": false, "want": "20.0\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "boolean_condition", "seed": 7, "span": {"col_offset": 7, "end_byte": 578, "lineno": 19, "node": "UnaryOp", "node_col_offset": 7, "node_end_col_offset": 15, "node_end_lineno": 19, "node_lineno": 19, "op_index": 0, "original_text": "not ", "replacement_text": "", "start_byte": 574}}, "public_tests": {"examples": [{"example_id": "average_absolute_deviation:0", "source": "average_absolute_deviation([0])\n", "want": "0.0\n"}, {"example_id": "average_absolute_deviation:1", "source": "average_absolute_deviation([4, 1, 3, 2])\n", "want": "1.0\n"}, {"example_id": "average_absolute_deviation:2", "source": "average_absolute_deviation([2, 70, 6, 50, 20, 8, 4, 0])\n", "want": "20.0\n"}, {"example_id": "average_absolute_deviation:3", "source": "average_absolute_deviation([-20, 0, 30, 15])\n", "want": "16.25\n"}, {"example_id": "average_absolute_deviation:4", "source": "average_absolute_deviation([])\n", "want": "Traceback (most recent call last):\n ...\nValueError: List is empty\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-fb1de0672b6e6c56", "tree_sha256": "af7b3ac9f9a986451e7307febb1a058bac3f18db147345e307a1f04fc0e0a54a", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/average_absolute_deviation.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def search(list_data: list, key: int, left: int = 0, right: int = 0) -> int:\n \"\"\"\n Iterate through the array to find the index of key using recursion.\n :param list_data: the list to be searched\n :param key: the key to be searched\n :param left: the index of first element\n :param right: the index of last element\n :return: the index of key value if found, -1 otherwise.\n\n >>> search(list(range(0, 11)), 5)\n 5\n >>> search([1, 2, 4, 5, 3], 4)\n 2\n >>> search([1, 2, 4, 5, 3], 6)\n -1\n >>> search([5], 5)\n 0\n >>> search([], 1)\n -1\n \"\"\"\n right = right or len(list_data) - 1\n if left > right:\n return -1\n elif list_data[left] == key:\n return left\n elif list_data[right] == key:\n return right\n else:\n return search(list_data, key, left + 1, right - 1)\n"}, "sha256": "efec43eb76f7f2a4ce21cfb1ff3dd44657f90c46134b8631d2dfa12188d7001d"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "efec43eb76f7f2a4ce21cfb1ff3dd44657f90c46134b8631d2dfa12188d7001d", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "4b51a60cdbc6ae85bba0339a405f842504ebac9374a08c417f40d4083cc085e3", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00189"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00189", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def search(list_data: list, key: int, left: int = 0, right: int = 0) -> int:\n \"\"\"\n Iterate through the array to find the index of key using recursion.\n :param list_data: the list to be searched\n :param key: the key to be searched\n :param left: the index of first element\n :param right: the index of last element\n :return: the index of key value if found, -1 otherwise.\n\n >>> search(list(range(0, 11)), 5)\n 5\n >>> search([1, 2, 4, 5, 3], 4)\n 2\n >>> search([1, 2, 4, 5, 3], 6)\n -1\n >>> search([5], 5)\n 0\n >>> search([], 1)\n -1\n \"\"\"\n right = right or len(list_data) - 1\n if left > right:\n return -1\n elif list_data[left] == key:\n return left\n elif list_data[right] == key:\n return right\n else:\n return search(list_data, key, left + 1, right + 1)\n"}, "sha256": "6f0059bd8764e27d51cdfea489872aa82a4f5399b2f50ac71fb7905060ee1dee"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "search:0", "got": "IndexError: list index out of range", "source": "search(list(range(0, 11)), 5)\n", "truncated": false, "want": "5\n"}, {"example_id": "search:1", "got": "IndexError: list index out of range", "source": "search([1, 2, 4, 5, 3], 4)\n", "truncated": false, "want": "2\n"}, {"example_id": "search:2", "got": "IndexError: list index out of range", "source": "search([1, 2, 4, 5, 3], 6)\n", "truncated": false, "want": "-1\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 54, "end_byte": 836, "lineno": 29, "node": "BinOp", "node_col_offset": 48, "node_end_col_offset": 57, "node_end_lineno": 29, "node_lineno": 29, "op_index": 0, "original_text": "-", "replacement_text": "+", "start_byte": 835}}, "public_tests": {"examples": [{"example_id": "search:0", "source": "search(list(range(0, 11)), 5)\n", "want": "5\n"}, {"example_id": "search:1", "source": "search([1, 2, 4, 5, 3], 4)\n", "want": "2\n"}, {"example_id": "search:2", "source": "search([1, 2, 4, 5, 3], 6)\n", "want": "-1\n"}, {"example_id": "search:3", "source": "search([5], 5)\n", "want": "0\n"}, {"example_id": "search:4", "source": "search([], 1)\n", "want": "-1\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-2a8d3e103c1b87f2", "tree_sha256": "efec43eb76f7f2a4ce21cfb1ff3dd44657f90c46134b8631d2dfa12188d7001d", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:searches/double_linear_search_recursion.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "from math import log2\n\n\ndef binary_count_trailing_zeros(a: int) -> int:\n \"\"\"\n Take in 1 integer, return a number that is\n the number of trailing zeros in binary representation of that number.\n\n >>> binary_count_trailing_zeros(25)\n 0\n >>> binary_count_trailing_zeros(36)\n 2\n >>> binary_count_trailing_zeros(16)\n 4\n >>> binary_count_trailing_zeros(58)\n 1\n >>> binary_count_trailing_zeros(4294967296)\n 32\n >>> binary_count_trailing_zeros(0)\n 0\n >>> binary_count_trailing_zeros(-10)\n Traceback (most recent call last):\n ...\n ValueError: Input value must be a positive integer\n >>> binary_count_trailing_zeros(0.8)\n Traceback (most recent call last):\n ...\n TypeError: Input value must be a 'int' type\n >>> binary_count_trailing_zeros(\"0\")\n Traceback (most recent call last):\n ...\n TypeError: '<' not supported between instances of 'str' and 'int'\n \"\"\"\n if a < 0:\n raise ValueError(\"Input value must be a positive integer\")\n elif isinstance(a, float):\n raise TypeError(\"Input value must be a 'int' type\")\n return 0 if (a == 0) else int(log2(a & -a))\n"}, "sha256": "63ced0d798f166667ac192c0e1cc4fb5ba91fe5f5fba53702565095a5f38b9ff"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "63ced0d798f166667ac192c0e1cc4fb5ba91fe5f5fba53702565095a5f38b9ff", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "7a0c09b1f50105a8c5e759740bd1c7b2aca28af2d6fed3a6c4c525d4fd7d18c9", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00190"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00190", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "from math import log2\n\n\ndef binary_count_trailing_zeros(a: int) -> int:\n \"\"\"\n Take in 1 integer, return a number that is\n the number of trailing zeros in binary representation of that number.\n\n >>> binary_count_trailing_zeros(25)\n 0\n >>> binary_count_trailing_zeros(36)\n 2\n >>> binary_count_trailing_zeros(16)\n 4\n >>> binary_count_trailing_zeros(58)\n 1\n >>> binary_count_trailing_zeros(4294967296)\n 32\n >>> binary_count_trailing_zeros(0)\n 0\n >>> binary_count_trailing_zeros(-10)\n Traceback (most recent call last):\n ...\n ValueError: Input value must be a positive integer\n >>> binary_count_trailing_zeros(0.8)\n Traceback (most recent call last):\n ...\n TypeError: Input value must be a 'int' type\n >>> binary_count_trailing_zeros(\"0\")\n Traceback (most recent call last):\n ...\n TypeError: '<' not supported between instances of 'str' and 'int'\n \"\"\"\n if a < 0:\n raise ValueError(\"Input value must be a positive integer\")\n elif isinstance(a, float):\n raise TypeError(\"Input value must be a 'int' type\")\n return (0 if (a == 0) else int(log2(a & -a))) + 1\n"}, "sha256": "1f0e68cb259acfcb93ab360d47621ee7066bdd2f31a13d24e4302dc76dd21360"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "binary_count_trailing_zeros:0", "got": "1\n", "source": "binary_count_trailing_zeros(25)\n", "truncated": false, "want": "0\n"}, {"example_id": "binary_count_trailing_zeros:1", "got": "3\n", "source": "binary_count_trailing_zeros(36)\n", "truncated": false, "want": "2\n"}, {"example_id": "binary_count_trailing_zeros:2", "got": "5\n", "source": "binary_count_trailing_zeros(16)\n", "truncated": false, "want": "4\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 1162, "lineno": 38, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 47, "node_end_lineno": 38, "node_lineno": 38, "op_index": 0, "original_text": "0 if (a == 0) else int(log2(a & -a))", "replacement_text": "(0 if (a == 0) else int(log2(a & -a))) + 1", "start_byte": 1126}}, "public_tests": {"examples": [{"example_id": "binary_count_trailing_zeros:0", "source": "binary_count_trailing_zeros(25)\n", "want": "0\n"}, {"example_id": "binary_count_trailing_zeros:1", "source": "binary_count_trailing_zeros(36)\n", "want": "2\n"}, {"example_id": "binary_count_trailing_zeros:2", "source": "binary_count_trailing_zeros(16)\n", "want": "4\n"}, {"example_id": "binary_count_trailing_zeros:3", "source": "binary_count_trailing_zeros(58)\n", "want": "1\n"}, {"example_id": "binary_count_trailing_zeros:4", "source": "binary_count_trailing_zeros(4294967296)\n", "want": "32\n"}, {"example_id": "binary_count_trailing_zeros:5", "source": "binary_count_trailing_zeros(0)\n", "want": "0\n"}, {"example_id": "binary_count_trailing_zeros:6", "source": "binary_count_trailing_zeros(-10)\n", "want": "Traceback (most recent call last):\n ...\nValueError: Input value must be a positive integer\n"}, {"example_id": "binary_count_trailing_zeros:7", "source": "binary_count_trailing_zeros(0.8)\n", "want": "Traceback (most recent call last):\n ...\nTypeError: Input value must be a 'int' type\n"}, {"example_id": "binary_count_trailing_zeros:8", "source": "binary_count_trailing_zeros(\"0\")\n", "want": "Traceback (most recent call last):\n ...\nTypeError: '<' not supported between instances of 'str' and 'int'\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-aae4be0f0fe76bd1", "tree_sha256": "63ced0d798f166667ac192c0e1cc4fb5ba91fe5f5fba53702565095a5f38b9ff", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:bit_manipulation/binary_count_trailing_zeros.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def prefix_function(input_string: str) -> list:\n \"\"\"\n For the given string this function computes value for each index(i),\n which represents the longest coincidence of prefix and suffix\n for given substring (input_str[0...i])\n\n For the value of the first element the algorithm always returns 0\n\n >>> prefix_function(\"aabcdaabc\")\n [0, 1, 0, 0, 0, 1, 2, 3, 4]\n >>> prefix_function(\"asdasdad\")\n [0, 0, 0, 1, 2, 3, 4, 0]\n \"\"\"\n\n # list for the result values\n prefix_result = [0] * len(input_string)\n\n for i in range(1, len(input_string)):\n # use last results for better performance - dynamic programming\n j = prefix_result[i - 1]\n while j > 0 and input_string[i] != input_string[j]:\n j = prefix_result[j - 1]\n\n if input_string[i] == input_string[j]:\n j += 1\n prefix_result[i] = j\n\n return prefix_result\n"}, "sha256": "d158eaede6771376946604ff644ff0d5fa1b59cd425eed8d34bd013e43ea3d3d"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "d158eaede6771376946604ff644ff0d5fa1b59cd425eed8d34bd013e43ea3d3d", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "705095110e7ba6a24cc2a983f2080290671551ce98f5e4042945ccf8771c4ecd", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00191"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00191", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 10, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def prefix_function(input_string: str) -> list:\n \"\"\"\n For the given string this function computes value for each index(i),\n which represents the longest coincidence of prefix and suffix\n for given substring (input_str[0...i])\n\n For the value of the first element the algorithm always returns 0\n\n >>> prefix_function(\"aabcdaabc\")\n [0, 1, 0, 0, 0, 1, 2, 3, 4]\n >>> prefix_function(\"asdasdad\")\n [0, 0, 0, 1, 2, 3, 4, 0]\n \"\"\"\n\n # list for the result values\n prefix_result = [0] * len(input_string)\n\n for i in range(1, len(input_string)):\n # use last results for better performance - dynamic programming\n j = prefix_result[i - 1]\n while j > 0 and input_string[i] != input_string[j]:\n j = prefix_result[j - 1]\n\n if input_string[i] == input_string[j]:\n j -= 1\n prefix_result[i] = j\n\n return prefix_result\n"}, "sha256": "ef3642dd6f6708c23383f03c641f2121632988eb400fce38b3a41a24733eeb7c"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "prefix_function:0", "got": "[0, -1, -1, -2, -2, -2, -2, -3, -3]\n", "source": "prefix_function(\"aabcdaabc\")\n", "truncated": false, "want": "[0, 1, 0, 0, 0, 1, 2, 3, 4]\n"}, {"example_id": "prefix_function:1", "got": "[0, 0, 0, -1, -1, -2, -3, -4]\n", "source": "prefix_function(\"asdasdad\")\n", "truncated": false, "want": "[0, 0, 0, 1, 2, 3, 4, 0]\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 14, "end_byte": 839, "lineno": 25, "node": "AugAssign", "node_col_offset": 12, "node_end_col_offset": 18, "node_end_lineno": 25, "node_lineno": 25, "op_index": 0, "original_text": "+=", "replacement_text": "-=", "start_byte": 837}}, "public_tests": {"examples": [{"example_id": "prefix_function:0", "source": "prefix_function(\"aabcdaabc\")\n", "want": "[0, 1, 0, 0, 0, 1, 2, 3, 4]\n"}, {"example_id": "prefix_function:1", "source": "prefix_function(\"asdasdad\")\n", "want": "[0, 0, 0, 1, 2, 3, 4, 0]\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-5c1d2aaf6e1fe5a5", "tree_sha256": "d158eaede6771376946604ff644ff0d5fa1b59cd425eed8d34bd013e43ea3d3d", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:strings/prefix_function.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def chebyshev_distance(point_a: list[float], point_b: list[float]) -> float:\n \"\"\"\n This function calculates the Chebyshev distance (also known as the\n Chessboard distance) between two n-dimensional points represented as lists.\n\n https://en.wikipedia.org/wiki/Chebyshev_distance\n\n >>> chebyshev_distance([1.0, 1.0], [2.0, 2.0])\n 1.0\n >>> chebyshev_distance([1.0, 1.0, 9.0], [2.0, 2.0, -5.2])\n 14.2\n >>> chebyshev_distance([1.0], [2.0, 2.0])\n Traceback (most recent call last):\n ...\n ValueError: Both points must have the same dimension.\n \"\"\"\n if len(point_a) != len(point_b):\n raise ValueError(\"Both points must have the same dimension.\")\n\n return max(abs(a - b) for a, b in zip(point_a, point_b))\n"}, "sha256": "23a91f6912b70982471b09ce1184e5634b6cbf3e7fb5ed86bbc8e2ce3d1bfb66"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "23a91f6912b70982471b09ce1184e5634b6cbf3e7fb5ed86bbc8e2ce3d1bfb66", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "dd5f29bd55c378e478f8c003feed13b45c714954b890605fcdda1e83cceb34bc", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00192"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00192", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 5, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def chebyshev_distance(point_a: list[float], point_b: list[float]) -> float:\n \"\"\"\n This function calculates the Chebyshev distance (also known as the\n Chessboard distance) between two n-dimensional points represented as lists.\n\n https://en.wikipedia.org/wiki/Chebyshev_distance\n\n >>> chebyshev_distance([1.0, 1.0], [2.0, 2.0])\n 1.0\n >>> chebyshev_distance([1.0, 1.0, 9.0], [2.0, 2.0, -5.2])\n 14.2\n >>> chebyshev_distance([1.0], [2.0, 2.0])\n Traceback (most recent call last):\n ...\n ValueError: Both points must have the same dimension.\n \"\"\"\n if len(point_a) != len(point_b):\n raise ValueError(\"Both points must have the same dimension.\")\n\n return max(abs(a + b) for a, b in zip(point_a, point_b))\n"}, "sha256": "d7e3d5d691aa917a74912bddba02302086ec60ae339345de1d3f6592f79fc1e9"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "chebyshev_distance:0", "got": "3.0\n", "source": "chebyshev_distance([1.0, 1.0], [2.0, 2.0])\n", "truncated": false, "want": "1.0\n"}, {"example_id": "chebyshev_distance:1", "got": "3.8\n", "source": "chebyshev_distance([1.0, 1.0, 9.0], [2.0, 2.0, -5.2])\n", "truncated": false, "want": "14.2\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 21, "end_byte": 714, "lineno": 20, "node": "BinOp", "node_col_offset": 19, "node_end_col_offset": 24, "node_end_lineno": 20, "node_lineno": 20, "op_index": 0, "original_text": "-", "replacement_text": "+", "start_byte": 713}}, "public_tests": {"examples": [{"example_id": "chebyshev_distance:0", "source": "chebyshev_distance([1.0, 1.0], [2.0, 2.0])\n", "want": "1.0\n"}, {"example_id": "chebyshev_distance:1", "source": "chebyshev_distance([1.0, 1.0, 9.0], [2.0, 2.0, -5.2])\n", "want": "14.2\n"}, {"example_id": "chebyshev_distance:2", "source": "chebyshev_distance([1.0], [2.0, 2.0])\n", "want": "Traceback (most recent call last):\n ...\nValueError: Both points must have the same dimension.\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-2aadbac902397f0a", "tree_sha256": "23a91f6912b70982471b09ce1184e5634b6cbf3e7fb5ed86bbc8e2ce3d1bfb66", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/chebyshev_distance.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def is_match(string: str, pattern: str) -> bool:\n \"\"\"\n >>> is_match(\"\", \"\")\n True\n >>> is_match(\"aa\", \"a\")\n False\n >>> is_match(\"abc\", \"abc\")\n True\n >>> is_match(\"abc\", \"*c\")\n True\n >>> is_match(\"abc\", \"a*\")\n True\n >>> is_match(\"abc\", \"*a*\")\n True\n >>> is_match(\"abc\", \"?b?\")\n True\n >>> is_match(\"abc\", \"*?\")\n True\n >>> is_match(\"abc\", \"a*d\")\n False\n >>> is_match(\"abc\", \"a*c?\")\n False\n >>> is_match('baaabab','*****ba*****ba')\n False\n >>> is_match('baaabab','*****ba*****ab')\n True\n >>> is_match('aa','*')\n True\n \"\"\"\n dp = [[False] * (len(pattern) + 1) for _ in string + \"1\"]\n dp[0][0] = True\n # Fill in the first row\n for j, char in enumerate(pattern, 1):\n if char == \"*\":\n dp[0][j] = dp[0][j - 1]\n # Fill in the rest of the DP table\n for i, s_char in enumerate(string, 1):\n for j, p_char in enumerate(pattern, 1):\n if p_char in (s_char, \"?\"):\n dp[i][j] = dp[i - 1][j - 1]\n elif pattern[j - 1] == \"*\":\n dp[i][j] = dp[i - 1][j] or dp[i][j - 1]\n return dp[len(string)][len(pattern)]\n"}, "sha256": "e0370d02e48206b51a35ae0fa4b9386720d7ba86b679e9a26aea084b369a270d"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "e0370d02e48206b51a35ae0fa4b9386720d7ba86b679e9a26aea084b369a270d", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "7c15cca5072a46539ebc8036206ccf2d65d2ed4e692dcedaa0d2413b7fb4922a", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00194"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00194", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def is_match(string: str, pattern: str) -> bool:\n \"\"\"\n >>> is_match(\"\", \"\")\n True\n >>> is_match(\"aa\", \"a\")\n False\n >>> is_match(\"abc\", \"abc\")\n True\n >>> is_match(\"abc\", \"*c\")\n True\n >>> is_match(\"abc\", \"a*\")\n True\n >>> is_match(\"abc\", \"*a*\")\n True\n >>> is_match(\"abc\", \"?b?\")\n True\n >>> is_match(\"abc\", \"*?\")\n True\n >>> is_match(\"abc\", \"a*d\")\n False\n >>> is_match(\"abc\", \"a*c?\")\n False\n >>> is_match('baaabab','*****ba*****ba')\n False\n >>> is_match('baaabab','*****ba*****ab')\n True\n >>> is_match('aa','*')\n True\n \"\"\"\n dp = [[False] * (len(pattern) + 1) for _ in string + \"1\"]\n dp[0][0] = True\n # Fill in the first row\n for j, char in enumerate(pattern, 1):\n if char == \"*\":\n dp[0][j] = dp[0][j + 1]\n # Fill in the rest of the DP table\n for i, s_char in enumerate(string, 1):\n for j, p_char in enumerate(pattern, 1):\n if p_char in (s_char, \"?\"):\n dp[i][j] = dp[i - 1][j - 1]\n elif pattern[j - 1] == \"*\":\n dp[i][j] = dp[i - 1][j] or dp[i][j - 1]\n return dp[len(string)][len(pattern)]\n"}, "sha256": "95a163514f4a9e6c625d25d7011771375e9e76fb920196208f36ec060c1b7c08"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "is_match:3", "got": "False\n", "source": "is_match(\"abc\", \"*c\")\n", "truncated": false, "want": "True\n"}, {"example_id": "is_match:4", "got": "IndexError: list index out of range", "source": "is_match(\"abc\", \"a*\")\n", "truncated": false, "want": "True\n"}, {"example_id": "is_match:5", "got": "IndexError: list index out of range", "source": "is_match(\"abc\", \"*a*\")\n", "truncated": false, "want": "True\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 31, "end_byte": 810, "lineno": 35, "node": "BinOp", "node_col_offset": 29, "node_end_col_offset": 34, "node_end_lineno": 35, "node_lineno": 35, "op_index": 0, "original_text": "-", "replacement_text": "+", "start_byte": 809}}, "public_tests": {"examples": [{"example_id": "is_match:0", "source": "is_match(\"\", \"\")\n", "want": "True\n"}, {"example_id": "is_match:1", "source": "is_match(\"aa\", \"a\")\n", "want": "False\n"}, {"example_id": "is_match:2", "source": "is_match(\"abc\", \"abc\")\n", "want": "True\n"}, {"example_id": "is_match:3", "source": "is_match(\"abc\", \"*c\")\n", "want": "True\n"}, {"example_id": "is_match:4", "source": "is_match(\"abc\", \"a*\")\n", "want": "True\n"}, {"example_id": "is_match:5", "source": "is_match(\"abc\", \"*a*\")\n", "want": "True\n"}, {"example_id": "is_match:6", "source": "is_match(\"abc\", \"?b?\")\n", "want": "True\n"}, {"example_id": "is_match:7", "source": "is_match(\"abc\", \"*?\")\n", "want": "True\n"}, {"example_id": "is_match:8", "source": "is_match(\"abc\", \"a*d\")\n", "want": "False\n"}, {"example_id": "is_match:9", "source": "is_match(\"abc\", \"a*c?\")\n", "want": "False\n"}, {"example_id": "is_match:10", "source": "is_match('baaabab','*****ba*****ba')\n", "want": "False\n"}, {"example_id": "is_match:11", "source": "is_match('baaabab','*****ba*****ab')\n", "want": "True\n"}, {"example_id": "is_match:12", "source": "is_match('aa','*')\n", "want": "True\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-b12fd0f3948b94ef", "tree_sha256": "e0370d02e48206b51a35ae0fa4b9386720d7ba86b679e9a26aea084b369a270d", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:dynamic_programming/wildcard_matching.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def is_isogram(string: str) -> bool:\n \"\"\"\n An isogram is a word in which no letter is repeated.\n Examples of isograms are uncopyrightable and ambidextrously.\n >>> is_isogram('Uncopyrightable')\n True\n >>> is_isogram('allowance')\n False\n >>> is_isogram('copy1')\n Traceback (most recent call last):\n ...\n ValueError: String must only contain alphabetic characters.\n \"\"\"\n if not all(x.isalpha() for x in string):\n raise ValueError(\"String must only contain alphabetic characters.\")\n\n letters = sorted(string.lower())\n return len(letters) == len(set(letters))\n"}, "sha256": "518557d2601ad31cc5ee80099e7c029db668d009289d46d60570f4436fb68a62"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "518557d2601ad31cc5ee80099e7c029db668d009289d46d60570f4436fb68a62", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "c67158938b38d19cabfcba5b76e079e495364e22d38a97222878751cdfcdf4b1", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00199"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00199", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 12, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def is_isogram(string: str) -> bool:\n \"\"\"\n An isogram is a word in which no letter is repeated.\n Examples of isograms are uncopyrightable and ambidextrously.\n >>> is_isogram('Uncopyrightable')\n True\n >>> is_isogram('allowance')\n False\n >>> is_isogram('copy1')\n Traceback (most recent call last):\n ...\n ValueError: String must only contain alphabetic characters.\n \"\"\"\n if not all(x.isalpha() for x in string):\n raise ValueError(\"String must only contain alphabetic characters.\")\n\n letters = sorted(string.lower())\n return not len(letters) == len(set(letters))\n"}, "sha256": "9c35f9afb2c63d4922806cb8694ef0f9b55723e675e69656d9de31330b1f45ee"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "is_isogram:0", "got": "False\n", "source": "is_isogram('Uncopyrightable')\n", "truncated": false, "want": "True\n"}, {"example_id": "is_isogram:1", "got": "True\n", "source": "is_isogram('allowance')\n", "truncated": false, "want": "False\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 607, "lineno": 18, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 44, "node_end_lineno": 18, "node_lineno": 18, "op_index": 0, "original_text": "len(letters) == len(set(letters))", "replacement_text": "not len(letters) == len(set(letters))", "start_byte": 574}}, "public_tests": {"examples": [{"example_id": "is_isogram:0", "source": "is_isogram('Uncopyrightable')\n", "want": "True\n"}, {"example_id": "is_isogram:1", "source": "is_isogram('allowance')\n", "want": "False\n"}, {"example_id": "is_isogram:2", "source": "is_isogram('copy1')\n", "want": "Traceback (most recent call last):\n ...\nValueError: String must only contain alphabetic characters.\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-69698580519e80d5", "tree_sha256": "518557d2601ad31cc5ee80099e7c029db668d009289d46d60570f4436fb68a62", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:strings/is_isogram.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def binary_and(a: int, b: int) -> str:\n \"\"\"\n Take in 2 integers, convert them to binary,\n return a binary number that is the\n result of a binary and operation on the integers provided.\n\n >>> binary_and(25, 32)\n '0b000000'\n >>> binary_and(37, 50)\n '0b100000'\n >>> binary_and(21, 30)\n '0b10100'\n >>> binary_and(58, 73)\n '0b0001000'\n >>> binary_and(0, 255)\n '0b00000000'\n >>> binary_and(256, 256)\n '0b100000000'\n >>> binary_and(0, -1)\n Traceback (most recent call last):\n ...\n ValueError: the value of both inputs must be positive\n >>> binary_and(0, 1.1)\n Traceback (most recent call last):\n ...\n ValueError: Unknown format code 'b' for object of type 'float'\n >>> binary_and(\"0\", \"1\")\n Traceback (most recent call last):\n ...\n TypeError: '<' not supported between instances of 'str' and 'int'\n \"\"\"\n if a < 0 or b < 0:\n raise ValueError(\"the value of both inputs must be positive\")\n\n a_binary = format(a, \"b\")\n b_binary = format(b, \"b\")\n\n max_len = max(len(a_binary), len(b_binary))\n\n return \"0b\" + \"\".join(\n str(int(char_a == \"1\" and char_b == \"1\"))\n for char_a, char_b in zip(a_binary.zfill(max_len), b_binary.zfill(max_len))\n )\n"}, "sha256": "8266334920fe4fe7522209991f61175e31efb8fab7ff209c97ef17722dd00e45"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "8266334920fe4fe7522209991f61175e31efb8fab7ff209c97ef17722dd00e45", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "da007375c7765e99d64d05ae3d826570d166c4c3efa598b28f7b94d81a4aef35", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00201"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00201", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def binary_and(a: int, b: int) -> str:\n \"\"\"\n Take in 2 integers, convert them to binary,\n return a binary number that is the\n result of a binary and operation on the integers provided.\n\n >>> binary_and(25, 32)\n '0b000000'\n >>> binary_and(37, 50)\n '0b100000'\n >>> binary_and(21, 30)\n '0b10100'\n >>> binary_and(58, 73)\n '0b0001000'\n >>> binary_and(0, 255)\n '0b00000000'\n >>> binary_and(256, 256)\n '0b100000000'\n >>> binary_and(0, -1)\n Traceback (most recent call last):\n ...\n ValueError: the value of both inputs must be positive\n >>> binary_and(0, 1.1)\n Traceback (most recent call last):\n ...\n ValueError: Unknown format code 'b' for object of type 'float'\n >>> binary_and(\"0\", \"1\")\n Traceback (most recent call last):\n ...\n TypeError: '<' not supported between instances of 'str' and 'int'\n \"\"\"\n if a < 0 or b < 0:\n raise ValueError(\"the value of both inputs must be positive\")\n\n a_binary = format(a, \"b\")\n b_binary = format(b, \"b\")\n\n max_len = max(len(a_binary), len(b_binary))\n\n return \"0b\" + \"\".join(\n str(int(char_a != \"1\" and char_b == \"1\"))\n for char_a, char_b in zip(a_binary.zfill(max_len), b_binary.zfill(max_len))\n )\n"}, "sha256": "89460c5a352197cb8d6bc1aced3366041534f498cfbfb35eb288625ee00ae5ab"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "binary_and:0", "got": "'0b100000'\n", "source": "binary_and(25, 32)\n", "truncated": false, "want": "'0b000000'\n"}, {"example_id": "binary_and:1", "got": "'0b010010'\n", "source": "binary_and(37, 50)\n", "truncated": false, "want": "'0b100000'\n"}, {"example_id": "binary_and:2", "got": "'0b01010'\n", "source": "binary_and(21, 30)\n", "truncated": false, "want": "'0b10100'\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "boolean_condition", "seed": 7, "span": {"col_offset": 23, "end_byte": 1151, "lineno": 41, "node": "Compare", "node_col_offset": 16, "node_end_col_offset": 29, "node_end_lineno": 41, "node_lineno": 41, "op_index": 0, "original_text": "==", "replacement_text": "!=", "start_byte": 1149}}, "public_tests": {"examples": [{"example_id": "binary_and:0", "source": "binary_and(25, 32)\n", "want": "'0b000000'\n"}, {"example_id": "binary_and:1", "source": "binary_and(37, 50)\n", "want": "'0b100000'\n"}, {"example_id": "binary_and:2", "source": "binary_and(21, 30)\n", "want": "'0b10100'\n"}, {"example_id": "binary_and:3", "source": "binary_and(58, 73)\n", "want": "'0b0001000'\n"}, {"example_id": "binary_and:4", "source": "binary_and(0, 255)\n", "want": "'0b00000000'\n"}, {"example_id": "binary_and:5", "source": "binary_and(256, 256)\n", "want": "'0b100000000'\n"}, {"example_id": "binary_and:6", "source": "binary_and(0, -1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: the value of both inputs must be positive\n"}, {"example_id": "binary_and:7", "source": "binary_and(0, 1.1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: Unknown format code 'b' for object of type 'float'\n"}, {"example_id": "binary_and:8", "source": "binary_and(\"0\", \"1\")\n", "want": "Traceback (most recent call last):\n ...\nTypeError: '<' not supported between instances of 'str' and 'int'\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-46e2a7087fb6941d", "tree_sha256": "8266334920fe4fe7522209991f61175e31efb8fab7ff209c97ef17722dd00e45", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:bit_manipulation/binary_and_operator.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def catalan_numbers(upper_limit: int) -> \"list[int]\":\n \"\"\"\n Return a list of the Catalan number sequence from 0 through `upper_limit`.\n\n >>> catalan_numbers(5)\n [1, 1, 2, 5, 14, 42]\n >>> catalan_numbers(2)\n [1, 1, 2]\n >>> catalan_numbers(-1)\n Traceback (most recent call last):\n ValueError: Limit for the Catalan sequence must be ≥ 0\n \"\"\"\n if upper_limit < 0:\n raise ValueError(\"Limit for the Catalan sequence must be ≥ 0\")\n\n catalan_list = [0] * (upper_limit + 1)\n\n # Base case: C(0) = C(1) = 1\n catalan_list[0] = 1\n if upper_limit > 0:\n catalan_list[1] = 1\n\n # Recurrence relation: C(i) = sum(C(j).C(i-j-1)), from j = 0 to i\n for i in range(2, upper_limit + 1):\n for j in range(i):\n catalan_list[i] += catalan_list[j] * catalan_list[i - j - 1]\n\n return catalan_list\n"}, "sha256": "3adebde86adfc2673db82bb95f801f6a848677758980a12f5863a3abb71d8ced"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "3adebde86adfc2673db82bb95f801f6a848677758980a12f5863a3abb71d8ced", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "26d5ae3f1fb7afef96ee2b88679344be01edf40642a94a9bbe28f9b357d03695", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00205"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00205", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 14, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def catalan_numbers(upper_limit: int) -> \"list[int]\":\n \"\"\"\n Return a list of the Catalan number sequence from 0 through `upper_limit`.\n\n >>> catalan_numbers(5)\n [1, 1, 2, 5, 14, 42]\n >>> catalan_numbers(2)\n [1, 1, 2]\n >>> catalan_numbers(-1)\n Traceback (most recent call last):\n ValueError: Limit for the Catalan sequence must be ≥ 0\n \"\"\"\n if upper_limit < 0:\n raise ValueError(\"Limit for the Catalan sequence must be ≥ 0\")\n\n catalan_list = [0] * (upper_limit + 1)\n\n # Base case: C(0) = C(1) = 1\n catalan_list[0] = 1\n if upper_limit > 0:\n catalan_list[1] = 1\n\n # Recurrence relation: C(i) = sum(C(j).C(i-j-1)), from j = 0 to i\n for i in range(2, upper_limit + 1):\n for j in range(i):\n catalan_list[i] += catalan_list[j] // catalan_list[i - j - 1]\n\n return catalan_list\n"}, "sha256": "ef2230e5ad295278be528ce495287a2af876a362a0e0e37276771f1f15cc29ed"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "catalan_numbers:0", "got": "[1, 1, 2, 3, 5, 9]\n", "source": "catalan_numbers(5)\n", "truncated": false, "want": "[1, 1, 2, 5, 14, 42]\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 47, "end_byte": 808, "lineno": 26, "node": "BinOp", "node_col_offset": 31, "node_end_col_offset": 72, "node_end_lineno": 26, "node_lineno": 26, "op_index": 0, "original_text": "*", "replacement_text": "//", "start_byte": 807}}, "public_tests": {"examples": [{"example_id": "catalan_numbers:0", "source": "catalan_numbers(5)\n", "want": "[1, 1, 2, 5, 14, 42]\n"}, {"example_id": "catalan_numbers:1", "source": "catalan_numbers(2)\n", "want": "[1, 1, 2]\n"}, {"example_id": "catalan_numbers:2", "source": "catalan_numbers(-1)\n", "want": "Traceback (most recent call last):\nValueError: Limit for the Catalan sequence must be ≥ 0\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-2cb03b9038e833c7", "tree_sha256": "3adebde86adfc2673db82bb95f801f6a848677758980a12f5863a3abb71d8ced", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:dynamic_programming/catalan_numbers.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def abs_max_sort(x: list[int]) -> int:\n \"\"\"\n >>> abs_max_sort([0,5,1,11])\n 11\n >>> abs_max_sort([3,-10,-2])\n -10\n >>> abs_max_sort([])\n Traceback (most recent call last):\n ...\n ValueError: abs_max_sort() arg is an empty sequence\n \"\"\"\n if len(x) == 0:\n raise ValueError(\"abs_max_sort() arg is an empty sequence\")\n return sorted(x, key=abs)[-1]\n"}, "sha256": "3d86db9a2ccfeaa48ecd29926e8d36c396b5741483a233da5ae06ea11b791fe2"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "3d86db9a2ccfeaa48ecd29926e8d36c396b5741483a233da5ae06ea11b791fe2", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "835a0eb4bf09e53fa2587d61400ef44a99de481d9aad66709e287eb1600d5102", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00206"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00206", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 12, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def abs_max_sort(x: list[int]) -> int:\n \"\"\"\n >>> abs_max_sort([0,5,1,11])\n 11\n >>> abs_max_sort([3,-10,-2])\n -10\n >>> abs_max_sort([])\n Traceback (most recent call last):\n ...\n ValueError: abs_max_sort() arg is an empty sequence\n \"\"\"\n if len(x) != 0:\n raise ValueError(\"abs_max_sort() arg is an empty sequence\")\n return sorted(x, key=abs)[-1]\n"}, "sha256": "498e965a7b69521a436fb89c3b6bbbe2ca53d2f6cf96d74881818c350a472b97"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "abs_max_sort:0", "got": "ValueError: abs_max_sort() arg is an empty sequence", "source": "abs_max_sort([0,5,1,11])\n", "truncated": false, "want": "11\n"}, {"example_id": "abs_max_sort:1", "got": "ValueError: abs_max_sort() arg is an empty sequence", "source": "abs_max_sort([3,-10,-2])\n", "truncated": false, "want": "-10\n"}, {"example_id": "abs_max_sort:2", "got": "IndexError: list index out of range", "source": "abs_max_sort([])\n", "truncated": false, "want": "Traceback (most recent call last):\n ...\nValueError: abs_max_sort() arg is an empty sequence\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "boolean_condition", "seed": 7, "span": {"col_offset": 14, "end_byte": 284, "lineno": 12, "node": "Compare", "node_col_offset": 7, "node_end_col_offset": 18, "node_end_lineno": 12, "node_lineno": 12, "op_index": 0, "original_text": "==", "replacement_text": "!=", "start_byte": 282}}, "public_tests": {"examples": [{"example_id": "abs_max_sort:0", "source": "abs_max_sort([0,5,1,11])\n", "want": "11\n"}, {"example_id": "abs_max_sort:1", "source": "abs_max_sort([3,-10,-2])\n", "want": "-10\n"}, {"example_id": "abs_max_sort:2", "source": "abs_max_sort([])\n", "want": "Traceback (most recent call last):\n ...\nValueError: abs_max_sort() arg is an empty sequence\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-6787677ac4ed089f", "tree_sha256": "3d86db9a2ccfeaa48ecd29926e8d36c396b5741483a233da5ae06ea11b791fe2", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/abs.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def pressure_and_volume_to_temperature(\n pressure: float, moles: float, volume: float\n) -> float:\n \"\"\"\n Convert pressure and volume to temperature.\n Ideal gas laws are used.\n Temperature is taken in kelvin.\n Volume is taken in litres.\n Pressure has atm as SI unit.\n\n Wikipedia reference: https://en.wikipedia.org/wiki/Gas_laws\n Wikipedia reference: https://en.wikipedia.org/wiki/Pressure\n Wikipedia reference: https://en.wikipedia.org/wiki/Temperature\n\n >>> pressure_and_volume_to_temperature(0.82, 1, 2)\n 20\n >>> pressure_and_volume_to_temperature(8.2, 5, 3)\n 60\n \"\"\"\n return round(float((pressure * volume) / (0.0821 * moles)))\n"}, "sha256": "dade0c4eff301e200870e4aed3c97afc2c49dd93b27511efa239c11ee1f0e620"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "dade0c4eff301e200870e4aed3c97afc2c49dd93b27511efa239c11ee1f0e620", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "08105f453b615cab15d16c71b8819cc4f444c36481f54c66991edf13146cda0c", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00209"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00209", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def pressure_and_volume_to_temperature(\n pressure: float, moles: float, volume: float\n) -> float:\n \"\"\"\n Convert pressure and volume to temperature.\n Ideal gas laws are used.\n Temperature is taken in kelvin.\n Volume is taken in litres.\n Pressure has atm as SI unit.\n\n Wikipedia reference: https://en.wikipedia.org/wiki/Gas_laws\n Wikipedia reference: https://en.wikipedia.org/wiki/Pressure\n Wikipedia reference: https://en.wikipedia.org/wiki/Temperature\n\n >>> pressure_and_volume_to_temperature(0.82, 1, 2)\n 20\n >>> pressure_and_volume_to_temperature(8.2, 5, 3)\n 60\n \"\"\"\n return round(float((pressure * volume) / (0.0821 // moles)))\n"}, "sha256": "4eee2b123c44ef269d1cbc908640ba51e2e02f7e5a86736c13981e6dabe04d2b"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "pressure_and_volume_to_temperature:0", "got": "ZeroDivisionError: float division by zero", "source": "pressure_and_volume_to_temperature(0.82, 1, 2)\n", "truncated": false, "want": "20\n"}, {"example_id": "pressure_and_volume_to_temperature:1", "got": "ZeroDivisionError: float division by zero", "source": "pressure_and_volume_to_temperature(8.2, 5, 3)\n", "truncated": false, "want": "60\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 53, "end_byte": 690, "lineno": 20, "node": "BinOp", "node_col_offset": 46, "node_end_col_offset": 60, "node_end_lineno": 20, "node_lineno": 20, "op_index": 0, "original_text": "*", "replacement_text": "//", "start_byte": 689}}, "public_tests": {"examples": [{"example_id": "pressure_and_volume_to_temperature:0", "source": "pressure_and_volume_to_temperature(0.82, 1, 2)\n", "want": "20\n"}, {"example_id": "pressure_and_volume_to_temperature:1", "source": "pressure_and_volume_to_temperature(8.2, 5, 3)\n", "want": "60\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-abc1ba08d917454e", "tree_sha256": "dade0c4eff301e200870e4aed3c97afc2c49dd93b27511efa239c11ee1f0e620", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:conversions/molecular_chemistry.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def get_1s_count(number: int) -> int:\n \"\"\"\n Count the number of set bits in a 32 bit integer using Brian Kernighan's way.\n Ref - https://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetKernighan\n >>> get_1s_count(25)\n 3\n >>> get_1s_count(37)\n 3\n >>> get_1s_count(21)\n 3\n >>> get_1s_count(58)\n 4\n >>> get_1s_count(0)\n 0\n >>> get_1s_count(256)\n 1\n >>> get_1s_count(-1)\n Traceback (most recent call last):\n ...\n ValueError: Input must be a non-negative integer\n >>> get_1s_count(0.8)\n Traceback (most recent call last):\n ...\n ValueError: Input must be a non-negative integer\n >>> get_1s_count(\"25\")\n Traceback (most recent call last):\n ...\n ValueError: Input must be a non-negative integer\n \"\"\"\n if not isinstance(number, int) or number < 0:\n raise ValueError(\"Input must be a non-negative integer\")\n\n count = 0\n while number:\n # This way we arrive at next set bit (next 1) instead of looping\n # through each bit and checking for 1s hence the\n # loop won't run 32 times it will only run the number of `1` times\n number &= number - 1\n count += 1\n return count\n"}, "sha256": "835a37970043464eb9a953ee9a7d481a8b11e916037312711872f871fdc5a3e4"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "835a37970043464eb9a953ee9a7d481a8b11e916037312711872f871fdc5a3e4", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "6f5bd2c56850d69ac412ae30fb1343f88edd3e9246a3c3c02638379397496bd8", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00210"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00210", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def get_1s_count(number: int) -> int:\n \"\"\"\n Count the number of set bits in a 32 bit integer using Brian Kernighan's way.\n Ref - https://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetKernighan\n >>> get_1s_count(25)\n 3\n >>> get_1s_count(37)\n 3\n >>> get_1s_count(21)\n 3\n >>> get_1s_count(58)\n 4\n >>> get_1s_count(0)\n 0\n >>> get_1s_count(256)\n 1\n >>> get_1s_count(-1)\n Traceback (most recent call last):\n ...\n ValueError: Input must be a non-negative integer\n >>> get_1s_count(0.8)\n Traceback (most recent call last):\n ...\n ValueError: Input must be a non-negative integer\n >>> get_1s_count(\"25\")\n Traceback (most recent call last):\n ...\n ValueError: Input must be a non-negative integer\n \"\"\"\n if not isinstance(number, int) or number <= 0:\n raise ValueError(\"Input must be a non-negative integer\")\n\n count = 0\n while number:\n # This way we arrive at next set bit (next 1) instead of looping\n # through each bit and checking for 1s hence the\n # loop won't run 32 times it will only run the number of `1` times\n number &= number - 1\n count += 1\n return count\n"}, "sha256": "039472b1053a81725ef3f4e2857832820b85298d06098a27df3c7d7da1d963ba"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "get_1s_count:4", "got": "ValueError: Input must be a non-negative integer", "source": "get_1s_count(0)\n", "truncated": false, "want": "0\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "comparison_boundary", "seed": 7, "span": {"col_offset": 45, "end_byte": 843, "lineno": 30, "node": "Compare", "node_col_offset": 38, "node_end_col_offset": 48, "node_end_lineno": 30, "node_lineno": 30, "op_index": 0, "original_text": "<", "replacement_text": "<=", "start_byte": 842}}, "public_tests": {"examples": [{"example_id": "get_1s_count:0", "source": "get_1s_count(25)\n", "want": "3\n"}, {"example_id": "get_1s_count:1", "source": "get_1s_count(37)\n", "want": "3\n"}, {"example_id": "get_1s_count:2", "source": "get_1s_count(21)\n", "want": "3\n"}, {"example_id": "get_1s_count:3", "source": "get_1s_count(58)\n", "want": "4\n"}, {"example_id": "get_1s_count:4", "source": "get_1s_count(0)\n", "want": "0\n"}, {"example_id": "get_1s_count:5", "source": "get_1s_count(256)\n", "want": "1\n"}, {"example_id": "get_1s_count:6", "source": "get_1s_count(-1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: Input must be a non-negative integer\n"}, {"example_id": "get_1s_count:7", "source": "get_1s_count(0.8)\n", "want": "Traceback (most recent call last):\n ...\nValueError: Input must be a non-negative integer\n"}, {"example_id": "get_1s_count:8", "source": "get_1s_count(\"25\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: Input must be a non-negative integer\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-8ad53ec0378e635f", "tree_sha256": "835a37970043464eb9a953ee9a7d481a8b11e916037312711872f871fdc5a3e4", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:bit_manipulation/count_1s_brian_kernighan_method.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def remove_digit(num: int) -> int:\n \"\"\"\n\n returns the biggest possible result\n that can be achieved by removing\n one digit from the given number\n\n >>> remove_digit(152)\n 52\n >>> remove_digit(6385)\n 685\n >>> remove_digit(-11)\n 1\n >>> remove_digit(2222222)\n 222222\n >>> remove_digit(\"2222222\")\n Traceback (most recent call last):\n TypeError: only integers accepted as input\n >>> remove_digit(\"string input\")\n Traceback (most recent call last):\n TypeError: only integers accepted as input\n \"\"\"\n\n if not isinstance(num, int):\n raise TypeError(\"only integers accepted as input\")\n else:\n num_str = str(abs(num))\n num_transpositions = [list(num_str) for char in range(len(num_str))]\n for index in range(len(num_str)):\n num_transpositions[index].pop(index)\n return max(\n int(\"\".join(list(transposition))) for transposition in num_transpositions\n )\n"}, "sha256": "61ca37f97e3dade0dd2bbf751faabf0e683e7b9d12a11d77371657bab171ef67"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "61ca37f97e3dade0dd2bbf751faabf0e683e7b9d12a11d77371657bab171ef67", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "e6eeef7cbe994e19927ce48bba8b75349e19ea1b9ac067c41506102103358e7a", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00212"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00212", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def remove_digit(num: int) -> int:\n \"\"\"\n\n returns the biggest possible result\n that can be achieved by removing\n one digit from the given number\n\n >>> remove_digit(152)\n 52\n >>> remove_digit(6385)\n 685\n >>> remove_digit(-11)\n 1\n >>> remove_digit(2222222)\n 222222\n >>> remove_digit(\"2222222\")\n Traceback (most recent call last):\n TypeError: only integers accepted as input\n >>> remove_digit(\"string input\")\n Traceback (most recent call last):\n TypeError: only integers accepted as input\n \"\"\"\n\n if isinstance(num, int):\n raise TypeError(\"only integers accepted as input\")\n else:\n num_str = str(abs(num))\n num_transpositions = [list(num_str) for char in range(len(num_str))]\n for index in range(len(num_str)):\n num_transpositions[index].pop(index)\n return max(\n int(\"\".join(list(transposition))) for transposition in num_transpositions\n )\n"}, "sha256": "5b2debf94fcf4cfaa72959741c12e31225406b25a02206dd5124093cf34bc6d2"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "remove_digit:0", "got": "TypeError: only integers accepted as input", "source": "remove_digit(152)\n", "truncated": false, "want": "52\n"}, {"example_id": "remove_digit:1", "got": "TypeError: only integers accepted as input", "source": "remove_digit(6385)\n", "truncated": false, "want": "685\n"}, {"example_id": "remove_digit:2", "got": "TypeError: only integers accepted as input", "source": "remove_digit(-11)\n", "truncated": false, "want": "1\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "boolean_condition", "seed": 7, "span": {"col_offset": 7, "end_byte": 560, "lineno": 24, "node": "UnaryOp", "node_col_offset": 7, "node_end_col_offset": 31, "node_end_lineno": 24, "node_lineno": 24, "op_index": 0, "original_text": "not ", "replacement_text": "", "start_byte": 556}}, "public_tests": {"examples": [{"example_id": "remove_digit:0", "source": "remove_digit(152)\n", "want": "52\n"}, {"example_id": "remove_digit:1", "source": "remove_digit(6385)\n", "want": "685\n"}, {"example_id": "remove_digit:2", "source": "remove_digit(-11)\n", "want": "1\n"}, {"example_id": "remove_digit:3", "source": "remove_digit(2222222)\n", "want": "222222\n"}, {"example_id": "remove_digit:4", "source": "remove_digit(\"2222222\")\n", "want": "Traceback (most recent call last):\nTypeError: only integers accepted as input\n"}, {"example_id": "remove_digit:5", "source": "remove_digit(\"string input\")\n", "want": "Traceback (most recent call last):\nTypeError: only integers accepted as input\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-6516ac9b7ea66ad2", "tree_sha256": "61ca37f97e3dade0dd2bbf751faabf0e683e7b9d12a11d77371657bab171ef67", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/remove_digit.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "from collections import Counter\n\n\ndef sock_merchant(colors: list[int]) -> int:\n \"\"\"\n >>> sock_merchant([10, 20, 20, 10, 10, 30, 50, 10, 20])\n 3\n >>> sock_merchant([1, 1, 3, 3])\n 2\n \"\"\"\n return sum(socks_by_color // 2 for socks_by_color in Counter(colors).values())\n"}, "sha256": "fbca935cf4d515abb09f818c8331f2cdc67dfe6f0d3d19c352b2a2fd2340da9a"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "fbca935cf4d515abb09f818c8331f2cdc67dfe6f0d3d19c352b2a2fd2340da9a", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "7cdc60fe97cef02226958608651507ddebf39282b15c1a0583a8ea08ae1e7bbf", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00213"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00213", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 12, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "from collections import Counter\n\n\ndef sock_merchant(colors: list[int]) -> int:\n \"\"\"\n >>> sock_merchant([10, 20, 20, 10, 10, 30, 50, 10, 20])\n 3\n >>> sock_merchant([1, 1, 3, 3])\n 2\n \"\"\"\n return sum(socks_by_color % 2 for socks_by_color in Counter(colors).values())\n"}, "sha256": "c4e78fcd372d0d4146e88b9accca2d0c26398c60f85a1d453d5978827cfc30e3"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "sock_merchant:1", "got": "0\n", "source": "sock_merchant([1, 1, 3, 3])\n", "truncated": false, "want": "2\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 30, "end_byte": 235, "lineno": 11, "node": "BinOp", "node_col_offset": 15, "node_end_col_offset": 34, "node_end_lineno": 11, "node_lineno": 11, "op_index": 0, "original_text": "//", "replacement_text": "%", "start_byte": 233}}, "public_tests": {"examples": [{"example_id": "sock_merchant:0", "source": "sock_merchant([10, 20, 20, 10, 10, 30, 50, 10, 20])\n", "want": "3\n"}, {"example_id": "sock_merchant:1", "source": "sock_merchant([1, 1, 3, 3])\n", "want": "2\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-bf3b7f92351f3f53", "tree_sha256": "fbca935cf4d515abb09f818c8331f2cdc67dfe6f0d3d19c352b2a2fd2340da9a", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/sock_merchant.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def find_previous_power_of_two(number: int) -> int:\n \"\"\"\n Find the largest power of two that is less than or equal to a given integer.\n https://stackoverflow.com/questions/1322510\n\n >>> [find_previous_power_of_two(i) for i in range(18)]\n [0, 1, 2, 2, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 16, 16]\n >>> find_previous_power_of_two(-5)\n Traceback (most recent call last):\n ...\n ValueError: Input must be a non-negative integer\n >>> find_previous_power_of_two(10.5)\n Traceback (most recent call last):\n ...\n ValueError: Input must be a non-negative integer\n \"\"\"\n if not isinstance(number, int) or number < 0:\n raise ValueError(\"Input must be a non-negative integer\")\n if number == 0:\n return 0\n power = 1\n while power <= number:\n power <<= 1 # Equivalent to multiplying by 2\n return power >> 1 if number > 1 else 1\n"}, "sha256": "06cecf6bfadedc0dfa9be761a890f9128eb6fb9a4a1ed706ab29a544382eac4c"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "06cecf6bfadedc0dfa9be761a890f9128eb6fb9a4a1ed706ab29a544382eac4c", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "667a438e1dbcaebca0adcc97b7900f34225f65112dcc734a04071be0c22f3f94", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00216"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00216", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 4, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def find_previous_power_of_two(number: int) -> int:\n \"\"\"\n Find the largest power of two that is less than or equal to a given integer.\n https://stackoverflow.com/questions/1322510\n\n >>> [find_previous_power_of_two(i) for i in range(18)]\n [0, 1, 2, 2, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 16, 16]\n >>> find_previous_power_of_two(-5)\n Traceback (most recent call last):\n ...\n ValueError: Input must be a non-negative integer\n >>> find_previous_power_of_two(10.5)\n Traceback (most recent call last):\n ...\n ValueError: Input must be a non-negative integer\n \"\"\"\n if not isinstance(number, int) or number <= 0:\n raise ValueError(\"Input must be a non-negative integer\")\n if number == 0:\n return 0\n power = 1\n while power <= number:\n power <<= 1 # Equivalent to multiplying by 2\n return power >> 1 if number > 1 else 1\n"}, "sha256": "314571e4f8cdd512468abeb210c4d37e5a91ebd84a12b326ab1be83b317b256e"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "find_previous_power_of_two:0", "got": "ValueError: Input must be a non-negative integer", "source": "[find_previous_power_of_two(i) for i in range(18)]\n", "truncated": false, "want": "[0, 1, 2, 2, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 16, 16]\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "comparison_boundary", "seed": 7, "span": {"col_offset": 45, "end_byte": 652, "lineno": 17, "node": "Compare", "node_col_offset": 38, "node_end_col_offset": 48, "node_end_lineno": 17, "node_lineno": 17, "op_index": 0, "original_text": "<", "replacement_text": "<=", "start_byte": 651}}, "public_tests": {"examples": [{"example_id": "find_previous_power_of_two:0", "source": "[find_previous_power_of_two(i) for i in range(18)]\n", "want": "[0, 1, 2, 2, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 16, 16]\n"}, {"example_id": "find_previous_power_of_two:1", "source": "find_previous_power_of_two(-5)\n", "want": "Traceback (most recent call last):\n ...\nValueError: Input must be a non-negative integer\n"}, {"example_id": "find_previous_power_of_two:2", "source": "find_previous_power_of_two(10.5)\n", "want": "Traceback (most recent call last):\n ...\nValueError: Input must be a non-negative integer\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-4640938b44d27661", "tree_sha256": "06cecf6bfadedc0dfa9be761a890f9128eb6fb9a4a1ed706ab29a544382eac4c", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:bit_manipulation/find_previous_power_of_two.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "from __future__ import annotations\n\n\ndef largest_divisible_subset(items: list[int]) -> list[int]:\n \"\"\"\n Algorithm to find the biggest subset in the given array such that for any 2 elements\n x and y in the subset, either x divides y or y divides x.\n >>> largest_divisible_subset([1, 16, 7, 8, 4])\n [16, 8, 4, 1]\n >>> largest_divisible_subset([1, 2, 3])\n [2, 1]\n >>> largest_divisible_subset([-1, -2, -3])\n [-3]\n >>> largest_divisible_subset([1, 2, 4, 8])\n [8, 4, 2, 1]\n >>> largest_divisible_subset((1, 2, 4, 8))\n [8, 4, 2, 1]\n >>> largest_divisible_subset([1, 1, 1])\n [1, 1, 1]\n >>> largest_divisible_subset([0, 0, 0])\n [0, 0, 0]\n >>> largest_divisible_subset([-1, -1, -1])\n [-1, -1, -1]\n >>> largest_divisible_subset([])\n []\n \"\"\"\n # Sort the array in ascending order as the sequence does not matter we only have to\n # pick up a subset.\n items = sorted(items)\n\n number_of_items = len(items)\n\n # Initialize memo with 1s and hash with increasing numbers\n memo = [1] * number_of_items\n hash_array = list(range(number_of_items))\n\n # Iterate through the array\n for i, item in enumerate(items):\n for prev_index in range(i):\n if ((items[prev_index] != 0 and item % items[prev_index]) == 0) and (\n (1 + memo[prev_index]) > memo[i]\n ):\n memo[i] = 1 + memo[prev_index]\n hash_array[i] = prev_index\n\n ans = -1\n last_index = -1\n\n # Find the maximum length and its corresponding index\n for i, memo_item in enumerate(memo):\n if memo_item > ans:\n ans = memo_item\n last_index = i\n\n # Reconstruct the divisible subset\n if last_index == -1:\n return []\n result = [items[last_index]]\n while hash_array[last_index] != last_index:\n last_index = hash_array[last_index]\n result.append(items[last_index])\n\n return result\n"}, "sha256": "770a1e4ad7feee351c73f31e996a9bec72a39a80dad10ca21f912b1e7a699869"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "770a1e4ad7feee351c73f31e996a9bec72a39a80dad10ca21f912b1e7a699869", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "1093f7db2f334ab728ceb921dcdc040ab59bd0fd565f3ad716147a4df090b574", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00218"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00218", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "from __future__ import annotations\n\n\ndef largest_divisible_subset(items: list[int]) -> list[int]:\n \"\"\"\n Algorithm to find the biggest subset in the given array such that for any 2 elements\n x and y in the subset, either x divides y or y divides x.\n >>> largest_divisible_subset([1, 16, 7, 8, 4])\n [16, 8, 4, 1]\n >>> largest_divisible_subset([1, 2, 3])\n [2, 1]\n >>> largest_divisible_subset([-1, -2, -3])\n [-3]\n >>> largest_divisible_subset([1, 2, 4, 8])\n [8, 4, 2, 1]\n >>> largest_divisible_subset((1, 2, 4, 8))\n [8, 4, 2, 1]\n >>> largest_divisible_subset([1, 1, 1])\n [1, 1, 1]\n >>> largest_divisible_subset([0, 0, 0])\n [0, 0, 0]\n >>> largest_divisible_subset([-1, -1, -1])\n [-1, -1, -1]\n >>> largest_divisible_subset([])\n []\n \"\"\"\n # Sort the array in ascending order as the sequence does not matter we only have to\n # pick up a subset.\n items = sorted(items)\n\n number_of_items = len(items)\n\n # Initialize memo with 1s and hash with increasing numbers\n memo = [1] * number_of_items\n hash_array = list(range(number_of_items))\n\n # Iterate through the array\n for i, item in enumerate(items):\n for prev_index in range(i):\n if ((items[prev_index] != 0 and item // items[prev_index]) == 0) and (\n (1 + memo[prev_index]) > memo[i]\n ):\n memo[i] = 1 + memo[prev_index]\n hash_array[i] = prev_index\n\n ans = -1\n last_index = -1\n\n # Find the maximum length and its corresponding index\n for i, memo_item in enumerate(memo):\n if memo_item > ans:\n ans = memo_item\n last_index = i\n\n # Reconstruct the divisible subset\n if last_index == -1:\n return []\n result = [items[last_index]]\n while hash_array[last_index] != last_index:\n last_index = hash_array[last_index]\n result.append(items[last_index])\n\n return result\n"}, "sha256": "0ce2692cb6eb6b0fa6942c8e12cf66020d26c66dbe4e3571bda69ab90a6215e9"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "largest_divisible_subset:0", "got": "[1]\n", "source": "largest_divisible_subset([1, 16, 7, 8, 4])\n", "truncated": false, "want": "[16, 8, 4, 1]\n"}, {"example_id": "largest_divisible_subset:1", "got": "[1]\n", "source": "largest_divisible_subset([1, 2, 3])\n", "truncated": false, "want": "[2, 1]\n"}, {"example_id": "largest_divisible_subset:2", "got": "[-1, -2, -3]\n", "source": "largest_divisible_subset([-1, -2, -3])\n", "truncated": false, "want": "[-3]\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 49, "end_byte": 1268, "lineno": 40, "node": "BinOp", "node_col_offset": 44, "node_end_col_offset": 68, "node_end_lineno": 40, "node_lineno": 40, "op_index": 0, "original_text": "%", "replacement_text": "//", "start_byte": 1267}}, "public_tests": {"examples": [{"example_id": "largest_divisible_subset:0", "source": "largest_divisible_subset([1, 16, 7, 8, 4])\n", "want": "[16, 8, 4, 1]\n"}, {"example_id": "largest_divisible_subset:1", "source": "largest_divisible_subset([1, 2, 3])\n", "want": "[2, 1]\n"}, {"example_id": "largest_divisible_subset:2", "source": "largest_divisible_subset([-1, -2, -3])\n", "want": "[-3]\n"}, {"example_id": "largest_divisible_subset:3", "source": "largest_divisible_subset([1, 2, 4, 8])\n", "want": "[8, 4, 2, 1]\n"}, {"example_id": "largest_divisible_subset:4", "source": "largest_divisible_subset((1, 2, 4, 8))\n", "want": "[8, 4, 2, 1]\n"}, {"example_id": "largest_divisible_subset:5", "source": "largest_divisible_subset([1, 1, 1])\n", "want": "[1, 1, 1]\n"}, {"example_id": "largest_divisible_subset:6", "source": "largest_divisible_subset([0, 0, 0])\n", "want": "[0, 0, 0]\n"}, {"example_id": "largest_divisible_subset:7", "source": "largest_divisible_subset([-1, -1, -1])\n", "want": "[-1, -1, -1]\n"}, {"example_id": "largest_divisible_subset:8", "source": "largest_divisible_subset([])\n", "want": "[]\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-4f5a32078ff9d93c", "tree_sha256": "770a1e4ad7feee351c73f31e996a9bec72a39a80dad10ca21f912b1e7a699869", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:dynamic_programming/largest_divisible_subset.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def tribonacci(num: int) -> list[int]:\n \"\"\"\n Given a number, return first n Tribonacci Numbers.\n >>> tribonacci(5)\n [0, 0, 1, 1, 2]\n >>> tribonacci(8)\n [0, 0, 1, 1, 2, 4, 7, 13]\n \"\"\"\n dp = [0] * num\n dp[2] = 1\n\n for i in range(3, num):\n dp[i] = dp[i - 1] + dp[i - 2] + dp[i - 3]\n\n return dp\n"}, "sha256": "11c2f747774fd48844149a993e711eeceb7ec74681cda482ebc8721e18981331"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "11c2f747774fd48844149a993e711eeceb7ec74681cda482ebc8721e18981331", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "91b17bee530c0165723196d114a216b57772a0583202c004c4450e7020df47d6", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00223"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00223", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 10, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def tribonacci(num: int) -> list[int]:\n \"\"\"\n Given a number, return first n Tribonacci Numbers.\n >>> tribonacci(5)\n [0, 0, 1, 1, 2]\n >>> tribonacci(8)\n [0, 0, 1, 1, 2, 4, 7, 13]\n \"\"\"\n dp = [0] * num\n dp[2] = 1\n\n for i in range(3, num):\n dp[i] = dp[i - 1] + dp[i + 2] + dp[i - 3]\n\n return dp\n"}, "sha256": "bceca3a07cd0650ebafc022c9230e17793ebc72fb8bdeedbd715ba8fa12d76d4"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "tribonacci:0", "got": "IndexError: list index out of range", "source": "tribonacci(5)\n", "truncated": false, "want": "[0, 0, 1, 1, 2]\n"}, {"example_id": "tribonacci:1", "got": "IndexError: list index out of range", "source": "tribonacci(8)\n", "truncated": false, "want": "[0, 0, 1, 1, 2, 4, 7, 13]\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 33, "end_byte": 300, "lineno": 13, "node": "BinOp", "node_col_offset": 31, "node_end_col_offset": 36, "node_end_lineno": 13, "node_lineno": 13, "op_index": 0, "original_text": "-", "replacement_text": "+", "start_byte": 299}}, "public_tests": {"examples": [{"example_id": "tribonacci:0", "source": "tribonacci(5)\n", "want": "[0, 0, 1, 1, 2]\n"}, {"example_id": "tribonacci:1", "source": "tribonacci(8)\n", "want": "[0, 0, 1, 1, 2, 4, 7, 13]\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-9bec4770d14b620a", "tree_sha256": "11c2f747774fd48844149a993e711eeceb7ec74681cda482ebc8721e18981331", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:dynamic_programming/tribonacci.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def is_int_palindrome(num: int) -> bool:\n \"\"\"\n Returns whether `num` is a palindrome or not\n (see for reference https://en.wikipedia.org/wiki/Palindromic_number).\n\n >>> is_int_palindrome(-121)\n False\n >>> is_int_palindrome(0)\n True\n >>> is_int_palindrome(10)\n False\n >>> is_int_palindrome(11)\n True\n >>> is_int_palindrome(101)\n True\n >>> is_int_palindrome(120)\n False\n \"\"\"\n if num < 0:\n return False\n\n num_copy: int = num\n rev_num: int = 0\n while num > 0:\n rev_num = rev_num * 10 + (num % 10)\n num //= 10\n\n return num_copy == rev_num\n"}, "sha256": "a09b4a54aed8c3e3d35a9b801ec0e34629a40450c33a50369a7a22162d113560"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "a09b4a54aed8c3e3d35a9b801ec0e34629a40450c33a50369a7a22162d113560", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "c4ff7ea1848bfde30a9892a800675572bcfeaa305961785da45fd3f85ee386b1", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00225"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00225", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def is_int_palindrome(num: int) -> bool:\n \"\"\"\n Returns whether `num` is a palindrome or not\n (see for reference https://en.wikipedia.org/wiki/Palindromic_number).\n\n >>> is_int_palindrome(-121)\n False\n >>> is_int_palindrome(0)\n True\n >>> is_int_palindrome(10)\n False\n >>> is_int_palindrome(11)\n True\n >>> is_int_palindrome(101)\n True\n >>> is_int_palindrome(120)\n False\n \"\"\"\n if num < 0:\n return True\n\n num_copy: int = num\n rev_num: int = 0\n while num > 0:\n rev_num = rev_num * 10 + (num % 10)\n num //= 10\n\n return num_copy == rev_num\n"}, "sha256": "df8e9347d0f07e96acc818ef05a626a21fd096f2917343716541577c3180e2dc"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "is_int_palindrome:0", "got": "True\n", "source": "is_int_palindrome(-121)\n", "truncated": false, "want": "False\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 15, "end_byte": 457, "lineno": 20, "node": "Return", "node_col_offset": 8, "node_end_col_offset": 20, "node_end_lineno": 20, "node_lineno": 20, "op_index": 0, "original_text": "False", "replacement_text": "True", "start_byte": 452}}, "public_tests": {"examples": [{"example_id": "is_int_palindrome:0", "source": "is_int_palindrome(-121)\n", "want": "False\n"}, {"example_id": "is_int_palindrome:1", "source": "is_int_palindrome(0)\n", "want": "True\n"}, {"example_id": "is_int_palindrome:2", "source": "is_int_palindrome(10)\n", "want": "False\n"}, {"example_id": "is_int_palindrome:3", "source": "is_int_palindrome(11)\n", "want": "True\n"}, {"example_id": "is_int_palindrome:4", "source": "is_int_palindrome(101)\n", "want": "True\n"}, {"example_id": "is_int_palindrome:5", "source": "is_int_palindrome(120)\n", "want": "False\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-bf8abb6d70938220", "tree_sha256": "a09b4a54aed8c3e3d35a9b801ec0e34629a40450c33a50369a7a22162d113560", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/is_int_palindrome.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def dodecahedron_surface_area(edge: float) -> float:\n \"\"\"\n Calculates the surface area of a regular dodecahedron\n a = 3 * ((25 + 10 * (5** (1 / 2))) ** (1 / 2 )) * (e**2)\n where:\n a --> is the area of the dodecahedron\n e --> is the length of the edge\n reference-->\"Dodecahedron\" Study.com\n \n\n :param edge: length of the edge of the dodecahedron\n :type edge: float\n :return: the surface area of the dodecahedron as a float\n\n\n Tests:\n >>> dodecahedron_surface_area(5)\n 516.1432201766901\n >>> dodecahedron_surface_area(10)\n 2064.5728807067603\n >>> dodecahedron_surface_area(-1)\n Traceback (most recent call last):\n ...\n ValueError: Length must be a positive.\n \"\"\"\n\n if edge <= 0 or not isinstance(edge, int):\n raise ValueError(\"Length must be a positive.\")\n return 3 * ((25 + 10 * (5 ** (1 / 2))) ** (1 / 2)) * (edge**2)\n"}, "sha256": "9b17e915b8b585a3e1ef545dfbd09d22ddc9b869db74be722cf0d9210c191179"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "9b17e915b8b585a3e1ef545dfbd09d22ddc9b869db74be722cf0d9210c191179", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "534ad60e07238d31343e425aa79fd6f0d271922ae3d845fc3930e02537841653", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00230"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00230", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 12, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def dodecahedron_surface_area(edge: float) -> float:\n \"\"\"\n Calculates the surface area of a regular dodecahedron\n a = 3 * ((25 + 10 * (5** (1 / 2))) ** (1 / 2 )) * (e**2)\n where:\n a --> is the area of the dodecahedron\n e --> is the length of the edge\n reference-->\"Dodecahedron\" Study.com\n \n\n :param edge: length of the edge of the dodecahedron\n :type edge: float\n :return: the surface area of the dodecahedron as a float\n\n\n Tests:\n >>> dodecahedron_surface_area(5)\n 516.1432201766901\n >>> dodecahedron_surface_area(10)\n 2064.5728807067603\n >>> dodecahedron_surface_area(-1)\n Traceback (most recent call last):\n ...\n ValueError: Length must be a positive.\n \"\"\"\n\n if edge <= 0 or not isinstance(edge, int):\n raise ValueError(\"Length must be a positive.\")\n return 3 * ((25 + 10 * (5 ** (1 / 2))) ** (1 / 2)) // (edge**2)\n"}, "sha256": "f6edaa7a1ca798f9d449153f083e489d7b0518f1502c50d875510bfca79838c3"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "dodecahedron_surface_area:0", "got": "0.0\n", "source": "dodecahedron_surface_area(5)\n", "truncated": false, "want": "516.1432201766901\n"}, {"example_id": "dodecahedron_surface_area:1", "got": "0.0\n", "source": "dodecahedron_surface_area(10)\n", "truncated": false, "want": "2064.5728807067603\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 55, "end_byte": 966, "lineno": 29, "node": "BinOp", "node_col_offset": 11, "node_end_col_offset": 66, "node_end_lineno": 29, "node_lineno": 29, "op_index": 0, "original_text": "*", "replacement_text": "//", "start_byte": 965}}, "public_tests": {"examples": [{"example_id": "dodecahedron_surface_area:0", "source": "dodecahedron_surface_area(5)\n", "want": "516.1432201766901\n"}, {"example_id": "dodecahedron_surface_area:1", "source": "dodecahedron_surface_area(10)\n", "want": "2064.5728807067603\n"}, {"example_id": "dodecahedron_surface_area:2", "source": "dodecahedron_surface_area(-1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: Length must be a positive.\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-b2c789719ab12cbe", "tree_sha256": "9b17e915b8b585a3e1ef545dfbd09d22ddc9b869db74be722cf0d9210c191179", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/dodecahedron.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def is_int_palindrome(num: int) -> bool:\n \"\"\"\n Returns whether `num` is a palindrome or not\n (see for reference https://en.wikipedia.org/wiki/Palindromic_number).\n\n >>> is_int_palindrome(-121)\n False\n >>> is_int_palindrome(0)\n True\n >>> is_int_palindrome(10)\n False\n >>> is_int_palindrome(11)\n True\n >>> is_int_palindrome(101)\n True\n >>> is_int_palindrome(120)\n False\n \"\"\"\n if num < 0:\n return False\n\n num_copy: int = num\n rev_num: int = 0\n while num > 0:\n rev_num = rev_num * 10 + (num % 10)\n num //= 10\n\n return num_copy == rev_num\n"}, "sha256": "a09b4a54aed8c3e3d35a9b801ec0e34629a40450c33a50369a7a22162d113560"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "a09b4a54aed8c3e3d35a9b801ec0e34629a40450c33a50369a7a22162d113560", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "0bb2cb89b5aac017212cbe8b3f27590ac74ebfd38b0cbcf689fda11eae93fe16", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00231"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00231", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def is_int_palindrome(num: int) -> bool:\n \"\"\"\n Returns whether `num` is a palindrome or not\n (see for reference https://en.wikipedia.org/wiki/Palindromic_number).\n\n >>> is_int_palindrome(-121)\n False\n >>> is_int_palindrome(0)\n True\n >>> is_int_palindrome(10)\n False\n >>> is_int_palindrome(11)\n True\n >>> is_int_palindrome(101)\n True\n >>> is_int_palindrome(120)\n False\n \"\"\"\n if num < 0:\n return False\n\n num_copy: int = num\n rev_num: int = 0\n while num > 0:\n rev_num = rev_num * 10 + (num % 10)\n num //= 10\n\n return not num_copy == rev_num\n"}, "sha256": "b5ba362cdf34e42666d5add1dcdcf49da7030271e33d52e25f1948b22c031857"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "is_int_palindrome:1", "got": "False\n", "source": "is_int_palindrome(0)\n", "truncated": false, "want": "True\n"}, {"example_id": "is_int_palindrome:2", "got": "True\n", "source": "is_int_palindrome(10)\n", "truncated": false, "want": "False\n"}, {"example_id": "is_int_palindrome:3", "got": "False\n", "source": "is_int_palindrome(11)\n", "truncated": false, "want": "True\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 617, "lineno": 28, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 30, "node_end_lineno": 28, "node_lineno": 28, "op_index": 0, "original_text": "num_copy == rev_num", "replacement_text": "not num_copy == rev_num", "start_byte": 598}}, "public_tests": {"examples": [{"example_id": "is_int_palindrome:0", "source": "is_int_palindrome(-121)\n", "want": "False\n"}, {"example_id": "is_int_palindrome:1", "source": "is_int_palindrome(0)\n", "want": "True\n"}, {"example_id": "is_int_palindrome:2", "source": "is_int_palindrome(10)\n", "want": "False\n"}, {"example_id": "is_int_palindrome:3", "source": "is_int_palindrome(11)\n", "want": "True\n"}, {"example_id": "is_int_palindrome:4", "source": "is_int_palindrome(101)\n", "want": "True\n"}, {"example_id": "is_int_palindrome:5", "source": "is_int_palindrome(120)\n", "want": "False\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-bf8abb6d70938220", "tree_sha256": "a09b4a54aed8c3e3d35a9b801ec0e34629a40450c33a50369a7a22162d113560", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/is_int_palindrome.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def find_unique_number(arr: list[int]) -> int:\n \"\"\"\n Given a list of integers where every element appears twice except for one,\n this function returns the element that appears only once using bitwise XOR.\n\n >>> find_unique_number([1, 1, 2, 2, 3])\n 3\n >>> find_unique_number([4, 5, 4, 6, 6])\n 5\n >>> find_unique_number([7])\n 7\n >>> find_unique_number([10, 20, 10])\n 20\n >>> find_unique_number([])\n Traceback (most recent call last):\n ...\n ValueError: input list must not be empty\n >>> find_unique_number([1, 'a', 1])\n Traceback (most recent call last):\n ...\n TypeError: all elements must be integers\n \"\"\"\n if not arr:\n raise ValueError(\"input list must not be empty\")\n if not all(isinstance(x, int) for x in arr):\n raise TypeError(\"all elements must be integers\")\n\n result = 0\n for num in arr:\n result ^= num\n return result\n"}, "sha256": "143b6d21dbc64232f6e592ebebf3b32fa8a220e23dce2703c7d1fa88927e6485"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "143b6d21dbc64232f6e592ebebf3b32fa8a220e23dce2703c7d1fa88927e6485", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "374460640ad05f435840c9627c375019e32757c4a8887c41a65a7d97ffdafeab", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00233"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00233", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 18, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def find_unique_number(arr: list[int]) -> int:\n \"\"\"\n Given a list of integers where every element appears twice except for one,\n this function returns the element that appears only once using bitwise XOR.\n\n >>> find_unique_number([1, 1, 2, 2, 3])\n 3\n >>> find_unique_number([4, 5, 4, 6, 6])\n 5\n >>> find_unique_number([7])\n 7\n >>> find_unique_number([10, 20, 10])\n 20\n >>> find_unique_number([])\n Traceback (most recent call last):\n ...\n ValueError: input list must not be empty\n >>> find_unique_number([1, 'a', 1])\n Traceback (most recent call last):\n ...\n TypeError: all elements must be integers\n \"\"\"\n if arr:\n raise ValueError(\"input list must not be empty\")\n if not all(isinstance(x, int) for x in arr):\n raise TypeError(\"all elements must be integers\")\n\n result = 0\n for num in arr:\n result ^= num\n return result\n"}, "sha256": "40341287c3eac0e674c16d8c475154345592709093367e5dc9db42f26d259192"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "find_unique_number:0", "got": "ValueError: input list must not be empty", "source": "find_unique_number([1, 1, 2, 2, 3])\n", "truncated": false, "want": "3\n"}, {"example_id": "find_unique_number:1", "got": "ValueError: input list must not be empty", "source": "find_unique_number([4, 5, 4, 6, 6])\n", "truncated": false, "want": "5\n"}, {"example_id": "find_unique_number:2", "got": "ValueError: input list must not be empty", "source": "find_unique_number([7])\n", "truncated": false, "want": "7\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "boolean_condition", "seed": 7, "span": {"col_offset": 7, "end_byte": 683, "lineno": 23, "node": "UnaryOp", "node_col_offset": 7, "node_end_col_offset": 14, "node_end_lineno": 23, "node_lineno": 23, "op_index": 0, "original_text": "not ", "replacement_text": "", "start_byte": 679}}, "public_tests": {"examples": [{"example_id": "find_unique_number:0", "source": "find_unique_number([1, 1, 2, 2, 3])\n", "want": "3\n"}, {"example_id": "find_unique_number:1", "source": "find_unique_number([4, 5, 4, 6, 6])\n", "want": "5\n"}, {"example_id": "find_unique_number:2", "source": "find_unique_number([7])\n", "want": "7\n"}, {"example_id": "find_unique_number:3", "source": "find_unique_number([10, 20, 10])\n", "want": "20\n"}, {"example_id": "find_unique_number:4", "source": "find_unique_number([])\n", "want": "Traceback (most recent call last):\n ...\nValueError: input list must not be empty\n"}, {"example_id": "find_unique_number:5", "source": "find_unique_number([1, 'a', 1])\n", "want": "Traceback (most recent call last):\n ...\nTypeError: all elements must be integers\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-3f45a5a68e5dbb52", "tree_sha256": "143b6d21dbc64232f6e592ebebf3b32fa8a220e23dce2703c7d1fa88927e6485", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:bit_manipulation/find_unique_number.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def merge(arr: list[int]) -> list[int]:\n \"\"\"Return a sorted array.\n >>> merge([10,9,8,7,6,5,4,3,2,1])\n [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n >>> merge([1,2,3,4,5,6,7,8,9,10])\n [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n >>> merge([10,22,1,2,3,9,15,23])\n [1, 2, 3, 9, 10, 15, 22, 23]\n >>> merge([100])\n [100]\n >>> merge([])\n []\n \"\"\"\n if len(arr) > 1:\n middle_length = len(arr) // 2 # Finds the middle of the array\n left_array = arr[\n :middle_length\n ] # Creates an array of the elements in the first half.\n right_array = arr[\n middle_length:\n ] # Creates an array of the elements in the second half.\n left_size = len(left_array)\n right_size = len(right_array)\n merge(left_array) # Starts sorting the left.\n merge(right_array) # Starts sorting the right\n left_index = 0 # Left Counter\n right_index = 0 # Right Counter\n index = 0 # Position Counter\n while (\n left_index < left_size and right_index < right_size\n ): # Runs until the lowers size of the left and right are sorted.\n if left_array[left_index] < right_array[right_index]:\n arr[index] = left_array[left_index]\n left_index += 1\n else:\n arr[index] = right_array[right_index]\n right_index += 1\n index += 1\n while (\n left_index < left_size\n ): # Adds the left over elements in the left half of the array\n arr[index] = left_array[left_index]\n left_index += 1\n index += 1\n while (\n right_index < right_size\n ): # Adds the left over elements in the right half of the array\n arr[index] = right_array[right_index]\n right_index += 1\n index += 1\n return arr\n"}, "sha256": "b262d138e0740ab6aa614845d394aa7f9395b13710e5bb769e2f4637dc4ef379"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "b262d138e0740ab6aa614845d394aa7f9395b13710e5bb769e2f4637dc4ef379", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "4cab8bd04d21cf52b764d442cc919c6552f334df52857375a7a1c3adc0e54cdf", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00234"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00234", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 16, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def merge(arr: list[int]) -> list[int]:\n \"\"\"Return a sorted array.\n >>> merge([10,9,8,7,6,5,4,3,2,1])\n [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n >>> merge([1,2,3,4,5,6,7,8,9,10])\n [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n >>> merge([10,22,1,2,3,9,15,23])\n [1, 2, 3, 9, 10, 15, 22, 23]\n >>> merge([100])\n [100]\n >>> merge([])\n []\n \"\"\"\n if len(arr) > 1:\n middle_length = len(arr) // 2 # Finds the middle of the array\n left_array = arr[\n :middle_length\n ] # Creates an array of the elements in the first half.\n right_array = arr[\n middle_length:\n ] # Creates an array of the elements in the second half.\n left_size = len(left_array)\n right_size = len(right_array)\n merge(left_array) # Starts sorting the left.\n merge(right_array) # Starts sorting the right\n left_index = 0 # Left Counter\n right_index = 0 # Right Counter\n index = 0 # Position Counter\n while (\n left_index < left_size and right_index < right_size\n ): # Runs until the lowers size of the left and right are sorted.\n if left_array[left_index] < right_array[right_index]:\n arr[index] = left_array[left_index]\n left_index += 1\n else:\n arr[index] = right_array[right_index]\n right_index += 1\n index += 1\n while (\n left_index <= left_size\n ): # Adds the left over elements in the left half of the array\n arr[index] = left_array[left_index]\n left_index += 1\n index += 1\n while (\n right_index < right_size\n ): # Adds the left over elements in the right half of the array\n arr[index] = right_array[right_index]\n right_index += 1\n index += 1\n return arr\n"}, "sha256": "fe26e1ab57b54edb4061f5dc409a4fd775c4aadd9d19865c6effd62133b04406"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "merge:0", "got": "IndexError: list index out of range", "source": "merge([10,9,8,7,6,5,4,3,2,1])\n", "truncated": false, "want": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n"}, {"example_id": "merge:1", "got": "IndexError: list index out of range", "source": "merge([1,2,3,4,5,6,7,8,9,10])\n", "truncated": false, "want": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n"}, {"example_id": "merge:2", "got": "IndexError: list index out of range", "source": "merge([10,22,1,2,3,9,15,23])\n", "truncated": false, "want": "[1, 2, 3, 9, 10, 15, 22, 23]\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "comparison_boundary", "seed": 7, "span": {"col_offset": 23, "end_byte": 1456, "lineno": 40, "node": "Compare", "node_col_offset": 12, "node_end_col_offset": 34, "node_end_lineno": 40, "node_lineno": 40, "op_index": 0, "original_text": "<", "replacement_text": "<=", "start_byte": 1455}}, "public_tests": {"examples": [{"example_id": "merge:0", "source": "merge([10,9,8,7,6,5,4,3,2,1])\n", "want": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n"}, {"example_id": "merge:1", "source": "merge([1,2,3,4,5,6,7,8,9,10])\n", "want": "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n"}, {"example_id": "merge:2", "source": "merge([10,22,1,2,3,9,15,23])\n", "want": "[1, 2, 3, 9, 10, 15, 22, 23]\n"}, {"example_id": "merge:3", "source": "merge([100])\n", "want": "[100]\n"}, {"example_id": "merge:4", "source": "merge([])\n", "want": "[]\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-7a45c92e46ccd4d3", "tree_sha256": "b262d138e0740ab6aa614845d394aa7f9395b13710e5bb769e2f4637dc4ef379", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:sorts/recursive_mergesort_array.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def ipv4_to_decimal(ipv4_address: str) -> int:\n \"\"\"\n Convert an IPv4 address to its decimal representation.\n\n Args:\n ip_address: A string representing an IPv4 address (e.g., \"192.168.0.1\").\n\n Returns:\n int: The decimal representation of the IP address.\n\n >>> ipv4_to_decimal(\"192.168.0.1\")\n 3232235521\n >>> ipv4_to_decimal(\"10.0.0.255\")\n 167772415\n >>> ipv4_to_decimal(\"10.0.255\")\n Traceback (most recent call last):\n ...\n ValueError: Invalid IPv4 address format\n >>> ipv4_to_decimal(\"10.0.0.256\")\n Traceback (most recent call last):\n ...\n ValueError: Invalid IPv4 octet 256\n \"\"\"\n\n octets = [int(octet) for octet in ipv4_address.split(\".\")]\n if len(octets) != 4:\n raise ValueError(\"Invalid IPv4 address format\")\n\n decimal_ipv4 = 0\n for octet in octets:\n if not 0 <= octet <= 255:\n raise ValueError(f\"Invalid IPv4 octet {octet}\") # noqa: EM102\n decimal_ipv4 = (decimal_ipv4 << 8) + int(octet)\n\n return decimal_ipv4\n"}, "sha256": "c5addf0c8bc971441899883d29d1096f60bbcd009fc78f57ea71f085e4379b20"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "c5addf0c8bc971441899883d29d1096f60bbcd009fc78f57ea71f085e4379b20", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "356ffe1c866692fb42defd2e6d9899c4fd28cde19b649516c20bf30e703be2c8", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00235"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00235", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 2, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def ipv4_to_decimal(ipv4_address: str) -> int:\n \"\"\"\n Convert an IPv4 address to its decimal representation.\n\n Args:\n ip_address: A string representing an IPv4 address (e.g., \"192.168.0.1\").\n\n Returns:\n int: The decimal representation of the IP address.\n\n >>> ipv4_to_decimal(\"192.168.0.1\")\n 3232235521\n >>> ipv4_to_decimal(\"10.0.0.255\")\n 167772415\n >>> ipv4_to_decimal(\"10.0.255\")\n Traceback (most recent call last):\n ...\n ValueError: Invalid IPv4 address format\n >>> ipv4_to_decimal(\"10.0.0.256\")\n Traceback (most recent call last):\n ...\n ValueError: Invalid IPv4 octet 256\n \"\"\"\n\n octets = [int(octet) for octet in ipv4_address.split(\".\")]\n if len(octets) != 4:\n raise ValueError(\"Invalid IPv4 address format\")\n\n decimal_ipv4 = 0\n for octet in octets:\n if not 0 < octet <= 255:\n raise ValueError(f\"Invalid IPv4 octet {octet}\") # noqa: EM102\n decimal_ipv4 = (decimal_ipv4 << 8) + int(octet)\n\n return decimal_ipv4\n"}, "sha256": "08185d1754858d8b8c3cbe12cef2ecbbebfb5e8739d407ee8dce93dc121e8e1d"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "ipv4_to_decimal:0", "got": "ValueError: Invalid IPv4 octet 0", "source": "ipv4_to_decimal(\"192.168.0.1\")\n", "truncated": false, "want": "3232235521\n"}, {"example_id": "ipv4_to_decimal:1", "got": "ValueError: Invalid IPv4 octet 0", "source": "ipv4_to_decimal(\"10.0.0.255\")\n", "truncated": false, "want": "167772415\n"}, {"example_id": "ipv4_to_decimal:3", "got": "ValueError: Invalid IPv4 octet 0", "source": "ipv4_to_decimal(\"10.0.0.256\")\n", "truncated": false, "want": "Traceback (most recent call last):\n ...\nValueError: Invalid IPv4 octet 256\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "comparison_boundary", "seed": 7, "span": {"col_offset": 17, "end_byte": 864, "lineno": 31, "node": "Compare", "node_col_offset": 15, "node_end_col_offset": 32, "node_end_lineno": 31, "node_lineno": 31, "op_index": 0, "original_text": "<=", "replacement_text": "<", "start_byte": 862}}, "public_tests": {"examples": [{"example_id": "ipv4_to_decimal:0", "source": "ipv4_to_decimal(\"192.168.0.1\")\n", "want": "3232235521\n"}, {"example_id": "ipv4_to_decimal:1", "source": "ipv4_to_decimal(\"10.0.0.255\")\n", "want": "167772415\n"}, {"example_id": "ipv4_to_decimal:2", "source": "ipv4_to_decimal(\"10.0.255\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: Invalid IPv4 address format\n"}, {"example_id": "ipv4_to_decimal:3", "source": "ipv4_to_decimal(\"10.0.0.256\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: Invalid IPv4 octet 256\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-66a134cd57c5f051", "tree_sha256": "c5addf0c8bc971441899883d29d1096f60bbcd009fc78f57ea71f085e4379b20", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:conversions/ipv4_conversion.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "from collections import Counter\n\n\ndef sock_merchant(colors: list[int]) -> int:\n \"\"\"\n >>> sock_merchant([10, 20, 20, 10, 10, 30, 50, 10, 20])\n 3\n >>> sock_merchant([1, 1, 3, 3])\n 2\n \"\"\"\n return sum(socks_by_color // 2 for socks_by_color in Counter(colors).values())\n"}, "sha256": "fbca935cf4d515abb09f818c8331f2cdc67dfe6f0d3d19c352b2a2fd2340da9a"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "fbca935cf4d515abb09f818c8331f2cdc67dfe6f0d3d19c352b2a2fd2340da9a", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "eea40ce586f7bdfb5147d15252d5ef512b5e07dce45288028236d2b646bc0a6a", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00237"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00237", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 12, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "from collections import Counter\n\n\ndef sock_merchant(colors: list[int]) -> int:\n \"\"\"\n >>> sock_merchant([10, 20, 20, 10, 10, 30, 50, 10, 20])\n 3\n >>> sock_merchant([1, 1, 3, 3])\n 2\n \"\"\"\n return sum(socks_by_color // 2 for socks_by_color in Counter(colors).values()) - 1\n"}, "sha256": "c9f7ba5d197c8a3255011056db10359bb99dcaf960c8cd8b1f17765e3a85fde2"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "sock_merchant:0", "got": "2\n", "source": "sock_merchant([10, 20, 20, 10, 10, 30, 50, 10, 20])\n", "truncated": false, "want": "3\n"}, {"example_id": "sock_merchant:1", "got": "1\n", "source": "sock_merchant([1, 1, 3, 3])\n", "truncated": false, "want": "2\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 285, "lineno": 11, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 82, "node_end_lineno": 11, "node_lineno": 11, "op_index": 0, "original_text": "sum(socks_by_color // 2 for socks_by_color in Counter(colors).values())", "replacement_text": "sum(socks_by_color // 2 for socks_by_color in Counter(colors).values()) - 1", "start_byte": 214}}, "public_tests": {"examples": [{"example_id": "sock_merchant:0", "source": "sock_merchant([10, 20, 20, 10, 10, 30, 50, 10, 20])\n", "want": "3\n"}, {"example_id": "sock_merchant:1", "source": "sock_merchant([1, 1, 3, 3])\n", "want": "2\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-bf3b7f92351f3f53", "tree_sha256": "fbca935cf4d515abb09f818c8331f2cdc67dfe6f0d3d19c352b2a2fd2340da9a", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/sock_merchant.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def perfect_square_binary_search(n: int) -> bool:\n \"\"\"\n Check if a number is perfect square using binary search.\n Time complexity : O(Log(n))\n Space complexity: O(1)\n\n >>> perfect_square_binary_search(9)\n True\n >>> perfect_square_binary_search(16)\n True\n >>> perfect_square_binary_search(1)\n True\n >>> perfect_square_binary_search(0)\n True\n >>> perfect_square_binary_search(10)\n False\n >>> perfect_square_binary_search(-1)\n False\n >>> perfect_square_binary_search(1.1)\n False\n >>> perfect_square_binary_search(\"a\")\n Traceback (most recent call last):\n ...\n TypeError: '<=' not supported between instances of 'int' and 'str'\n >>> perfect_square_binary_search(None)\n Traceback (most recent call last):\n ...\n TypeError: '<=' not supported between instances of 'int' and 'NoneType'\n >>> perfect_square_binary_search([])\n Traceback (most recent call last):\n ...\n TypeError: '<=' not supported between instances of 'int' and 'list'\n \"\"\"\n left = 0\n right = n\n while left <= right:\n mid = (left + right) // 2\n if mid**2 == n:\n return True\n elif mid**2 > n:\n right = mid - 1\n else:\n left = mid + 1\n return False\n"}, "sha256": "fdd79d1c55e1abf785f4e12bdee3e97183e851891fcc72392250dd63e543ed57"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "fdd79d1c55e1abf785f4e12bdee3e97183e851891fcc72392250dd63e543ed57", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "c09053ed44f1df22761eddd460393192e1a2703f7806432a04dba8d7b0a242e1", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00240"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00240", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def perfect_square_binary_search(n: int) -> bool:\n \"\"\"\n Check if a number is perfect square using binary search.\n Time complexity : O(Log(n))\n Space complexity: O(1)\n\n >>> perfect_square_binary_search(9)\n True\n >>> perfect_square_binary_search(16)\n True\n >>> perfect_square_binary_search(1)\n True\n >>> perfect_square_binary_search(0)\n True\n >>> perfect_square_binary_search(10)\n False\n >>> perfect_square_binary_search(-1)\n False\n >>> perfect_square_binary_search(1.1)\n False\n >>> perfect_square_binary_search(\"a\")\n Traceback (most recent call last):\n ...\n TypeError: '<=' not supported between instances of 'int' and 'str'\n >>> perfect_square_binary_search(None)\n Traceback (most recent call last):\n ...\n TypeError: '<=' not supported between instances of 'int' and 'NoneType'\n >>> perfect_square_binary_search([])\n Traceback (most recent call last):\n ...\n TypeError: '<=' not supported between instances of 'int' and 'list'\n \"\"\"\n left = 0\n right = n\n while left < right:\n mid = (left + right) // 2\n if mid**2 == n:\n return True\n elif mid**2 > n:\n right = mid - 1\n else:\n left = mid + 1\n return False\n"}, "sha256": "35b590b54b2d6f10f57d0affe298679d39a9e349a719c813e664ca016b0a5c33"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "perfect_square_binary_search:0", "got": "False\n", "source": "perfect_square_binary_search(9)\n", "truncated": false, "want": "True\n"}, {"example_id": "perfect_square_binary_search:1", "got": "False\n", "source": "perfect_square_binary_search(16)\n", "truncated": false, "want": "True\n"}, {"example_id": "perfect_square_binary_search:2", "got": "False\n", "source": "perfect_square_binary_search(1)\n", "truncated": false, "want": "True\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "comparison_boundary", "seed": 7, "span": {"col_offset": 15, "end_byte": 1080, "lineno": 36, "node": "Compare", "node_col_offset": 10, "node_end_col_offset": 23, "node_end_lineno": 36, "node_lineno": 36, "op_index": 0, "original_text": "<=", "replacement_text": "<", "start_byte": 1078}}, "public_tests": {"examples": [{"example_id": "perfect_square_binary_search:0", "source": "perfect_square_binary_search(9)\n", "want": "True\n"}, {"example_id": "perfect_square_binary_search:1", "source": "perfect_square_binary_search(16)\n", "want": "True\n"}, {"example_id": "perfect_square_binary_search:2", "source": "perfect_square_binary_search(1)\n", "want": "True\n"}, {"example_id": "perfect_square_binary_search:3", "source": "perfect_square_binary_search(0)\n", "want": "True\n"}, {"example_id": "perfect_square_binary_search:4", "source": "perfect_square_binary_search(10)\n", "want": "False\n"}, {"example_id": "perfect_square_binary_search:5", "source": "perfect_square_binary_search(-1)\n", "want": "False\n"}, {"example_id": "perfect_square_binary_search:6", "source": "perfect_square_binary_search(1.1)\n", "want": "False\n"}, {"example_id": "perfect_square_binary_search:7", "source": "perfect_square_binary_search(\"a\")\n", "want": "Traceback (most recent call last):\n ...\nTypeError: '<=' not supported between instances of 'int' and 'str'\n"}, {"example_id": "perfect_square_binary_search:8", "source": "perfect_square_binary_search(None)\n", "want": "Traceback (most recent call last):\n ...\nTypeError: '<=' not supported between instances of 'int' and 'NoneType'\n"}, {"example_id": "perfect_square_binary_search:9", "source": "perfect_square_binary_search([])\n", "want": "Traceback (most recent call last):\n ...\nTypeError: '<=' not supported between instances of 'int' and 'list'\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-daa2defee986b883", "tree_sha256": "fdd79d1c55e1abf785f4e12bdee3e97183e851891fcc72392250dd63e543ed57", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/perfect_square.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "from collections import Counter\n\n\ndef sock_merchant(colors: list[int]) -> int:\n \"\"\"\n >>> sock_merchant([10, 20, 20, 10, 10, 30, 50, 10, 20])\n 3\n >>> sock_merchant([1, 1, 3, 3])\n 2\n \"\"\"\n return sum(socks_by_color // 2 for socks_by_color in Counter(colors).values())\n"}, "sha256": "fbca935cf4d515abb09f818c8331f2cdc67dfe6f0d3d19c352b2a2fd2340da9a"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "fbca935cf4d515abb09f818c8331f2cdc67dfe6f0d3d19c352b2a2fd2340da9a", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "12c02e671bc5003e606acb6f457af5f471df2b03124d0b4913b9fb45ab5105eb", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00241"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00241", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 12, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "from collections import Counter\n\n\ndef sock_merchant(colors: list[int]) -> int:\n \"\"\"\n >>> sock_merchant([10, 20, 20, 10, 10, 30, 50, 10, 20])\n 3\n >>> sock_merchant([1, 1, 3, 3])\n 2\n \"\"\"\n return sum(socks_by_color // 2 for socks_by_color in Counter(colors).values()) + 1\n"}, "sha256": "2f34dfb1e8ed30f1fad7bede880da0e72aeb0f64cb526908ccde9ccd717c5e1e"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "sock_merchant:0", "got": "4\n", "source": "sock_merchant([10, 20, 20, 10, 10, 30, 50, 10, 20])\n", "truncated": false, "want": "3\n"}, {"example_id": "sock_merchant:1", "got": "3\n", "source": "sock_merchant([1, 1, 3, 3])\n", "truncated": false, "want": "2\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 285, "lineno": 11, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 82, "node_end_lineno": 11, "node_lineno": 11, "op_index": 0, "original_text": "sum(socks_by_color // 2 for socks_by_color in Counter(colors).values())", "replacement_text": "sum(socks_by_color // 2 for socks_by_color in Counter(colors).values()) + 1", "start_byte": 214}}, "public_tests": {"examples": [{"example_id": "sock_merchant:0", "source": "sock_merchant([10, 20, 20, 10, 10, 30, 50, 10, 20])\n", "want": "3\n"}, {"example_id": "sock_merchant:1", "source": "sock_merchant([1, 1, 3, 3])\n", "want": "2\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-bf3b7f92351f3f53", "tree_sha256": "fbca935cf4d515abb09f818c8331f2cdc67dfe6f0d3d19c352b2a2fd2340da9a", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/sock_merchant.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "from __future__ import annotations\n\n\ndef maximum_non_adjacent_sum(nums: list[int]) -> int:\n \"\"\"\n Find the maximum non-adjacent sum of the integers in the nums input list\n\n >>> maximum_non_adjacent_sum([1, 2, 3])\n 4\n >>> maximum_non_adjacent_sum([1, 5, 3, 7, 2, 2, 6])\n 18\n >>> maximum_non_adjacent_sum([-1, -5, -3, -7, -2, -2, -6])\n 0\n >>> maximum_non_adjacent_sum([499, 500, -3, -7, -2, -2, -6])\n 500\n \"\"\"\n if not nums:\n return 0\n max_including = nums[0]\n max_excluding = 0\n for num in nums[1:]:\n max_including, max_excluding = (\n max_excluding + num,\n max(max_including, max_excluding),\n )\n return max(max_excluding, max_including)\n"}, "sha256": "dc59aad3f504e26529c6a1d813ab10ff5c3b0a0b9fb77e77ca08c3ef759be8aa"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "dc59aad3f504e26529c6a1d813ab10ff5c3b0a0b9fb77e77ca08c3ef759be8aa", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "2ee6045937b2de3c08afdc86a45408baea842fec1c9ad3c8665d4061b4a3b118", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00242"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00242", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 23, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "from __future__ import annotations\n\n\ndef maximum_non_adjacent_sum(nums: list[int]) -> int:\n \"\"\"\n Find the maximum non-adjacent sum of the integers in the nums input list\n\n >>> maximum_non_adjacent_sum([1, 2, 3])\n 4\n >>> maximum_non_adjacent_sum([1, 5, 3, 7, 2, 2, 6])\n 18\n >>> maximum_non_adjacent_sum([-1, -5, -3, -7, -2, -2, -6])\n 0\n >>> maximum_non_adjacent_sum([499, 500, -3, -7, -2, -2, -6])\n 500\n \"\"\"\n if not nums:\n return 0\n max_including = nums[0]\n max_excluding = 0\n for num in nums[1:]:\n max_including, max_excluding = (\n max_excluding - num,\n max(max_including, max_excluding),\n )\n return max(max_excluding, max_including)\n"}, "sha256": "e01127aa631662d7b99423a72526cd83c26dcc66fed1bce7d5f408067651a3e3"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "maximum_non_adjacent_sum:0", "got": "1\n", "source": "maximum_non_adjacent_sum([1, 2, 3])\n", "truncated": false, "want": "4\n"}, {"example_id": "maximum_non_adjacent_sum:1", "got": "1\n", "source": "maximum_non_adjacent_sum([1, 5, 3, 7, 2, 2, 6])\n", "truncated": false, "want": "18\n"}, {"example_id": "maximum_non_adjacent_sum:2", "got": "18\n", "source": "maximum_non_adjacent_sum([-1, -5, -3, -7, -2, -2, -6])\n", "truncated": false, "want": "0\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 26, "end_byte": 617, "lineno": 23, "node": "BinOp", "node_col_offset": 12, "node_end_col_offset": 31, "node_end_lineno": 23, "node_lineno": 23, "op_index": 0, "original_text": "+", "replacement_text": "-", "start_byte": 616}}, "public_tests": {"examples": [{"example_id": "maximum_non_adjacent_sum:0", "source": "maximum_non_adjacent_sum([1, 2, 3])\n", "want": "4\n"}, {"example_id": "maximum_non_adjacent_sum:1", "source": "maximum_non_adjacent_sum([1, 5, 3, 7, 2, 2, 6])\n", "want": "18\n"}, {"example_id": "maximum_non_adjacent_sum:2", "source": "maximum_non_adjacent_sum([-1, -5, -3, -7, -2, -2, -6])\n", "want": "0\n"}, {"example_id": "maximum_non_adjacent_sum:3", "source": "maximum_non_adjacent_sum([499, 500, -3, -7, -2, -2, -6])\n", "want": "500\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-b8479c6c36cb0cc5", "tree_sha256": "dc59aad3f504e26529c6a1d813ab10ff5c3b0a0b9fb77e77ca08c3ef759be8aa", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:dynamic_programming/max_non_adjacent_sum.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def factorial(number: int) -> int:\n \"\"\"\n Calculate the factorial of specified number (n!).\n\n >>> import math\n >>> all(factorial(i) == math.factorial(i) for i in range(20))\n True\n >>> factorial(0.1)\n Traceback (most recent call last):\n ...\n ValueError: factorial() only accepts integral values\n >>> factorial(-1)\n Traceback (most recent call last):\n ...\n ValueError: factorial() not defined for negative values\n >>> factorial(1)\n 1\n >>> factorial(6)\n 720\n >>> factorial(0)\n 1\n \"\"\"\n if number != int(number):\n raise ValueError(\"factorial() only accepts integral values\")\n if number < 0:\n raise ValueError(\"factorial() not defined for negative values\")\n value = 1\n for i in range(1, number + 1):\n value *= i\n return value\n"}, "sha256": "a82829b49c3fea28a514363892e0a2754119afc9d6b34f18a9059d51aeaa66c3"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "a82829b49c3fea28a514363892e0a2754119afc9d6b34f18a9059d51aeaa66c3", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "be11aef0943ca8e94fd1e65b879149561e6cbd5e26c53243efd51699cbfc2298", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00244"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00244", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 15, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def factorial(number: int) -> int:\n \"\"\"\n Calculate the factorial of specified number (n!).\n\n >>> import math\n >>> all(factorial(i) == math.factorial(i) for i in range(20))\n True\n >>> factorial(0.1)\n Traceback (most recent call last):\n ...\n ValueError: factorial() only accepts integral values\n >>> factorial(-1)\n Traceback (most recent call last):\n ...\n ValueError: factorial() not defined for negative values\n >>> factorial(1)\n 1\n >>> factorial(6)\n 720\n >>> factorial(0)\n 1\n \"\"\"\n if number != int(number):\n raise ValueError(\"factorial() only accepts integral values\")\n if number < 0:\n raise ValueError(\"factorial() not defined for negative values\")\n value = 1\n for i in range(1, number - 1):\n value *= i\n return value\n"}, "sha256": "6982d38f14fee8d1facc1d131cbc3a3d2492ab8fb7726dcb3d44b7ffb61d822e"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "factorial:1", "got": "False\n", "source": "all(factorial(i) == math.factorial(i) for i in range(20))\n", "truncated": false, "want": "True\n"}, {"example_id": "factorial:5", "got": "24\n", "source": "factorial(6)\n", "truncated": false, "want": "720\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 29, "end_byte": 782, "lineno": 28, "node": "BinOp", "node_col_offset": 22, "node_end_col_offset": 32, "node_end_lineno": 28, "node_lineno": 28, "op_index": 0, "original_text": "+", "replacement_text": "-", "start_byte": 781}}, "public_tests": {"examples": [{"example_id": "factorial:0", "source": "import math\n", "want": ""}, {"example_id": "factorial:1", "source": "all(factorial(i) == math.factorial(i) for i in range(20))\n", "want": "True\n"}, {"example_id": "factorial:2", "source": "factorial(0.1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: factorial() only accepts integral values\n"}, {"example_id": "factorial:3", "source": "factorial(-1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: factorial() not defined for negative values\n"}, {"example_id": "factorial:4", "source": "factorial(1)\n", "want": "1\n"}, {"example_id": "factorial:5", "source": "factorial(6)\n", "want": "720\n"}, {"example_id": "factorial:6", "source": "factorial(0)\n", "want": "1\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-5978d4171e6ba63e", "tree_sha256": "a82829b49c3fea28a514363892e0a2754119afc9d6b34f18a9059d51aeaa66c3", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/factorial.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def oct_to_decimal(oct_string: str) -> int:\n \"\"\"\n Convert a octal value to its decimal equivalent\n\n >>> oct_to_decimal(\"\")\n Traceback (most recent call last):\n ...\n ValueError: Empty string was passed to the function\n >>> oct_to_decimal(\"-\")\n Traceback (most recent call last):\n ...\n ValueError: Non-octal value was passed to the function\n >>> oct_to_decimal(\"e\")\n Traceback (most recent call last):\n ...\n ValueError: Non-octal value was passed to the function\n >>> oct_to_decimal(\"8\")\n Traceback (most recent call last):\n ...\n ValueError: Non-octal value was passed to the function\n >>> oct_to_decimal(\"-e\")\n Traceback (most recent call last):\n ...\n ValueError: Non-octal value was passed to the function\n >>> oct_to_decimal(\"-8\")\n Traceback (most recent call last):\n ...\n ValueError: Non-octal value was passed to the function\n >>> oct_to_decimal(\"1\")\n 1\n >>> oct_to_decimal(\"-1\")\n -1\n >>> oct_to_decimal(\"12\")\n 10\n >>> oct_to_decimal(\" 12 \")\n 10\n >>> oct_to_decimal(\"-45\")\n -37\n >>> oct_to_decimal(\"-\")\n Traceback (most recent call last):\n ...\n ValueError: Non-octal value was passed to the function\n >>> oct_to_decimal(\"0\")\n 0\n >>> oct_to_decimal(\"-4055\")\n -2093\n >>> oct_to_decimal(\"2-0Fm\")\n Traceback (most recent call last):\n ...\n ValueError: Non-octal value was passed to the function\n >>> oct_to_decimal(\"\")\n Traceback (most recent call last):\n ...\n ValueError: Empty string was passed to the function\n >>> oct_to_decimal(\"19\")\n Traceback (most recent call last):\n ...\n ValueError: Non-octal value was passed to the function\n \"\"\"\n oct_string = str(oct_string).strip()\n if not oct_string:\n raise ValueError(\"Empty string was passed to the function\")\n is_negative = oct_string[0] == \"-\"\n if is_negative:\n oct_string = oct_string[1:]\n if not oct_string.isdigit() or not all(0 <= int(char) <= 7 for char in oct_string):\n raise ValueError(\"Non-octal value was passed to the function\")\n decimal_number = 0\n for char in oct_string:\n decimal_number = 8 * decimal_number + int(char)\n if is_negative:\n decimal_number = -decimal_number\n return decimal_number\n"}, "sha256": "a87223a3cca2a4a430fa63a086fc7a7f18120f2078f57d4a9bcb8c323f3aeed8"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "a87223a3cca2a4a430fa63a086fc7a7f18120f2078f57d4a9bcb8c323f3aeed8", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "d7188ee8a3d35ed980612165d7be3b02c6bac81942089b5b2a1867b333282745", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00247"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00247", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 13, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def oct_to_decimal(oct_string: str) -> int:\n \"\"\"\n Convert a octal value to its decimal equivalent\n\n >>> oct_to_decimal(\"\")\n Traceback (most recent call last):\n ...\n ValueError: Empty string was passed to the function\n >>> oct_to_decimal(\"-\")\n Traceback (most recent call last):\n ...\n ValueError: Non-octal value was passed to the function\n >>> oct_to_decimal(\"e\")\n Traceback (most recent call last):\n ...\n ValueError: Non-octal value was passed to the function\n >>> oct_to_decimal(\"8\")\n Traceback (most recent call last):\n ...\n ValueError: Non-octal value was passed to the function\n >>> oct_to_decimal(\"-e\")\n Traceback (most recent call last):\n ...\n ValueError: Non-octal value was passed to the function\n >>> oct_to_decimal(\"-8\")\n Traceback (most recent call last):\n ...\n ValueError: Non-octal value was passed to the function\n >>> oct_to_decimal(\"1\")\n 1\n >>> oct_to_decimal(\"-1\")\n -1\n >>> oct_to_decimal(\"12\")\n 10\n >>> oct_to_decimal(\" 12 \")\n 10\n >>> oct_to_decimal(\"-45\")\n -37\n >>> oct_to_decimal(\"-\")\n Traceback (most recent call last):\n ...\n ValueError: Non-octal value was passed to the function\n >>> oct_to_decimal(\"0\")\n 0\n >>> oct_to_decimal(\"-4055\")\n -2093\n >>> oct_to_decimal(\"2-0Fm\")\n Traceback (most recent call last):\n ...\n ValueError: Non-octal value was passed to the function\n >>> oct_to_decimal(\"\")\n Traceback (most recent call last):\n ...\n ValueError: Empty string was passed to the function\n >>> oct_to_decimal(\"19\")\n Traceback (most recent call last):\n ...\n ValueError: Non-octal value was passed to the function\n \"\"\"\n oct_string = str(oct_string).strip()\n if not oct_string:\n raise ValueError(\"Empty string was passed to the function\")\n is_negative = oct_string[0] == \"-\"\n if is_negative:\n oct_string = oct_string[1:]\n if not oct_string.isdigit() or not all(0 <= int(char) <= 7 for char in oct_string):\n raise ValueError(\"Non-octal value was passed to the function\")\n decimal_number = 0\n for char in oct_string:\n decimal_number = 8 * decimal_number + int(char)\n if is_negative:\n decimal_number = -decimal_number\n return decimal_number - 1\n"}, "sha256": "8da62b28bb2836e369fc683a9437f83a91463e1d8ccefdc11a28b75174509fd5"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "oct_to_decimal:6", "got": "0\n", "source": "oct_to_decimal(\"1\")\n", "truncated": false, "want": "1\n"}, {"example_id": "oct_to_decimal:7", "got": "-2\n", "source": "oct_to_decimal(\"-1\")\n", "truncated": false, "want": "-1\n"}, {"example_id": "oct_to_decimal:8", "got": "9\n", "source": "oct_to_decimal(\"12\")\n", "truncated": false, "want": "10\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 2331, "lineno": 73, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 25, "node_end_lineno": 73, "node_lineno": 73, "op_index": 0, "original_text": "decimal_number", "replacement_text": "decimal_number - 1", "start_byte": 2317}}, "public_tests": {"examples": [{"example_id": "oct_to_decimal:0", "source": "oct_to_decimal(\"\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: Empty string was passed to the function\n"}, {"example_id": "oct_to_decimal:1", "source": "oct_to_decimal(\"-\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: Non-octal value was passed to the function\n"}, {"example_id": "oct_to_decimal:2", "source": "oct_to_decimal(\"e\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: Non-octal value was passed to the function\n"}, {"example_id": "oct_to_decimal:3", "source": "oct_to_decimal(\"8\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: Non-octal value was passed to the function\n"}, {"example_id": "oct_to_decimal:4", "source": "oct_to_decimal(\"-e\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: Non-octal value was passed to the function\n"}, {"example_id": "oct_to_decimal:5", "source": "oct_to_decimal(\"-8\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: Non-octal value was passed to the function\n"}, {"example_id": "oct_to_decimal:6", "source": "oct_to_decimal(\"1\")\n", "want": "1\n"}, {"example_id": "oct_to_decimal:7", "source": "oct_to_decimal(\"-1\")\n", "want": "-1\n"}, {"example_id": "oct_to_decimal:8", "source": "oct_to_decimal(\"12\")\n", "want": "10\n"}, {"example_id": "oct_to_decimal:9", "source": "oct_to_decimal(\" 12 \")\n", "want": "10\n"}, {"example_id": "oct_to_decimal:10", "source": "oct_to_decimal(\"-45\")\n", "want": "-37\n"}, {"example_id": "oct_to_decimal:11", "source": "oct_to_decimal(\"-\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: Non-octal value was passed to the function\n"}, {"example_id": "oct_to_decimal:12", "source": "oct_to_decimal(\"0\")\n", "want": "0\n"}, {"example_id": "oct_to_decimal:13", "source": "oct_to_decimal(\"-4055\")\n", "want": "-2093\n"}, {"example_id": "oct_to_decimal:14", "source": "oct_to_decimal(\"2-0Fm\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: Non-octal value was passed to the function\n"}, {"example_id": "oct_to_decimal:15", "source": "oct_to_decimal(\"\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: Empty string was passed to the function\n"}, {"example_id": "oct_to_decimal:16", "source": "oct_to_decimal(\"19\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: Non-octal value was passed to the function\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-64e993af6d6f00d2", "tree_sha256": "a87223a3cca2a4a430fa63a086fc7a7f18120f2078f57d4a9bcb8c323f3aeed8", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:conversions/octal_to_decimal.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def damerau_levenshtein_distance(first_string: str, second_string: str) -> int:\n \"\"\"\n Implements the Damerau-Levenshtein distance algorithm that measures\n the edit distance between two strings.\n\n Parameters:\n first_string: The first string to compare\n second_string: The second string to compare\n\n Returns:\n distance: The edit distance between the first and second strings\n\n >>> damerau_levenshtein_distance(\"cat\", \"cut\")\n 1\n >>> damerau_levenshtein_distance(\"kitten\", \"sitting\")\n 3\n >>> damerau_levenshtein_distance(\"hello\", \"world\")\n 4\n >>> damerau_levenshtein_distance(\"book\", \"back\")\n 2\n >>> damerau_levenshtein_distance(\"container\", \"containment\")\n 3\n >>> damerau_levenshtein_distance(\"container\", \"containment\")\n 3\n \"\"\"\n # Create a dynamic programming matrix to store the distances\n dp_matrix = [[0] * (len(second_string) + 1) for _ in range(len(first_string) + 1)]\n\n # Initialize the matrix\n for i in range(len(first_string) + 1):\n dp_matrix[i][0] = i\n for j in range(len(second_string) + 1):\n dp_matrix[0][j] = j\n\n # Fill the matrix\n for i, first_char in enumerate(first_string, start=1):\n for j, second_char in enumerate(second_string, start=1):\n cost = int(first_char != second_char)\n\n dp_matrix[i][j] = min(\n dp_matrix[i - 1][j] + 1, # Deletion\n dp_matrix[i][j - 1] + 1, # Insertion\n dp_matrix[i - 1][j - 1] + cost, # Substitution\n )\n\n if (\n i > 1\n and j > 1\n and first_string[i - 1] == second_string[j - 2]\n and first_string[i - 2] == second_string[j - 1]\n ):\n # Transposition\n dp_matrix[i][j] = min(dp_matrix[i][j], dp_matrix[i - 2][j - 2] + cost)\n\n return dp_matrix[-1][-1]\n"}, "sha256": "10b7dc962ae767f8ad46ace01fe07ec826d5bd6d1502d6d7e05f45c771f159f2"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "10b7dc962ae767f8ad46ace01fe07ec826d5bd6d1502d6d7e05f45c771f159f2", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "db2e056b17d7477c1881f35c713b4fe60e0803ae46ac153c17640fa005a8486d", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00249"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00249", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def damerau_levenshtein_distance(first_string: str, second_string: str) -> int:\n \"\"\"\n Implements the Damerau-Levenshtein distance algorithm that measures\n the edit distance between two strings.\n\n Parameters:\n first_string: The first string to compare\n second_string: The second string to compare\n\n Returns:\n distance: The edit distance between the first and second strings\n\n >>> damerau_levenshtein_distance(\"cat\", \"cut\")\n 1\n >>> damerau_levenshtein_distance(\"kitten\", \"sitting\")\n 3\n >>> damerau_levenshtein_distance(\"hello\", \"world\")\n 4\n >>> damerau_levenshtein_distance(\"book\", \"back\")\n 2\n >>> damerau_levenshtein_distance(\"container\", \"containment\")\n 3\n >>> damerau_levenshtein_distance(\"container\", \"containment\")\n 3\n \"\"\"\n # Create a dynamic programming matrix to store the distances\n dp_matrix = [[0] * (len(second_string) + 1) for _ in range(len(first_string) + 1)]\n\n # Initialize the matrix\n for i in range(len(first_string) + 1):\n dp_matrix[i][0] = i\n for j in range(len(second_string) + 1):\n dp_matrix[0][j] = j\n\n # Fill the matrix\n for i, first_char in enumerate(first_string, start=1):\n for j, second_char in enumerate(second_string, start=1):\n cost = int(first_char != second_char)\n\n dp_matrix[i][j] = min(\n dp_matrix[i - 1][j] + 1, # Deletion\n dp_matrix[i][j - 1] + 1, # Insertion\n dp_matrix[i - 1][j - 1] + cost, # Substitution\n )\n\n if (\n i > 1\n and j > 1\n and first_string[i - 1] == second_string[j - 2]\n and first_string[i - 2] == second_string[j - 1]\n ):\n # Transposition\n dp_matrix[i][j] = min(dp_matrix[i][j], dp_matrix[i - 2][j - 2] + cost)\n\n return dp_matrix[-1][-1] - 1\n"}, "sha256": "159670f5594c8fd5c1b6b0768c8d0c3baf89e894dd3059a217673c1175f90390"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "damerau_levenshtein_distance:0", "got": "0\n", "source": "damerau_levenshtein_distance(\"cat\", \"cut\")\n", "truncated": false, "want": "1\n"}, {"example_id": "damerau_levenshtein_distance:1", "got": "2\n", "source": "damerau_levenshtein_distance(\"kitten\", \"sitting\")\n", "truncated": false, "want": "3\n"}, {"example_id": "damerau_levenshtein_distance:2", "got": "3\n", "source": "damerau_levenshtein_distance(\"hello\", \"world\")\n", "truncated": false, "want": "4\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 1900, "lineno": 55, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 28, "node_end_lineno": 55, "node_lineno": 55, "op_index": 0, "original_text": "dp_matrix[-1][-1]", "replacement_text": "dp_matrix[-1][-1] - 1", "start_byte": 1883}}, "public_tests": {"examples": [{"example_id": "damerau_levenshtein_distance:0", "source": "damerau_levenshtein_distance(\"cat\", \"cut\")\n", "want": "1\n"}, {"example_id": "damerau_levenshtein_distance:1", "source": "damerau_levenshtein_distance(\"kitten\", \"sitting\")\n", "want": "3\n"}, {"example_id": "damerau_levenshtein_distance:2", "source": "damerau_levenshtein_distance(\"hello\", \"world\")\n", "want": "4\n"}, {"example_id": "damerau_levenshtein_distance:3", "source": "damerau_levenshtein_distance(\"book\", \"back\")\n", "want": "2\n"}, {"example_id": "damerau_levenshtein_distance:4", "source": "damerau_levenshtein_distance(\"container\", \"containment\")\n", "want": "3\n"}, {"example_id": "damerau_levenshtein_distance:5", "source": "damerau_levenshtein_distance(\"container\", \"containment\")\n", "want": "3\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-68e4348732f01105", "tree_sha256": "10b7dc962ae767f8ad46ace01fe07ec826d5bd6d1502d6d7e05f45c771f159f2", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:strings/damerau_levenshtein_distance.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def octal_to_binary(octal_number: str) -> str:\n \"\"\"\n Convert an Octal number to Binary.\n\n >>> octal_to_binary(\"17\")\n '001111'\n >>> octal_to_binary(\"7\")\n '111'\n >>> octal_to_binary(\"Av\")\n Traceback (most recent call last):\n ...\n ValueError: Non-octal value was passed to the function\n >>> octal_to_binary(\"@#\")\n Traceback (most recent call last):\n ...\n ValueError: Non-octal value was passed to the function\n >>> octal_to_binary(\"\")\n Traceback (most recent call last):\n ...\n ValueError: Empty string was passed to the function\n \"\"\"\n if not octal_number:\n raise ValueError(\"Empty string was passed to the function\")\n\n binary_number = \"\"\n octal_digits = \"01234567\"\n for digit in octal_number:\n if digit not in octal_digits:\n raise ValueError(\"Non-octal value was passed to the function\")\n\n binary_digit = \"\"\n value = int(digit)\n for _ in range(3):\n binary_digit = str(value % 2) + binary_digit\n value //= 2\n binary_number += binary_digit\n\n return binary_number\n"}, "sha256": "6df38b1302b901a7facaeda582fd59268709b889c15def0cf5e04e0532c9d6ae"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "6df38b1302b901a7facaeda582fd59268709b889c15def0cf5e04e0532c9d6ae", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "3ee4165a1d885cdaf11b750143d3556139b65fcd43a55e2b109e54c0563ba47c", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00250"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00250", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 6, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def octal_to_binary(octal_number: str) -> str:\n \"\"\"\n Convert an Octal number to Binary.\n\n >>> octal_to_binary(\"17\")\n '001111'\n >>> octal_to_binary(\"7\")\n '111'\n >>> octal_to_binary(\"Av\")\n Traceback (most recent call last):\n ...\n ValueError: Non-octal value was passed to the function\n >>> octal_to_binary(\"@#\")\n Traceback (most recent call last):\n ...\n ValueError: Non-octal value was passed to the function\n >>> octal_to_binary(\"\")\n Traceback (most recent call last):\n ...\n ValueError: Empty string was passed to the function\n \"\"\"\n if not octal_number:\n raise ValueError(\"Empty string was passed to the function\")\n\n binary_number = \"\"\n octal_digits = \"01234567\"\n for digit in octal_number:\n if digit not in octal_digits:\n raise ValueError(\"Non-octal value was passed to the function\")\n\n binary_digit = \"\"\n value = int(digit)\n for _ in range(3):\n binary_digit = str(value % 2) + binary_digit\n value %= 2\n binary_number += binary_digit\n\n return binary_number\n"}, "sha256": "dca7d9cd45a88610d2bce0f03fc40ea3c8e8553cd5f5c79e2c0bf6f074c8a11f"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "octal_to_binary:0", "got": "'111111'\n", "source": "octal_to_binary(\"17\")\n", "truncated": false, "want": "'001111'\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 18, "end_byte": 1050, "lineno": 35, "node": "AugAssign", "node_col_offset": 12, "node_end_col_offset": 23, "node_end_lineno": 35, "node_lineno": 35, "op_index": 0, "original_text": "//=", "replacement_text": "%=", "start_byte": 1047}}, "public_tests": {"examples": [{"example_id": "octal_to_binary:0", "source": "octal_to_binary(\"17\")\n", "want": "'001111'\n"}, {"example_id": "octal_to_binary:1", "source": "octal_to_binary(\"7\")\n", "want": "'111'\n"}, {"example_id": "octal_to_binary:2", "source": "octal_to_binary(\"Av\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: Non-octal value was passed to the function\n"}, {"example_id": "octal_to_binary:3", "source": "octal_to_binary(\"@#\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: Non-octal value was passed to the function\n"}, {"example_id": "octal_to_binary:4", "source": "octal_to_binary(\"\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: Empty string was passed to the function\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-264c9e6434108710", "tree_sha256": "6df38b1302b901a7facaeda582fd59268709b889c15def0cf5e04e0532c9d6ae", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:conversions/octal_to_binary.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def odd_even_sort(input_list: list) -> list:\n \"\"\"\n Sort input with odd even sort.\n\n This algorithm uses the same idea of bubblesort,\n but by first dividing in two phase (odd and even).\n Originally developed for use on parallel processors\n with local interconnections.\n :param collection: mutable ordered sequence of elements\n :return: same collection in ascending order\n Examples:\n >>> odd_even_sort([5 , 4 ,3 ,2 ,1])\n [1, 2, 3, 4, 5]\n >>> odd_even_sort([])\n []\n >>> odd_even_sort([-10 ,-1 ,10 ,2])\n [-10, -1, 2, 10]\n >>> odd_even_sort([1 ,2 ,3 ,4])\n [1, 2, 3, 4]\n \"\"\"\n is_sorted = False\n while is_sorted is False: # Until all the indices are traversed keep looping\n is_sorted = True\n for i in range(0, len(input_list) - 1, 2): # iterating over all even indices\n if input_list[i] > input_list[i + 1]:\n input_list[i], input_list[i + 1] = input_list[i + 1], input_list[i]\n # swapping if elements not in order\n is_sorted = False\n\n for i in range(1, len(input_list) - 1, 2): # iterating over all odd indices\n if input_list[i] > input_list[i + 1]:\n input_list[i], input_list[i + 1] = input_list[i + 1], input_list[i]\n # swapping if elements not in order\n is_sorted = False\n return input_list\n"}, "sha256": "9ecd7470cab4d896bbef029162f6ff30734e79ddd6a432926593aedbdbc54ce7"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "9ecd7470cab4d896bbef029162f6ff30734e79ddd6a432926593aedbdbc54ce7", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "59f3dea7981cb103004dab01df4dd0a4591b3c853e8769af5ff278d6ba564acb", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00251"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00251", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 16, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def odd_even_sort(input_list: list) -> list:\n \"\"\"\n Sort input with odd even sort.\n\n This algorithm uses the same idea of bubblesort,\n but by first dividing in two phase (odd and even).\n Originally developed for use on parallel processors\n with local interconnections.\n :param collection: mutable ordered sequence of elements\n :return: same collection in ascending order\n Examples:\n >>> odd_even_sort([5 , 4 ,3 ,2 ,1])\n [1, 2, 3, 4, 5]\n >>> odd_even_sort([])\n []\n >>> odd_even_sort([-10 ,-1 ,10 ,2])\n [-10, -1, 2, 10]\n >>> odd_even_sort([1 ,2 ,3 ,4])\n [1, 2, 3, 4]\n \"\"\"\n is_sorted = False\n while is_sorted is False: # Until all the indices are traversed keep looping\n is_sorted = True\n for i in range(0, len(input_list) - 1, 2): # iterating over all even indices\n if input_list[i] > input_list[i + 1]:\n input_list[i], input_list[i + 1] = input_list[i + 1], input_list[i]\n # swapping if elements not in order\n is_sorted = False\n\n for i in range(0, len(input_list) - 1, 2): # iterating over all odd indices\n if input_list[i] > input_list[i + 1]:\n input_list[i], input_list[i + 1] = input_list[i + 1], input_list[i]\n # swapping if elements not in order\n is_sorted = False\n return input_list\n"}, "sha256": "3afdcbbddcd7691050f32f702593aeebcb7151d6de006c8698844fb1299beeab"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "odd_even_sort:0", "got": "[4, 5, 2, 3, 1]\n", "source": "odd_even_sort([5 , 4 ,3 ,2 ,1])\n", "truncated": false, "want": "[1, 2, 3, 4, 5]\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "off_by_one", "seed": 7, "span": {"col_offset": 23, "end_byte": 1083, "lineno": 30, "node": "Constant", "node_col_offset": 23, "node_end_col_offset": 24, "node_end_lineno": 30, "node_lineno": 30, "op_index": 0, "original_text": "1", "replacement_text": "0", "start_byte": 1082}}, "public_tests": {"examples": [{"example_id": "odd_even_sort:0", "source": "odd_even_sort([5 , 4 ,3 ,2 ,1])\n", "want": "[1, 2, 3, 4, 5]\n"}, {"example_id": "odd_even_sort:1", "source": "odd_even_sort([])\n", "want": "[]\n"}, {"example_id": "odd_even_sort:2", "source": "odd_even_sort([-10 ,-1 ,10 ,2])\n", "want": "[-10, -1, 2, 10]\n"}, {"example_id": "odd_even_sort:3", "source": "odd_even_sort([1 ,2 ,3 ,4])\n", "want": "[1, 2, 3, 4]\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-93644211a9df8b4f", "tree_sha256": "9ecd7470cab4d896bbef029162f6ff30734e79ddd6a432926593aedbdbc54ce7", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:sorts/odd_even_sort.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def is_contains_unique_chars(input_str: str) -> bool:\n \"\"\"\n Check if all characters in the string is unique or not.\n >>> is_contains_unique_chars(\"I_love.py\")\n True\n >>> is_contains_unique_chars(\"I don't love Python\")\n False\n\n Time complexity: O(n)\n Space complexity: O(1) 19320 bytes as we are having 144697 characters in unicode\n \"\"\"\n\n # Each bit will represent each unicode character\n # For example 65th bit representing 'A'\n # https://stackoverflow.com/a/12811293\n bitmap = 0\n for ch in input_str:\n ch_unicode = ord(ch)\n ch_bit_index_on = pow(2, ch_unicode)\n\n # If we already turned on bit for current character's unicode\n if bitmap >> ch_unicode & 1 == 1:\n return False\n bitmap |= ch_bit_index_on\n return True\n"}, "sha256": "735532da92292c793741fed624079f43127da045cd122b0036fbd642d988eb47"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "735532da92292c793741fed624079f43127da045cd122b0036fbd642d988eb47", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "2d90e2d493b8e19d090459c9616e1f96ac40f211ec0e0055fc4c93353ec58b08", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00252"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00252", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 10, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def is_contains_unique_chars(input_str: str) -> bool:\n \"\"\"\n Check if all characters in the string is unique or not.\n >>> is_contains_unique_chars(\"I_love.py\")\n True\n >>> is_contains_unique_chars(\"I don't love Python\")\n False\n\n Time complexity: O(n)\n Space complexity: O(1) 19320 bytes as we are having 144697 characters in unicode\n \"\"\"\n\n # Each bit will represent each unicode character\n # For example 65th bit representing 'A'\n # https://stackoverflow.com/a/12811293\n bitmap = 0\n for ch in input_str:\n ch_unicode = ord(ch)\n ch_bit_index_on = pow(2, ch_unicode)\n\n # If we already turned on bit for current character's unicode\n if bitmap >> ch_unicode & 1 == 0:\n return False\n bitmap |= ch_bit_index_on\n return True\n"}, "sha256": "3eafea9e7d22559024bc5cfbdc27e05d55dfa9785825a805e2fd5e64dae67129"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "is_contains_unique_chars:0", "got": "False\n", "source": "is_contains_unique_chars(\"I_love.py\")\n", "truncated": false, "want": "True\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "off_by_one", "seed": 7, "span": {"col_offset": 39, "end_byte": 729, "lineno": 22, "node": "Constant", "node_col_offset": 39, "node_end_col_offset": 40, "node_end_lineno": 22, "node_lineno": 22, "op_index": 0, "original_text": "1", "replacement_text": "0", "start_byte": 728}}, "public_tests": {"examples": [{"example_id": "is_contains_unique_chars:0", "source": "is_contains_unique_chars(\"I_love.py\")\n", "want": "True\n"}, {"example_id": "is_contains_unique_chars:1", "source": "is_contains_unique_chars(\"I don't love Python\")\n", "want": "False\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-e2e296ecf11eeb82", "tree_sha256": "735532da92292c793741fed624079f43127da045cd122b0036fbd642d988eb47", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:strings/is_contains_unique_chars.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def get_index_of_rightmost_set_bit(number: int) -> int:\n \"\"\"\n Take in a positive integer 'number'.\n Returns the zero-based index of first set bit in that 'number' from right.\n Returns -1, If no set bit found.\n\n >>> get_index_of_rightmost_set_bit(0)\n -1\n >>> get_index_of_rightmost_set_bit(5)\n 0\n >>> get_index_of_rightmost_set_bit(36)\n 2\n >>> get_index_of_rightmost_set_bit(8)\n 3\n >>> get_index_of_rightmost_set_bit(-18)\n Traceback (most recent call last):\n ...\n ValueError: Input must be a non-negative integer\n >>> get_index_of_rightmost_set_bit('test')\n Traceback (most recent call last):\n ...\n ValueError: Input must be a non-negative integer\n >>> get_index_of_rightmost_set_bit(1.25)\n Traceback (most recent call last):\n ...\n ValueError: Input must be a non-negative integer\n \"\"\"\n\n if not isinstance(number, int) or number < 0:\n raise ValueError(\"Input must be a non-negative integer\")\n\n intermediate = number & ~(number - 1)\n index = 0\n while intermediate:\n intermediate >>= 1\n index += 1\n return index - 1\n"}, "sha256": "ee1faa17f7263b9d65d2fa1d3d2d1dbb8ed9246d71ffe014fedc8e1c50801fb9"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "ee1faa17f7263b9d65d2fa1d3d2d1dbb8ed9246d71ffe014fedc8e1c50801fb9", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "6f87a5237974584054a3f994e2bb3e31abc2ef1916b27bfd6a08a7cfc0e63545", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00255"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00255", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def get_index_of_rightmost_set_bit(number: int) -> int:\n \"\"\"\n Take in a positive integer 'number'.\n Returns the zero-based index of first set bit in that 'number' from right.\n Returns -1, If no set bit found.\n\n >>> get_index_of_rightmost_set_bit(0)\n -1\n >>> get_index_of_rightmost_set_bit(5)\n 0\n >>> get_index_of_rightmost_set_bit(36)\n 2\n >>> get_index_of_rightmost_set_bit(8)\n 3\n >>> get_index_of_rightmost_set_bit(-18)\n Traceback (most recent call last):\n ...\n ValueError: Input must be a non-negative integer\n >>> get_index_of_rightmost_set_bit('test')\n Traceback (most recent call last):\n ...\n ValueError: Input must be a non-negative integer\n >>> get_index_of_rightmost_set_bit(1.25)\n Traceback (most recent call last):\n ...\n ValueError: Input must be a non-negative integer\n \"\"\"\n\n if not isinstance(number, int) or number <= 0:\n raise ValueError(\"Input must be a non-negative integer\")\n\n intermediate = number & ~(number - 1)\n index = 0\n while intermediate:\n intermediate >>= 1\n index += 1\n return index - 1\n"}, "sha256": "309f5859c50ebadece44603becd5852a5ae917cbbbb355bbd1e572968bac060b"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "get_index_of_rightmost_set_bit:0", "got": "ValueError: Input must be a non-negative integer", "source": "get_index_of_rightmost_set_bit(0)\n", "truncated": false, "want": "-1\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "comparison_boundary", "seed": 7, "span": {"col_offset": 45, "end_byte": 919, "lineno": 29, "node": "Compare", "node_col_offset": 38, "node_end_col_offset": 48, "node_end_lineno": 29, "node_lineno": 29, "op_index": 0, "original_text": "<", "replacement_text": "<=", "start_byte": 918}}, "public_tests": {"examples": [{"example_id": "get_index_of_rightmost_set_bit:0", "source": "get_index_of_rightmost_set_bit(0)\n", "want": "-1\n"}, {"example_id": "get_index_of_rightmost_set_bit:1", "source": "get_index_of_rightmost_set_bit(5)\n", "want": "0\n"}, {"example_id": "get_index_of_rightmost_set_bit:2", "source": "get_index_of_rightmost_set_bit(36)\n", "want": "2\n"}, {"example_id": "get_index_of_rightmost_set_bit:3", "source": "get_index_of_rightmost_set_bit(8)\n", "want": "3\n"}, {"example_id": "get_index_of_rightmost_set_bit:4", "source": "get_index_of_rightmost_set_bit(-18)\n", "want": "Traceback (most recent call last):\n ...\nValueError: Input must be a non-negative integer\n"}, {"example_id": "get_index_of_rightmost_set_bit:5", "source": "get_index_of_rightmost_set_bit('test')\n", "want": "Traceback (most recent call last):\n ...\nValueError: Input must be a non-negative integer\n"}, {"example_id": "get_index_of_rightmost_set_bit:6", "source": "get_index_of_rightmost_set_bit(1.25)\n", "want": "Traceback (most recent call last):\n ...\nValueError: Input must be a non-negative integer\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-b3c1a976472238e9", "tree_sha256": "ee1faa17f7263b9d65d2fa1d3d2d1dbb8ed9246d71ffe014fedc8e1c50801fb9", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:bit_manipulation/index_of_rightmost_set_bit.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "from itertools import compress, repeat\nfrom math import ceil, sqrt\n\n\ndef odd_sieve(num: int) -> list[int]:\n \"\"\"\n Returns the prime numbers < `num`. The prime numbers are calculated using an\n odd sieve implementation of the Sieve of Eratosthenes algorithm\n (see for reference https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes).\n\n >>> odd_sieve(2)\n []\n >>> odd_sieve(3)\n [2]\n >>> odd_sieve(10)\n [2, 3, 5, 7]\n >>> odd_sieve(20)\n [2, 3, 5, 7, 11, 13, 17, 19]\n \"\"\"\n\n if num <= 2:\n return []\n if num == 3:\n return [2]\n\n # Odd sieve for numbers in range [3, num - 1]\n sieve = bytearray(b\"\\x01\") * ((num >> 1) - 1)\n\n for i in range(3, int(sqrt(num)) + 1, 2):\n if sieve[(i >> 1) - 1]:\n i_squared = i**2\n sieve[(i_squared >> 1) - 1 :: i] = repeat(\n 0, ceil((num - i_squared) / (i << 1))\n )\n\n return [2, *list(compress(range(3, num, 2), sieve))]\n"}, "sha256": "c2dad96a6a816866e5996f8381f3b58ac8fc017a0ea79656cb93870dfd476020"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "c2dad96a6a816866e5996f8381f3b58ac8fc017a0ea79656cb93870dfd476020", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "1c2cd6216fc1ae83635f4355c1b858772a7831c34764619435846a71818b8d54", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00256"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00256", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 22, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "from itertools import compress, repeat\nfrom math import ceil, sqrt\n\n\ndef odd_sieve(num: int) -> list[int]:\n \"\"\"\n Returns the prime numbers < `num`. The prime numbers are calculated using an\n odd sieve implementation of the Sieve of Eratosthenes algorithm\n (see for reference https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes).\n\n >>> odd_sieve(2)\n []\n >>> odd_sieve(3)\n [2]\n >>> odd_sieve(10)\n [2, 3, 5, 7]\n >>> odd_sieve(20)\n [2, 3, 5, 7, 11, 13, 17, 19]\n \"\"\"\n\n if num <= 2:\n return []\n if num == 3:\n return [2]\n\n # Odd sieve for numbers in range [3, num - 1]\n sieve = bytearray(b\"\\x01\") * ((num >> 1) - 1)\n\n for i in range(3, int(sqrt(num)) + 1, 2):\n if sieve[(i >> 1) - 1]:\n i_squared = i**2\n sieve[(i_squared >> 1) - 1 :: i] = repeat(\n 0, ceil((num + i_squared) / (i << 1))\n )\n\n return [2, *list(compress(range(3, num, 2), sieve))]\n"}, "sha256": "2501f71eae80eeb2699fd8f025a066af22ac012cd92b9932f6446b9a61d2c734"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "odd_sieve:2", "got": "ValueError: attempt to assign bytes of size 4 to extended slice of size 1", "source": "odd_sieve(10)\n", "truncated": false, "want": "[2, 3, 5, 7]\n"}, {"example_id": "odd_sieve:3", "got": "ValueError: attempt to assign bytes of size 5 to extended slice of size 2", "source": "odd_sieve(20)\n", "truncated": false, "want": "[2, 3, 5, 7, 11, 13, 17, 19]\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 29, "end_byte": 867, "lineno": 33, "node": "BinOp", "node_col_offset": 25, "node_end_col_offset": 40, "node_end_lineno": 33, "node_lineno": 33, "op_index": 0, "original_text": "-", "replacement_text": "+", "start_byte": 866}}, "public_tests": {"examples": [{"example_id": "odd_sieve:0", "source": "odd_sieve(2)\n", "want": "[]\n"}, {"example_id": "odd_sieve:1", "source": "odd_sieve(3)\n", "want": "[2]\n"}, {"example_id": "odd_sieve:2", "source": "odd_sieve(10)\n", "want": "[2, 3, 5, 7]\n"}, {"example_id": "odd_sieve:3", "source": "odd_sieve(20)\n", "want": "[2, 3, 5, 7, 11, 13, 17, 19]\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-ecc0f5732f2269a9", "tree_sha256": "c2dad96a6a816866e5996f8381f3b58ac8fc017a0ea79656cb93870dfd476020", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/odd_sieve.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def alt_ipv4_to_decimal(ipv4_address: str) -> int:\n \"\"\"\n >>> alt_ipv4_to_decimal(\"192.168.0.1\")\n 3232235521\n >>> alt_ipv4_to_decimal(\"10.0.0.255\")\n 167772415\n \"\"\"\n return int(\"0x\" + \"\".join(f\"{int(i):02x}\" for i in ipv4_address.split(\".\")), 16)\n"}, "sha256": "d66f8c83e7b6984120b2625b3f92388f98dd5c68dca943625694dd8138880698"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "d66f8c83e7b6984120b2625b3f92388f98dd5c68dca943625694dd8138880698", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "cd3388fab7d0ca86a7fe5ba6f2e07eaa4e495b534707d8c0f842289b127ced4f", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00257"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00257", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 7, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def alt_ipv4_to_decimal(ipv4_address: str) -> int:\n \"\"\"\n >>> alt_ipv4_to_decimal(\"192.168.0.1\")\n 3232235521\n >>> alt_ipv4_to_decimal(\"10.0.0.255\")\n 167772415\n \"\"\"\n return int(\"0x\" - \"\".join(f\"{int(i):02x}\" for i in ipv4_address.split(\".\")), 16)\n"}, "sha256": "ca48ad8645686d55159302e99dd56d890b40a352ca92fe87de64565820a2cd34"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "alt_ipv4_to_decimal:0", "got": "TypeError: unsupported operand type(s) for -: 'str' and 'str'", "source": "alt_ipv4_to_decimal(\"192.168.0.1\")\n", "truncated": false, "want": "3232235521\n"}, {"example_id": "alt_ipv4_to_decimal:1", "got": "TypeError: unsupported operand type(s) for -: 'str' and 'str'", "source": "alt_ipv4_to_decimal(\"10.0.0.255\")\n", "truncated": false, "want": "167772415\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 20, "end_byte": 202, "lineno": 8, "node": "BinOp", "node_col_offset": 15, "node_end_col_offset": 79, "node_end_lineno": 8, "node_lineno": 8, "op_index": 0, "original_text": "+", "replacement_text": "-", "start_byte": 201}}, "public_tests": {"examples": [{"example_id": "alt_ipv4_to_decimal:0", "source": "alt_ipv4_to_decimal(\"192.168.0.1\")\n", "want": "3232235521\n"}, {"example_id": "alt_ipv4_to_decimal:1", "source": "alt_ipv4_to_decimal(\"10.0.0.255\")\n", "want": "167772415\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-8b1387aa93347e64", "tree_sha256": "d66f8c83e7b6984120b2625b3f92388f98dd5c68dca943625694dd8138880698", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:conversions/ipv4_conversion.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def rec_linear_search(sequence: list, low: int, high: int, target: int) -> int:\n \"\"\"\n A pure Python implementation of a recursive linear search algorithm\n\n :param sequence: a collection with comparable items (as sorted items not required\n in Linear Search)\n :param low: Lower bound of the array\n :param high: Higher bound of the array\n :param target: The element to be found\n :return: Index of the key or -1 if key not found\n\n Examples:\n >>> rec_linear_search([0, 30, 500, 100, 700], 0, 4, 0)\n 0\n >>> rec_linear_search([0, 30, 500, 100, 700], 0, 4, 700)\n 4\n >>> rec_linear_search([0, 30, 500, 100, 700], 0, 4, 30)\n 1\n >>> rec_linear_search([0, 30, 500, 100, 700], 0, 4, -6)\n -1\n \"\"\"\n if not (0 <= high < len(sequence) and 0 <= low < len(sequence)):\n raise Exception(\"Invalid upper or lower bound!\")\n if high < low:\n return -1\n if sequence[low] == target:\n return low\n if sequence[high] == target:\n return high\n return rec_linear_search(sequence, low + 1, high - 1, target)\n"}, "sha256": "a96a5cc31f4af959178f77f959dc5ed9e7a9974a488f40f547492bc113f64a67"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "a96a5cc31f4af959178f77f959dc5ed9e7a9974a488f40f547492bc113f64a67", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "6807f08a58a1bc9b0ee5412b64d3b4aee8b4d40e6e3d5bc302cb307a53079a47", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00258"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00258", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def rec_linear_search(sequence: list, low: int, high: int, target: int) -> int:\n \"\"\"\n A pure Python implementation of a recursive linear search algorithm\n\n :param sequence: a collection with comparable items (as sorted items not required\n in Linear Search)\n :param low: Lower bound of the array\n :param high: Higher bound of the array\n :param target: The element to be found\n :return: Index of the key or -1 if key not found\n\n Examples:\n >>> rec_linear_search([0, 30, 500, 100, 700], 0, 4, 0)\n 0\n >>> rec_linear_search([0, 30, 500, 100, 700], 0, 4, 700)\n 4\n >>> rec_linear_search([0, 30, 500, 100, 700], 0, 4, 30)\n 1\n >>> rec_linear_search([0, 30, 500, 100, 700], 0, 4, -6)\n -1\n \"\"\"\n if not (0 <= high < len(sequence) and 0 <= low < len(sequence)):\n raise Exception(\"Invalid upper or lower bound!\")\n if high < low:\n return -1\n if sequence[low] == target:\n return low\n if sequence[high] == target:\n return high\n return rec_linear_search(sequence, low - 1, high - 1, target)\n"}, "sha256": "0a74fdcfff5f8e0670b31e119c6205fa5816e48c126aad1053650ea8fc0c1fa4"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "rec_linear_search:2", "got": "Exception: Invalid upper or lower bound!", "source": "rec_linear_search([0, 30, 500, 100, 700], 0, 4, 30)\n", "truncated": false, "want": "1\n"}, {"example_id": "rec_linear_search:3", "got": "Exception: Invalid upper or lower bound!", "source": "rec_linear_search([0, 30, 500, 100, 700], 0, 4, -6)\n", "truncated": false, "want": "-1\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 43, "end_byte": 1052, "lineno": 30, "node": "BinOp", "node_col_offset": 39, "node_end_col_offset": 46, "node_end_lineno": 30, "node_lineno": 30, "op_index": 0, "original_text": "+", "replacement_text": "-", "start_byte": 1051}}, "public_tests": {"examples": [{"example_id": "rec_linear_search:0", "source": "rec_linear_search([0, 30, 500, 100, 700], 0, 4, 0)\n", "want": "0\n"}, {"example_id": "rec_linear_search:1", "source": "rec_linear_search([0, 30, 500, 100, 700], 0, 4, 700)\n", "want": "4\n"}, {"example_id": "rec_linear_search:2", "source": "rec_linear_search([0, 30, 500, 100, 700], 0, 4, 30)\n", "want": "1\n"}, {"example_id": "rec_linear_search:3", "source": "rec_linear_search([0, 30, 500, 100, 700], 0, 4, -6)\n", "want": "-1\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-26d085394e7ff052", "tree_sha256": "a96a5cc31f4af959178f77f959dc5ed9e7a9974a488f40f547492bc113f64a67", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:searches/linear_search.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def gnome_sort(lst: list) -> list:\n \"\"\"\n Pure implementation of the gnome sort algorithm in Python\n\n Take some mutable ordered collection with heterogeneous comparable items inside as\n arguments, return the same collection ordered by ascending.\n\n Examples:\n >>> gnome_sort([0, 5, 3, 2, 2])\n [0, 2, 2, 3, 5]\n\n >>> gnome_sort([])\n []\n\n >>> gnome_sort([-2, -5, -45])\n [-45, -5, -2]\n\n >>> \"\".join(gnome_sort(list(set(\"Gnomes are stupid!\"))))\n ' !Gadeimnoprstu'\n \"\"\"\n if len(lst) <= 1:\n return lst\n\n i = 1\n\n while i < len(lst):\n if lst[i - 1] <= lst[i]:\n i += 1\n else:\n lst[i - 1], lst[i] = lst[i], lst[i - 1]\n i -= 1\n if i == 0:\n i = 1\n\n return lst\n"}, "sha256": "4069405f6daeb856a685e02ad6ae970d24b54358cf324eb0dd1ebf6366291166"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "4069405f6daeb856a685e02ad6ae970d24b54358cf324eb0dd1ebf6366291166", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "e6177ff26bf1b06b45bd3b30ffc4a6e49868f9d18e46d836c517f546e363a160", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00260"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00260", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 11, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def gnome_sort(lst: list) -> list:\n \"\"\"\n Pure implementation of the gnome sort algorithm in Python\n\n Take some mutable ordered collection with heterogeneous comparable items inside as\n arguments, return the same collection ordered by ascending.\n\n Examples:\n >>> gnome_sort([0, 5, 3, 2, 2])\n [0, 2, 2, 3, 5]\n\n >>> gnome_sort([])\n []\n\n >>> gnome_sort([-2, -5, -45])\n [-45, -5, -2]\n\n >>> \"\".join(gnome_sort(list(set(\"Gnomes are stupid!\"))))\n ' !Gadeimnoprstu'\n \"\"\"\n if len(lst) <= 1:\n return lst\n\n i = 1\n\n while i < len(lst):\n if lst[i - 1] <= lst[i]:\n i -= 1\n else:\n lst[i - 1], lst[i] = lst[i], lst[i - 1]\n i -= 1\n if i == 0:\n i = 1\n\n return lst\n"}, "sha256": "877591222f87f212040046bac306b049f210baa71a98ea58f77b8a1ddb9a6dfa"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "gnome_sort:0", "got": "IndexError: list index out of range", "source": "gnome_sort([0, 5, 3, 2, 2])\n", "truncated": false, "want": "[0, 2, 2, 3, 5]\n"}, {"example_id": "gnome_sort:2", "got": "IndexError: list index out of range", "source": "gnome_sort([-2, -5, -45])\n", "truncated": false, "want": "[-45, -5, -2]\n"}, {"example_id": "gnome_sort:3", "got": "IndexError: list index out of range", "source": "\"\".join(gnome_sort(list(set(\"Gnomes are stupid!\"))))\n", "truncated": false, "want": "' !Gadeimnoprstu'\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 14, "end_byte": 630, "lineno": 28, "node": "AugAssign", "node_col_offset": 12, "node_end_col_offset": 18, "node_end_lineno": 28, "node_lineno": 28, "op_index": 0, "original_text": "+=", "replacement_text": "-=", "start_byte": 628}}, "public_tests": {"examples": [{"example_id": "gnome_sort:0", "source": "gnome_sort([0, 5, 3, 2, 2])\n", "want": "[0, 2, 2, 3, 5]\n"}, {"example_id": "gnome_sort:1", "source": "gnome_sort([])\n", "want": "[]\n"}, {"example_id": "gnome_sort:2", "source": "gnome_sort([-2, -5, -45])\n", "want": "[-45, -5, -2]\n"}, {"example_id": "gnome_sort:3", "source": "\"\".join(gnome_sort(list(set(\"Gnomes are stupid!\"))))\n", "want": "' !Gadeimnoprstu'\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-86d35f87d6d37eee", "tree_sha256": "4069405f6daeb856a685e02ad6ae970d24b54358cf324eb0dd1ebf6366291166", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:sorts/gnome_sort.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def factorial_recursive(n: int) -> int:\n \"\"\"\n Calculate the factorial of a positive integer\n https://en.wikipedia.org/wiki/Factorial\n\n >>> import math\n >>> all(factorial_recursive(i) == math.factorial(i) for i in range(20))\n True\n >>> factorial_recursive(0.1)\n Traceback (most recent call last):\n ...\n ValueError: factorial_recursive() only accepts integral values\n >>> factorial_recursive(-1)\n Traceback (most recent call last):\n ...\n ValueError: factorial_recursive() not defined for negative values\n \"\"\"\n if not isinstance(n, int):\n raise ValueError(\"factorial_recursive() only accepts integral values\")\n if n < 0:\n raise ValueError(\"factorial_recursive() not defined for negative values\")\n return 1 if n in {0, 1} else n * factorial_recursive(n - 1)\n"}, "sha256": "913c284000be6faef49784378d8a77cbddf75d72819650a7bd060a4e55d39d03"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "913c284000be6faef49784378d8a77cbddf75d72819650a7bd060a4e55d39d03", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "879c19bfcd485e4f43a492978ca819f889ea18fdb210c860bf7176aafd3bd373", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00262"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00262", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 6, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def factorial_recursive(n: int) -> int:\n \"\"\"\n Calculate the factorial of a positive integer\n https://en.wikipedia.org/wiki/Factorial\n\n >>> import math\n >>> all(factorial_recursive(i) == math.factorial(i) for i in range(20))\n True\n >>> factorial_recursive(0.1)\n Traceback (most recent call last):\n ...\n ValueError: factorial_recursive() only accepts integral values\n >>> factorial_recursive(-1)\n Traceback (most recent call last):\n ...\n ValueError: factorial_recursive() not defined for negative values\n \"\"\"\n if not isinstance(n, int):\n raise ValueError(\"factorial_recursive() only accepts integral values\")\n if n < 0:\n raise ValueError(\"factorial_recursive() not defined for negative values\")\n return 1 if n in {0, 1} else n // factorial_recursive(n - 1)\n"}, "sha256": "04b7d7a2515c6ed55b5f38e9cd1d5337345f00811c0d741310a9546a9243da20"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "factorial_recursive:1", "got": "False\n", "source": "all(factorial_recursive(i) == math.factorial(i) for i in range(20))\n", "truncated": false, "want": "True\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 35, "end_byte": 802, "lineno": 22, "node": "BinOp", "node_col_offset": 33, "node_end_col_offset": 63, "node_end_lineno": 22, "node_lineno": 22, "op_index": 0, "original_text": "*", "replacement_text": "//", "start_byte": 801}}, "public_tests": {"examples": [{"example_id": "factorial_recursive:0", "source": "import math\n", "want": ""}, {"example_id": "factorial_recursive:1", "source": "all(factorial_recursive(i) == math.factorial(i) for i in range(20))\n", "want": "True\n"}, {"example_id": "factorial_recursive:2", "source": "factorial_recursive(0.1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: factorial_recursive() only accepts integral values\n"}, {"example_id": "factorial_recursive:3", "source": "factorial_recursive(-1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: factorial_recursive() not defined for negative values\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-d53897470533e53d", "tree_sha256": "913c284000be6faef49784378d8a77cbddf75d72819650a7bd060a4e55d39d03", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/factorial.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def binary_coded_decimal(number: int) -> str:\n \"\"\"\n Find binary coded decimal (bcd) of integer base 10.\n Each digit of the number is represented by a 4-bit binary.\n Example:\n >>> binary_coded_decimal(-2)\n '0b0000'\n >>> binary_coded_decimal(-1)\n '0b0000'\n >>> binary_coded_decimal(0)\n '0b0000'\n >>> binary_coded_decimal(3)\n '0b0011'\n >>> binary_coded_decimal(2)\n '0b0010'\n >>> binary_coded_decimal(12)\n '0b00010010'\n >>> binary_coded_decimal(987)\n '0b100110000111'\n \"\"\"\n return \"0b\" + \"\".join(\n str(bin(int(digit)))[2:].zfill(4) for digit in str(max(0, number))\n )\n"}, "sha256": "8f9069b0999830445059a821dd81f7ce3586f0d4d8b24f4d34584e94a0fa0126"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "8f9069b0999830445059a821dd81f7ce3586f0d4d8b24f4d34584e94a0fa0126", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "1deb3dfecbf75791a078441c5aeae397833fbc164a4a5d23fdc54f103438789c", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00263"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00263", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def binary_coded_decimal(number: int) -> str:\n \"\"\"\n Find binary coded decimal (bcd) of integer base 10.\n Each digit of the number is represented by a 4-bit binary.\n Example:\n >>> binary_coded_decimal(-2)\n '0b0000'\n >>> binary_coded_decimal(-1)\n '0b0000'\n >>> binary_coded_decimal(0)\n '0b0000'\n >>> binary_coded_decimal(3)\n '0b0011'\n >>> binary_coded_decimal(2)\n '0b0010'\n >>> binary_coded_decimal(12)\n '0b00010010'\n >>> binary_coded_decimal(987)\n '0b100110000111'\n \"\"\"\n return \"0b\" + \"\".join(\n str(bin(int(digit)))[1:].zfill(4) for digit in str(max(0, number))\n )\n"}, "sha256": "e0be57e6a61c091daec93d7c83636f159cda3c146c7b80a3f1d8679bbe619491"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "binary_coded_decimal:0", "got": "'0b00b0'\n", "source": "binary_coded_decimal(-2)\n", "truncated": false, "want": "'0b0000'\n"}, {"example_id": "binary_coded_decimal:1", "got": "'0b00b0'\n", "source": "binary_coded_decimal(-1)\n", "truncated": false, "want": "'0b0000'\n"}, {"example_id": "binary_coded_decimal:2", "got": "'0b00b0'\n", "source": "binary_coded_decimal(0)\n", "truncated": false, "want": "'0b0000'\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "off_by_one", "seed": 7, "span": {"col_offset": 29, "end_byte": 583, "lineno": 22, "node": "Constant", "node_col_offset": 29, "node_end_col_offset": 30, "node_end_lineno": 22, "node_lineno": 22, "op_index": 0, "original_text": "2", "replacement_text": "1", "start_byte": 582}}, "public_tests": {"examples": [{"example_id": "binary_coded_decimal:0", "source": "binary_coded_decimal(-2)\n", "want": "'0b0000'\n"}, {"example_id": "binary_coded_decimal:1", "source": "binary_coded_decimal(-1)\n", "want": "'0b0000'\n"}, {"example_id": "binary_coded_decimal:2", "source": "binary_coded_decimal(0)\n", "want": "'0b0000'\n"}, {"example_id": "binary_coded_decimal:3", "source": "binary_coded_decimal(3)\n", "want": "'0b0011'\n"}, {"example_id": "binary_coded_decimal:4", "source": "binary_coded_decimal(2)\n", "want": "'0b0010'\n"}, {"example_id": "binary_coded_decimal:5", "source": "binary_coded_decimal(12)\n", "want": "'0b00010010'\n"}, {"example_id": "binary_coded_decimal:6", "source": "binary_coded_decimal(987)\n", "want": "'0b100110000111'\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-debab8b4fad77e2a", "tree_sha256": "8f9069b0999830445059a821dd81f7ce3586f0d4d8b24f4d34584e94a0fa0126", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:bit_manipulation/binary_coded_decimal.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def is_power_of_two(number: int) -> bool:\n \"\"\"\n Return True if this number is power of 2 or False otherwise.\n\n >>> is_power_of_two(0)\n True\n >>> is_power_of_two(1)\n True\n >>> is_power_of_two(2)\n True\n >>> is_power_of_two(4)\n True\n >>> is_power_of_two(6)\n False\n >>> is_power_of_two(8)\n True\n >>> is_power_of_two(17)\n False\n >>> is_power_of_two(-1)\n Traceback (most recent call last):\n ...\n ValueError: number must not be negative\n >>> is_power_of_two(1.2)\n Traceback (most recent call last):\n ...\n TypeError: unsupported operand type(s) for &: 'float' and 'float'\n\n # Test all powers of 2 from 0 to 10,000\n >>> all(is_power_of_two(int(2 ** i)) for i in range(10000))\n True\n \"\"\"\n if number < 0:\n raise ValueError(\"number must not be negative\")\n return number & (number - 1) == 0\n"}, "sha256": "63e962a60e6bc8e12c5fc3967d041a81c74b385fd32ca4468e938001c76b2a07"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "63e962a60e6bc8e12c5fc3967d041a81c74b385fd32ca4468e938001c76b2a07", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "a1eb9e8f147ae8adcb51c4696a049e2c91e7ed58f68c8421beaffc2c103716f3", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00266"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00266", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def is_power_of_two(number: int) -> bool:\n \"\"\"\n Return True if this number is power of 2 or False otherwise.\n\n >>> is_power_of_two(0)\n True\n >>> is_power_of_two(1)\n True\n >>> is_power_of_two(2)\n True\n >>> is_power_of_two(4)\n True\n >>> is_power_of_two(6)\n False\n >>> is_power_of_two(8)\n True\n >>> is_power_of_two(17)\n False\n >>> is_power_of_two(-1)\n Traceback (most recent call last):\n ...\n ValueError: number must not be negative\n >>> is_power_of_two(1.2)\n Traceback (most recent call last):\n ...\n TypeError: unsupported operand type(s) for &: 'float' and 'float'\n\n # Test all powers of 2 from 0 to 10,000\n >>> all(is_power_of_two(int(2 ** i)) for i in range(10000))\n True\n \"\"\"\n if number < 0:\n raise ValueError(\"number must not be negative\")\n return number & (number - 1) != 0\n"}, "sha256": "be6eae75a09e16c44249519a9c416ef951324f539272e6e7ed27f692c3638fc1"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "is_power_of_two:0", "got": "False\n", "source": "is_power_of_two(0)\n", "truncated": false, "want": "True\n"}, {"example_id": "is_power_of_two:1", "got": "False\n", "source": "is_power_of_two(1)\n", "truncated": false, "want": "True\n"}, {"example_id": "is_power_of_two:2", "got": "False\n", "source": "is_power_of_two(2)\n", "truncated": false, "want": "True\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "boolean_condition", "seed": 7, "span": {"col_offset": 33, "end_byte": 880, "lineno": 34, "node": "Compare", "node_col_offset": 11, "node_end_col_offset": 37, "node_end_lineno": 34, "node_lineno": 34, "op_index": 0, "original_text": "==", "replacement_text": "!=", "start_byte": 878}}, "public_tests": {"examples": [{"example_id": "is_power_of_two:0", "source": "is_power_of_two(0)\n", "want": "True\n"}, {"example_id": "is_power_of_two:1", "source": "is_power_of_two(1)\n", "want": "True\n"}, {"example_id": "is_power_of_two:2", "source": "is_power_of_two(2)\n", "want": "True\n"}, {"example_id": "is_power_of_two:3", "source": "is_power_of_two(4)\n", "want": "True\n"}, {"example_id": "is_power_of_two:4", "source": "is_power_of_two(6)\n", "want": "False\n"}, {"example_id": "is_power_of_two:5", "source": "is_power_of_two(8)\n", "want": "True\n"}, {"example_id": "is_power_of_two:6", "source": "is_power_of_two(17)\n", "want": "False\n"}, {"example_id": "is_power_of_two:7", "source": "is_power_of_two(-1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: number must not be negative\n"}, {"example_id": "is_power_of_two:8", "source": "is_power_of_two(1.2)\n", "want": "Traceback (most recent call last):\n ...\nTypeError: unsupported operand type(s) for &: 'float' and 'float'\n"}, {"example_id": "is_power_of_two:9", "source": "all(is_power_of_two(int(2 ** i)) for i in range(10000))\n", "want": "True\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-9cf005a701561f8a", "tree_sha256": "63e962a60e6bc8e12c5fc3967d041a81c74b385fd32ca4468e938001c76b2a07", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:bit_manipulation/is_power_of_two.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "from __future__ import annotations\n\n\ndef all_construct(target: str, word_bank: list[str] | None = None) -> list[list[str]]:\n \"\"\"\n returns the list containing all the possible\n combinations a string(`target`) can be constructed from\n the given list of substrings(`word_bank`)\n\n >>> all_construct(\"hello\", [\"he\", \"l\", \"o\"])\n [['he', 'l', 'l', 'o']]\n >>> all_construct(\"purple\",[\"purp\",\"p\",\"ur\",\"le\",\"purpl\"])\n [['purp', 'le'], ['p', 'ur', 'p', 'le']]\n \"\"\"\n\n word_bank = word_bank or []\n # create a table\n table_size: int = len(target) + 1\n\n table: list[list[list[str]]] = []\n for _ in range(table_size):\n table.append([])\n # seed value\n table[0] = [[]] # because empty string has empty combination\n\n # iterate through the indices\n for i in range(table_size):\n # condition\n if table[i] != []:\n for word in word_bank:\n # slice condition\n if target[i : i + len(word)] == word:\n new_combinations: list[list[str]] = [\n [word, *way] for way in table[i]\n ]\n # adds the word to every combination the current position holds\n # now,push that combination to the table[i+len(word)]\n table[i + len(word)] += new_combinations\n\n # combinations are in reverse order so reverse for better output\n for combination in table[len(target)]:\n combination.reverse()\n\n return table[len(target)]\n"}, "sha256": "e3fb6ff3c8b458d45c54b29584b7f5a9410a25578acb12b42c28a13ed4498a7c"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "e3fb6ff3c8b458d45c54b29584b7f5a9410a25578acb12b42c28a13ed4498a7c", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "97e310a273ce8c7a0b41c93d10cf78ff873308dcabeab2f7d326de1cea5bc7dd", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00267"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00267", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 23, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "from __future__ import annotations\n\n\ndef all_construct(target: str, word_bank: list[str] | None = None) -> list[list[str]]:\n \"\"\"\n returns the list containing all the possible\n combinations a string(`target`) can be constructed from\n the given list of substrings(`word_bank`)\n\n >>> all_construct(\"hello\", [\"he\", \"l\", \"o\"])\n [['he', 'l', 'l', 'o']]\n >>> all_construct(\"purple\",[\"purp\",\"p\",\"ur\",\"le\",\"purpl\"])\n [['purp', 'le'], ['p', 'ur', 'p', 'le']]\n \"\"\"\n\n word_bank = word_bank and []\n # create a table\n table_size: int = len(target) + 1\n\n table: list[list[list[str]]] = []\n for _ in range(table_size):\n table.append([])\n # seed value\n table[0] = [[]] # because empty string has empty combination\n\n # iterate through the indices\n for i in range(table_size):\n # condition\n if table[i] != []:\n for word in word_bank:\n # slice condition\n if target[i : i + len(word)] == word:\n new_combinations: list[list[str]] = [\n [word, *way] for way in table[i]\n ]\n # adds the word to every combination the current position holds\n # now,push that combination to the table[i+len(word)]\n table[i + len(word)] += new_combinations\n\n # combinations are in reverse order so reverse for better output\n for combination in table[len(target)]:\n combination.reverse()\n\n return table[len(target)]\n"}, "sha256": "6dc1e4b54ad932565bb084e9ad6eb0f42556d6dc761414f9e47db839f21d0532"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "all_construct:0", "got": "[]\n", "source": "all_construct(\"hello\", [\"he\", \"l\", \"o\"])\n", "truncated": false, "want": "[['he', 'l', 'l', 'o']]\n"}, {"example_id": "all_construct:1", "got": "[]\n", "source": "all_construct(\"purple\",[\"purp\",\"p\",\"ur\",\"le\",\"purpl\"])\n", "truncated": false, "want": "[['purp', 'le'], ['p', 'ur', 'p', 'le']]\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "boolean_condition", "seed": 7, "span": {"col_offset": 26, "end_byte": 510, "lineno": 16, "node": "BoolOp", "node_col_offset": 16, "node_end_col_offset": 31, "node_end_lineno": 16, "node_lineno": 16, "op_index": 0, "original_text": "or", "replacement_text": "and", "start_byte": 508}}, "public_tests": {"examples": [{"example_id": "all_construct:0", "source": "all_construct(\"hello\", [\"he\", \"l\", \"o\"])\n", "want": "[['he', 'l', 'l', 'o']]\n"}, {"example_id": "all_construct:1", "source": "all_construct(\"purple\",[\"purp\",\"p\",\"ur\",\"le\",\"purpl\"])\n", "want": "[['purp', 'le'], ['p', 'ur', 'p', 'le']]\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-75910929c89b5ba8", "tree_sha256": "e3fb6ff3c8b458d45c54b29584b7f5a9410a25578acb12b42c28a13ed4498a7c", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:dynamic_programming/all_construct.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def create_ngram(sentence: str, ngram_size: int) -> list[str]:\n \"\"\"\n Create ngrams from a sentence\n\n >>> create_ngram(\"I am a sentence\", 2)\n ['I ', ' a', 'am', 'm ', ' a', 'a ', ' s', 'se', 'en', 'nt', 'te', 'en', 'nc', 'ce']\n >>> create_ngram(\"I am an NLPer\", 2)\n ['I ', ' a', 'am', 'm ', ' a', 'an', 'n ', ' N', 'NL', 'LP', 'Pe', 'er']\n >>> create_ngram(\"This is short\", 50)\n []\n \"\"\"\n return [sentence[i : i + ngram_size] for i in range(len(sentence) - ngram_size + 1)]\n"}, "sha256": "3881251200419c2008cd6f4ec6b1c04cafed25b764512c567432c86fe3abb1d8"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "3881251200419c2008cd6f4ec6b1c04cafed25b764512c567432c86fe3abb1d8", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "dfc45e8664cf02080f0b9e07183a2380eb30692d9e1d2bedfe9b4a0f6890353c", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00269"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00269", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def create_ngram(sentence: str, ngram_size: int) -> list[str]:\n \"\"\"\n Create ngrams from a sentence\n\n >>> create_ngram(\"I am a sentence\", 2)\n ['I ', ' a', 'am', 'm ', ' a', 'a ', ' s', 'se', 'en', 'nt', 'te', 'en', 'nc', 'ce']\n >>> create_ngram(\"I am an NLPer\", 2)\n ['I ', ' a', 'am', 'm ', ' a', 'an', 'n ', ' N', 'NL', 'LP', 'Pe', 'er']\n >>> create_ngram(\"This is short\", 50)\n []\n \"\"\"\n return [sentence[i : i + ngram_size] for i in range(len(sentence) - ngram_size - 1)]\n"}, "sha256": "c78f06ed880aaab991b97c52c1550956e992901dc23ad3dc2e0f5ba432d7e03a"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "create_ngram:0", "got": "['I ', ' a', 'am', 'm ', ' a', 'a ', ' s', 'se', 'en', 'nt', 'te', 'en']\n", "source": "create_ngram(\"I am a sentence\", 2)\n", "truncated": false, "want": "['I ', ' a', 'am', 'm ', ' a', 'a ', ' s', 'se', 'en', 'nt', 'te', 'en', 'nc', 'ce']\n"}, {"example_id": "create_ngram:1", "got": "['I ', ' a', 'am', 'm ', ' a', 'an', 'n ', ' N', 'NL', 'LP']\n", "source": "create_ngram(\"I am an NLPer\", 2)\n", "truncated": false, "want": "['I ', ' a', 'am', 'm ', ' a', 'an', 'n ', ' N', 'NL', 'LP', 'Pe', 'er']\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 83, "end_byte": 497, "lineno": 12, "node": "BinOp", "node_col_offset": 56, "node_end_col_offset": 86, "node_end_lineno": 12, "node_lineno": 12, "op_index": 0, "original_text": "+", "replacement_text": "-", "start_byte": 496}}, "public_tests": {"examples": [{"example_id": "create_ngram:0", "source": "create_ngram(\"I am a sentence\", 2)\n", "want": "['I ', ' a', 'am', 'm ', ' a', 'a ', ' s', 'se', 'en', 'nt', 'te', 'en', 'nc', 'ce']\n"}, {"example_id": "create_ngram:1", "source": "create_ngram(\"I am an NLPer\", 2)\n", "want": "['I ', ' a', 'am', 'm ', ' a', 'an', 'n ', ' N', 'NL', 'LP', 'Pe', 'er']\n"}, {"example_id": "create_ngram:2", "source": "create_ngram(\"This is short\", 50)\n", "want": "[]\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-8622d18f97f27b2e", "tree_sha256": "3881251200419c2008cd6f4ec6b1c04cafed25b764512c567432c86fe3abb1d8", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:strings/ngram.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def moles_to_volume(pressure: float, moles: float, temperature: float) -> float:\n \"\"\"\n Convert moles to volume.\n Ideal gas laws are used.\n Temperature is taken in kelvin.\n Volume is taken in litres.\n Pressure has atm as SI unit.\n\n Wikipedia reference: https://en.wikipedia.org/wiki/Gas_laws\n Wikipedia reference: https://en.wikipedia.org/wiki/Pressure\n Wikipedia reference: https://en.wikipedia.org/wiki/Temperature\n\n >>> moles_to_volume(0.82, 3, 300)\n 90\n >>> moles_to_volume(8.2, 5, 200)\n 10\n \"\"\"\n return round(float((moles * 0.0821 * temperature) / (pressure)))\n"}, "sha256": "03704e7cb7003462f130a9f4be4768b87164bfcdc3834d639bb5cc66f17704b0"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "03704e7cb7003462f130a9f4be4768b87164bfcdc3834d639bb5cc66f17704b0", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "f1f643505bc03df9ab92c694ff2b4d671dc153b180458e57a69af5c94cc4f618", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00272"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00272", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def moles_to_volume(pressure: float, moles: float, temperature: float) -> float:\n \"\"\"\n Convert moles to volume.\n Ideal gas laws are used.\n Temperature is taken in kelvin.\n Volume is taken in litres.\n Pressure has atm as SI unit.\n\n Wikipedia reference: https://en.wikipedia.org/wiki/Gas_laws\n Wikipedia reference: https://en.wikipedia.org/wiki/Pressure\n Wikipedia reference: https://en.wikipedia.org/wiki/Temperature\n\n >>> moles_to_volume(0.82, 3, 300)\n 90\n >>> moles_to_volume(8.2, 5, 200)\n 10\n \"\"\"\n return round(float((moles // 0.0821 * temperature) / (pressure)))\n"}, "sha256": "4b6b5ec93481190075aba20e9b74581f2d3e4896e6a06aa048dc15fc0c619b48"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "moles_to_volume:0", "got": "13171\n", "source": "moles_to_volume(0.82, 3, 300)\n", "truncated": false, "want": "90\n"}, {"example_id": "moles_to_volume:1", "got": "1463\n", "source": "moles_to_volume(8.2, 5, 200)\n", "truncated": false, "want": "10\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 30, "end_byte": 594, "lineno": 18, "node": "BinOp", "node_col_offset": 24, "node_end_col_offset": 38, "node_end_lineno": 18, "node_lineno": 18, "op_index": 0, "original_text": "*", "replacement_text": "//", "start_byte": 593}}, "public_tests": {"examples": [{"example_id": "moles_to_volume:0", "source": "moles_to_volume(0.82, 3, 300)\n", "want": "90\n"}, {"example_id": "moles_to_volume:1", "source": "moles_to_volume(8.2, 5, 200)\n", "want": "10\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-1b3ddf3b9f300ebb", "tree_sha256": "03704e7cb7003462f130a9f4be4768b87164bfcdc3834d639bb5cc66f17704b0", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:conversions/molecular_chemistry.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def decimal_to_fraction(decimal: float | str) -> tuple[int, int]:\n \"\"\"\n Return a decimal number in its simplest fraction form\n >>> decimal_to_fraction(2)\n (2, 1)\n >>> decimal_to_fraction(89.)\n (89, 1)\n >>> decimal_to_fraction(\"67\")\n (67, 1)\n >>> decimal_to_fraction(\"45.0\")\n (45, 1)\n >>> decimal_to_fraction(1.5)\n (3, 2)\n >>> decimal_to_fraction(\"6.25\")\n (25, 4)\n >>> decimal_to_fraction(\"78td\")\n Traceback (most recent call last):\n ValueError: Please enter a valid number\n >>> decimal_to_fraction(0)\n (0, 1)\n >>> decimal_to_fraction(-2.5)\n (-5, 2)\n >>> decimal_to_fraction(0.125)\n (1, 8)\n >>> decimal_to_fraction(1000000.25)\n (4000001, 4)\n >>> decimal_to_fraction(1.3333)\n (13333, 10000)\n >>> decimal_to_fraction(\"1.23e2\")\n (123, 1)\n >>> decimal_to_fraction(\"0.500\")\n (1, 2)\n \"\"\"\n try:\n decimal = float(decimal)\n except ValueError:\n raise ValueError(\"Please enter a valid number\")\n fractional_part = decimal - int(decimal)\n if fractional_part == 0:\n return int(decimal), 1\n else:\n number_of_frac_digits = len(str(decimal).split(\".\")[1])\n numerator = int(decimal * (10**number_of_frac_digits))\n denominator = 10**number_of_frac_digits\n divisor, dividend = denominator, numerator\n while True:\n remainder = dividend % divisor\n if remainder == 0:\n break\n dividend, divisor = divisor, remainder\n numerator, denominator = numerator // divisor, denominator // divisor\n return numerator, denominator\n"}, "sha256": "6ef6afe3e999ce6c5a82bc42cd5eb21bcf3ac879ace305bc56fda4aa42e9adfa"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "6ef6afe3e999ce6c5a82bc42cd5eb21bcf3ac879ace305bc56fda4aa42e9adfa", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "40a41bf1ac4b54589eebdf08135966b8b79c784ea52e56f4231ed98d023ce106", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00277"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00277", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def decimal_to_fraction(decimal: float | str) -> tuple[int, int]:\n \"\"\"\n Return a decimal number in its simplest fraction form\n >>> decimal_to_fraction(2)\n (2, 1)\n >>> decimal_to_fraction(89.)\n (89, 1)\n >>> decimal_to_fraction(\"67\")\n (67, 1)\n >>> decimal_to_fraction(\"45.0\")\n (45, 1)\n >>> decimal_to_fraction(1.5)\n (3, 2)\n >>> decimal_to_fraction(\"6.25\")\n (25, 4)\n >>> decimal_to_fraction(\"78td\")\n Traceback (most recent call last):\n ValueError: Please enter a valid number\n >>> decimal_to_fraction(0)\n (0, 1)\n >>> decimal_to_fraction(-2.5)\n (-5, 2)\n >>> decimal_to_fraction(0.125)\n (1, 8)\n >>> decimal_to_fraction(1000000.25)\n (4000001, 4)\n >>> decimal_to_fraction(1.3333)\n (13333, 10000)\n >>> decimal_to_fraction(\"1.23e2\")\n (123, 1)\n >>> decimal_to_fraction(\"0.500\")\n (1, 2)\n \"\"\"\n try:\n decimal = float(decimal)\n except ValueError:\n raise ValueError(\"Please enter a valid number\")\n fractional_part = decimal - int(decimal)\n if fractional_part == 0:\n return int(decimal), 1\n else:\n number_of_frac_digits = len(str(decimal).split(\".\")[1])\n numerator = int(decimal * (10**number_of_frac_digits))\n denominator = 10**number_of_frac_digits\n divisor, dividend = denominator, numerator\n while True:\n remainder = dividend // divisor\n if remainder == 0:\n break\n dividend, divisor = divisor, remainder\n numerator, denominator = numerator // divisor, denominator // divisor\n return numerator, denominator\n"}, "sha256": "fef037117a1fd69275526e37aeee33facc8e5d7a9bc9d48b709962dd72308937"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "decimal_to_fraction:4", "got": "(1, 1)\n", "source": "decimal_to_fraction(1.5)\n", "truncated": false, "want": "(3, 2)\n"}, {"example_id": "decimal_to_fraction:5", "got": "(39, 6)\n", "source": "decimal_to_fraction(\"6.25\")\n", "truncated": false, "want": "(25, 4)\n"}, {"example_id": "decimal_to_fraction:8", "got": "(6, -3)\n", "source": "decimal_to_fraction(-2.5)\n", "truncated": false, "want": "(-5, 2)\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 33, "end_byte": 1393, "lineno": 47, "node": "BinOp", "node_col_offset": 24, "node_end_col_offset": 42, "node_end_lineno": 47, "node_lineno": 47, "op_index": 0, "original_text": "%", "replacement_text": "//", "start_byte": 1392}}, "public_tests": {"examples": [{"example_id": "decimal_to_fraction:0", "source": "decimal_to_fraction(2)\n", "want": "(2, 1)\n"}, {"example_id": "decimal_to_fraction:1", "source": "decimal_to_fraction(89.)\n", "want": "(89, 1)\n"}, {"example_id": "decimal_to_fraction:2", "source": "decimal_to_fraction(\"67\")\n", "want": "(67, 1)\n"}, {"example_id": "decimal_to_fraction:3", "source": "decimal_to_fraction(\"45.0\")\n", "want": "(45, 1)\n"}, {"example_id": "decimal_to_fraction:4", "source": "decimal_to_fraction(1.5)\n", "want": "(3, 2)\n"}, {"example_id": "decimal_to_fraction:5", "source": "decimal_to_fraction(\"6.25\")\n", "want": "(25, 4)\n"}, {"example_id": "decimal_to_fraction:6", "source": "decimal_to_fraction(\"78td\")\n", "want": "Traceback (most recent call last):\nValueError: Please enter a valid number\n"}, {"example_id": "decimal_to_fraction:7", "source": "decimal_to_fraction(0)\n", "want": "(0, 1)\n"}, {"example_id": "decimal_to_fraction:8", "source": "decimal_to_fraction(-2.5)\n", "want": "(-5, 2)\n"}, {"example_id": "decimal_to_fraction:9", "source": "decimal_to_fraction(0.125)\n", "want": "(1, 8)\n"}, {"example_id": "decimal_to_fraction:10", "source": "decimal_to_fraction(1000000.25)\n", "want": "(4000001, 4)\n"}, {"example_id": "decimal_to_fraction:11", "source": "decimal_to_fraction(1.3333)\n", "want": "(13333, 10000)\n"}, {"example_id": "decimal_to_fraction:12", "source": "decimal_to_fraction(\"1.23e2\")\n", "want": "(123, 1)\n"}, {"example_id": "decimal_to_fraction:13", "source": "decimal_to_fraction(\"0.500\")\n", "want": "(1, 2)\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-82cb3955aacfb1a6", "tree_sha256": "6ef6afe3e999ce6c5a82bc42cd5eb21bcf3ac879ace305bc56fda4aa42e9adfa", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/decimal_to_fraction.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def decimal_to_fraction(decimal: float | str) -> tuple[int, int]:\n \"\"\"\n Return a decimal number in its simplest fraction form\n >>> decimal_to_fraction(2)\n (2, 1)\n >>> decimal_to_fraction(89.)\n (89, 1)\n >>> decimal_to_fraction(\"67\")\n (67, 1)\n >>> decimal_to_fraction(\"45.0\")\n (45, 1)\n >>> decimal_to_fraction(1.5)\n (3, 2)\n >>> decimal_to_fraction(\"6.25\")\n (25, 4)\n >>> decimal_to_fraction(\"78td\")\n Traceback (most recent call last):\n ValueError: Please enter a valid number\n >>> decimal_to_fraction(0)\n (0, 1)\n >>> decimal_to_fraction(-2.5)\n (-5, 2)\n >>> decimal_to_fraction(0.125)\n (1, 8)\n >>> decimal_to_fraction(1000000.25)\n (4000001, 4)\n >>> decimal_to_fraction(1.3333)\n (13333, 10000)\n >>> decimal_to_fraction(\"1.23e2\")\n (123, 1)\n >>> decimal_to_fraction(\"0.500\")\n (1, 2)\n \"\"\"\n try:\n decimal = float(decimal)\n except ValueError:\n raise ValueError(\"Please enter a valid number\")\n fractional_part = decimal - int(decimal)\n if fractional_part == 0:\n return int(decimal), 1\n else:\n number_of_frac_digits = len(str(decimal).split(\".\")[1])\n numerator = int(decimal * (10**number_of_frac_digits))\n denominator = 10**number_of_frac_digits\n divisor, dividend = denominator, numerator\n while True:\n remainder = dividend % divisor\n if remainder == 0:\n break\n dividend, divisor = divisor, remainder\n numerator, denominator = numerator // divisor, denominator // divisor\n return numerator, denominator\n"}, "sha256": "6ef6afe3e999ce6c5a82bc42cd5eb21bcf3ac879ace305bc56fda4aa42e9adfa"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "6ef6afe3e999ce6c5a82bc42cd5eb21bcf3ac879ace305bc56fda4aa42e9adfa", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "6a2eab274e1f933f67d3caad56479d6f198051b423cf942f832b4d1c147493d7", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00278"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00278", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def decimal_to_fraction(decimal: float | str) -> tuple[int, int]:\n \"\"\"\n Return a decimal number in its simplest fraction form\n >>> decimal_to_fraction(2)\n (2, 1)\n >>> decimal_to_fraction(89.)\n (89, 1)\n >>> decimal_to_fraction(\"67\")\n (67, 1)\n >>> decimal_to_fraction(\"45.0\")\n (45, 1)\n >>> decimal_to_fraction(1.5)\n (3, 2)\n >>> decimal_to_fraction(\"6.25\")\n (25, 4)\n >>> decimal_to_fraction(\"78td\")\n Traceback (most recent call last):\n ValueError: Please enter a valid number\n >>> decimal_to_fraction(0)\n (0, 1)\n >>> decimal_to_fraction(-2.5)\n (-5, 2)\n >>> decimal_to_fraction(0.125)\n (1, 8)\n >>> decimal_to_fraction(1000000.25)\n (4000001, 4)\n >>> decimal_to_fraction(1.3333)\n (13333, 10000)\n >>> decimal_to_fraction(\"1.23e2\")\n (123, 1)\n >>> decimal_to_fraction(\"0.500\")\n (1, 2)\n \"\"\"\n try:\n decimal = float(decimal)\n except ValueError:\n raise ValueError(\"Please enter a valid number\")\n fractional_part = decimal - int(decimal)\n if fractional_part == 0:\n return int(decimal), 1\n else:\n number_of_frac_digits = len(str(decimal).split(\".\")[2])\n numerator = int(decimal * (10**number_of_frac_digits))\n denominator = 10**number_of_frac_digits\n divisor, dividend = denominator, numerator\n while True:\n remainder = dividend % divisor\n if remainder == 0:\n break\n dividend, divisor = divisor, remainder\n numerator, denominator = numerator // divisor, denominator // divisor\n return numerator, denominator\n"}, "sha256": "9ebabc0f7eefa01572b969d40250d2270b271fd1a53ebac2c13c4acf84518679"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "decimal_to_fraction:4", "got": "IndexError: list index out of range", "source": "decimal_to_fraction(1.5)\n", "truncated": false, "want": "(3, 2)\n"}, {"example_id": "decimal_to_fraction:5", "got": "IndexError: list index out of range", "source": "decimal_to_fraction(\"6.25\")\n", "truncated": false, "want": "(25, 4)\n"}, {"example_id": "decimal_to_fraction:8", "got": "IndexError: list index out of range", "source": "decimal_to_fraction(-2.5)\n", "truncated": false, "want": "(-5, 2)\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "off_by_one", "seed": 7, "span": {"col_offset": 60, "end_byte": 1174, "lineno": 42, "node": "Constant", "node_col_offset": 60, "node_end_col_offset": 61, "node_end_lineno": 42, "node_lineno": 42, "op_index": 0, "original_text": "1", "replacement_text": "2", "start_byte": 1173}}, "public_tests": {"examples": [{"example_id": "decimal_to_fraction:0", "source": "decimal_to_fraction(2)\n", "want": "(2, 1)\n"}, {"example_id": "decimal_to_fraction:1", "source": "decimal_to_fraction(89.)\n", "want": "(89, 1)\n"}, {"example_id": "decimal_to_fraction:2", "source": "decimal_to_fraction(\"67\")\n", "want": "(67, 1)\n"}, {"example_id": "decimal_to_fraction:3", "source": "decimal_to_fraction(\"45.0\")\n", "want": "(45, 1)\n"}, {"example_id": "decimal_to_fraction:4", "source": "decimal_to_fraction(1.5)\n", "want": "(3, 2)\n"}, {"example_id": "decimal_to_fraction:5", "source": "decimal_to_fraction(\"6.25\")\n", "want": "(25, 4)\n"}, {"example_id": "decimal_to_fraction:6", "source": "decimal_to_fraction(\"78td\")\n", "want": "Traceback (most recent call last):\nValueError: Please enter a valid number\n"}, {"example_id": "decimal_to_fraction:7", "source": "decimal_to_fraction(0)\n", "want": "(0, 1)\n"}, {"example_id": "decimal_to_fraction:8", "source": "decimal_to_fraction(-2.5)\n", "want": "(-5, 2)\n"}, {"example_id": "decimal_to_fraction:9", "source": "decimal_to_fraction(0.125)\n", "want": "(1, 8)\n"}, {"example_id": "decimal_to_fraction:10", "source": "decimal_to_fraction(1000000.25)\n", "want": "(4000001, 4)\n"}, {"example_id": "decimal_to_fraction:11", "source": "decimal_to_fraction(1.3333)\n", "want": "(13333, 10000)\n"}, {"example_id": "decimal_to_fraction:12", "source": "decimal_to_fraction(\"1.23e2\")\n", "want": "(123, 1)\n"}, {"example_id": "decimal_to_fraction:13", "source": "decimal_to_fraction(\"0.500\")\n", "want": "(1, 2)\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-82cb3955aacfb1a6", "tree_sha256": "6ef6afe3e999ce6c5a82bc42cd5eb21bcf3ac879ace305bc56fda4aa42e9adfa", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/decimal_to_fraction.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "from __future__ import annotations\nfrom cmath import sqrt\n\n\ndef quadratic_roots(a: int, b: int, c: int) -> tuple[complex, complex]:\n \"\"\"\n Given the numerical coefficients a, b and c,\n calculates the roots for any quadratic equation of the form ax^2 + bx + c\n\n >>> quadratic_roots(a=1, b=3, c=-4)\n (1.0, -4.0)\n >>> quadratic_roots(5, 6, 1)\n (-0.2, -1.0)\n >>> quadratic_roots(1, -6, 25)\n ((3+4j), (3-4j))\n \"\"\"\n\n if a == 0:\n raise ValueError(\"Coefficient 'a' must not be zero.\")\n delta = b * b - 4 * a * c\n\n root_1 = (-b + sqrt(delta)) / (2 * a)\n root_2 = (-b - sqrt(delta)) / (2 * a)\n\n return (\n root_1.real if not root_1.imag else root_1,\n root_2.real if not root_2.imag else root_2,\n )\n"}, "sha256": "9b43eefb544c6cbcbc45ca74fe4ef2ddd362d7945752017b32642fb5559b1cd2"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "9b43eefb544c6cbcbc45ca74fe4ef2ddd362d7945752017b32642fb5559b1cd2", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "667198b639bf878e6401c5142430ebd8cda1aefac2697b986526f88d5920b346", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00280"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00280", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "from __future__ import annotations\nfrom cmath import sqrt\n\n\ndef quadratic_roots(a: int, b: int, c: int) -> tuple[complex, complex]:\n \"\"\"\n Given the numerical coefficients a, b and c,\n calculates the roots for any quadratic equation of the form ax^2 + bx + c\n\n >>> quadratic_roots(a=1, b=3, c=-4)\n (1.0, -4.0)\n >>> quadratic_roots(5, 6, 1)\n (-0.2, -1.0)\n >>> quadratic_roots(1, -6, 25)\n ((3+4j), (3-4j))\n \"\"\"\n\n if a != 0:\n raise ValueError(\"Coefficient 'a' must not be zero.\")\n delta = b * b - 4 * a * c\n\n root_1 = (-b + sqrt(delta)) / (2 * a)\n root_2 = (-b - sqrt(delta)) / (2 * a)\n\n return (\n root_1.real if not root_1.imag else root_1,\n root_2.real if not root_2.imag else root_2,\n )\n"}, "sha256": "30084bb9d7932f55dc2e422f2079cdb2fb432269244cf785d57723e19e1b23df"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "quadratic_roots:0", "got": "ValueError: Coefficient 'a' must not be zero.", "source": "quadratic_roots(a=1, b=3, c=-4)\n", "truncated": false, "want": "(1.0, -4.0)\n"}, {"example_id": "quadratic_roots:1", "got": "ValueError: Coefficient 'a' must not be zero.", "source": "quadratic_roots(5, 6, 1)\n", "truncated": false, "want": "(-0.2, -1.0)\n"}, {"example_id": "quadratic_roots:2", "got": "ValueError: Coefficient 'a' must not be zero.", "source": "quadratic_roots(1, -6, 25)\n", "truncated": false, "want": "((3+4j), (3-4j))\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "boolean_condition", "seed": 7, "span": {"col_offset": 9, "end_byte": 450, "lineno": 18, "node": "Compare", "node_col_offset": 7, "node_end_col_offset": 13, "node_end_lineno": 18, "node_lineno": 18, "op_index": 0, "original_text": "==", "replacement_text": "!=", "start_byte": 448}}, "public_tests": {"examples": [{"example_id": "quadratic_roots:0", "source": "quadratic_roots(a=1, b=3, c=-4)\n", "want": "(1.0, -4.0)\n"}, {"example_id": "quadratic_roots:1", "source": "quadratic_roots(5, 6, 1)\n", "want": "(-0.2, -1.0)\n"}, {"example_id": "quadratic_roots:2", "source": "quadratic_roots(1, -6, 25)\n", "want": "((3+4j), (3-4j))\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-edb4aeff0498eef6", "tree_sha256": "9b43eefb544c6cbcbc45ca74fe4ef2ddd362d7945752017b32642fb5559b1cd2", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/quadratic_equations_complex_numbers.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def octal_to_hex(octal: str) -> str:\n \"\"\"\n Convert an Octal number to Hexadecimal number.\n For more information: https://en.wikipedia.org/wiki/Octal\n\n >>> octal_to_hex(\"100\")\n '0x40'\n >>> octal_to_hex(\"235\")\n '0x9D'\n >>> octal_to_hex(17)\n Traceback (most recent call last):\n ...\n TypeError: Expected a string as input\n >>> octal_to_hex(\"Av\")\n Traceback (most recent call last):\n ...\n ValueError: Not a Valid Octal Number\n >>> octal_to_hex(\"\")\n Traceback (most recent call last):\n ...\n ValueError: Empty string was passed to the function\n \"\"\"\n\n if not isinstance(octal, str):\n raise TypeError(\"Expected a string as input\")\n if octal.startswith(\"0o\"):\n octal = octal[2:]\n if octal == \"\":\n raise ValueError(\"Empty string was passed to the function\")\n if any(char not in \"01234567\" for char in octal):\n raise ValueError(\"Not a Valid Octal Number\")\n\n decimal = 0\n for char in octal:\n decimal <<= 3\n decimal |= int(char)\n\n hex_char = \"0123456789ABCDEF\"\n\n revhex = \"\"\n while decimal:\n revhex += hex_char[decimal & 15]\n decimal >>= 4\n\n return \"0x\" + revhex[::-1]\n"}, "sha256": "60cade18c59e6d2f94becc790bba720ecd3fc3ef964c38789825cff97fa020c3"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "60cade18c59e6d2f94becc790bba720ecd3fc3ef964c38789825cff97fa020c3", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "33aa035bae9ef44b9fdbc906c60f63f60f2ed976d33a04a6618d5d87f0a5d864", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00282"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00282", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 8, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def octal_to_hex(octal: str) -> str:\n \"\"\"\n Convert an Octal number to Hexadecimal number.\n For more information: https://en.wikipedia.org/wiki/Octal\n\n >>> octal_to_hex(\"100\")\n '0x40'\n >>> octal_to_hex(\"235\")\n '0x9D'\n >>> octal_to_hex(17)\n Traceback (most recent call last):\n ...\n TypeError: Expected a string as input\n >>> octal_to_hex(\"Av\")\n Traceback (most recent call last):\n ...\n ValueError: Not a Valid Octal Number\n >>> octal_to_hex(\"\")\n Traceback (most recent call last):\n ...\n ValueError: Empty string was passed to the function\n \"\"\"\n\n if isinstance(octal, str):\n raise TypeError(\"Expected a string as input\")\n if octal.startswith(\"0o\"):\n octal = octal[2:]\n if octal == \"\":\n raise ValueError(\"Empty string was passed to the function\")\n if any(char not in \"01234567\" for char in octal):\n raise ValueError(\"Not a Valid Octal Number\")\n\n decimal = 0\n for char in octal:\n decimal <<= 3\n decimal |= int(char)\n\n hex_char = \"0123456789ABCDEF\"\n\n revhex = \"\"\n while decimal:\n revhex += hex_char[decimal & 15]\n decimal >>= 4\n\n return \"0x\" + revhex[::-1]\n"}, "sha256": "96d3b6e70438ad451dd42bc194f8bf1ee57311fdc356dd090ec7c70904f0db62"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "octal_to_hex:0", "got": "TypeError: Expected a string as input", "source": "octal_to_hex(\"100\")\n", "truncated": false, "want": "'0x40'\n"}, {"example_id": "octal_to_hex:1", "got": "TypeError: Expected a string as input", "source": "octal_to_hex(\"235\")\n", "truncated": false, "want": "'0x9D'\n"}, {"example_id": "octal_to_hex:2", "got": "AttributeError: 'int' object has no attribute 'startswith'", "source": "octal_to_hex(17)\n", "truncated": false, "want": "Traceback (most recent call last):\n ...\nTypeError: Expected a string as input\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "boolean_condition", "seed": 7, "span": {"col_offset": 7, "end_byte": 626, "lineno": 24, "node": "UnaryOp", "node_col_offset": 7, "node_end_col_offset": 33, "node_end_lineno": 24, "node_lineno": 24, "op_index": 0, "original_text": "not ", "replacement_text": "", "start_byte": 622}}, "public_tests": {"examples": [{"example_id": "octal_to_hex:0", "source": "octal_to_hex(\"100\")\n", "want": "'0x40'\n"}, {"example_id": "octal_to_hex:1", "source": "octal_to_hex(\"235\")\n", "want": "'0x9D'\n"}, {"example_id": "octal_to_hex:2", "source": "octal_to_hex(17)\n", "want": "Traceback (most recent call last):\n ...\nTypeError: Expected a string as input\n"}, {"example_id": "octal_to_hex:3", "source": "octal_to_hex(\"Av\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: Not a Valid Octal Number\n"}, {"example_id": "octal_to_hex:4", "source": "octal_to_hex(\"\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: Empty string was passed to the function\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-bbcdd5ef8b93b6b6", "tree_sha256": "60cade18c59e6d2f94becc790bba720ecd3fc3ef964c38789825cff97fa020c3", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:conversions/octal_to_hexadecimal.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "from __future__ import annotations\nfrom cmath import sqrt\n\n\ndef quadratic_roots(a: int, b: int, c: int) -> tuple[complex, complex]:\n \"\"\"\n Given the numerical coefficients a, b and c,\n calculates the roots for any quadratic equation of the form ax^2 + bx + c\n\n >>> quadratic_roots(a=1, b=3, c=-4)\n (1.0, -4.0)\n >>> quadratic_roots(5, 6, 1)\n (-0.2, -1.0)\n >>> quadratic_roots(1, -6, 25)\n ((3+4j), (3-4j))\n \"\"\"\n\n if a == 0:\n raise ValueError(\"Coefficient 'a' must not be zero.\")\n delta = b * b - 4 * a * c\n\n root_1 = (-b + sqrt(delta)) / (2 * a)\n root_2 = (-b - sqrt(delta)) / (2 * a)\n\n return (\n root_1.real if not root_1.imag else root_1,\n root_2.real if not root_2.imag else root_2,\n )\n"}, "sha256": "9b43eefb544c6cbcbc45ca74fe4ef2ddd362d7945752017b32642fb5559b1cd2"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "9b43eefb544c6cbcbc45ca74fe4ef2ddd362d7945752017b32642fb5559b1cd2", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "76a2cda4582ef8b12c86857a24c8e2845676fcbf7dc0af3cef3cda17b8c1eb66", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00284"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00284", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "from __future__ import annotations\nfrom cmath import sqrt\n\n\ndef quadratic_roots(a: int, b: int, c: int) -> tuple[complex, complex]:\n \"\"\"\n Given the numerical coefficients a, b and c,\n calculates the roots for any quadratic equation of the form ax^2 + bx + c\n\n >>> quadratic_roots(a=1, b=3, c=-4)\n (1.0, -4.0)\n >>> quadratic_roots(5, 6, 1)\n (-0.2, -1.0)\n >>> quadratic_roots(1, -6, 25)\n ((3+4j), (3-4j))\n \"\"\"\n\n if a == 1:\n raise ValueError(\"Coefficient 'a' must not be zero.\")\n delta = b * b - 4 * a * c\n\n root_1 = (-b + sqrt(delta)) / (2 * a)\n root_2 = (-b - sqrt(delta)) / (2 * a)\n\n return (\n root_1.real if not root_1.imag else root_1,\n root_2.real if not root_2.imag else root_2,\n )\n"}, "sha256": "72f1d79b3f43d33da60ad7f59d0b48aa5a99d9464eeaf37ce97ce0cd5f4d21b8"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "quadratic_roots:0", "got": "ValueError: Coefficient 'a' must not be zero.", "source": "quadratic_roots(a=1, b=3, c=-4)\n", "truncated": false, "want": "(1.0, -4.0)\n"}, {"example_id": "quadratic_roots:2", "got": "ValueError: Coefficient 'a' must not be zero.", "source": "quadratic_roots(1, -6, 25)\n", "truncated": false, "want": "((3+4j), (3-4j))\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "off_by_one", "seed": 7, "span": {"col_offset": 12, "end_byte": 452, "lineno": 18, "node": "Constant", "node_col_offset": 12, "node_end_col_offset": 13, "node_end_lineno": 18, "node_lineno": 18, "op_index": 0, "original_text": "0", "replacement_text": "1", "start_byte": 451}}, "public_tests": {"examples": [{"example_id": "quadratic_roots:0", "source": "quadratic_roots(a=1, b=3, c=-4)\n", "want": "(1.0, -4.0)\n"}, {"example_id": "quadratic_roots:1", "source": "quadratic_roots(5, 6, 1)\n", "want": "(-0.2, -1.0)\n"}, {"example_id": "quadratic_roots:2", "source": "quadratic_roots(1, -6, 25)\n", "want": "((3+4j), (3-4j))\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-edb4aeff0498eef6", "tree_sha256": "9b43eefb544c6cbcbc45ca74fe4ef2ddd362d7945752017b32642fb5559b1cd2", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/quadratic_equations_complex_numbers.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def binary_count_setbits(a: int) -> int:\n \"\"\"\n Take in 1 integer, return a number that is\n the number of 1's in binary representation of that number.\n\n >>> binary_count_setbits(25)\n 3\n >>> binary_count_setbits(36)\n 2\n >>> binary_count_setbits(16)\n 1\n >>> binary_count_setbits(58)\n 4\n >>> binary_count_setbits(4294967295)\n 32\n >>> binary_count_setbits(0)\n 0\n >>> binary_count_setbits(-10)\n Traceback (most recent call last):\n ...\n ValueError: Input value must be a positive integer\n >>> binary_count_setbits(0.8)\n Traceback (most recent call last):\n ...\n TypeError: Input value must be a 'int' type\n >>> binary_count_setbits(\"0\")\n Traceback (most recent call last):\n ...\n TypeError: '<' not supported between instances of 'str' and 'int'\n \"\"\"\n if a < 0:\n raise ValueError(\"Input value must be a positive integer\")\n elif isinstance(a, float):\n raise TypeError(\"Input value must be a 'int' type\")\n return bin(a).count(\"1\")\n"}, "sha256": "17af49a439d7715b4c411122212d610ff64d43c9590b8f7851ba87302bf64fbf"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "17af49a439d7715b4c411122212d610ff64d43c9590b8f7851ba87302bf64fbf", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "073a395ee515db5e1fbf543469b2813d4515a79c5235d3352d30e6b5927210e8", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00285"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00285", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def binary_count_setbits(a: int) -> int:\n \"\"\"\n Take in 1 integer, return a number that is\n the number of 1's in binary representation of that number.\n\n >>> binary_count_setbits(25)\n 3\n >>> binary_count_setbits(36)\n 2\n >>> binary_count_setbits(16)\n 1\n >>> binary_count_setbits(58)\n 4\n >>> binary_count_setbits(4294967295)\n 32\n >>> binary_count_setbits(0)\n 0\n >>> binary_count_setbits(-10)\n Traceback (most recent call last):\n ...\n ValueError: Input value must be a positive integer\n >>> binary_count_setbits(0.8)\n Traceback (most recent call last):\n ...\n TypeError: Input value must be a 'int' type\n >>> binary_count_setbits(\"0\")\n Traceback (most recent call last):\n ...\n TypeError: '<' not supported between instances of 'str' and 'int'\n \"\"\"\n if a < 0:\n raise ValueError(\"Input value must be a positive integer\")\n elif isinstance(a, float):\n raise TypeError(\"Input value must be a 'int' type\")\n return bin(a).count(\"1\") - 1\n"}, "sha256": "eb162b63b043df38f9cc653a78a92339b7d96edf7e89e7888516af2e74d5d090"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "binary_count_setbits:0", "got": "2\n", "source": "binary_count_setbits(25)\n", "truncated": false, "want": "3\n"}, {"example_id": "binary_count_setbits:1", "got": "1\n", "source": "binary_count_setbits(36)\n", "truncated": false, "want": "2\n"}, {"example_id": "binary_count_setbits:2", "got": "0\n", "source": "binary_count_setbits(16)\n", "truncated": false, "want": "1\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 1038, "lineno": 35, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 28, "node_end_lineno": 35, "node_lineno": 35, "op_index": 0, "original_text": "bin(a).count(\"1\")", "replacement_text": "bin(a).count(\"1\") - 1", "start_byte": 1021}}, "public_tests": {"examples": [{"example_id": "binary_count_setbits:0", "source": "binary_count_setbits(25)\n", "want": "3\n"}, {"example_id": "binary_count_setbits:1", "source": "binary_count_setbits(36)\n", "want": "2\n"}, {"example_id": "binary_count_setbits:2", "source": "binary_count_setbits(16)\n", "want": "1\n"}, {"example_id": "binary_count_setbits:3", "source": "binary_count_setbits(58)\n", "want": "4\n"}, {"example_id": "binary_count_setbits:4", "source": "binary_count_setbits(4294967295)\n", "want": "32\n"}, {"example_id": "binary_count_setbits:5", "source": "binary_count_setbits(0)\n", "want": "0\n"}, {"example_id": "binary_count_setbits:6", "source": "binary_count_setbits(-10)\n", "want": "Traceback (most recent call last):\n ...\nValueError: Input value must be a positive integer\n"}, {"example_id": "binary_count_setbits:7", "source": "binary_count_setbits(0.8)\n", "want": "Traceback (most recent call last):\n ...\nTypeError: Input value must be a 'int' type\n"}, {"example_id": "binary_count_setbits:8", "source": "binary_count_setbits(\"0\")\n", "want": "Traceback (most recent call last):\n ...\nTypeError: '<' not supported between instances of 'str' and 'int'\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-5811ec8749219449", "tree_sha256": "17af49a439d7715b4c411122212d610ff64d43c9590b8f7851ba87302bf64fbf", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:bit_manipulation/binary_count_setbits.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def longest_common_subsequence(x: str, y: str):\n \"\"\"\n Finds the longest common subsequence between two strings. Also returns the\n The subsequence found\n\n Parameters\n ----------\n\n x: str, one of the strings\n y: str, the other string\n\n Returns\n -------\n L[m][n]: int, the length of the longest subsequence. Also equal to len(seq)\n Seq: str, the subsequence found\n\n >>> longest_common_subsequence(\"programming\", \"gaming\")\n (6, 'gaming')\n >>> longest_common_subsequence(\"physics\", \"smartphone\")\n (2, 'ph')\n >>> longest_common_subsequence(\"computer\", \"food\")\n (1, 'o')\n >>> longest_common_subsequence(\"\", \"abc\") # One string is empty\n (0, '')\n >>> longest_common_subsequence(\"abc\", \"\") # Other string is empty\n (0, '')\n >>> longest_common_subsequence(\"\", \"\") # Both strings are empty\n (0, '')\n >>> longest_common_subsequence(\"abc\", \"def\") # No common subsequence\n (0, '')\n >>> longest_common_subsequence(\"abc\", \"abc\") # Identical strings\n (3, 'abc')\n >>> longest_common_subsequence(\"a\", \"a\") # Single character match\n (1, 'a')\n >>> longest_common_subsequence(\"a\", \"b\") # Single character no match\n (0, '')\n >>> longest_common_subsequence(\"abcdef\", \"ace\") # Interleaved subsequence\n (3, 'ace')\n >>> longest_common_subsequence(\"ABCD\", \"ACBD\") # No repeated characters\n (3, 'ABD')\n \"\"\"\n # find the length of strings\n\n assert x is not None\n assert y is not None\n\n m = len(x)\n n = len(y)\n\n # declaring the array for storing the dp values\n dp = [[0] * (n + 1) for _ in range(m + 1)]\n\n for i in range(1, m + 1):\n for j in range(1, n + 1):\n match = 1 if x[i - 1] == y[j - 1] else 0\n\n dp[i][j] = max(dp[i - 1][j], dp[i][j - 1], dp[i - 1][j - 1] + match)\n\n seq = \"\"\n i, j = m, n\n while i > 0 and j > 0:\n match = 1 if x[i - 1] == y[j - 1] else 0\n\n if dp[i][j] == dp[i - 1][j - 1] + match:\n if match == 1:\n seq = x[i - 1] + seq\n i -= 1\n j -= 1\n elif dp[i][j] == dp[i - 1][j]:\n i -= 1\n else:\n j -= 1\n\n return dp[m][n], seq\n"}, "sha256": "b57beb30e6898f2174b9fb6ece9661384657c70995b79a47ac73992a0abcd6a3"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "b57beb30e6898f2174b9fb6ece9661384657c70995b79a47ac73992a0abcd6a3", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "67f3237cd06079bdd586c935d64c54cad103f8247c6706db03cafb2ee422b5c9", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00289"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00289", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def longest_common_subsequence(x: str, y: str):\n \"\"\"\n Finds the longest common subsequence between two strings. Also returns the\n The subsequence found\n\n Parameters\n ----------\n\n x: str, one of the strings\n y: str, the other string\n\n Returns\n -------\n L[m][n]: int, the length of the longest subsequence. Also equal to len(seq)\n Seq: str, the subsequence found\n\n >>> longest_common_subsequence(\"programming\", \"gaming\")\n (6, 'gaming')\n >>> longest_common_subsequence(\"physics\", \"smartphone\")\n (2, 'ph')\n >>> longest_common_subsequence(\"computer\", \"food\")\n (1, 'o')\n >>> longest_common_subsequence(\"\", \"abc\") # One string is empty\n (0, '')\n >>> longest_common_subsequence(\"abc\", \"\") # Other string is empty\n (0, '')\n >>> longest_common_subsequence(\"\", \"\") # Both strings are empty\n (0, '')\n >>> longest_common_subsequence(\"abc\", \"def\") # No common subsequence\n (0, '')\n >>> longest_common_subsequence(\"abc\", \"abc\") # Identical strings\n (3, 'abc')\n >>> longest_common_subsequence(\"a\", \"a\") # Single character match\n (1, 'a')\n >>> longest_common_subsequence(\"a\", \"b\") # Single character no match\n (0, '')\n >>> longest_common_subsequence(\"abcdef\", \"ace\") # Interleaved subsequence\n (3, 'ace')\n >>> longest_common_subsequence(\"ABCD\", \"ACBD\") # No repeated characters\n (3, 'ABD')\n \"\"\"\n # find the length of strings\n\n assert x is not None\n assert y is not None\n\n m = len(x)\n n = len(y)\n\n # declaring the array for storing the dp values\n dp = [[0] * (n + 1) for _ in range(m + 1)]\n\n for i in range(1, m + 1):\n for j in range(1, n + 1):\n match = 1 if x[i - 1] == y[j - 1] else 0\n\n dp[i][j] = max(dp[i - 1][j], dp[i][j - 1], dp[i - 1][j - 1] + match)\n\n seq = \"\"\n i, j = m, n\n while i > 0 and j > 0:\n match = 1 if x[i - 1] == y[j - 1] else 0\n\n if dp[i][j] != dp[i - 1][j - 1] + match:\n if match == 1:\n seq = x[i - 1] + seq\n i -= 1\n j -= 1\n elif dp[i][j] == dp[i - 1][j]:\n i -= 1\n else:\n j -= 1\n\n return dp[m][n], seq\n"}, "sha256": "b9072298d0f0bf1b539af7f10e14a0ac372dfe7946ff416eb556e1340c321671"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "longest_common_subsequence:0", "got": "(6, '')\n", "source": "longest_common_subsequence(\"programming\", \"gaming\")\n", "truncated": false, "want": "(6, 'gaming')\n"}, {"example_id": "longest_common_subsequence:1", "got": "(2, '')\n", "source": "longest_common_subsequence(\"physics\", \"smartphone\")\n", "truncated": false, "want": "(2, 'ph')\n"}, {"example_id": "longest_common_subsequence:2", "got": "(1, '')\n", "source": "longest_common_subsequence(\"computer\", \"food\")\n", "truncated": false, "want": "(1, 'o')\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "boolean_condition", "seed": 7, "span": {"col_offset": 20, "end_byte": 1939, "lineno": 64, "node": "Compare", "node_col_offset": 11, "node_end_col_offset": 47, "node_end_lineno": 64, "node_lineno": 64, "op_index": 0, "original_text": "==", "replacement_text": "!=", "start_byte": 1937}}, "public_tests": {"examples": [{"example_id": "longest_common_subsequence:0", "source": "longest_common_subsequence(\"programming\", \"gaming\")\n", "want": "(6, 'gaming')\n"}, {"example_id": "longest_common_subsequence:1", "source": "longest_common_subsequence(\"physics\", \"smartphone\")\n", "want": "(2, 'ph')\n"}, {"example_id": "longest_common_subsequence:2", "source": "longest_common_subsequence(\"computer\", \"food\")\n", "want": "(1, 'o')\n"}, {"example_id": "longest_common_subsequence:3", "source": "longest_common_subsequence(\"\", \"abc\") # One string is empty\n", "want": "(0, '')\n"}, {"example_id": "longest_common_subsequence:4", "source": "longest_common_subsequence(\"abc\", \"\") # Other string is empty\n", "want": "(0, '')\n"}, {"example_id": "longest_common_subsequence:5", "source": "longest_common_subsequence(\"\", \"\") # Both strings are empty\n", "want": "(0, '')\n"}, {"example_id": "longest_common_subsequence:6", "source": "longest_common_subsequence(\"abc\", \"def\") # No common subsequence\n", "want": "(0, '')\n"}, {"example_id": "longest_common_subsequence:7", "source": "longest_common_subsequence(\"abc\", \"abc\") # Identical strings\n", "want": "(3, 'abc')\n"}, {"example_id": "longest_common_subsequence:8", "source": "longest_common_subsequence(\"a\", \"a\") # Single character match\n", "want": "(1, 'a')\n"}, {"example_id": "longest_common_subsequence:9", "source": "longest_common_subsequence(\"a\", \"b\") # Single character no match\n", "want": "(0, '')\n"}, {"example_id": "longest_common_subsequence:10", "source": "longest_common_subsequence(\"abcdef\", \"ace\") # Interleaved subsequence\n", "want": "(3, 'ace')\n"}, {"example_id": "longest_common_subsequence:11", "source": "longest_common_subsequence(\"ABCD\", \"ACBD\") # No repeated characters\n", "want": "(3, 'ABD')\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-2325d19d958de463", "tree_sha256": "b57beb30e6898f2174b9fb6ece9661384657c70995b79a47ac73992a0abcd6a3", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:dynamic_programming/longest_common_subsequence.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def strip(user_string: str, characters: str = \" \\t\\n\\r\") -> str:\n \"\"\"\n Remove leading and trailing characters (whitespace by default) from a string.\n\n Args:\n user_string (str): The input string to be stripped.\n characters (str, optional): Optional characters to be removed\n (default is whitespace).\n\n Returns:\n str: The stripped string.\n\n Examples:\n >>> strip(\" hello \")\n 'hello'\n >>> strip(\"...world...\", \".\")\n 'world'\n >>> strip(\"123hello123\", \"123\")\n 'hello'\n >>> strip(\"\")\n ''\n \"\"\"\n\n start = 0\n end = len(user_string)\n\n while start < end and user_string[start] in characters:\n start += 1\n\n while end > start and user_string[end - 1] in characters:\n end -= 1\n\n return user_string[start:end]\n"}, "sha256": "31e238903899a072a53304e6748c0900094fa86bd9e955fc5413223cd819ddff"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "31e238903899a072a53304e6748c0900094fa86bd9e955fc5413223cd819ddff", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "1b98f658fc144759539ab8768c94a1b6a84b3c427821a443e10eb147b2f87b2f", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00290"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00290", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def strip(user_string: str, characters: str = \" \\t\\n\\r\") -> str:\n \"\"\"\n Remove leading and trailing characters (whitespace by default) from a string.\n\n Args:\n user_string (str): The input string to be stripped.\n characters (str, optional): Optional characters to be removed\n (default is whitespace).\n\n Returns:\n str: The stripped string.\n\n Examples:\n >>> strip(\" hello \")\n 'hello'\n >>> strip(\"...world...\", \".\")\n 'world'\n >>> strip(\"123hello123\", \"123\")\n 'hello'\n >>> strip(\"\")\n ''\n \"\"\"\n\n start = 0\n end = len(user_string)\n\n while start < end and user_string[start] in characters:\n start += 1\n\n while end >= start and user_string[end - 1] in characters:\n end -= 1\n\n return user_string[start:end]\n"}, "sha256": "fa6e99da62405f9d85afb74c76851aff80b9a3c4d22fd9b6e6cafda819753a47"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "strip:3", "got": "IndexError: string index out of range", "source": "strip(\"\")\n", "truncated": false, "want": "''\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "comparison_boundary", "seed": 7, "span": {"col_offset": 14, "end_byte": 738, "lineno": 30, "node": "Compare", "node_col_offset": 10, "node_end_col_offset": 21, "node_end_lineno": 30, "node_lineno": 30, "op_index": 0, "original_text": ">", "replacement_text": ">=", "start_byte": 737}}, "public_tests": {"examples": [{"example_id": "strip:0", "source": "strip(\" hello \")\n", "want": "'hello'\n"}, {"example_id": "strip:1", "source": "strip(\"...world...\", \".\")\n", "want": "'world'\n"}, {"example_id": "strip:2", "source": "strip(\"123hello123\", \"123\")\n", "want": "'hello'\n"}, {"example_id": "strip:3", "source": "strip(\"\")\n", "want": "''\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-22f63ae65a109834", "tree_sha256": "31e238903899a072a53304e6748c0900094fa86bd9e955fc5413223cd819ddff", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:strings/strip.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def get_bit(number: int, position: int) -> int:\n \"\"\"\n Get the bit at the given position\n\n Details: perform bitwise and for the given number and X,\n Where X is a number with all the bits - zeroes and bit on given position - one.\n If the result is not equal to 0, then the bit on the given position is 1, else 0.\n\n >>> get_bit(0b1010, 0)\n 0\n >>> get_bit(0b1010, 1)\n 1\n >>> get_bit(0b1010, 2)\n 0\n >>> get_bit(0b1010, 3)\n 1\n \"\"\"\n return int((number & (1 << position)) != 0)\n"}, "sha256": "23f79c67759708919c3b5e7ba83406df0b382fe86cdd48f0cbedbbc8c92afd96"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "23f79c67759708919c3b5e7ba83406df0b382fe86cdd48f0cbedbbc8c92afd96", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "6deeeb04df24eb5bf46e1dce2f3f46556ea9358f953e4ff7c1e7aa8348ea1c29", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00291"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00291", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def get_bit(number: int, position: int) -> int:\n \"\"\"\n Get the bit at the given position\n\n Details: perform bitwise and for the given number and X,\n Where X is a number with all the bits - zeroes and bit on given position - one.\n If the result is not equal to 0, then the bit on the given position is 1, else 0.\n\n >>> get_bit(0b1010, 0)\n 0\n >>> get_bit(0b1010, 1)\n 1\n >>> get_bit(0b1010, 2)\n 0\n >>> get_bit(0b1010, 3)\n 1\n \"\"\"\n return int((number & (1 << position)) == 0)\n"}, "sha256": "200170a2e80b75e524f40d7f1f728ffd2fc537373c2a0307a0d7634bab8effa4"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "get_bit:0", "got": "1\n", "source": "get_bit(0b1010, 0)\n", "truncated": false, "want": "0\n"}, {"example_id": "get_bit:1", "got": "0\n", "source": "get_bit(0b1010, 1)\n", "truncated": false, "want": "1\n"}, {"example_id": "get_bit:2", "got": "1\n", "source": "get_bit(0b1010, 2)\n", "truncated": false, "want": "0\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "boolean_condition", "seed": 7, "span": {"col_offset": 42, "end_byte": 511, "lineno": 18, "node": "Compare", "node_col_offset": 15, "node_end_col_offset": 46, "node_end_lineno": 18, "node_lineno": 18, "op_index": 0, "original_text": "!=", "replacement_text": "==", "start_byte": 509}}, "public_tests": {"examples": [{"example_id": "get_bit:0", "source": "get_bit(0b1010, 0)\n", "want": "0\n"}, {"example_id": "get_bit:1", "source": "get_bit(0b1010, 1)\n", "want": "1\n"}, {"example_id": "get_bit:2", "source": "get_bit(0b1010, 2)\n", "want": "0\n"}, {"example_id": "get_bit:3", "source": "get_bit(0b1010, 3)\n", "want": "1\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-cdaf1d74f1e0d7ae", "tree_sha256": "23f79c67759708919c3b5e7ba83406df0b382fe86cdd48f0cbedbbc8c92afd96", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:bit_manipulation/single_bit_manipulation_operations.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def gnome_sort(lst: list) -> list:\n \"\"\"\n Pure implementation of the gnome sort algorithm in Python\n\n Take some mutable ordered collection with heterogeneous comparable items inside as\n arguments, return the same collection ordered by ascending.\n\n Examples:\n >>> gnome_sort([0, 5, 3, 2, 2])\n [0, 2, 2, 3, 5]\n\n >>> gnome_sort([])\n []\n\n >>> gnome_sort([-2, -5, -45])\n [-45, -5, -2]\n\n >>> \"\".join(gnome_sort(list(set(\"Gnomes are stupid!\"))))\n ' !Gadeimnoprstu'\n \"\"\"\n if len(lst) <= 1:\n return lst\n\n i = 1\n\n while i < len(lst):\n if lst[i - 1] <= lst[i]:\n i += 1\n else:\n lst[i - 1], lst[i] = lst[i], lst[i - 1]\n i -= 1\n if i == 0:\n i = 1\n\n return lst\n"}, "sha256": "4069405f6daeb856a685e02ad6ae970d24b54358cf324eb0dd1ebf6366291166"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "4069405f6daeb856a685e02ad6ae970d24b54358cf324eb0dd1ebf6366291166", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "5905b3f0f98fa3a659af722f6d7a1ac2daa8c20c61c7eb4b8567d3d72b357c88", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00292"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00292", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 11, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def gnome_sort(lst: list) -> list:\n \"\"\"\n Pure implementation of the gnome sort algorithm in Python\n\n Take some mutable ordered collection with heterogeneous comparable items inside as\n arguments, return the same collection ordered by ascending.\n\n Examples:\n >>> gnome_sort([0, 5, 3, 2, 2])\n [0, 2, 2, 3, 5]\n\n >>> gnome_sort([])\n []\n\n >>> gnome_sort([-2, -5, -45])\n [-45, -5, -2]\n\n >>> \"\".join(gnome_sort(list(set(\"Gnomes are stupid!\"))))\n ' !Gadeimnoprstu'\n \"\"\"\n if len(lst) <= 1:\n return lst\n\n i = 1\n\n while i < len(lst):\n if lst[i - 1] <= lst[i]:\n i += 1\n else:\n lst[i - 1], lst[i] = lst[i], lst[i + 1]\n i -= 1\n if i == 0:\n i = 1\n\n return lst\n"}, "sha256": "c5e1fbbc91f3d358cdc2e3facf114966c46051d1a6e2186c51ec9d66f7501d8a"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "gnome_sort:0", "got": "[0, 2, 2, 2, 2]\n", "source": "gnome_sort([0, 5, 3, 2, 2])\n", "truncated": false, "want": "[0, 2, 2, 3, 5]\n"}, {"example_id": "gnome_sort:2", "got": "[-45, -45, -45]\n", "source": "gnome_sort([-2, -5, -45])\n", "truncated": false, "want": "[-45, -5, -2]\n"}, {"example_id": "gnome_sort:3", "got": "IndexError: list index out of range", "source": "\"\".join(gnome_sort(list(set(\"Gnomes are stupid!\"))))\n", "truncated": false, "want": "' !Gadeimnoprstu'\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 47, "end_byte": 695, "lineno": 30, "node": "BinOp", "node_col_offset": 45, "node_end_col_offset": 50, "node_end_lineno": 30, "node_lineno": 30, "op_index": 0, "original_text": "-", "replacement_text": "+", "start_byte": 694}}, "public_tests": {"examples": [{"example_id": "gnome_sort:0", "source": "gnome_sort([0, 5, 3, 2, 2])\n", "want": "[0, 2, 2, 3, 5]\n"}, {"example_id": "gnome_sort:1", "source": "gnome_sort([])\n", "want": "[]\n"}, {"example_id": "gnome_sort:2", "source": "gnome_sort([-2, -5, -45])\n", "want": "[-45, -5, -2]\n"}, {"example_id": "gnome_sort:3", "source": "\"\".join(gnome_sort(list(set(\"Gnomes are stupid!\"))))\n", "want": "' !Gadeimnoprstu'\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-86d35f87d6d37eee", "tree_sha256": "4069405f6daeb856a685e02ad6ae970d24b54358cf324eb0dd1ebf6366291166", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:sorts/gnome_sort.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def hamming_distance(string1: str, string2: str) -> int:\n \"\"\"Calculate the Hamming distance between two equal length strings\n In information theory, the Hamming distance between two strings of equal\n length is the number of positions at which the corresponding symbols are\n different. https://en.wikipedia.org/wiki/Hamming_distance\n\n Args:\n string1 (str): Sequence 1\n string2 (str): Sequence 2\n\n Returns:\n int: Hamming distance\n\n >>> hamming_distance(\"python\", \"python\")\n 0\n >>> hamming_distance(\"karolin\", \"kathrin\")\n 3\n >>> hamming_distance(\"00000\", \"11111\")\n 5\n >>> hamming_distance(\"karolin\", \"kath\")\n Traceback (most recent call last):\n ...\n ValueError: String lengths must match!\n \"\"\"\n if len(string1) != len(string2):\n raise ValueError(\"String lengths must match!\")\n\n count = 0\n\n for char1, char2 in zip(string1, string2):\n if char1 != char2:\n count += 1\n\n return count\n"}, "sha256": "f46df4c5270fd0c51e21a534123df98303618f284d5d461f4f7b3aad5fff2401"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "f46df4c5270fd0c51e21a534123df98303618f284d5d461f4f7b3aad5fff2401", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "a687b309fa9503fbbccbb3248e63975c87f7ef13153c3536fdb902679abb89ab", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00293"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00293", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 11, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def hamming_distance(string1: str, string2: str) -> int:\n \"\"\"Calculate the Hamming distance between two equal length strings\n In information theory, the Hamming distance between two strings of equal\n length is the number of positions at which the corresponding symbols are\n different. https://en.wikipedia.org/wiki/Hamming_distance\n\n Args:\n string1 (str): Sequence 1\n string2 (str): Sequence 2\n\n Returns:\n int: Hamming distance\n\n >>> hamming_distance(\"python\", \"python\")\n 0\n >>> hamming_distance(\"karolin\", \"kathrin\")\n 3\n >>> hamming_distance(\"00000\", \"11111\")\n 5\n >>> hamming_distance(\"karolin\", \"kath\")\n Traceback (most recent call last):\n ...\n ValueError: String lengths must match!\n \"\"\"\n if len(string1) != len(string2):\n raise ValueError(\"String lengths must match!\")\n\n count = 0\n\n for char1, char2 in zip(string1, string2):\n if char1 == char2:\n count += 1\n\n return count\n"}, "sha256": "0f0a2a53d2a55e3037d3f3c31d7a61d33318bcecda7c494cb2e2e6382bffc692"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "hamming_distance:0", "got": "6\n", "source": "hamming_distance(\"python\", \"python\")\n", "truncated": false, "want": "0\n"}, {"example_id": "hamming_distance:1", "got": "4\n", "source": "hamming_distance(\"karolin\", \"kathrin\")\n", "truncated": false, "want": "3\n"}, {"example_id": "hamming_distance:2", "got": "0\n", "source": "hamming_distance(\"00000\", \"11111\")\n", "truncated": false, "want": "5\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "boolean_condition", "seed": 7, "span": {"col_offset": 17, "end_byte": 939, "lineno": 31, "node": "Compare", "node_col_offset": 11, "node_end_col_offset": 25, "node_end_lineno": 31, "node_lineno": 31, "op_index": 0, "original_text": "!=", "replacement_text": "==", "start_byte": 937}}, "public_tests": {"examples": [{"example_id": "hamming_distance:0", "source": "hamming_distance(\"python\", \"python\")\n", "want": "0\n"}, {"example_id": "hamming_distance:1", "source": "hamming_distance(\"karolin\", \"kathrin\")\n", "want": "3\n"}, {"example_id": "hamming_distance:2", "source": "hamming_distance(\"00000\", \"11111\")\n", "want": "5\n"}, {"example_id": "hamming_distance:3", "source": "hamming_distance(\"karolin\", \"kath\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: String lengths must match!\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-c9b3cdaed361d596", "tree_sha256": "f46df4c5270fd0c51e21a534123df98303618f284d5d461f4f7b3aad5fff2401", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:strings/hamming_distance.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def hex_to_bin(hex_num: str) -> int:\n \"\"\"\n Convert a hexadecimal value to its binary equivalent\n #https://stackoverflow.com/questions/1425493/convert-hex-to-binary\n Here, we have used the bitwise right shift operator: >>\n Shifts the bits of the number to the right and fills 0 on voids left as a result.\n Similar effect as of dividing the number with some power of two.\n Example:\n a = 10\n a >> 1 = 5\n\n >>> hex_to_bin(\"AC\")\n 10101100\n >>> hex_to_bin(\"9A4\")\n 100110100100\n >>> hex_to_bin(\" 12f \")\n 100101111\n >>> hex_to_bin(\"FfFf\")\n 1111111111111111\n >>> hex_to_bin(\"-fFfF\")\n -1111111111111111\n >>> hex_to_bin(\"F-f\")\n Traceback (most recent call last):\n ...\n ValueError: Invalid value was passed to the function\n >>> hex_to_bin(\"\")\n Traceback (most recent call last):\n ...\n ValueError: No value was passed to the function\n \"\"\"\n\n hex_num = hex_num.strip()\n if not hex_num:\n raise ValueError(\"No value was passed to the function\")\n\n is_negative = hex_num[0] == \"-\"\n if is_negative:\n hex_num = hex_num[1:]\n\n try:\n int_num = int(hex_num, 16)\n except ValueError:\n raise ValueError(\"Invalid value was passed to the function\")\n\n bin_str = \"\"\n while int_num > 0:\n bin_str = str(int_num % 2) + bin_str\n int_num >>= 1\n\n return int((\"-\" + bin_str) if is_negative else bin_str)\n"}, "sha256": "98e689a32810bda00e358c045bb9964765c3483ce523aeabe09cef135f5ac747"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "98e689a32810bda00e358c045bb9964765c3483ce523aeabe09cef135f5ac747", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "765b9b3bcab8b1d6964062f154812f8d9637427a9d62d7f3d9a7e58982c190cc", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00295"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00295", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 18, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def hex_to_bin(hex_num: str) -> int:\n \"\"\"\n Convert a hexadecimal value to its binary equivalent\n #https://stackoverflow.com/questions/1425493/convert-hex-to-binary\n Here, we have used the bitwise right shift operator: >>\n Shifts the bits of the number to the right and fills 0 on voids left as a result.\n Similar effect as of dividing the number with some power of two.\n Example:\n a = 10\n a >> 1 = 5\n\n >>> hex_to_bin(\"AC\")\n 10101100\n >>> hex_to_bin(\"9A4\")\n 100110100100\n >>> hex_to_bin(\" 12f \")\n 100101111\n >>> hex_to_bin(\"FfFf\")\n 1111111111111111\n >>> hex_to_bin(\"-fFfF\")\n -1111111111111111\n >>> hex_to_bin(\"F-f\")\n Traceback (most recent call last):\n ...\n ValueError: Invalid value was passed to the function\n >>> hex_to_bin(\"\")\n Traceback (most recent call last):\n ...\n ValueError: No value was passed to the function\n \"\"\"\n\n hex_num = hex_num.strip()\n if not hex_num:\n raise ValueError(\"No value was passed to the function\")\n\n is_negative = hex_num[0] == \"-\"\n if is_negative:\n hex_num = hex_num[0:]\n\n try:\n int_num = int(hex_num, 16)\n except ValueError:\n raise ValueError(\"Invalid value was passed to the function\")\n\n bin_str = \"\"\n while int_num > 0:\n bin_str = str(int_num % 2) + bin_str\n int_num >>= 1\n\n return int((\"-\" + bin_str) if is_negative else bin_str)\n"}, "sha256": "2f084322a2c75dd51dbe2b19fd282da28fce64bd5d954a9719bc72f31544158f"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "hex_to_bin:4", "got": "ValueError: invalid literal for int() with base 10: '-'", "source": "hex_to_bin(\"-fFfF\")\n", "truncated": false, "want": "-1111111111111111\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "off_by_one", "seed": 7, "span": {"col_offset": 26, "end_byte": 1120, "lineno": 38, "node": "Constant", "node_col_offset": 26, "node_end_col_offset": 27, "node_end_lineno": 38, "node_lineno": 38, "op_index": 0, "original_text": "1", "replacement_text": "0", "start_byte": 1119}}, "public_tests": {"examples": [{"example_id": "hex_to_bin:0", "source": "hex_to_bin(\"AC\")\n", "want": "10101100\n"}, {"example_id": "hex_to_bin:1", "source": "hex_to_bin(\"9A4\")\n", "want": "100110100100\n"}, {"example_id": "hex_to_bin:2", "source": "hex_to_bin(\" 12f \")\n", "want": "100101111\n"}, {"example_id": "hex_to_bin:3", "source": "hex_to_bin(\"FfFf\")\n", "want": "1111111111111111\n"}, {"example_id": "hex_to_bin:4", "source": "hex_to_bin(\"-fFfF\")\n", "want": "-1111111111111111\n"}, {"example_id": "hex_to_bin:5", "source": "hex_to_bin(\"F-f\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: Invalid value was passed to the function\n"}, {"example_id": "hex_to_bin:6", "source": "hex_to_bin(\"\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: No value was passed to the function\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-7323bfddd774f513", "tree_sha256": "98e689a32810bda00e358c045bb9964765c3483ce523aeabe09cef135f5ac747", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:conversions/hex_to_bin.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def is_bit_set(number: int, position: int) -> bool:\n \"\"\"\n Is the bit at position set?\n\n Details: Shift the bit at position to be the first (smallest) bit.\n Then check if the first bit is set by anding the shifted number with 1.\n\n >>> is_bit_set(0b1010, 0)\n False\n >>> is_bit_set(0b1010, 1)\n True\n >>> is_bit_set(0b1010, 2)\n False\n >>> is_bit_set(0b1010, 3)\n True\n >>> is_bit_set(0b0, 17)\n False\n \"\"\"\n return ((number >> position) & 1) == 1\n"}, "sha256": "d6f63aa4e9bdb9c5a57a851f92c6406124356841c11101f459f054a5cf57bc48"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "d6f63aa4e9bdb9c5a57a851f92c6406124356841c11101f459f054a5cf57bc48", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "db60acf58c12e113624e9d02f4094f07c4357e24db44908a3a7502f50b4bb295", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00300"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00300", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def is_bit_set(number: int, position: int) -> bool:\n \"\"\"\n Is the bit at position set?\n\n Details: Shift the bit at position to be the first (smallest) bit.\n Then check if the first bit is set by anding the shifted number with 1.\n\n >>> is_bit_set(0b1010, 0)\n False\n >>> is_bit_set(0b1010, 1)\n True\n >>> is_bit_set(0b1010, 2)\n False\n >>> is_bit_set(0b1010, 3)\n True\n >>> is_bit_set(0b0, 17)\n False\n \"\"\"\n return not ((number >> position) & 1) == 1\n"}, "sha256": "479c8bae6cd29dc424dddbcc53145a97f49cb7569a65f15be50190a9be262573"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "is_bit_set:0", "got": "True\n", "source": "is_bit_set(0b1010, 0)\n", "truncated": false, "want": "False\n"}, {"example_id": "is_bit_set:1", "got": "False\n", "source": "is_bit_set(0b1010, 1)\n", "truncated": false, "want": "True\n"}, {"example_id": "is_bit_set:2", "got": "True\n", "source": "is_bit_set(0b1010, 2)\n", "truncated": false, "want": "False\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 487, "lineno": 19, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 42, "node_end_lineno": 19, "node_lineno": 19, "op_index": 0, "original_text": "((number >> position) & 1) == 1", "replacement_text": "not ((number >> position) & 1) == 1", "start_byte": 456}}, "public_tests": {"examples": [{"example_id": "is_bit_set:0", "source": "is_bit_set(0b1010, 0)\n", "want": "False\n"}, {"example_id": "is_bit_set:1", "source": "is_bit_set(0b1010, 1)\n", "want": "True\n"}, {"example_id": "is_bit_set:2", "source": "is_bit_set(0b1010, 2)\n", "want": "False\n"}, {"example_id": "is_bit_set:3", "source": "is_bit_set(0b1010, 3)\n", "want": "True\n"}, {"example_id": "is_bit_set:4", "source": "is_bit_set(0b0, 17)\n", "want": "False\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-36a5168b87a800bd", "tree_sha256": "d6f63aa4e9bdb9c5a57a851f92c6406124356841c11101f459f054a5cf57bc48", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:bit_manipulation/single_bit_manipulation_operations.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def count_vowels_and_consonants(text: str) -> tuple[int, int]:\n \"\"\"\n Count the number of vowels and consonants in a given string.\n\n This function ignores non-alphabetic characters.\n\n Args:\n text (str): Input string.\n\n Returns:\n tuple[int, int]: A tuple containing (vowel_count,\n consonant_count).\n Examples:\n >>> count_vowels_and_consonants(\"Hello World\")\n (3, 7)\n >>> count_vowels_and_consonants(\"AEIOU\")\n (5, 0)\n >>> count_vowels_and_consonants(\"bcdf\")\n (0, 4)\n >>> count_vowels_and_consonants(\"\")\n (0, 0)\n \"\"\"\n vowels = set(\"aeiouAEIOU\")\n vowel_count = 0\n consonant_count = 0\n\n for char in text:\n if char.isalpha():\n if char in vowels:\n vowel_count += 1\n else:\n consonant_count += 1\n\n return vowel_count, consonant_count\n"}, "sha256": "e06c1ac685930125f8499c079d1398f7eb85ba1db7dc5030007eba2a6dd67a81"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "e06c1ac685930125f8499c079d1398f7eb85ba1db7dc5030007eba2a6dd67a81", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "fbb4c77b018b155cf4cb979140a25bdec3d1801a73a150562beb676b4924e27f", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00301"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00301", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 15, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def count_vowels_and_consonants(text: str) -> tuple[int, int]:\n \"\"\"\n Count the number of vowels and consonants in a given string.\n\n This function ignores non-alphabetic characters.\n\n Args:\n text (str): Input string.\n\n Returns:\n tuple[int, int]: A tuple containing (vowel_count,\n consonant_count).\n Examples:\n >>> count_vowels_and_consonants(\"Hello World\")\n (3, 7)\n >>> count_vowels_and_consonants(\"AEIOU\")\n (5, 0)\n >>> count_vowels_and_consonants(\"bcdf\")\n (0, 4)\n >>> count_vowels_and_consonants(\"\")\n (0, 0)\n \"\"\"\n vowels = set(\"aeiouAEIOU\")\n vowel_count = 0\n consonant_count = 0\n\n for char in text:\n if char.isalpha():\n if char in vowels:\n vowel_count += 1\n else:\n consonant_count -= 1\n\n return vowel_count, consonant_count\n"}, "sha256": "fd14787f3a03909a4489aaaf3599f7e6e824eec5ad4908135a534584bdf16c84"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "count_vowels_and_consonants:0", "got": "(3, -7)\n", "source": "count_vowels_and_consonants(\"Hello World\")\n", "truncated": false, "want": "(3, 7)\n"}, {"example_id": "count_vowels_and_consonants:2", "got": "(0, -4)\n", "source": "count_vowels_and_consonants(\"bcdf\")\n", "truncated": false, "want": "(0, 4)\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 32, "end_byte": 873, "lineno": 32, "node": "AugAssign", "node_col_offset": 16, "node_end_col_offset": 36, "node_end_lineno": 32, "node_lineno": 32, "op_index": 0, "original_text": "+=", "replacement_text": "-=", "start_byte": 871}}, "public_tests": {"examples": [{"example_id": "count_vowels_and_consonants:0", "source": "count_vowels_and_consonants(\"Hello World\")\n", "want": "(3, 7)\n"}, {"example_id": "count_vowels_and_consonants:1", "source": "count_vowels_and_consonants(\"AEIOU\")\n", "want": "(5, 0)\n"}, {"example_id": "count_vowels_and_consonants:2", "source": "count_vowels_and_consonants(\"bcdf\")\n", "want": "(0, 4)\n"}, {"example_id": "count_vowels_and_consonants:3", "source": "count_vowels_and_consonants(\"\")\n", "want": "(0, 0)\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-8838c78676ad28d6", "tree_sha256": "e06c1ac685930125f8499c079d1398f7eb85ba1db7dc5030007eba2a6dd67a81", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:strings/count_vowels_consonants.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def aliquot_sum(input_num: int) -> int:\n \"\"\"\n Finds the aliquot sum of an input integer, where the\n aliquot sum of a number n is defined as the sum of all\n natural numbers less than n that divide n evenly. For\n example, the aliquot sum of 15 is 1 + 3 + 5 = 9. This is\n a simple O(n) implementation.\n @param input_num: a positive integer whose aliquot sum is to be found\n @return: the aliquot sum of input_num, if input_num is positive.\n Otherwise, raise a ValueError\n Wikipedia Explanation: https://en.wikipedia.org/wiki/Aliquot_sum\n\n >>> aliquot_sum(15)\n 9\n >>> aliquot_sum(6)\n 6\n >>> aliquot_sum(-1)\n Traceback (most recent call last):\n ...\n ValueError: Input must be positive\n >>> aliquot_sum(0)\n Traceback (most recent call last):\n ...\n ValueError: Input must be positive\n >>> aliquot_sum(1.6)\n Traceback (most recent call last):\n ...\n ValueError: Input must be an integer\n >>> aliquot_sum(12)\n 16\n >>> aliquot_sum(1)\n 0\n >>> aliquot_sum(19)\n 1\n \"\"\"\n if not isinstance(input_num, int):\n raise ValueError(\"Input must be an integer\")\n if input_num <= 0:\n raise ValueError(\"Input must be positive\")\n return sum(\n divisor for divisor in range(1, input_num // 2 + 1) if input_num % divisor == 0\n )\n"}, "sha256": "5ae7c24a0037dfa3ef2c7fd6d771a659be7d15bf36c67445dd3214d82611f336"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "5ae7c24a0037dfa3ef2c7fd6d771a659be7d15bf36c67445dd3214d82611f336", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "6a7935293390f509ca62449f0377db3d64e08194e6fc0812ac942dd688db4c8f", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00302"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00302", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 23, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def aliquot_sum(input_num: int) -> int:\n \"\"\"\n Finds the aliquot sum of an input integer, where the\n aliquot sum of a number n is defined as the sum of all\n natural numbers less than n that divide n evenly. For\n example, the aliquot sum of 15 is 1 + 3 + 5 = 9. This is\n a simple O(n) implementation.\n @param input_num: a positive integer whose aliquot sum is to be found\n @return: the aliquot sum of input_num, if input_num is positive.\n Otherwise, raise a ValueError\n Wikipedia Explanation: https://en.wikipedia.org/wiki/Aliquot_sum\n\n >>> aliquot_sum(15)\n 9\n >>> aliquot_sum(6)\n 6\n >>> aliquot_sum(-1)\n Traceback (most recent call last):\n ...\n ValueError: Input must be positive\n >>> aliquot_sum(0)\n Traceback (most recent call last):\n ...\n ValueError: Input must be positive\n >>> aliquot_sum(1.6)\n Traceback (most recent call last):\n ...\n ValueError: Input must be an integer\n >>> aliquot_sum(12)\n 16\n >>> aliquot_sum(1)\n 0\n >>> aliquot_sum(19)\n 1\n \"\"\"\n if not isinstance(input_num, int):\n raise ValueError(\"Input must be an integer\")\n if input_num <= 0:\n raise ValueError(\"Input must be positive\")\n return sum(\n divisor for divisor in range(1, input_num // 2 + 1) if input_num % divisor == 0\n ) - 1\n"}, "sha256": "11b1186341beb98d0cf4577bd5901243d5fe369903608bfe6e270f5ff25642e1"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "aliquot_sum:0", "got": "8\n", "source": "aliquot_sum(15)\n", "truncated": false, "want": "9\n"}, {"example_id": "aliquot_sum:1", "got": "5\n", "source": "aliquot_sum(6)\n", "truncated": false, "want": "6\n"}, {"example_id": "aliquot_sum:5", "got": "15\n", "source": "aliquot_sum(12)\n", "truncated": false, "want": "16\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 1334, "lineno": 40, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 5, "node_end_lineno": 42, "node_lineno": 40, "op_index": 0, "original_text": "sum(\n divisor for divisor in range(1, input_num // 2 + 1) if input_num % divisor == 0\n )", "replacement_text": "sum(\n divisor for divisor in range(1, input_num // 2 + 1) if input_num % divisor == 0\n ) - 1", "start_byte": 1236}}, "public_tests": {"examples": [{"example_id": "aliquot_sum:0", "source": "aliquot_sum(15)\n", "want": "9\n"}, {"example_id": "aliquot_sum:1", "source": "aliquot_sum(6)\n", "want": "6\n"}, {"example_id": "aliquot_sum:2", "source": "aliquot_sum(-1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: Input must be positive\n"}, {"example_id": "aliquot_sum:3", "source": "aliquot_sum(0)\n", "want": "Traceback (most recent call last):\n ...\nValueError: Input must be positive\n"}, {"example_id": "aliquot_sum:4", "source": "aliquot_sum(1.6)\n", "want": "Traceback (most recent call last):\n ...\nValueError: Input must be an integer\n"}, {"example_id": "aliquot_sum:5", "source": "aliquot_sum(12)\n", "want": "16\n"}, {"example_id": "aliquot_sum:6", "source": "aliquot_sum(1)\n", "want": "0\n"}, {"example_id": "aliquot_sum:7", "source": "aliquot_sum(19)\n", "want": "1\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-d51240075f4f9f29", "tree_sha256": "5ae7c24a0037dfa3ef2c7fd6d771a659be7d15bf36c67445dd3214d82611f336", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/aliquot_sum.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def count_vowels(s: str) -> int:\n \"\"\"\n Count the number of vowels in a given string.\n\n :param s: Input string to count vowels in.\n :return: Number of vowels in the input string.\n\n Examples:\n >>> count_vowels(\"hello world\")\n 3\n >>> count_vowels(\"HELLO WORLD\")\n 3\n >>> count_vowels(\"123 hello world\")\n 3\n >>> count_vowels(\"\")\n 0\n >>> count_vowels(\"a quick brown fox\")\n 5\n >>> count_vowels(\"the quick BROWN fox\")\n 5\n >>> count_vowels(\"PYTHON\")\n 1\n \"\"\"\n if not isinstance(s, str):\n raise TypeError(\"Input must be a string\")\n\n vowels = \"aeiouAEIOU\"\n return sum(1 for char in s if char in vowels)\n"}, "sha256": "fcfbbb0e1249dc4775c0e500da7c7d0d6c6477f5b002832d137aa4c030a4a5ab"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "fcfbbb0e1249dc4775c0e500da7c7d0d6c6477f5b002832d137aa4c030a4a5ab", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "1efb8ee8c6c8a05cd260b02bd73781e7cdb484dd757f65f8daf2211fe40431da", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00303"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00303", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def count_vowels(s: str) -> int:\n \"\"\"\n Count the number of vowels in a given string.\n\n :param s: Input string to count vowels in.\n :return: Number of vowels in the input string.\n\n Examples:\n >>> count_vowels(\"hello world\")\n 3\n >>> count_vowels(\"HELLO WORLD\")\n 3\n >>> count_vowels(\"123 hello world\")\n 3\n >>> count_vowels(\"\")\n 0\n >>> count_vowels(\"a quick brown fox\")\n 5\n >>> count_vowels(\"the quick BROWN fox\")\n 5\n >>> count_vowels(\"PYTHON\")\n 1\n \"\"\"\n if isinstance(s, str):\n raise TypeError(\"Input must be a string\")\n\n vowels = \"aeiouAEIOU\"\n return sum(1 for char in s if char in vowels)\n"}, "sha256": "b967e560f9b8cbd9fb2f7e6e26599c4a67cc91c5701bbcc95b0256fa21cb45f8"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "count_vowels:0", "got": "TypeError: Input must be a string", "source": "count_vowels(\"hello world\")\n", "truncated": false, "want": "3\n"}, {"example_id": "count_vowels:1", "got": "TypeError: Input must be a string", "source": "count_vowels(\"HELLO WORLD\")\n", "truncated": false, "want": "3\n"}, {"example_id": "count_vowels:2", "got": "TypeError: Input must be a string", "source": "count_vowels(\"123 hello world\")\n", "truncated": false, "want": "3\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "boolean_condition", "seed": 7, "span": {"col_offset": 7, "end_byte": 520, "lineno": 24, "node": "UnaryOp", "node_col_offset": 7, "node_end_col_offset": 29, "node_end_lineno": 24, "node_lineno": 24, "op_index": 0, "original_text": "not ", "replacement_text": "", "start_byte": 516}}, "public_tests": {"examples": [{"example_id": "count_vowels:0", "source": "count_vowels(\"hello world\")\n", "want": "3\n"}, {"example_id": "count_vowels:1", "source": "count_vowels(\"HELLO WORLD\")\n", "want": "3\n"}, {"example_id": "count_vowels:2", "source": "count_vowels(\"123 hello world\")\n", "want": "3\n"}, {"example_id": "count_vowels:3", "source": "count_vowels(\"\")\n", "want": "0\n"}, {"example_id": "count_vowels:4", "source": "count_vowels(\"a quick brown fox\")\n", "want": "5\n"}, {"example_id": "count_vowels:5", "source": "count_vowels(\"the quick BROWN fox\")\n", "want": "5\n"}, {"example_id": "count_vowels:6", "source": "count_vowels(\"PYTHON\")\n", "want": "1\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-348c4077ef4ba693", "tree_sha256": "fcfbbb0e1249dc4775c0e500da7c7d0d6c6477f5b002832d137aa4c030a4a5ab", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:strings/count_vowels.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def factorial_recursive(n: int) -> int:\n \"\"\"\n Calculate the factorial of a positive integer\n https://en.wikipedia.org/wiki/Factorial\n\n >>> import math\n >>> all(factorial_recursive(i) == math.factorial(i) for i in range(20))\n True\n >>> factorial_recursive(0.1)\n Traceback (most recent call last):\n ...\n ValueError: factorial_recursive() only accepts integral values\n >>> factorial_recursive(-1)\n Traceback (most recent call last):\n ...\n ValueError: factorial_recursive() not defined for negative values\n \"\"\"\n if not isinstance(n, int):\n raise ValueError(\"factorial_recursive() only accepts integral values\")\n if n < 0:\n raise ValueError(\"factorial_recursive() not defined for negative values\")\n return 1 if n in {0, 1} else n * factorial_recursive(n - 1)\n"}, "sha256": "913c284000be6faef49784378d8a77cbddf75d72819650a7bd060a4e55d39d03"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "913c284000be6faef49784378d8a77cbddf75d72819650a7bd060a4e55d39d03", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "818caf660eb9f2ee660901110c41c689af0960d5ab0122aa8e124333bca667dd", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00305"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00305", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 6, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def factorial_recursive(n: int) -> int:\n \"\"\"\n Calculate the factorial of a positive integer\n https://en.wikipedia.org/wiki/Factorial\n\n >>> import math\n >>> all(factorial_recursive(i) == math.factorial(i) for i in range(20))\n True\n >>> factorial_recursive(0.1)\n Traceback (most recent call last):\n ...\n ValueError: factorial_recursive() only accepts integral values\n >>> factorial_recursive(-1)\n Traceback (most recent call last):\n ...\n ValueError: factorial_recursive() not defined for negative values\n \"\"\"\n if not isinstance(n, int):\n raise ValueError(\"factorial_recursive() only accepts integral values\")\n if n < 0:\n raise ValueError(\"factorial_recursive() not defined for negative values\")\n return not (1 if n in {0, 1} else n * factorial_recursive(n - 1))\n"}, "sha256": "9b68481bc5a2e1860c063c087f98df60eb4ebd64e286ebff1702c56dc2170256"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "factorial_recursive:1", "got": "False\n", "source": "all(factorial_recursive(i) == math.factorial(i) for i in range(20))\n", "truncated": false, "want": "True\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 829, "lineno": 22, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 63, "node_end_lineno": 22, "node_lineno": 22, "op_index": 0, "original_text": "1 if n in {0, 1} else n * factorial_recursive(n - 1)", "replacement_text": "not (1 if n in {0, 1} else n * factorial_recursive(n - 1))", "start_byte": 777}}, "public_tests": {"examples": [{"example_id": "factorial_recursive:0", "source": "import math\n", "want": ""}, {"example_id": "factorial_recursive:1", "source": "all(factorial_recursive(i) == math.factorial(i) for i in range(20))\n", "want": "True\n"}, {"example_id": "factorial_recursive:2", "source": "factorial_recursive(0.1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: factorial_recursive() only accepts integral values\n"}, {"example_id": "factorial_recursive:3", "source": "factorial_recursive(-1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: factorial_recursive() not defined for negative values\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-d53897470533e53d", "tree_sha256": "913c284000be6faef49784378d8a77cbddf75d72819650a7bd060a4e55d39d03", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/factorial.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def factorial_recursive(n: int) -> int:\n \"\"\"\n Calculate the factorial of a positive integer\n https://en.wikipedia.org/wiki/Factorial\n\n >>> import math\n >>> all(factorial_recursive(i) == math.factorial(i) for i in range(20))\n True\n >>> factorial_recursive(0.1)\n Traceback (most recent call last):\n ...\n ValueError: factorial_recursive() only accepts integral values\n >>> factorial_recursive(-1)\n Traceback (most recent call last):\n ...\n ValueError: factorial_recursive() not defined for negative values\n \"\"\"\n if not isinstance(n, int):\n raise ValueError(\"factorial_recursive() only accepts integral values\")\n if n < 0:\n raise ValueError(\"factorial_recursive() not defined for negative values\")\n return 1 if n in {0, 1} else n * factorial_recursive(n - 1)\n"}, "sha256": "913c284000be6faef49784378d8a77cbddf75d72819650a7bd060a4e55d39d03"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "913c284000be6faef49784378d8a77cbddf75d72819650a7bd060a4e55d39d03", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "17a2c4418a6746905b3ec357e36d65b10f408c75890ab7841ece35750b091135", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00307"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00307", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 6, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def factorial_recursive(n: int) -> int:\n \"\"\"\n Calculate the factorial of a positive integer\n https://en.wikipedia.org/wiki/Factorial\n\n >>> import math\n >>> all(factorial_recursive(i) == math.factorial(i) for i in range(20))\n True\n >>> factorial_recursive(0.1)\n Traceback (most recent call last):\n ...\n ValueError: factorial_recursive() only accepts integral values\n >>> factorial_recursive(-1)\n Traceback (most recent call last):\n ...\n ValueError: factorial_recursive() not defined for negative values\n \"\"\"\n if isinstance(n, int):\n raise ValueError(\"factorial_recursive() only accepts integral values\")\n if n < 0:\n raise ValueError(\"factorial_recursive() not defined for negative values\")\n return 1 if n in {0, 1} else n * factorial_recursive(n - 1)\n"}, "sha256": "e9ccc617c91557a7118a66792b35419fa45604d0c4680daf6eaa008b4783cd58"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "factorial_recursive:1", "got": "ValueError: factorial_recursive() only accepts integral values", "source": "all(factorial_recursive(i) == math.factorial(i) for i in range(20))\n", "truncated": false, "want": "True\n"}, {"example_id": "factorial_recursive:2", "got": "ValueError: factorial_recursive() not defined for negative values", "source": "factorial_recursive(0.1)\n", "truncated": false, "want": "Traceback (most recent call last):\n ...\nValueError: factorial_recursive() only accepts integral values\n"}, {"example_id": "factorial_recursive:3", "got": "ValueError: factorial_recursive() only accepts integral values", "source": "factorial_recursive(-1)\n", "truncated": false, "want": "Traceback (most recent call last):\n ...\nValueError: factorial_recursive() not defined for negative values\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "boolean_condition", "seed": 7, "span": {"col_offset": 7, "end_byte": 571, "lineno": 18, "node": "UnaryOp", "node_col_offset": 7, "node_end_col_offset": 29, "node_end_lineno": 18, "node_lineno": 18, "op_index": 0, "original_text": "not ", "replacement_text": "", "start_byte": 567}}, "public_tests": {"examples": [{"example_id": "factorial_recursive:0", "source": "import math\n", "want": ""}, {"example_id": "factorial_recursive:1", "source": "all(factorial_recursive(i) == math.factorial(i) for i in range(20))\n", "want": "True\n"}, {"example_id": "factorial_recursive:2", "source": "factorial_recursive(0.1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: factorial_recursive() only accepts integral values\n"}, {"example_id": "factorial_recursive:3", "source": "factorial_recursive(-1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: factorial_recursive() not defined for negative values\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-d53897470533e53d", "tree_sha256": "913c284000be6faef49784378d8a77cbddf75d72819650a7bd060a4e55d39d03", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/factorial.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def largest_pow_of_two_le_num(number: int) -> int:\n \"\"\"\n Return the largest power of two less than or equal to a number.\n\n >>> largest_pow_of_two_le_num(0)\n 0\n >>> largest_pow_of_two_le_num(1)\n 1\n >>> largest_pow_of_two_le_num(-1)\n 0\n >>> largest_pow_of_two_le_num(3)\n 2\n >>> largest_pow_of_two_le_num(15)\n 8\n >>> largest_pow_of_two_le_num(99)\n 64\n >>> largest_pow_of_two_le_num(178)\n 128\n >>> largest_pow_of_two_le_num(999999)\n 524288\n >>> largest_pow_of_two_le_num(99.9)\n Traceback (most recent call last):\n ...\n TypeError: Input value must be a 'int' type\n \"\"\"\n if isinstance(number, float):\n raise TypeError(\"Input value must be a 'int' type\")\n if number <= 0:\n return 0\n res = 1\n while (res << 1) <= number:\n res <<= 1\n return res\n"}, "sha256": "fe524cf6d26f2890d28aafa73c4e1c10356660019c7a877868816a91777d710c"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "fe524cf6d26f2890d28aafa73c4e1c10356660019c7a877868816a91777d710c", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "a5d30ebdf4a8e687453e021294948d7935dc3df021800228d5121d74d3431643", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00308"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00308", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def largest_pow_of_two_le_num(number: int) -> int:\n \"\"\"\n Return the largest power of two less than or equal to a number.\n\n >>> largest_pow_of_two_le_num(0)\n 0\n >>> largest_pow_of_two_le_num(1)\n 1\n >>> largest_pow_of_two_le_num(-1)\n 0\n >>> largest_pow_of_two_le_num(3)\n 2\n >>> largest_pow_of_two_le_num(15)\n 8\n >>> largest_pow_of_two_le_num(99)\n 64\n >>> largest_pow_of_two_le_num(178)\n 128\n >>> largest_pow_of_two_le_num(999999)\n 524288\n >>> largest_pow_of_two_le_num(99.9)\n Traceback (most recent call last):\n ...\n TypeError: Input value must be a 'int' type\n \"\"\"\n if isinstance(number, float):\n raise TypeError(\"Input value must be a 'int' type\")\n if number < 0:\n return 0\n res = 1\n while (res << 1) <= number:\n res <<= 1\n return res\n"}, "sha256": "779eb32ce729d8e6414dad4696a386c531433088b8e9213d1987fdb7704762b2"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "largest_pow_of_two_le_num:0", "got": "1\n", "source": "largest_pow_of_two_le_num(0)\n", "truncated": false, "want": "0\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "comparison_boundary", "seed": 7, "span": {"col_offset": 14, "end_byte": 747, "lineno": 28, "node": "Compare", "node_col_offset": 7, "node_end_col_offset": 18, "node_end_lineno": 28, "node_lineno": 28, "op_index": 0, "original_text": "<=", "replacement_text": "<", "start_byte": 745}}, "public_tests": {"examples": [{"example_id": "largest_pow_of_two_le_num:0", "source": "largest_pow_of_two_le_num(0)\n", "want": "0\n"}, {"example_id": "largest_pow_of_two_le_num:1", "source": "largest_pow_of_two_le_num(1)\n", "want": "1\n"}, {"example_id": "largest_pow_of_two_le_num:2", "source": "largest_pow_of_two_le_num(-1)\n", "want": "0\n"}, {"example_id": "largest_pow_of_two_le_num:3", "source": "largest_pow_of_two_le_num(3)\n", "want": "2\n"}, {"example_id": "largest_pow_of_two_le_num:4", "source": "largest_pow_of_two_le_num(15)\n", "want": "8\n"}, {"example_id": "largest_pow_of_two_le_num:5", "source": "largest_pow_of_two_le_num(99)\n", "want": "64\n"}, {"example_id": "largest_pow_of_two_le_num:6", "source": "largest_pow_of_two_le_num(178)\n", "want": "128\n"}, {"example_id": "largest_pow_of_two_le_num:7", "source": "largest_pow_of_two_le_num(999999)\n", "want": "524288\n"}, {"example_id": "largest_pow_of_two_le_num:8", "source": "largest_pow_of_two_le_num(99.9)\n", "want": "Traceback (most recent call last):\n ...\nTypeError: Input value must be a 'int' type\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-1d2b3f7f4f6c2ca9", "tree_sha256": "fe524cf6d26f2890d28aafa73c4e1c10356660019c7a877868816a91777d710c", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:bit_manipulation/largest_pow_of_two_le_num.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def is_power_of_two(number: int) -> bool:\n \"\"\"\n Return True if this number is power of 2 or False otherwise.\n\n >>> is_power_of_two(0)\n True\n >>> is_power_of_two(1)\n True\n >>> is_power_of_two(2)\n True\n >>> is_power_of_two(4)\n True\n >>> is_power_of_two(6)\n False\n >>> is_power_of_two(8)\n True\n >>> is_power_of_two(17)\n False\n >>> is_power_of_two(-1)\n Traceback (most recent call last):\n ...\n ValueError: number must not be negative\n >>> is_power_of_two(1.2)\n Traceback (most recent call last):\n ...\n TypeError: unsupported operand type(s) for &: 'float' and 'float'\n\n # Test all powers of 2 from 0 to 10,000\n >>> all(is_power_of_two(int(2 ** i)) for i in range(10000))\n True\n \"\"\"\n if number < 0:\n raise ValueError(\"number must not be negative\")\n return number & (number - 1) == 0\n"}, "sha256": "63e962a60e6bc8e12c5fc3967d041a81c74b385fd32ca4468e938001c76b2a07"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "63e962a60e6bc8e12c5fc3967d041a81c74b385fd32ca4468e938001c76b2a07", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "46730bf058800643f7d0276d3a5c0049f4e722bbe34839f1118ca11ecb1e5aca", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00309"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00309", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def is_power_of_two(number: int) -> bool:\n \"\"\"\n Return True if this number is power of 2 or False otherwise.\n\n >>> is_power_of_two(0)\n True\n >>> is_power_of_two(1)\n True\n >>> is_power_of_two(2)\n True\n >>> is_power_of_two(4)\n True\n >>> is_power_of_two(6)\n False\n >>> is_power_of_two(8)\n True\n >>> is_power_of_two(17)\n False\n >>> is_power_of_two(-1)\n Traceback (most recent call last):\n ...\n ValueError: number must not be negative\n >>> is_power_of_two(1.2)\n Traceback (most recent call last):\n ...\n TypeError: unsupported operand type(s) for &: 'float' and 'float'\n\n # Test all powers of 2 from 0 to 10,000\n >>> all(is_power_of_two(int(2 ** i)) for i in range(10000))\n True\n \"\"\"\n if number <= 0:\n raise ValueError(\"number must not be negative\")\n return number & (number - 1) == 0\n"}, "sha256": "7cfb3df1c246a4e00ab57575c5c5dd2a2cf7fe6cf9ce0083a3fd9210e821b3c1"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "is_power_of_two:0", "got": "ValueError: number must not be negative", "source": "is_power_of_two(0)\n", "truncated": false, "want": "True\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "comparison_boundary", "seed": 7, "span": {"col_offset": 14, "end_byte": 785, "lineno": 32, "node": "Compare", "node_col_offset": 7, "node_end_col_offset": 17, "node_end_lineno": 32, "node_lineno": 32, "op_index": 0, "original_text": "<", "replacement_text": "<=", "start_byte": 784}}, "public_tests": {"examples": [{"example_id": "is_power_of_two:0", "source": "is_power_of_two(0)\n", "want": "True\n"}, {"example_id": "is_power_of_two:1", "source": "is_power_of_two(1)\n", "want": "True\n"}, {"example_id": "is_power_of_two:2", "source": "is_power_of_two(2)\n", "want": "True\n"}, {"example_id": "is_power_of_two:3", "source": "is_power_of_two(4)\n", "want": "True\n"}, {"example_id": "is_power_of_two:4", "source": "is_power_of_two(6)\n", "want": "False\n"}, {"example_id": "is_power_of_two:5", "source": "is_power_of_two(8)\n", "want": "True\n"}, {"example_id": "is_power_of_two:6", "source": "is_power_of_two(17)\n", "want": "False\n"}, {"example_id": "is_power_of_two:7", "source": "is_power_of_two(-1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: number must not be negative\n"}, {"example_id": "is_power_of_two:8", "source": "is_power_of_two(1.2)\n", "want": "Traceback (most recent call last):\n ...\nTypeError: unsupported operand type(s) for &: 'float' and 'float'\n"}, {"example_id": "is_power_of_two:9", "source": "all(is_power_of_two(int(2 ** i)) for i in range(10000))\n", "want": "True\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-9cf005a701561f8a", "tree_sha256": "63e962a60e6bc8e12c5fc3967d041a81c74b385fd32ca4468e938001c76b2a07", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:bit_manipulation/is_power_of_two.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def stalin_sort(sequence: list[int]) -> list[int]:\n \"\"\"\n Sorts a list using the Stalin sort algorithm.\n\n >>> stalin_sort([4, 3, 5, 2, 1, 7])\n [4, 5, 7]\n\n >>> stalin_sort([1, 2, 3, 4])\n [1, 2, 3, 4]\n\n >>> stalin_sort([4, 5, 5, 2, 3])\n [4, 5, 5]\n\n >>> stalin_sort([6, 11, 12, 4, 1, 5])\n [6, 11, 12]\n\n >>> stalin_sort([5, 0, 4, 3])\n [5]\n\n >>> stalin_sort([5, 4, 3, 2, 1])\n [5]\n\n >>> stalin_sort([1, 2, 3, 4, 5])\n [1, 2, 3, 4, 5]\n\n >>> stalin_sort([1, 2, 8, 7, 6])\n [1, 2, 8]\n \"\"\"\n result = [sequence[0]]\n for element in sequence[1:]:\n if element >= result[-1]:\n result.append(element)\n\n return result\n"}, "sha256": "62a7aa83188014908407a31a5beb27d88e16fdf0dfddc2c906924bb2be69e3c7"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "62a7aa83188014908407a31a5beb27d88e16fdf0dfddc2c906924bb2be69e3c7", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "7bf05edf8000cbfe4ca12a4fbd68bfc88492efc59142032c133956ae584667ac", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00311"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00311", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def stalin_sort(sequence: list[int]) -> list[int]:\n \"\"\"\n Sorts a list using the Stalin sort algorithm.\n\n >>> stalin_sort([4, 3, 5, 2, 1, 7])\n [4, 5, 7]\n\n >>> stalin_sort([1, 2, 3, 4])\n [1, 2, 3, 4]\n\n >>> stalin_sort([4, 5, 5, 2, 3])\n [4, 5, 5]\n\n >>> stalin_sort([6, 11, 12, 4, 1, 5])\n [6, 11, 12]\n\n >>> stalin_sort([5, 0, 4, 3])\n [5]\n\n >>> stalin_sort([5, 4, 3, 2, 1])\n [5]\n\n >>> stalin_sort([1, 2, 3, 4, 5])\n [1, 2, 3, 4, 5]\n\n >>> stalin_sort([1, 2, 8, 7, 6])\n [1, 2, 8]\n \"\"\"\n result = [sequence[0]]\n for element in sequence[1:]:\n if element > result[-1]:\n result.append(element)\n\n return result\n"}, "sha256": "c85f04f4c5f9b6c83c7a5452562792046226fbfd283fa74ad0947cfd7262f642"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "stalin_sort:2", "got": "[4, 5]\n", "source": "stalin_sort([4, 5, 5, 2, 3])\n", "truncated": false, "want": "[4, 5, 5]\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "comparison_boundary", "seed": 7, "span": {"col_offset": 19, "end_byte": 615, "lineno": 31, "node": "Compare", "node_col_offset": 11, "node_end_col_offset": 32, "node_end_lineno": 31, "node_lineno": 31, "op_index": 0, "original_text": ">=", "replacement_text": ">", "start_byte": 613}}, "public_tests": {"examples": [{"example_id": "stalin_sort:0", "source": "stalin_sort([4, 3, 5, 2, 1, 7])\n", "want": "[4, 5, 7]\n"}, {"example_id": "stalin_sort:1", "source": "stalin_sort([1, 2, 3, 4])\n", "want": "[1, 2, 3, 4]\n"}, {"example_id": "stalin_sort:2", "source": "stalin_sort([4, 5, 5, 2, 3])\n", "want": "[4, 5, 5]\n"}, {"example_id": "stalin_sort:3", "source": "stalin_sort([6, 11, 12, 4, 1, 5])\n", "want": "[6, 11, 12]\n"}, {"example_id": "stalin_sort:4", "source": "stalin_sort([5, 0, 4, 3])\n", "want": "[5]\n"}, {"example_id": "stalin_sort:5", "source": "stalin_sort([5, 4, 3, 2, 1])\n", "want": "[5]\n"}, {"example_id": "stalin_sort:6", "source": "stalin_sort([1, 2, 3, 4, 5])\n", "want": "[1, 2, 3, 4, 5]\n"}, {"example_id": "stalin_sort:7", "source": "stalin_sort([1, 2, 8, 7, 6])\n", "want": "[1, 2, 8]\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-df20fb30a718705d", "tree_sha256": "62a7aa83188014908407a31a5beb27d88e16fdf0dfddc2c906924bb2be69e3c7", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:sorts/stalin_sort.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def signum(num: float) -> int:\n \"\"\"\n Applies signum function on the number\n\n Custom test cases:\n >>> signum(-10)\n -1\n >>> signum(10)\n 1\n >>> signum(0)\n 0\n >>> signum(-20.5)\n -1\n >>> signum(20.5)\n 1\n >>> signum(-1e-6)\n -1\n >>> signum(1e-6)\n 1\n >>> signum(\"Hello\")\n Traceback (most recent call last):\n ...\n TypeError: '<' not supported between instances of 'str' and 'int'\n >>> signum([])\n Traceback (most recent call last):\n ...\n TypeError: '<' not supported between instances of 'list' and 'int'\n \"\"\"\n if num < 0:\n return -1\n return 1 if num else 0\n"}, "sha256": "b4915a1473356c9c2028027fd53f7e7755543e227fdcc9c44fae4d8a29c19e39"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "b4915a1473356c9c2028027fd53f7e7755543e227fdcc9c44fae4d8a29c19e39", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "becec6038c88d45efe064691bb0dbcb9b28f29b604c379d066aff773e5efbee9", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00313"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00313", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def signum(num: float) -> int:\n \"\"\"\n Applies signum function on the number\n\n Custom test cases:\n >>> signum(-10)\n -1\n >>> signum(10)\n 1\n >>> signum(0)\n 0\n >>> signum(-20.5)\n -1\n >>> signum(20.5)\n 1\n >>> signum(-1e-6)\n -1\n >>> signum(1e-6)\n 1\n >>> signum(\"Hello\")\n Traceback (most recent call last):\n ...\n TypeError: '<' not supported between instances of 'str' and 'int'\n >>> signum([])\n Traceback (most recent call last):\n ...\n TypeError: '<' not supported between instances of 'list' and 'int'\n \"\"\"\n if num < 0:\n return 0\n return 1 if num else 0\n"}, "sha256": "ce95a0bec4baf8e93d7691117c7caf263f38b9258cba0a9e87da96853c510822"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "signum:0", "got": "0\n", "source": "signum(-10)\n", "truncated": false, "want": "-1\n"}, {"example_id": "signum:3", "got": "0\n", "source": "signum(-20.5)\n", "truncated": false, "want": "-1\n"}, {"example_id": "signum:5", "got": "0\n", "source": "signum(-1e-6)\n", "truncated": false, "want": "-1\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 15, "end_byte": 620, "lineno": 30, "node": "Return", "node_col_offset": 8, "node_end_col_offset": 17, "node_end_lineno": 30, "node_lineno": 30, "op_index": 0, "original_text": "-1", "replacement_text": "0", "start_byte": 618}}, "public_tests": {"examples": [{"example_id": "signum:0", "source": "signum(-10)\n", "want": "-1\n"}, {"example_id": "signum:1", "source": "signum(10)\n", "want": "1\n"}, {"example_id": "signum:2", "source": "signum(0)\n", "want": "0\n"}, {"example_id": "signum:3", "source": "signum(-20.5)\n", "want": "-1\n"}, {"example_id": "signum:4", "source": "signum(20.5)\n", "want": "1\n"}, {"example_id": "signum:5", "source": "signum(-1e-6)\n", "want": "-1\n"}, {"example_id": "signum:6", "source": "signum(1e-6)\n", "want": "1\n"}, {"example_id": "signum:7", "source": "signum(\"Hello\")\n", "want": "Traceback (most recent call last):\n ...\nTypeError: '<' not supported between instances of 'str' and 'int'\n"}, {"example_id": "signum:8", "source": "signum([])\n", "want": "Traceback (most recent call last):\n ...\nTypeError: '<' not supported between instances of 'list' and 'int'\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-413d4d00136fd20a", "tree_sha256": "b4915a1473356c9c2028027fd53f7e7755543e227fdcc9c44fae4d8a29c19e39", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/signum.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def naive_pattern_search(s: str, pattern: str) -> list:\n \"\"\"\n >>> naive_pattern_search(\"ABAAABCDBBABCDDEBCABC\", \"ABC\")\n [4, 10, 18]\n >>> naive_pattern_search(\"ABC\", \"ABAAABCDBBABCDDEBCABC\")\n []\n >>> naive_pattern_search(\"\", \"ABC\")\n []\n >>> naive_pattern_search(\"TEST\", \"TEST\")\n [0]\n >>> naive_pattern_search(\"ABCDEGFTEST\", \"TEST\")\n [7]\n \"\"\"\n pat_len = len(pattern)\n position = []\n for i in range(len(s) - pat_len + 1):\n match_found = True\n for j in range(pat_len):\n if s[i + j] != pattern[j]:\n match_found = False\n break\n if match_found:\n position.append(i)\n return position\n"}, "sha256": "6f912b6763d0741f5ee479f755c1853fb7b01b1f6a731ed0003f9c55f6c04d71"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "6f912b6763d0741f5ee479f755c1853fb7b01b1f6a731ed0003f9c55f6c04d71", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "a6e23a94b43a35c39ff1f9b2c5e508623c8d865e777deea0eea1670665975bc3", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00319"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00319", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def naive_pattern_search(s: str, pattern: str) -> list:\n \"\"\"\n >>> naive_pattern_search(\"ABAAABCDBBABCDDEBCABC\", \"ABC\")\n [4, 10, 18]\n >>> naive_pattern_search(\"ABC\", \"ABAAABCDBBABCDDEBCABC\")\n []\n >>> naive_pattern_search(\"\", \"ABC\")\n []\n >>> naive_pattern_search(\"TEST\", \"TEST\")\n [0]\n >>> naive_pattern_search(\"ABCDEGFTEST\", \"TEST\")\n [7]\n \"\"\"\n pat_len = len(pattern)\n position = []\n for i in range(len(s) - pat_len + 1):\n match_found = True\n for j in range(pat_len):\n if s[i + j] == pattern[j]:\n match_found = False\n break\n if match_found:\n position.append(i)\n return position\n"}, "sha256": "a0d384a6902fcd707e82b58bd8dbb0b42312da64efc521a34e87cd40d44eab98"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "naive_pattern_search:0", "got": "[1, 5, 6, 9, 11, 12, 13, 14, 16, 17]\n", "source": "naive_pattern_search(\"ABAAABCDBBABCDDEBCABC\", \"ABC\")\n", "truncated": false, "want": "[4, 10, 18]\n"}, {"example_id": "naive_pattern_search:3", "got": "[]\n", "source": "naive_pattern_search(\"TEST\", \"TEST\")\n", "truncated": false, "want": "[0]\n"}, {"example_id": "naive_pattern_search:4", "got": "[0, 1, 2, 5, 6]\n", "source": "naive_pattern_search(\"ABCDEGFTEST\", \"TEST\")\n", "truncated": false, "want": "[7]\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "boolean_condition", "seed": 7, "span": {"col_offset": 24, "end_byte": 550, "lineno": 19, "node": "Compare", "node_col_offset": 15, "node_end_col_offset": 37, "node_end_lineno": 19, "node_lineno": 19, "op_index": 0, "original_text": "!=", "replacement_text": "==", "start_byte": 548}}, "public_tests": {"examples": [{"example_id": "naive_pattern_search:0", "source": "naive_pattern_search(\"ABAAABCDBBABCDDEBCABC\", \"ABC\")\n", "want": "[4, 10, 18]\n"}, {"example_id": "naive_pattern_search:1", "source": "naive_pattern_search(\"ABC\", \"ABAAABCDBBABCDDEBCABC\")\n", "want": "[]\n"}, {"example_id": "naive_pattern_search:2", "source": "naive_pattern_search(\"\", \"ABC\")\n", "want": "[]\n"}, {"example_id": "naive_pattern_search:3", "source": "naive_pattern_search(\"TEST\", \"TEST\")\n", "want": "[0]\n"}, {"example_id": "naive_pattern_search:4", "source": "naive_pattern_search(\"ABCDEGFTEST\", \"TEST\")\n", "want": "[7]\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-fb0365a668236537", "tree_sha256": "6f912b6763d0741f5ee479f755c1853fb7b01b1f6a731ed0003f9c55f6c04d71", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:strings/naive_string_search.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def prefix_sum(array: list[int], queries: list[tuple[int, int]]) -> list[int]:\n \"\"\"\n >>> prefix_sum([1, 4, 6, 2, 61, 12], [(2, 5), (1, 5), (3, 4)])\n [81, 85, 63]\n >>> prefix_sum([4, 2, 1, 6, 3], [(3, 4), (1, 3), (0, 2)])\n [9, 9, 7]\n \"\"\"\n # The prefix sum array\n dp = [0] * len(array)\n dp[0] = array[0]\n for i in range(1, len(array)):\n dp[i] = dp[i - 1] + array[i]\n\n # See Algorithm section (Line 44)\n result = []\n for query in queries:\n left, right = query\n res = dp[right]\n if left > 0:\n res -= dp[left - 1]\n result.append(res)\n\n return result\n"}, "sha256": "0c10d1c6f3f791fa7a104d60611d7d0ba95e4b643976b7069da0a5f58d7b1189"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "0c10d1c6f3f791fa7a104d60611d7d0ba95e4b643976b7069da0a5f58d7b1189", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "383f9b96be975339240151f1a5b73ad249586f11428ae821e2b224b66633904c", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00321"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00321", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 21, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def prefix_sum(array: list[int], queries: list[tuple[int, int]]) -> list[int]:\n \"\"\"\n >>> prefix_sum([1, 4, 6, 2, 61, 12], [(2, 5), (1, 5), (3, 4)])\n [81, 85, 63]\n >>> prefix_sum([4, 2, 1, 6, 3], [(3, 4), (1, 3), (0, 2)])\n [9, 9, 7]\n \"\"\"\n # The prefix sum array\n dp = [0] * len(array)\n dp[0] = array[0]\n for i in range(1, len(array)):\n dp[i] = dp[i - 1] - array[i]\n\n # See Algorithm section (Line 44)\n result = []\n for query in queries:\n left, right = query\n res = dp[right]\n if left > 0:\n res -= dp[left - 1]\n result.append(res)\n\n return result\n"}, "sha256": "9e0e2813a693958b171650c43c98e68ebd1c6ac9a6a014ed5703e19504398558"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "prefix_sum:0", "got": "[-81, -85, -63]\n", "source": "prefix_sum([1, 4, 6, 2, 61, 12], [(2, 5), (1, 5), (3, 4)])\n", "truncated": false, "want": "[81, 85, 63]\n"}, {"example_id": "prefix_sum:1", "got": "[-9, -9, 1]\n", "source": "prefix_sum([4, 2, 1, 6, 3], [(3, 4), (1, 3), (0, 2)])\n", "truncated": false, "want": "[9, 9, 7]\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 26, "end_byte": 391, "lineno": 12, "node": "BinOp", "node_col_offset": 16, "node_end_col_offset": 36, "node_end_lineno": 12, "node_lineno": 12, "op_index": 0, "original_text": "+", "replacement_text": "-", "start_byte": 390}}, "public_tests": {"examples": [{"example_id": "prefix_sum:0", "source": "prefix_sum([1, 4, 6, 2, 61, 12], [(2, 5), (1, 5), (3, 4)])\n", "want": "[81, 85, 63]\n"}, {"example_id": "prefix_sum:1", "source": "prefix_sum([4, 2, 1, 6, 3], [(3, 4), (1, 3), (0, 2)])\n", "want": "[9, 9, 7]\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-2bfc536db12e9fdb", "tree_sha256": "0c10d1c6f3f791fa7a104d60611d7d0ba95e4b643976b7069da0a5f58d7b1189", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:dynamic_programming/range_sum_query.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def super_digit(n_str: str, repetitions: int) -> int:\n \"\"\"\n Computes the super digit of a number formed by concatenating\n n_str repeated times.\n\n Parameters:\n n_str (str): The string representation of the integer.\n repetitions (int): The number of times to concatenate n_str.\n\n Returns:\n int: The super digit of the concatenated number.\n\n >>> super_digit(\"148\", 3)\n 3\n >>> super_digit(\"9875\", 4)\n 8\n >>> super_digit(\"123\", 3)\n 9\n \"\"\"\n\n # Calculate the initial sum of the digits in n_str\n digit_sum = sum(int(digit) for digit in n_str)\n\n # Multiply the sum by repetitions\n total_sum = digit_sum * repetitions\n\n # Recursive function to find the super digit\n while total_sum >= 10:\n total_sum = sum(int(digit) for digit in str(total_sum))\n\n return total_sum\n"}, "sha256": "6ec16b0b2cf4322e50758ea48b28ca10552959faef2795e8d3667cad2f93ac0a"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "6ec16b0b2cf4322e50758ea48b28ca10552959faef2795e8d3667cad2f93ac0a", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "43a2c60900def944228dc85ccaa20c6de239d66228417b3579e9368faadb781f", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00322"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00322", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def super_digit(n_str: str, repetitions: int) -> int:\n \"\"\"\n Computes the super digit of a number formed by concatenating\n n_str repeated times.\n\n Parameters:\n n_str (str): The string representation of the integer.\n repetitions (int): The number of times to concatenate n_str.\n\n Returns:\n int: The super digit of the concatenated number.\n\n >>> super_digit(\"148\", 3)\n 3\n >>> super_digit(\"9875\", 4)\n 8\n >>> super_digit(\"123\", 3)\n 9\n \"\"\"\n\n # Calculate the initial sum of the digits in n_str\n digit_sum = sum(int(digit) for digit in n_str)\n\n # Multiply the sum by repetitions\n total_sum = digit_sum * repetitions\n\n # Recursive function to find the super digit\n while total_sum >= 10:\n total_sum = sum(int(digit) for digit in str(total_sum))\n\n return total_sum + 1\n"}, "sha256": "9a881aecbca4e0f59c54ba5f6f73bec586990e0d7f03df61848743d108d5e256"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "super_digit:0", "got": "4\n", "source": "super_digit(\"148\", 3)\n", "truncated": false, "want": "3\n"}, {"example_id": "super_digit:1", "got": "9\n", "source": "super_digit(\"9875\", 4)\n", "truncated": false, "want": "8\n"}, {"example_id": "super_digit:2", "got": "10\n", "source": "super_digit(\"123\", 3)\n", "truncated": false, "want": "9\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 827, "lineno": 31, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 20, "node_end_lineno": 31, "node_lineno": 31, "op_index": 0, "original_text": "total_sum", "replacement_text": "total_sum + 1", "start_byte": 818}}, "public_tests": {"examples": [{"example_id": "super_digit:0", "source": "super_digit(\"148\", 3)\n", "want": "3\n"}, {"example_id": "super_digit:1", "source": "super_digit(\"9875\", 4)\n", "want": "8\n"}, {"example_id": "super_digit:2", "source": "super_digit(\"123\", 3)\n", "want": "9\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-6ff4b2d4c415a1d5", "tree_sha256": "6ec16b0b2cf4322e50758ea48b28ca10552959faef2795e8d3667cad2f93ac0a", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/recursive_digit_sum.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def super_digit(n_str: str, repetitions: int) -> int:\n \"\"\"\n Computes the super digit of a number formed by concatenating\n n_str repeated times.\n\n Parameters:\n n_str (str): The string representation of the integer.\n repetitions (int): The number of times to concatenate n_str.\n\n Returns:\n int: The super digit of the concatenated number.\n\n >>> super_digit(\"148\", 3)\n 3\n >>> super_digit(\"9875\", 4)\n 8\n >>> super_digit(\"123\", 3)\n 9\n \"\"\"\n\n # Calculate the initial sum of the digits in n_str\n digit_sum = sum(int(digit) for digit in n_str)\n\n # Multiply the sum by repetitions\n total_sum = digit_sum * repetitions\n\n # Recursive function to find the super digit\n while total_sum >= 10:\n total_sum = sum(int(digit) for digit in str(total_sum))\n\n return total_sum\n"}, "sha256": "6ec16b0b2cf4322e50758ea48b28ca10552959faef2795e8d3667cad2f93ac0a"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "6ec16b0b2cf4322e50758ea48b28ca10552959faef2795e8d3667cad2f93ac0a", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "54e53e7f3410a5db65fa4fcf87257006df3940c684ffb8cdbfce5319564cdb32", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00331"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00331", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def super_digit(n_str: str, repetitions: int) -> int:\n \"\"\"\n Computes the super digit of a number formed by concatenating\n n_str repeated times.\n\n Parameters:\n n_str (str): The string representation of the integer.\n repetitions (int): The number of times to concatenate n_str.\n\n Returns:\n int: The super digit of the concatenated number.\n\n >>> super_digit(\"148\", 3)\n 3\n >>> super_digit(\"9875\", 4)\n 8\n >>> super_digit(\"123\", 3)\n 9\n \"\"\"\n\n # Calculate the initial sum of the digits in n_str\n digit_sum = sum(int(digit) for digit in n_str)\n\n # Multiply the sum by repetitions\n total_sum = digit_sum // repetitions\n\n # Recursive function to find the super digit\n while total_sum >= 10:\n total_sum = sum(int(digit) for digit in str(total_sum))\n\n return total_sum\n"}, "sha256": "9542ab8c1442375bdde9c24706a52e38400b96ab9bbf925528e4cc0ce61b0c41"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "super_digit:0", "got": "4\n", "source": "super_digit(\"148\", 3)\n", "truncated": false, "want": "3\n"}, {"example_id": "super_digit:1", "got": "7\n", "source": "super_digit(\"9875\", 4)\n", "truncated": false, "want": "8\n"}, {"example_id": "super_digit:2", "got": "2\n", "source": "super_digit(\"123\", 3)\n", "truncated": false, "want": "9\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 26, "end_byte": 652, "lineno": 25, "node": "BinOp", "node_col_offset": 16, "node_end_col_offset": 39, "node_end_lineno": 25, "node_lineno": 25, "op_index": 0, "original_text": "*", "replacement_text": "//", "start_byte": 651}}, "public_tests": {"examples": [{"example_id": "super_digit:0", "source": "super_digit(\"148\", 3)\n", "want": "3\n"}, {"example_id": "super_digit:1", "source": "super_digit(\"9875\", 4)\n", "want": "8\n"}, {"example_id": "super_digit:2", "source": "super_digit(\"123\", 3)\n", "want": "9\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-6ff4b2d4c415a1d5", "tree_sha256": "6ec16b0b2cf4322e50758ea48b28ca10552959faef2795e8d3667cad2f93ac0a", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/recursive_digit_sum.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def compute_geometric_mean(*args: int) -> float:\n \"\"\"\n Return the geometric mean of the argument numbers.\n >>> compute_geometric_mean(2,8)\n 4.0\n >>> compute_geometric_mean('a', 4)\n Traceback (most recent call last):\n ...\n TypeError: Not a Number\n >>> compute_geometric_mean(5, 125)\n 25.0\n >>> compute_geometric_mean(1, 0)\n 0.0\n >>> compute_geometric_mean(1, 5, 25, 5)\n 5.0\n >>> compute_geometric_mean(2, -2)\n Traceback (most recent call last):\n ...\n ArithmeticError: Cannot Compute Geometric Mean for these numbers.\n >>> compute_geometric_mean(-5, 25, 1)\n -5.0\n \"\"\"\n product = 1\n for number in args:\n if not isinstance(number, int) and not isinstance(number, float):\n raise TypeError(\"Not a Number\")\n product *= number\n # Cannot calculate the even root for negative product.\n # Frequently they are restricted to being positive.\n if product < 0 and len(args) % 2 == 0:\n raise ArithmeticError(\"Cannot Compute Geometric Mean for these numbers.\")\n mean = abs(product) ** (1 / len(args))\n # Since python calculates complex roots for negative products with odd roots.\n if product < 0:\n mean = -mean\n # Since it does floating point arithmetic, it gives 64**(1/3) as 3.99999996\n possible_mean = float(round(mean))\n # To check if the rounded number is actually the mean.\n if possible_mean ** len(args) == product:\n mean = possible_mean\n return mean\n"}, "sha256": "8ad4ac73aed238d029e62de39e06c7df1d8607ff92df59d3ace87657f486da53"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "8ad4ac73aed238d029e62de39e06c7df1d8607ff92df59d3ace87657f486da53", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "85c042dfc4ddefa3b9f10fae5b5f0b40d163c424283acbd695bcba0094e192ca", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00332"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00332", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def compute_geometric_mean(*args: int) -> float:\n \"\"\"\n Return the geometric mean of the argument numbers.\n >>> compute_geometric_mean(2,8)\n 4.0\n >>> compute_geometric_mean('a', 4)\n Traceback (most recent call last):\n ...\n TypeError: Not a Number\n >>> compute_geometric_mean(5, 125)\n 25.0\n >>> compute_geometric_mean(1, 0)\n 0.0\n >>> compute_geometric_mean(1, 5, 25, 5)\n 5.0\n >>> compute_geometric_mean(2, -2)\n Traceback (most recent call last):\n ...\n ArithmeticError: Cannot Compute Geometric Mean for these numbers.\n >>> compute_geometric_mean(-5, 25, 1)\n -5.0\n \"\"\"\n product = 1\n for number in args:\n if not isinstance(number, int) and not isinstance(number, float):\n raise TypeError(\"Not a Number\")\n product //= number\n # Cannot calculate the even root for negative product.\n # Frequently they are restricted to being positive.\n if product < 0 and len(args) % 2 == 0:\n raise ArithmeticError(\"Cannot Compute Geometric Mean for these numbers.\")\n mean = abs(product) ** (1 / len(args))\n # Since python calculates complex roots for negative products with odd roots.\n if product < 0:\n mean = -mean\n # Since it does floating point arithmetic, it gives 64**(1/3) as 3.99999996\n possible_mean = float(round(mean))\n # To check if the rounded number is actually the mean.\n if possible_mean ** len(args) == product:\n mean = possible_mean\n return mean\n"}, "sha256": "fead681fb83e1189352b7edc60016208f6785ac0ad8a63cdbdd3328b309c4347"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "compute_geometric_mean:0", "got": "0.0\n", "source": "compute_geometric_mean(2,8)\n", "truncated": false, "want": "4.0\n"}, {"example_id": "compute_geometric_mean:2", "got": "0.0\n", "source": "compute_geometric_mean(5, 125)\n", "truncated": false, "want": "25.0\n"}, {"example_id": "compute_geometric_mean:3", "got": "ZeroDivisionError: integer division or modulo by zero", "source": "compute_geometric_mean(1, 0)\n", "truncated": false, "want": "0.0\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 16, "end_byte": 813, "lineno": 27, "node": "AugAssign", "node_col_offset": 8, "node_end_col_offset": 25, "node_end_lineno": 27, "node_lineno": 27, "op_index": 0, "original_text": "*=", "replacement_text": "//=", "start_byte": 811}}, "public_tests": {"examples": [{"example_id": "compute_geometric_mean:0", "source": "compute_geometric_mean(2,8)\n", "want": "4.0\n"}, {"example_id": "compute_geometric_mean:1", "source": "compute_geometric_mean('a', 4)\n", "want": "Traceback (most recent call last):\n ...\nTypeError: Not a Number\n"}, {"example_id": "compute_geometric_mean:2", "source": "compute_geometric_mean(5, 125)\n", "want": "25.0\n"}, {"example_id": "compute_geometric_mean:3", "source": "compute_geometric_mean(1, 0)\n", "want": "0.0\n"}, {"example_id": "compute_geometric_mean:4", "source": "compute_geometric_mean(1, 5, 25, 5)\n", "want": "5.0\n"}, {"example_id": "compute_geometric_mean:5", "source": "compute_geometric_mean(2, -2)\n", "want": "Traceback (most recent call last):\n ...\nArithmeticError: Cannot Compute Geometric Mean for these numbers.\n"}, {"example_id": "compute_geometric_mean:6", "source": "compute_geometric_mean(-5, 25, 1)\n", "want": "-5.0\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-afe067ad08d0b879", "tree_sha256": "8ad4ac73aed238d029e62de39e06c7df1d8607ff92df59d3ace87657f486da53", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/geometric_mean.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def count_vowels(s: str) -> int:\n \"\"\"\n Count the number of vowels in a given string.\n\n :param s: Input string to count vowels in.\n :return: Number of vowels in the input string.\n\n Examples:\n >>> count_vowels(\"hello world\")\n 3\n >>> count_vowels(\"HELLO WORLD\")\n 3\n >>> count_vowels(\"123 hello world\")\n 3\n >>> count_vowels(\"\")\n 0\n >>> count_vowels(\"a quick brown fox\")\n 5\n >>> count_vowels(\"the quick BROWN fox\")\n 5\n >>> count_vowels(\"PYTHON\")\n 1\n \"\"\"\n if not isinstance(s, str):\n raise TypeError(\"Input must be a string\")\n\n vowels = \"aeiouAEIOU\"\n return sum(1 for char in s if char in vowels)\n"}, "sha256": "fcfbbb0e1249dc4775c0e500da7c7d0d6c6477f5b002832d137aa4c030a4a5ab"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "fcfbbb0e1249dc4775c0e500da7c7d0d6c6477f5b002832d137aa4c030a4a5ab", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "dc11e39ecde7ab13dfbb934563b72369433cd93efcc8923f4de341fc982f5505", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00333"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00333", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def count_vowels(s: str) -> int:\n \"\"\"\n Count the number of vowels in a given string.\n\n :param s: Input string to count vowels in.\n :return: Number of vowels in the input string.\n\n Examples:\n >>> count_vowels(\"hello world\")\n 3\n >>> count_vowels(\"HELLO WORLD\")\n 3\n >>> count_vowels(\"123 hello world\")\n 3\n >>> count_vowels(\"\")\n 0\n >>> count_vowels(\"a quick brown fox\")\n 5\n >>> count_vowels(\"the quick BROWN fox\")\n 5\n >>> count_vowels(\"PYTHON\")\n 1\n \"\"\"\n if not isinstance(s, str):\n raise TypeError(\"Input must be a string\")\n\n vowels = \"aeiouAEIOU\"\n return sum(1 for char in s if char in vowels) - 1\n"}, "sha256": "9cbc73147efdd2487fa263db1aa433495414309fb5053e65630fd1980b0a873c"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "count_vowels:0", "got": "2\n", "source": "count_vowels(\"hello world\")\n", "truncated": false, "want": "3\n"}, {"example_id": "count_vowels:1", "got": "2\n", "source": "count_vowels(\"HELLO WORLD\")\n", "truncated": false, "want": "3\n"}, {"example_id": "count_vowels:2", "got": "2\n", "source": "count_vowels(\"123 hello world\")\n", "truncated": false, "want": "3\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 666, "lineno": 28, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 49, "node_end_lineno": 28, "node_lineno": 28, "op_index": 0, "original_text": "sum(1 for char in s if char in vowels)", "replacement_text": "sum(1 for char in s if char in vowels) - 1", "start_byte": 628}}, "public_tests": {"examples": [{"example_id": "count_vowels:0", "source": "count_vowels(\"hello world\")\n", "want": "3\n"}, {"example_id": "count_vowels:1", "source": "count_vowels(\"HELLO WORLD\")\n", "want": "3\n"}, {"example_id": "count_vowels:2", "source": "count_vowels(\"123 hello world\")\n", "want": "3\n"}, {"example_id": "count_vowels:3", "source": "count_vowels(\"\")\n", "want": "0\n"}, {"example_id": "count_vowels:4", "source": "count_vowels(\"a quick brown fox\")\n", "want": "5\n"}, {"example_id": "count_vowels:5", "source": "count_vowels(\"the quick BROWN fox\")\n", "want": "5\n"}, {"example_id": "count_vowels:6", "source": "count_vowels(\"PYTHON\")\n", "want": "1\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-348c4077ef4ba693", "tree_sha256": "fcfbbb0e1249dc4775c0e500da7c7d0d6c6477f5b002832d137aa4c030a4a5ab", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:strings/count_vowels.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def greatest_common_divisor(a: int, b: int) -> int:\n \"\"\"\n Calculate Greatest Common Divisor (GCD).\n >>> greatest_common_divisor(24, 40)\n 8\n >>> greatest_common_divisor(1, 1)\n 1\n >>> greatest_common_divisor(1, 800)\n 1\n >>> greatest_common_divisor(11, 37)\n 1\n >>> greatest_common_divisor(3, 5)\n 1\n >>> greatest_common_divisor(16, 4)\n 4\n >>> greatest_common_divisor(-3, 9)\n 3\n >>> greatest_common_divisor(9, -3)\n 3\n >>> greatest_common_divisor(3, -9)\n 3\n >>> greatest_common_divisor(-3, -9)\n 3\n >>> greatest_common_divisor(0, 0)\n 0\n \"\"\"\n return abs(b) if a == 0 else greatest_common_divisor(b % a, a)\n"}, "sha256": "c83b231cabe16db1ee264bbab4da1750cb72d603a68112a349ee3b152d638e16"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "c83b231cabe16db1ee264bbab4da1750cb72d603a68112a349ee3b152d638e16", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "e6e81f8c183b35e1b92ec93145ba9bce15f7933a6e9924d5526f8128d1a00b03", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00334"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00334", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def greatest_common_divisor(a: int, b: int) -> int:\n \"\"\"\n Calculate Greatest Common Divisor (GCD).\n >>> greatest_common_divisor(24, 40)\n 8\n >>> greatest_common_divisor(1, 1)\n 1\n >>> greatest_common_divisor(1, 800)\n 1\n >>> greatest_common_divisor(11, 37)\n 1\n >>> greatest_common_divisor(3, 5)\n 1\n >>> greatest_common_divisor(16, 4)\n 4\n >>> greatest_common_divisor(-3, 9)\n 3\n >>> greatest_common_divisor(9, -3)\n 3\n >>> greatest_common_divisor(3, -9)\n 3\n >>> greatest_common_divisor(-3, -9)\n 3\n >>> greatest_common_divisor(0, 0)\n 0\n \"\"\"\n return abs(b) if a == 1 else greatest_common_divisor(b % a, a)\n"}, "sha256": "9cbf72360ac4a5eb96768f9fd624b81e17b3f80bfd7d8865e750430946b9dba6"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "greatest_common_divisor:0", "got": "ZeroDivisionError: integer modulo by zero", "source": "greatest_common_divisor(24, 40)\n", "truncated": false, "want": "8\n"}, {"example_id": "greatest_common_divisor:2", "got": "800\n", "source": "greatest_common_divisor(1, 800)\n", "truncated": false, "want": "1\n"}, {"example_id": "greatest_common_divisor:3", "got": "3\n", "source": "greatest_common_divisor(11, 37)\n", "truncated": false, "want": "1\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "off_by_one", "seed": 7, "span": {"col_offset": 26, "end_byte": 636, "lineno": 27, "node": "Constant", "node_col_offset": 26, "node_end_col_offset": 27, "node_end_lineno": 27, "node_lineno": 27, "op_index": 0, "original_text": "0", "replacement_text": "1", "start_byte": 635}}, "public_tests": {"examples": [{"example_id": "greatest_common_divisor:0", "source": "greatest_common_divisor(24, 40)\n", "want": "8\n"}, {"example_id": "greatest_common_divisor:1", "source": "greatest_common_divisor(1, 1)\n", "want": "1\n"}, {"example_id": "greatest_common_divisor:2", "source": "greatest_common_divisor(1, 800)\n", "want": "1\n"}, {"example_id": "greatest_common_divisor:3", "source": "greatest_common_divisor(11, 37)\n", "want": "1\n"}, {"example_id": "greatest_common_divisor:4", "source": "greatest_common_divisor(3, 5)\n", "want": "1\n"}, {"example_id": "greatest_common_divisor:5", "source": "greatest_common_divisor(16, 4)\n", "want": "4\n"}, {"example_id": "greatest_common_divisor:6", "source": "greatest_common_divisor(-3, 9)\n", "want": "3\n"}, {"example_id": "greatest_common_divisor:7", "source": "greatest_common_divisor(9, -3)\n", "want": "3\n"}, {"example_id": "greatest_common_divisor:8", "source": "greatest_common_divisor(3, -9)\n", "want": "3\n"}, {"example_id": "greatest_common_divisor:9", "source": "greatest_common_divisor(-3, -9)\n", "want": "3\n"}, {"example_id": "greatest_common_divisor:10", "source": "greatest_common_divisor(0, 0)\n", "want": "0\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-fe0a440000419c59", "tree_sha256": "c83b231cabe16db1ee264bbab4da1750cb72d603a68112a349ee3b152d638e16", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/greatest_common_divisor.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def damerau_levenshtein_distance(first_string: str, second_string: str) -> int:\n \"\"\"\n Implements the Damerau-Levenshtein distance algorithm that measures\n the edit distance between two strings.\n\n Parameters:\n first_string: The first string to compare\n second_string: The second string to compare\n\n Returns:\n distance: The edit distance between the first and second strings\n\n >>> damerau_levenshtein_distance(\"cat\", \"cut\")\n 1\n >>> damerau_levenshtein_distance(\"kitten\", \"sitting\")\n 3\n >>> damerau_levenshtein_distance(\"hello\", \"world\")\n 4\n >>> damerau_levenshtein_distance(\"book\", \"back\")\n 2\n >>> damerau_levenshtein_distance(\"container\", \"containment\")\n 3\n >>> damerau_levenshtein_distance(\"container\", \"containment\")\n 3\n \"\"\"\n # Create a dynamic programming matrix to store the distances\n dp_matrix = [[0] * (len(second_string) + 1) for _ in range(len(first_string) + 1)]\n\n # Initialize the matrix\n for i in range(len(first_string) + 1):\n dp_matrix[i][0] = i\n for j in range(len(second_string) + 1):\n dp_matrix[0][j] = j\n\n # Fill the matrix\n for i, first_char in enumerate(first_string, start=1):\n for j, second_char in enumerate(second_string, start=1):\n cost = int(first_char != second_char)\n\n dp_matrix[i][j] = min(\n dp_matrix[i - 1][j] + 1, # Deletion\n dp_matrix[i][j - 1] + 1, # Insertion\n dp_matrix[i - 1][j - 1] + cost, # Substitution\n )\n\n if (\n i > 1\n and j > 1\n and first_string[i - 1] == second_string[j - 2]\n and first_string[i - 2] == second_string[j - 1]\n ):\n # Transposition\n dp_matrix[i][j] = min(dp_matrix[i][j], dp_matrix[i - 2][j - 2] + cost)\n\n return dp_matrix[-1][-1]\n"}, "sha256": "10b7dc962ae767f8ad46ace01fe07ec826d5bd6d1502d6d7e05f45c771f159f2"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "10b7dc962ae767f8ad46ace01fe07ec826d5bd6d1502d6d7e05f45c771f159f2", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "be4453b08d29e766eddbcf6cfc21d866ef05dc86220b530bcac91f2b311431ea", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00335"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00335", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def damerau_levenshtein_distance(first_string: str, second_string: str) -> int:\n \"\"\"\n Implements the Damerau-Levenshtein distance algorithm that measures\n the edit distance between two strings.\n\n Parameters:\n first_string: The first string to compare\n second_string: The second string to compare\n\n Returns:\n distance: The edit distance between the first and second strings\n\n >>> damerau_levenshtein_distance(\"cat\", \"cut\")\n 1\n >>> damerau_levenshtein_distance(\"kitten\", \"sitting\")\n 3\n >>> damerau_levenshtein_distance(\"hello\", \"world\")\n 4\n >>> damerau_levenshtein_distance(\"book\", \"back\")\n 2\n >>> damerau_levenshtein_distance(\"container\", \"containment\")\n 3\n >>> damerau_levenshtein_distance(\"container\", \"containment\")\n 3\n \"\"\"\n # Create a dynamic programming matrix to store the distances\n dp_matrix = [[0] * (len(second_string) + 1) for _ in range(len(first_string) + 1)]\n\n # Initialize the matrix\n for i in range(len(first_string) + 1):\n dp_matrix[i][0] = i\n for j in range(len(second_string) + 1):\n dp_matrix[0][j] = j\n\n # Fill the matrix\n for i, first_char in enumerate(first_string, start=1):\n for j, second_char in enumerate(second_string, start=1):\n cost = int(first_char != second_char)\n\n dp_matrix[i][j] = min(\n dp_matrix[i - 1][j] + 1, # Deletion\n dp_matrix[i][j - 1] + 1, # Insertion\n dp_matrix[i - 1][j - 1] + cost, # Substitution\n )\n\n if (\n i > 1\n and j > 1\n and first_string[i - 1] == second_string[j - 2]\n and first_string[i - 2] == second_string[j - 1]\n ):\n # Transposition\n dp_matrix[i][j] = min(dp_matrix[i][j], dp_matrix[i - 2][j - 2] + cost)\n\n return dp_matrix[-1][-1] + 1\n"}, "sha256": "9968524e6097d6718b1f6a979d36221e51dd8a94b7934e14e680cfa3a40f772e"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "damerau_levenshtein_distance:0", "got": "2\n", "source": "damerau_levenshtein_distance(\"cat\", \"cut\")\n", "truncated": false, "want": "1\n"}, {"example_id": "damerau_levenshtein_distance:1", "got": "4\n", "source": "damerau_levenshtein_distance(\"kitten\", \"sitting\")\n", "truncated": false, "want": "3\n"}, {"example_id": "damerau_levenshtein_distance:2", "got": "5\n", "source": "damerau_levenshtein_distance(\"hello\", \"world\")\n", "truncated": false, "want": "4\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 1900, "lineno": 55, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 28, "node_end_lineno": 55, "node_lineno": 55, "op_index": 0, "original_text": "dp_matrix[-1][-1]", "replacement_text": "dp_matrix[-1][-1] + 1", "start_byte": 1883}}, "public_tests": {"examples": [{"example_id": "damerau_levenshtein_distance:0", "source": "damerau_levenshtein_distance(\"cat\", \"cut\")\n", "want": "1\n"}, {"example_id": "damerau_levenshtein_distance:1", "source": "damerau_levenshtein_distance(\"kitten\", \"sitting\")\n", "want": "3\n"}, {"example_id": "damerau_levenshtein_distance:2", "source": "damerau_levenshtein_distance(\"hello\", \"world\")\n", "want": "4\n"}, {"example_id": "damerau_levenshtein_distance:3", "source": "damerau_levenshtein_distance(\"book\", \"back\")\n", "want": "2\n"}, {"example_id": "damerau_levenshtein_distance:4", "source": "damerau_levenshtein_distance(\"container\", \"containment\")\n", "want": "3\n"}, {"example_id": "damerau_levenshtein_distance:5", "source": "damerau_levenshtein_distance(\"container\", \"containment\")\n", "want": "3\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-68e4348732f01105", "tree_sha256": "10b7dc962ae767f8ad46ace01fe07ec826d5bd6d1502d6d7e05f45c771f159f2", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:strings/damerau_levenshtein_distance.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def pressure_and_volume_to_temperature(\n pressure: float, moles: float, volume: float\n) -> float:\n \"\"\"\n Convert pressure and volume to temperature.\n Ideal gas laws are used.\n Temperature is taken in kelvin.\n Volume is taken in litres.\n Pressure has atm as SI unit.\n\n Wikipedia reference: https://en.wikipedia.org/wiki/Gas_laws\n Wikipedia reference: https://en.wikipedia.org/wiki/Pressure\n Wikipedia reference: https://en.wikipedia.org/wiki/Temperature\n\n >>> pressure_and_volume_to_temperature(0.82, 1, 2)\n 20\n >>> pressure_and_volume_to_temperature(8.2, 5, 3)\n 60\n \"\"\"\n return round(float((pressure * volume) / (0.0821 * moles)))\n"}, "sha256": "dade0c4eff301e200870e4aed3c97afc2c49dd93b27511efa239c11ee1f0e620"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "dade0c4eff301e200870e4aed3c97afc2c49dd93b27511efa239c11ee1f0e620", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "4d9b8d378966a3549b5353d79512ad19c5f8a3d898369e90a91346a972ad4c1c", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00336"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00336", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def pressure_and_volume_to_temperature(\n pressure: float, moles: float, volume: float\n) -> float:\n \"\"\"\n Convert pressure and volume to temperature.\n Ideal gas laws are used.\n Temperature is taken in kelvin.\n Volume is taken in litres.\n Pressure has atm as SI unit.\n\n Wikipedia reference: https://en.wikipedia.org/wiki/Gas_laws\n Wikipedia reference: https://en.wikipedia.org/wiki/Pressure\n Wikipedia reference: https://en.wikipedia.org/wiki/Temperature\n\n >>> pressure_and_volume_to_temperature(0.82, 1, 2)\n 20\n >>> pressure_and_volume_to_temperature(8.2, 5, 3)\n 60\n \"\"\"\n return round(float((pressure // volume) / (0.0821 * moles)))\n"}, "sha256": "1a84bb1f01bf813123e51939fad8b3b2805f26f96c5ea123c14140c6614b0fca"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "pressure_and_volume_to_temperature:0", "got": "0\n", "source": "pressure_and_volume_to_temperature(0.82, 1, 2)\n", "truncated": false, "want": "20\n"}, {"example_id": "pressure_and_volume_to_temperature:1", "got": "5\n", "source": "pressure_and_volume_to_temperature(8.2, 5, 3)\n", "truncated": false, "want": "60\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 33, "end_byte": 670, "lineno": 20, "node": "BinOp", "node_col_offset": 24, "node_end_col_offset": 41, "node_end_lineno": 20, "node_lineno": 20, "op_index": 0, "original_text": "*", "replacement_text": "//", "start_byte": 669}}, "public_tests": {"examples": [{"example_id": "pressure_and_volume_to_temperature:0", "source": "pressure_and_volume_to_temperature(0.82, 1, 2)\n", "want": "20\n"}, {"example_id": "pressure_and_volume_to_temperature:1", "source": "pressure_and_volume_to_temperature(8.2, 5, 3)\n", "want": "60\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-abc1ba08d917454e", "tree_sha256": "dade0c4eff301e200870e4aed3c97afc2c49dd93b27511efa239c11ee1f0e620", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:conversions/molecular_chemistry.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def f(x):\n \"\"\"\n This is the function to integrate, f(x) = (x - 0)^2 = x^2.\n\n :param x: The input value\n :return: The value of f(x)\n\n >>> f(0)\n 0\n >>> f(1)\n 1\n >>> f(0.5)\n 0.25\n \"\"\"\n return x**2\n"}, "sha256": "ff21c134e72e49a6e18a9a3d03ff125473491699a7adb3099beb83a61141d30f"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "ff21c134e72e49a6e18a9a3d03ff125473491699a7adb3099beb83a61141d30f", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "cc8bc80e7e3b4e3ac19d87d4f3869af55abba3d0ab9513195e8ab3fe8fd03ab7", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00337"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00337", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 16, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def f(x):\n \"\"\"\n This is the function to integrate, f(x) = (x - 0)^2 = x^2.\n\n :param x: The input value\n :return: The value of f(x)\n\n >>> f(0)\n 0\n >>> f(1)\n 1\n >>> f(0.5)\n 0.25\n \"\"\"\n return x**2 - 1\n"}, "sha256": "3a9eb1926c88ea122a84806056baff6c42fa6460b325584c2f40a7ba6a18d366"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "f:0", "got": "-1\n", "source": "f(0)\n", "truncated": false, "want": "0\n"}, {"example_id": "f:1", "got": "0\n", "source": "f(1)\n", "truncated": false, "want": "1\n"}, {"example_id": "f:2", "got": "-0.75\n", "source": "f(0.5)\n", "truncated": false, "want": "0.25\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 229, "lineno": 15, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 15, "node_end_lineno": 15, "node_lineno": 15, "op_index": 0, "original_text": "x**2", "replacement_text": "x**2 - 1", "start_byte": 225}}, "public_tests": {"examples": [{"example_id": "f:0", "source": "f(0)\n", "want": "0\n"}, {"example_id": "f:1", "source": "f(1)\n", "want": "1\n"}, {"example_id": "f:2", "source": "f(0.5)\n", "want": "0.25\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-d44abb0285594913", "tree_sha256": "ff21c134e72e49a6e18a9a3d03ff125473491699a7adb3099beb83a61141d30f", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/trapezoidal_rule.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "from __future__ import annotations\n\n\ndef pigeon_sort(array: list[int]) -> list[int]:\n \"\"\"\n Implementation of pigeon hole sort algorithm\n :param array: Collection of comparable items\n :return: Collection sorted in ascending order\n >>> pigeon_sort([0, 5, 3, 2, 2])\n [0, 2, 2, 3, 5]\n >>> pigeon_sort([])\n []\n >>> pigeon_sort([-2, -5, -45])\n [-45, -5, -2]\n \"\"\"\n if len(array) == 0:\n return array\n\n _min, _max = min(array), max(array)\n\n # Compute the variables\n holes_range = _max - _min + 1\n holes, holes_repeat = [0] * holes_range, [0] * holes_range\n\n # Make the sorting.\n for i in array:\n index = i - _min\n holes[index] = i\n holes_repeat[index] += 1\n\n # Makes the array back by replacing the numbers.\n index = 0\n for i in range(holes_range):\n while holes_repeat[i] > 0:\n array[index] = holes[i]\n index += 1\n holes_repeat[i] -= 1\n\n # Returns the sorted array.\n return array\n"}, "sha256": "640d952d768d57e33fb1784c0ad2267d683bd5a9dfca5fd08a4130a76ca6e8b1"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "640d952d768d57e33fb1784c0ad2267d683bd5a9dfca5fd08a4130a76ca6e8b1", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "787dc18fdac261e94985a185aec231513e0d58c57964fbc64098bb662c6a65b3", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00338"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00338", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 11, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "from __future__ import annotations\n\n\ndef pigeon_sort(array: list[int]) -> list[int]:\n \"\"\"\n Implementation of pigeon hole sort algorithm\n :param array: Collection of comparable items\n :return: Collection sorted in ascending order\n >>> pigeon_sort([0, 5, 3, 2, 2])\n [0, 2, 2, 3, 5]\n >>> pigeon_sort([])\n []\n >>> pigeon_sort([-2, -5, -45])\n [-45, -5, -2]\n \"\"\"\n if len(array) == 1:\n return array\n\n _min, _max = min(array), max(array)\n\n # Compute the variables\n holes_range = _max - _min + 1\n holes, holes_repeat = [0] * holes_range, [0] * holes_range\n\n # Make the sorting.\n for i in array:\n index = i - _min\n holes[index] = i\n holes_repeat[index] += 1\n\n # Makes the array back by replacing the numbers.\n index = 0\n for i in range(holes_range):\n while holes_repeat[i] > 0:\n array[index] = holes[i]\n index += 1\n holes_repeat[i] -= 1\n\n # Returns the sorted array.\n return array\n"}, "sha256": "4727b55c7ed7b06c2a57f01974d9fc6879421d289eac6522a62da6b6a4f8e728"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "pigeon_sort:1", "got": "ValueError: min() iterable argument is empty", "source": "pigeon_sort([])\n", "truncated": false, "want": "[]\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "off_by_one", "seed": 7, "span": {"col_offset": 21, "end_byte": 412, "lineno": 16, "node": "Constant", "node_col_offset": 21, "node_end_col_offset": 22, "node_end_lineno": 16, "node_lineno": 16, "op_index": 0, "original_text": "0", "replacement_text": "1", "start_byte": 411}}, "public_tests": {"examples": [{"example_id": "pigeon_sort:0", "source": "pigeon_sort([0, 5, 3, 2, 2])\n", "want": "[0, 2, 2, 3, 5]\n"}, {"example_id": "pigeon_sort:1", "source": "pigeon_sort([])\n", "want": "[]\n"}, {"example_id": "pigeon_sort:2", "source": "pigeon_sort([-2, -5, -45])\n", "want": "[-45, -5, -2]\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-e923f0a8fc45fbad", "tree_sha256": "640d952d768d57e33fb1784c0ad2267d683bd5a9dfca5fd08a4130a76ca6e8b1", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:sorts/pigeon_sort.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "from __future__ import annotations\n\n\ndef mean(nums: list) -> float:\n \"\"\"\n Find mean of a list of numbers.\n Wiki: https://en.wikipedia.org/wiki/Mean\n\n >>> mean([3, 6, 9, 12, 15, 18, 21])\n 12.0\n >>> mean([5, 10, 15, 20, 25, 30, 35])\n 20.0\n >>> mean([1, 2, 3, 4, 5, 6, 7, 8])\n 4.5\n >>> mean([])\n Traceback (most recent call last):\n ...\n ValueError: List is empty\n \"\"\"\n if not nums:\n raise ValueError(\"List is empty\")\n return sum(nums) / len(nums)\n"}, "sha256": "f103adea08055c4958131091ab5eb0dd434dffd06009c3a4e6ed7fa7c674f0fe"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "f103adea08055c4958131091ab5eb0dd434dffd06009c3a4e6ed7fa7c674f0fe", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "aee1e3ff0479ff1f1e7f627fd02a675b4f214aa61a9ee223672642e08acb87a2", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00339"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00339", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 15, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "from __future__ import annotations\n\n\ndef mean(nums: list) -> float:\n \"\"\"\n Find mean of a list of numbers.\n Wiki: https://en.wikipedia.org/wiki/Mean\n\n >>> mean([3, 6, 9, 12, 15, 18, 21])\n 12.0\n >>> mean([5, 10, 15, 20, 25, 30, 35])\n 20.0\n >>> mean([1, 2, 3, 4, 5, 6, 7, 8])\n 4.5\n >>> mean([])\n Traceback (most recent call last):\n ...\n ValueError: List is empty\n \"\"\"\n if nums:\n raise ValueError(\"List is empty\")\n return sum(nums) / len(nums)\n"}, "sha256": "63de0fc74d254771cab5d031671b29c95d42b36c45cbf0596d873a73f0feae00"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "mean:0", "got": "ValueError: List is empty", "source": "mean([3, 6, 9, 12, 15, 18, 21])\n", "truncated": false, "want": "12.0\n"}, {"example_id": "mean:1", "got": "ValueError: List is empty", "source": "mean([5, 10, 15, 20, 25, 30, 35])\n", "truncated": false, "want": "20.0\n"}, {"example_id": "mean:2", "got": "ValueError: List is empty", "source": "mean([1, 2, 3, 4, 5, 6, 7, 8])\n", "truncated": false, "want": "4.5\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "boolean_condition", "seed": 7, "span": {"col_offset": 7, "end_byte": 422, "lineno": 20, "node": "UnaryOp", "node_col_offset": 7, "node_end_col_offset": 15, "node_end_lineno": 20, "node_lineno": 20, "op_index": 0, "original_text": "not ", "replacement_text": "", "start_byte": 418}}, "public_tests": {"examples": [{"example_id": "mean:0", "source": "mean([3, 6, 9, 12, 15, 18, 21])\n", "want": "12.0\n"}, {"example_id": "mean:1", "source": "mean([5, 10, 15, 20, 25, 30, 35])\n", "want": "20.0\n"}, {"example_id": "mean:2", "source": "mean([1, 2, 3, 4, 5, 6, 7, 8])\n", "want": "4.5\n"}, {"example_id": "mean:3", "source": "mean([])\n", "want": "Traceback (most recent call last):\n ...\nValueError: List is empty\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-76f75f25c94666a6", "tree_sha256": "f103adea08055c4958131091ab5eb0dd434dffd06009c3a4e6ed7fa7c674f0fe", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/average_mean.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def find_unique_number(arr: list[int]) -> int:\n \"\"\"\n Given a list of integers where every element appears twice except for one,\n this function returns the element that appears only once using bitwise XOR.\n\n >>> find_unique_number([1, 1, 2, 2, 3])\n 3\n >>> find_unique_number([4, 5, 4, 6, 6])\n 5\n >>> find_unique_number([7])\n 7\n >>> find_unique_number([10, 20, 10])\n 20\n >>> find_unique_number([])\n Traceback (most recent call last):\n ...\n ValueError: input list must not be empty\n >>> find_unique_number([1, 'a', 1])\n Traceback (most recent call last):\n ...\n TypeError: all elements must be integers\n \"\"\"\n if not arr:\n raise ValueError(\"input list must not be empty\")\n if not all(isinstance(x, int) for x in arr):\n raise TypeError(\"all elements must be integers\")\n\n result = 0\n for num in arr:\n result ^= num\n return result\n"}, "sha256": "143b6d21dbc64232f6e592ebebf3b32fa8a220e23dce2703c7d1fa88927e6485"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "143b6d21dbc64232f6e592ebebf3b32fa8a220e23dce2703c7d1fa88927e6485", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "f22f815efadbb95f0bae5286a74ae6b388a6a8848475e278c93137383c29f51e", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00345"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00345", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 18, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def find_unique_number(arr: list[int]) -> int:\n \"\"\"\n Given a list of integers where every element appears twice except for one,\n this function returns the element that appears only once using bitwise XOR.\n\n >>> find_unique_number([1, 1, 2, 2, 3])\n 3\n >>> find_unique_number([4, 5, 4, 6, 6])\n 5\n >>> find_unique_number([7])\n 7\n >>> find_unique_number([10, 20, 10])\n 20\n >>> find_unique_number([])\n Traceback (most recent call last):\n ...\n ValueError: input list must not be empty\n >>> find_unique_number([1, 'a', 1])\n Traceback (most recent call last):\n ...\n TypeError: all elements must be integers\n \"\"\"\n if not arr:\n raise ValueError(\"input list must not be empty\")\n if not all(isinstance(x, int) for x in arr):\n raise TypeError(\"all elements must be integers\")\n\n result = 0\n for num in arr:\n result ^= num\n return result + 1\n"}, "sha256": "5cce74d340ea2798d5f47e844825cbb01d75ee790869d6b64fe3c8a90e84a603"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "find_unique_number:0", "got": "4\n", "source": "find_unique_number([1, 1, 2, 2, 3])\n", "truncated": false, "want": "3\n"}, {"example_id": "find_unique_number:1", "got": "6\n", "source": "find_unique_number([4, 5, 4, 6, 6])\n", "truncated": false, "want": "5\n"}, {"example_id": "find_unique_number:2", "got": "8\n", "source": "find_unique_number([7])\n", "truncated": false, "want": "7\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 926, "lineno": 31, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 17, "node_end_lineno": 31, "node_lineno": 31, "op_index": 0, "original_text": "result", "replacement_text": "result + 1", "start_byte": 920}}, "public_tests": {"examples": [{"example_id": "find_unique_number:0", "source": "find_unique_number([1, 1, 2, 2, 3])\n", "want": "3\n"}, {"example_id": "find_unique_number:1", "source": "find_unique_number([4, 5, 4, 6, 6])\n", "want": "5\n"}, {"example_id": "find_unique_number:2", "source": "find_unique_number([7])\n", "want": "7\n"}, {"example_id": "find_unique_number:3", "source": "find_unique_number([10, 20, 10])\n", "want": "20\n"}, {"example_id": "find_unique_number:4", "source": "find_unique_number([])\n", "want": "Traceback (most recent call last):\n ...\nValueError: input list must not be empty\n"}, {"example_id": "find_unique_number:5", "source": "find_unique_number([1, 'a', 1])\n", "want": "Traceback (most recent call last):\n ...\nTypeError: all elements must be integers\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-3f45a5a68e5dbb52", "tree_sha256": "143b6d21dbc64232f6e592ebebf3b32fa8a220e23dce2703c7d1fa88927e6485", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:bit_manipulation/find_unique_number.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def power(base: int, exponent: int) -> float:\n \"\"\"\n Calculate the power of a base raised to an exponent.\n\n >>> power(3, 4)\n 81\n >>> power(2, 0)\n 1\n >>> all(power(base, exponent) == pow(base, exponent)\n ... for base in range(-10, 10) for exponent in range(10))\n True\n >>> power('a', 1)\n 'a'\n >>> power('a', 2)\n Traceback (most recent call last):\n ...\n TypeError: can't multiply sequence by non-int of type 'str'\n >>> power('a', 'b')\n Traceback (most recent call last):\n ...\n TypeError: unsupported operand type(s) for -: 'str' and 'int'\n >>> power(2, -1)\n Traceback (most recent call last):\n ...\n RecursionError: maximum recursion depth exceeded\n >>> power(0, 0)\n 1\n >>> power(0, 1)\n 0\n >>> power(5,6)\n 15625\n >>> power(23, 12)\n 21914624432020321\n \"\"\"\n return base * power(base, (exponent - 1)) if exponent else 1\n"}, "sha256": "b10f16474c8b9bba30e88a1357725c79986ee0af0bf7e45d36476d2bd4257893"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "b10f16474c8b9bba30e88a1357725c79986ee0af0bf7e45d36476d2bd4257893", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "149a57d65028a5a88d4015f522f952646e730b91778b99c53d613ce718b4b673", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00346"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00346", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def power(base: int, exponent: int) -> float:\n \"\"\"\n Calculate the power of a base raised to an exponent.\n\n >>> power(3, 4)\n 81\n >>> power(2, 0)\n 1\n >>> all(power(base, exponent) == pow(base, exponent)\n ... for base in range(-10, 10) for exponent in range(10))\n True\n >>> power('a', 1)\n 'a'\n >>> power('a', 2)\n Traceback (most recent call last):\n ...\n TypeError: can't multiply sequence by non-int of type 'str'\n >>> power('a', 'b')\n Traceback (most recent call last):\n ...\n TypeError: unsupported operand type(s) for -: 'str' and 'int'\n >>> power(2, -1)\n Traceback (most recent call last):\n ...\n RecursionError: maximum recursion depth exceeded\n >>> power(0, 0)\n 1\n >>> power(0, 1)\n 0\n >>> power(5,6)\n 15625\n >>> power(23, 12)\n 21914624432020321\n \"\"\"\n return base // power(base, (exponent - 1)) if exponent else 1\n"}, "sha256": "568455fd546696e0cfa03956c98184e9657dbdbb9d846ab493131d234564cc53"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "power:0", "got": "1\n", "source": "power(3, 4)\n", "truncated": false, "want": "81\n"}, {"example_id": "power:2", "got": "False\n", "source": "all(power(base, exponent) == pow(base, exponent)\n for base in range(-10, 10) for exponent in range(10))\n", "truncated": false, "want": "True\n"}, {"example_id": "power:3", "got": "TypeError: unsupported operand type(s) for //: 'str' and 'int'", "source": "power('a', 1)\n", "truncated": false, "want": "'a'\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 16, "end_byte": 880, "lineno": 35, "node": "BinOp", "node_col_offset": 11, "node_end_col_offset": 45, "node_end_lineno": 35, "node_lineno": 35, "op_index": 0, "original_text": "*", "replacement_text": "//", "start_byte": 879}}, "public_tests": {"examples": [{"example_id": "power:0", "source": "power(3, 4)\n", "want": "81\n"}, {"example_id": "power:1", "source": "power(2, 0)\n", "want": "1\n"}, {"example_id": "power:2", "source": "all(power(base, exponent) == pow(base, exponent)\n for base in range(-10, 10) for exponent in range(10))\n", "want": "True\n"}, {"example_id": "power:3", "source": "power('a', 1)\n", "want": "'a'\n"}, {"example_id": "power:4", "source": "power('a', 2)\n", "want": "Traceback (most recent call last):\n ...\nTypeError: can't multiply sequence by non-int of type 'str'\n"}, {"example_id": "power:5", "source": "power('a', 'b')\n", "want": "Traceback (most recent call last):\n ...\nTypeError: unsupported operand type(s) for -: 'str' and 'int'\n"}, {"example_id": "power:6", "source": "power(2, -1)\n", "want": "Traceback (most recent call last):\n ...\nRecursionError: maximum recursion depth exceeded\n"}, {"example_id": "power:7", "source": "power(0, 0)\n", "want": "1\n"}, {"example_id": "power:8", "source": "power(0, 1)\n", "want": "0\n"}, {"example_id": "power:9", "source": "power(5,6)\n", "want": "15625\n"}, {"example_id": "power:10", "source": "power(23, 12)\n", "want": "21914624432020321\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-c16ead021c988355", "tree_sha256": "b10f16474c8b9bba30e88a1357725c79986ee0af0bf7e45d36476d2bd4257893", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/power_using_recursion.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def signum(num: float) -> int:\n \"\"\"\n Applies signum function on the number\n\n Custom test cases:\n >>> signum(-10)\n -1\n >>> signum(10)\n 1\n >>> signum(0)\n 0\n >>> signum(-20.5)\n -1\n >>> signum(20.5)\n 1\n >>> signum(-1e-6)\n -1\n >>> signum(1e-6)\n 1\n >>> signum(\"Hello\")\n Traceback (most recent call last):\n ...\n TypeError: '<' not supported between instances of 'str' and 'int'\n >>> signum([])\n Traceback (most recent call last):\n ...\n TypeError: '<' not supported between instances of 'list' and 'int'\n \"\"\"\n if num < 0:\n return -1\n return 1 if num else 0\n"}, "sha256": "b4915a1473356c9c2028027fd53f7e7755543e227fdcc9c44fae4d8a29c19e39"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "b4915a1473356c9c2028027fd53f7e7755543e227fdcc9c44fae4d8a29c19e39", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "34426901a2ae380b837b02c74fc1fb4426fc968c8c1147fc3c71f88572eeb7bd", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00347"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00347", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def signum(num: float) -> int:\n \"\"\"\n Applies signum function on the number\n\n Custom test cases:\n >>> signum(-10)\n -1\n >>> signum(10)\n 1\n >>> signum(0)\n 0\n >>> signum(-20.5)\n -1\n >>> signum(20.5)\n 1\n >>> signum(-1e-6)\n -1\n >>> signum(1e-6)\n 1\n >>> signum(\"Hello\")\n Traceback (most recent call last):\n ...\n TypeError: '<' not supported between instances of 'str' and 'int'\n >>> signum([])\n Traceback (most recent call last):\n ...\n TypeError: '<' not supported between instances of 'list' and 'int'\n \"\"\"\n if num <= 0:\n return -1\n return 1 if num else 0\n"}, "sha256": "01d479de9e3f97ff00b9d268c147db1f314c49e6af23ecd419ad5b5f0f6d7400"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "signum:2", "got": "-1\n", "source": "signum(0)\n", "truncated": false, "want": "0\n"}, {"example_id": "signum:7", "got": "TypeError: '<=' not supported between instances of 'str' and 'int'", "source": "signum(\"Hello\")\n", "truncated": false, "want": "Traceback (most recent call last):\n ...\nTypeError: '<' not supported between instances of 'str' and 'int'\n"}, {"example_id": "signum:8", "got": "TypeError: '<=' not supported between instances of 'list' and 'int'", "source": "signum([])\n", "truncated": false, "want": "Traceback (most recent call last):\n ...\nTypeError: '<' not supported between instances of 'list' and 'int'\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "comparison_boundary", "seed": 7, "span": {"col_offset": 11, "end_byte": 599, "lineno": 29, "node": "Compare", "node_col_offset": 7, "node_end_col_offset": 14, "node_end_lineno": 29, "node_lineno": 29, "op_index": 0, "original_text": "<", "replacement_text": "<=", "start_byte": 598}}, "public_tests": {"examples": [{"example_id": "signum:0", "source": "signum(-10)\n", "want": "-1\n"}, {"example_id": "signum:1", "source": "signum(10)\n", "want": "1\n"}, {"example_id": "signum:2", "source": "signum(0)\n", "want": "0\n"}, {"example_id": "signum:3", "source": "signum(-20.5)\n", "want": "-1\n"}, {"example_id": "signum:4", "source": "signum(20.5)\n", "want": "1\n"}, {"example_id": "signum:5", "source": "signum(-1e-6)\n", "want": "-1\n"}, {"example_id": "signum:6", "source": "signum(1e-6)\n", "want": "1\n"}, {"example_id": "signum:7", "source": "signum(\"Hello\")\n", "want": "Traceback (most recent call last):\n ...\nTypeError: '<' not supported between instances of 'str' and 'int'\n"}, {"example_id": "signum:8", "source": "signum([])\n", "want": "Traceback (most recent call last):\n ...\nTypeError: '<' not supported between instances of 'list' and 'int'\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-413d4d00136fd20a", "tree_sha256": "b4915a1473356c9c2028027fd53f7e7755543e227fdcc9c44fae4d8a29c19e39", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/signum.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def decimal_to_negative_base_2(num: int) -> int:\n \"\"\"\n This function returns the number negative base 2\n of the decimal number of the input data.\n\n Args:\n int: The decimal number to convert.\n\n Returns:\n int: The negative base 2 number.\n\n Examples:\n >>> decimal_to_negative_base_2(0)\n 0\n >>> decimal_to_negative_base_2(-19)\n 111101\n >>> decimal_to_negative_base_2(4)\n 100\n >>> decimal_to_negative_base_2(7)\n 11011\n \"\"\"\n if num == 0:\n return 0\n ans = \"\"\n while num != 0:\n num, rem = divmod(num, -2)\n if rem < 0:\n rem += 2\n num += 1\n ans = str(rem) + ans\n return int(ans)\n"}, "sha256": "34f3860c63da8675a104dd5f4b5ed941cf7c9fa33f066e0b881a822527f10296"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "34f3860c63da8675a104dd5f4b5ed941cf7c9fa33f066e0b881a822527f10296", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "a75d26a44a8d98c246ad582773b0c42790c2dc4cc18cb8a0bc58f79310caafff", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00349"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00349", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def decimal_to_negative_base_2(num: int) -> int:\n \"\"\"\n This function returns the number negative base 2\n of the decimal number of the input data.\n\n Args:\n int: The decimal number to convert.\n\n Returns:\n int: The negative base 2 number.\n\n Examples:\n >>> decimal_to_negative_base_2(0)\n 0\n >>> decimal_to_negative_base_2(-19)\n 111101\n >>> decimal_to_negative_base_2(4)\n 100\n >>> decimal_to_negative_base_2(7)\n 11011\n \"\"\"\n if num != 0:\n return 0\n ans = \"\"\n while num != 0:\n num, rem = divmod(num, -2)\n if rem < 0:\n rem += 2\n num += 1\n ans = str(rem) + ans\n return int(ans)\n"}, "sha256": "ebb81ce95d5dc5c186981359d32a7f53cd94d313841b6490d544801635e9bd37"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "decimal_to_negative_base_2:0", "got": "ValueError: invalid literal for int() with base 10: ''", "source": "decimal_to_negative_base_2(0)\n", "truncated": false, "want": "0\n"}, {"example_id": "decimal_to_negative_base_2:1", "got": "0\n", "source": "decimal_to_negative_base_2(-19)\n", "truncated": false, "want": "111101\n"}, {"example_id": "decimal_to_negative_base_2:2", "got": "0\n", "source": "decimal_to_negative_base_2(4)\n", "truncated": false, "want": "100\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "boolean_condition", "seed": 7, "span": {"col_offset": 11, "end_byte": 526, "lineno": 22, "node": "Compare", "node_col_offset": 7, "node_end_col_offset": 15, "node_end_lineno": 22, "node_lineno": 22, "op_index": 0, "original_text": "==", "replacement_text": "!=", "start_byte": 524}}, "public_tests": {"examples": [{"example_id": "decimal_to_negative_base_2:0", "source": "decimal_to_negative_base_2(0)\n", "want": "0\n"}, {"example_id": "decimal_to_negative_base_2:1", "source": "decimal_to_negative_base_2(-19)\n", "want": "111101\n"}, {"example_id": "decimal_to_negative_base_2:2", "source": "decimal_to_negative_base_2(4)\n", "want": "100\n"}, {"example_id": "decimal_to_negative_base_2:3", "source": "decimal_to_negative_base_2(7)\n", "want": "11011\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-483bcdc4ee29d0ea", "tree_sha256": "34f3860c63da8675a104dd5f4b5ed941cf7c9fa33f066e0b881a822527f10296", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/base_neg2_conversion.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def multiplicative_persistence(num: int) -> int:\n \"\"\"\n Return the persistence of a given number.\n\n https://en.wikipedia.org/wiki/Persistence_of_a_number\n\n >>> multiplicative_persistence(217)\n 2\n >>> multiplicative_persistence(-1)\n Traceback (most recent call last):\n ...\n ValueError: multiplicative_persistence() does not accept negative values\n >>> multiplicative_persistence(\"long number\")\n Traceback (most recent call last):\n ...\n ValueError: multiplicative_persistence() only accepts integral values\n \"\"\"\n\n if not isinstance(num, int):\n raise ValueError(\"multiplicative_persistence() only accepts integral values\")\n if num < 0:\n raise ValueError(\"multiplicative_persistence() does not accept negative values\")\n\n steps = 0\n num_string = str(num)\n\n while len(num_string) != 1:\n numbers = [int(i) for i in num_string]\n\n total = 1\n for i in range(len(numbers)):\n total *= numbers[i]\n\n num_string = str(total)\n\n steps += 1\n return steps\n"}, "sha256": "4be6e0123044dc9d22bdf60f21fd6635f6e952c7436fa079d69d937bf4ed8d41"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "4be6e0123044dc9d22bdf60f21fd6635f6e952c7436fa079d69d937bf4ed8d41", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "c694a133d33aba368e4847b4c52d220d4cc770b263a03af0a65a9332f80163c7", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00350"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00350", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 8, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def multiplicative_persistence(num: int) -> int:\n \"\"\"\n Return the persistence of a given number.\n\n https://en.wikipedia.org/wiki/Persistence_of_a_number\n\n >>> multiplicative_persistence(217)\n 2\n >>> multiplicative_persistence(-1)\n Traceback (most recent call last):\n ...\n ValueError: multiplicative_persistence() does not accept negative values\n >>> multiplicative_persistence(\"long number\")\n Traceback (most recent call last):\n ...\n ValueError: multiplicative_persistence() only accepts integral values\n \"\"\"\n\n if not isinstance(num, int):\n raise ValueError(\"multiplicative_persistence() only accepts integral values\")\n if num < 0:\n raise ValueError(\"multiplicative_persistence() does not accept negative values\")\n\n steps = 0\n num_string = str(num)\n\n while len(num_string) != 1:\n numbers = [int(i) for i in num_string]\n\n total = 1\n for i in range(len(numbers)):\n total *= numbers[i]\n\n num_string = str(total)\n\n steps += 1\n return steps - 1\n"}, "sha256": "4ad330df6a1edd0a0e3c79cbdf9f2e79856137613e0cba39b0bc890171cdc4a0"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "multiplicative_persistence:0", "got": "1\n", "source": "multiplicative_persistence(217)\n", "truncated": false, "want": "2\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 1063, "lineno": 37, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 16, "node_end_lineno": 37, "node_lineno": 37, "op_index": 0, "original_text": "steps", "replacement_text": "steps - 1", "start_byte": 1058}}, "public_tests": {"examples": [{"example_id": "multiplicative_persistence:0", "source": "multiplicative_persistence(217)\n", "want": "2\n"}, {"example_id": "multiplicative_persistence:1", "source": "multiplicative_persistence(-1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: multiplicative_persistence() does not accept negative values\n"}, {"example_id": "multiplicative_persistence:2", "source": "multiplicative_persistence(\"long number\")\n", "want": "Traceback (most recent call last):\n ...\nValueError: multiplicative_persistence() only accepts integral values\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-171cc41a163a164b", "tree_sha256": "4be6e0123044dc9d22bdf60f21fd6635f6e952c7436fa079d69d937bf4ed8d41", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/persistence.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def tribonacci(num: int) -> list[int]:\n \"\"\"\n Given a number, return first n Tribonacci Numbers.\n >>> tribonacci(5)\n [0, 0, 1, 1, 2]\n >>> tribonacci(8)\n [0, 0, 1, 1, 2, 4, 7, 13]\n \"\"\"\n dp = [0] * num\n dp[2] = 1\n\n for i in range(3, num):\n dp[i] = dp[i - 1] + dp[i - 2] + dp[i - 3]\n\n return dp\n"}, "sha256": "11c2f747774fd48844149a993e711eeceb7ec74681cda482ebc8721e18981331"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "11c2f747774fd48844149a993e711eeceb7ec74681cda482ebc8721e18981331", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "93d8e0fbbcc80868520d12d3f0f08e29dc857d297fe12d8a7f0ffd318e9d61e6", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00351"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00351", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 10, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def tribonacci(num: int) -> list[int]:\n \"\"\"\n Given a number, return first n Tribonacci Numbers.\n >>> tribonacci(5)\n [0, 0, 1, 1, 2]\n >>> tribonacci(8)\n [0, 0, 1, 1, 2, 4, 7, 13]\n \"\"\"\n dp = [0] * num\n dp[3] = 1\n\n for i in range(3, num):\n dp[i] = dp[i - 1] + dp[i - 2] + dp[i - 3]\n\n return dp\n"}, "sha256": "b6a582be4cf9acbba24166a387fa0e383cadc095dbd6f7644b5978db61a9b14c"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "tribonacci:0", "got": "[0, 0, 0, 0, 0]\n", "source": "tribonacci(5)\n", "truncated": false, "want": "[0, 0, 1, 1, 2]\n"}, {"example_id": "tribonacci:1", "got": "[0, 0, 0, 0, 0, 0, 0, 0]\n", "source": "tribonacci(8)\n", "truncated": false, "want": "[0, 0, 1, 1, 2, 4, 7, 13]\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "off_by_one", "seed": 7, "span": {"col_offset": 7, "end_byte": 231, "lineno": 10, "node": "Constant", "node_col_offset": 7, "node_end_col_offset": 8, "node_end_lineno": 10, "node_lineno": 10, "op_index": 0, "original_text": "2", "replacement_text": "3", "start_byte": 230}}, "public_tests": {"examples": [{"example_id": "tribonacci:0", "source": "tribonacci(5)\n", "want": "[0, 0, 1, 1, 2]\n"}, {"example_id": "tribonacci:1", "source": "tribonacci(8)\n", "want": "[0, 0, 1, 1, 2, 4, 7, 13]\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-9bec4770d14b620a", "tree_sha256": "11c2f747774fd48844149a993e711eeceb7ec74681cda482ebc8721e18981331", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:dynamic_programming/tribonacci.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "from __future__ import annotations\n\n\ndef allocation_num(number_of_bytes: int, partitions: int) -> list[str]:\n \"\"\"\n Divide a number of bytes into x partitions.\n :param number_of_bytes: the total of bytes.\n :param partitions: the number of partition need to be allocated.\n :return: list of bytes to be assigned to each worker thread\n\n >>> allocation_num(16647, 4)\n ['1-4161', '4162-8322', '8323-12483', '12484-16647']\n >>> allocation_num(50000, 5)\n ['1-10000', '10001-20000', '20001-30000', '30001-40000', '40001-50000']\n >>> allocation_num(888, 999)\n Traceback (most recent call last):\n ...\n ValueError: partitions can not > number_of_bytes!\n >>> allocation_num(888, -4)\n Traceback (most recent call last):\n ...\n ValueError: partitions must be a positive number!\n \"\"\"\n if partitions <= 0:\n raise ValueError(\"partitions must be a positive number!\")\n if partitions > number_of_bytes:\n raise ValueError(\"partitions can not > number_of_bytes!\")\n bytes_per_partition = number_of_bytes // partitions\n allocation_list = []\n for i in range(partitions):\n start_bytes = i * bytes_per_partition + 1\n end_bytes = (\n number_of_bytes if i == partitions - 1 else (i + 1) * bytes_per_partition\n )\n allocation_list.append(f\"{start_bytes}-{end_bytes}\")\n return allocation_list\n"}, "sha256": "5cba465d43ec399ef3861a20bad2c508ed10b61e479c7d87437b8cee768e0edb"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "5cba465d43ec399ef3861a20bad2c508ed10b61e479c7d87437b8cee768e0edb", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "5e5572552d69764777ac591865f4dae4ddd9f4927e1d557ec6ee8bfc0f8200af", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00358"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00358", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "from __future__ import annotations\n\n\ndef allocation_num(number_of_bytes: int, partitions: int) -> list[str]:\n \"\"\"\n Divide a number of bytes into x partitions.\n :param number_of_bytes: the total of bytes.\n :param partitions: the number of partition need to be allocated.\n :return: list of bytes to be assigned to each worker thread\n\n >>> allocation_num(16647, 4)\n ['1-4161', '4162-8322', '8323-12483', '12484-16647']\n >>> allocation_num(50000, 5)\n ['1-10000', '10001-20000', '20001-30000', '30001-40000', '40001-50000']\n >>> allocation_num(888, 999)\n Traceback (most recent call last):\n ...\n ValueError: partitions can not > number_of_bytes!\n >>> allocation_num(888, -4)\n Traceback (most recent call last):\n ...\n ValueError: partitions must be a positive number!\n \"\"\"\n if partitions <= 0:\n raise ValueError(\"partitions must be a positive number!\")\n if partitions > number_of_bytes:\n raise ValueError(\"partitions can not > number_of_bytes!\")\n bytes_per_partition = number_of_bytes // partitions\n allocation_list = []\n for i in range(partitions):\n start_bytes = i * bytes_per_partition + 1\n end_bytes = (\n number_of_bytes if i == partitions - 1 else (i - 1) * bytes_per_partition\n )\n allocation_list.append(f\"{start_bytes}-{end_bytes}\")\n return allocation_list\n"}, "sha256": "1bd7a6d68de10bc40e379e7226e987d565531aae4c9928fce53cc48c9dad9223"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "allocation_num:0", "got": "['1--4161', '4162-0', '8323-4161', '12484-16647']\n", "source": "allocation_num(16647, 4)\n", "truncated": false, "want": "['1-4161', '4162-8322', '8323-12483', '12484-16647']\n"}, {"example_id": "allocation_num:1", "got": "['1--10000', '10001-0', '20001-10000', '30001-20000', '40001-50000']\n", "source": "allocation_num(50000, 5)\n", "truncated": false, "want": "['1-10000', '10001-20000', '20001-30000', '30001-40000', '40001-50000']\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 59, "end_byte": 1267, "lineno": 33, "node": "BinOp", "node_col_offset": 57, "node_end_col_offset": 62, "node_end_lineno": 33, "node_lineno": 33, "op_index": 0, "original_text": "+", "replacement_text": "-", "start_byte": 1266}}, "public_tests": {"examples": [{"example_id": "allocation_num:0", "source": "allocation_num(16647, 4)\n", "want": "['1-4161', '4162-8322', '8323-12483', '12484-16647']\n"}, {"example_id": "allocation_num:1", "source": "allocation_num(50000, 5)\n", "want": "['1-10000', '10001-20000', '20001-30000', '30001-40000', '40001-50000']\n"}, {"example_id": "allocation_num:2", "source": "allocation_num(888, 999)\n", "want": "Traceback (most recent call last):\n ...\nValueError: partitions can not > number_of_bytes!\n"}, {"example_id": "allocation_num:3", "source": "allocation_num(888, -4)\n", "want": "Traceback (most recent call last):\n ...\nValueError: partitions must be a positive number!\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-4087334913238749", "tree_sha256": "5cba465d43ec399ef3861a20bad2c508ed10b61e479c7d87437b8cee768e0edb", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/allocation_number.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def sum_of_series(first_term: int, common_diff: int, num_of_terms: int) -> float:\n \"\"\"\n Find the sum of n terms in an arithmetic progression.\n\n >>> sum_of_series(1, 1, 10)\n 55.0\n >>> sum_of_series(1, 10, 100)\n 49600.0\n \"\"\"\n total = (num_of_terms / 2) * (2 * first_term + (num_of_terms - 1) * common_diff)\n # formula for sum of series\n return total\n"}, "sha256": "5274639e3fe46c7b9d296294131476bc50d3dfde5124cfc301303c1e7ee1fe63"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "5274639e3fe46c7b9d296294131476bc50d3dfde5124cfc301303c1e7ee1fe63", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "dc5dae9f20abc9ca8aa3003c5ab6d0b875704cc398ccc020abc9b83ee07b9880", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00359"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00359", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def sum_of_series(first_term: int, common_diff: int, num_of_terms: int) -> float:\n \"\"\"\n Find the sum of n terms in an arithmetic progression.\n\n >>> sum_of_series(1, 1, 10)\n 55.0\n >>> sum_of_series(1, 10, 100)\n 49600.0\n \"\"\"\n total = (num_of_terms / 2) // (2 * first_term + (num_of_terms - 1) * common_diff)\n # formula for sum of series\n return total\n"}, "sha256": "bbe9bcbe84a87e531697383749c9f81a38d1a909bf87a83b015d262daa7c4488"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "sum_of_series:0", "got": "0.0\n", "source": "sum_of_series(1, 1, 10)\n", "truncated": false, "want": "55.0\n"}, {"example_id": "sum_of_series:1", "got": "0.0\n", "source": "sum_of_series(1, 10, 100)\n", "truncated": false, "want": "49600.0\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 31, "end_byte": 276, "lineno": 10, "node": "BinOp", "node_col_offset": 12, "node_end_col_offset": 84, "node_end_lineno": 10, "node_lineno": 10, "op_index": 0, "original_text": "*", "replacement_text": "//", "start_byte": 275}}, "public_tests": {"examples": [{"example_id": "sum_of_series:0", "source": "sum_of_series(1, 1, 10)\n", "want": "55.0\n"}, {"example_id": "sum_of_series:1", "source": "sum_of_series(1, 10, 100)\n", "want": "49600.0\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-12589f23c8294445", "tree_sha256": "5274639e3fe46c7b9d296294131476bc50d3dfde5124cfc301303c1e7ee1fe63", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/sum_of_arithmetic_series.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def is_bit_set(number: int, position: int) -> bool:\n \"\"\"\n Is the bit at position set?\n\n Details: Shift the bit at position to be the first (smallest) bit.\n Then check if the first bit is set by anding the shifted number with 1.\n\n >>> is_bit_set(0b1010, 0)\n False\n >>> is_bit_set(0b1010, 1)\n True\n >>> is_bit_set(0b1010, 2)\n False\n >>> is_bit_set(0b1010, 3)\n True\n >>> is_bit_set(0b0, 17)\n False\n \"\"\"\n return ((number >> position) & 1) == 1\n"}, "sha256": "d6f63aa4e9bdb9c5a57a851f92c6406124356841c11101f459f054a5cf57bc48"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "d6f63aa4e9bdb9c5a57a851f92c6406124356841c11101f459f054a5cf57bc48", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "105a546f89f0dd5b695c4a7d1bbc8d146f69e15d778911054a386b81e51a570a", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00363"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00363", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def is_bit_set(number: int, position: int) -> bool:\n \"\"\"\n Is the bit at position set?\n\n Details: Shift the bit at position to be the first (smallest) bit.\n Then check if the first bit is set by anding the shifted number with 1.\n\n >>> is_bit_set(0b1010, 0)\n False\n >>> is_bit_set(0b1010, 1)\n True\n >>> is_bit_set(0b1010, 2)\n False\n >>> is_bit_set(0b1010, 3)\n True\n >>> is_bit_set(0b0, 17)\n False\n \"\"\"\n return ((number >> position) & 1) == 0\n"}, "sha256": "08b6a71f6c2f9898b520a3e543da96a784375ef5f0ed101c0de1682b723564b6"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "is_bit_set:0", "got": "True\n", "source": "is_bit_set(0b1010, 0)\n", "truncated": false, "want": "False\n"}, {"example_id": "is_bit_set:1", "got": "False\n", "source": "is_bit_set(0b1010, 1)\n", "truncated": false, "want": "True\n"}, {"example_id": "is_bit_set:2", "got": "True\n", "source": "is_bit_set(0b1010, 2)\n", "truncated": false, "want": "False\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "off_by_one", "seed": 7, "span": {"col_offset": 41, "end_byte": 487, "lineno": 19, "node": "Constant", "node_col_offset": 41, "node_end_col_offset": 42, "node_end_lineno": 19, "node_lineno": 19, "op_index": 0, "original_text": "1", "replacement_text": "0", "start_byte": 486}}, "public_tests": {"examples": [{"example_id": "is_bit_set:0", "source": "is_bit_set(0b1010, 0)\n", "want": "False\n"}, {"example_id": "is_bit_set:1", "source": "is_bit_set(0b1010, 1)\n", "want": "True\n"}, {"example_id": "is_bit_set:2", "source": "is_bit_set(0b1010, 2)\n", "want": "False\n"}, {"example_id": "is_bit_set:3", "source": "is_bit_set(0b1010, 3)\n", "want": "True\n"}, {"example_id": "is_bit_set:4", "source": "is_bit_set(0b0, 17)\n", "want": "False\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-36a5168b87a800bd", "tree_sha256": "d6f63aa4e9bdb9c5a57a851f92c6406124356841c11101f459f054a5cf57bc48", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:bit_manipulation/single_bit_manipulation_operations.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def dp_match(text: str, pattern: str) -> bool:\n r\"\"\"\n Dynamic programming matching algorithm.\n\n | Time complexity: O(\\|text\\| * \\|pattern\\|)\n | Space complexity: O(\\|text\\| * \\|pattern\\|)\n\n :param text: Text to match.\n :param pattern: Pattern to match.\n :return: ``True`` if `text` matches `pattern`, ``False`` otherwise.\n\n >>> dp_match('abc', 'a.c')\n True\n >>> dp_match('abc', 'af*.c')\n True\n >>> dp_match('abc', 'a.c*')\n True\n >>> dp_match('abc', 'a.c*d')\n False\n >>> dp_match('aa', '.*')\n True\n \"\"\"\n m = len(text)\n n = len(pattern)\n dp = [[False for _ in range(n + 1)] for _ in range(m + 1)]\n dp[0][0] = True\n\n for j in range(1, n + 1):\n dp[0][j] = pattern[j - 1] == \"*\" and dp[0][j - 2]\n\n for i in range(1, m + 1):\n for j in range(1, n + 1):\n if pattern[j - 1] in {\".\", text[i - 1]}:\n dp[i][j] = dp[i - 1][j - 1]\n elif pattern[j - 1] == \"*\":\n dp[i][j] = dp[i][j - 2]\n if pattern[j - 2] in {\".\", text[i - 1]}:\n dp[i][j] |= dp[i - 1][j]\n else:\n dp[i][j] = False\n\n return dp[m][n]\n"}, "sha256": "4c67111780bb70660d8a61404df8f3683ac6c79e280bc802dfdc701ac85e3a5a"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "4c67111780bb70660d8a61404df8f3683ac6c79e280bc802dfdc701ac85e3a5a", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "da4f7e0d7a83f5bbf03a680c379b526233a895a65735e1461da958c7a077a5fa", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00371"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00371", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def dp_match(text: str, pattern: str) -> bool:\n r\"\"\"\n Dynamic programming matching algorithm.\n\n | Time complexity: O(\\|text\\| * \\|pattern\\|)\n | Space complexity: O(\\|text\\| * \\|pattern\\|)\n\n :param text: Text to match.\n :param pattern: Pattern to match.\n :return: ``True`` if `text` matches `pattern`, ``False`` otherwise.\n\n >>> dp_match('abc', 'a.c')\n True\n >>> dp_match('abc', 'af*.c')\n True\n >>> dp_match('abc', 'a.c*')\n True\n >>> dp_match('abc', 'a.c*d')\n False\n >>> dp_match('aa', '.*')\n True\n \"\"\"\n m = len(text)\n n = len(pattern)\n dp = [[False for _ in range(n + 1)] for _ in range(m + 1)]\n dp[0][0] = True\n\n for j in range(1, n + 1):\n dp[0][j] = pattern[j - 1] == \"*\" and dp[0][j - 2]\n\n for i in range(1, m + 1):\n for j in range(1, n - 1):\n if pattern[j - 1] in {\".\", text[i - 1]}:\n dp[i][j] = dp[i - 1][j - 1]\n elif pattern[j - 1] == \"*\":\n dp[i][j] = dp[i][j - 2]\n if pattern[j - 2] in {\".\", text[i - 1]}:\n dp[i][j] |= dp[i - 1][j]\n else:\n dp[i][j] = False\n\n return dp[m][n]\n"}, "sha256": "ac638484fb9eae22e5bfbfb40b0915a72cc7a2a9803201b91dc3224e577b90e7"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "dp_match:0", "got": "False\n", "source": "dp_match('abc', 'a.c')\n", "truncated": false, "want": "True\n"}, {"example_id": "dp_match:1", "got": "False\n", "source": "dp_match('abc', 'af*.c')\n", "truncated": false, "want": "True\n"}, {"example_id": "dp_match:2", "got": "False\n", "source": "dp_match('abc', 'a.c*')\n", "truncated": false, "want": "True\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 28, "end_byte": 827, "lineno": 32, "node": "BinOp", "node_col_offset": 26, "node_end_col_offset": 31, "node_end_lineno": 32, "node_lineno": 32, "op_index": 0, "original_text": "+", "replacement_text": "-", "start_byte": 826}}, "public_tests": {"examples": [{"example_id": "dp_match:0", "source": "dp_match('abc', 'a.c')\n", "want": "True\n"}, {"example_id": "dp_match:1", "source": "dp_match('abc', 'af*.c')\n", "want": "True\n"}, {"example_id": "dp_match:2", "source": "dp_match('abc', 'a.c*')\n", "want": "True\n"}, {"example_id": "dp_match:3", "source": "dp_match('abc', 'a.c*d')\n", "want": "False\n"}, {"example_id": "dp_match:4", "source": "dp_match('aa', '.*')\n", "want": "True\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-3e87adc7aca54dfc", "tree_sha256": "4c67111780bb70660d8a61404df8f3683ac6c79e280bc802dfdc701ac85e3a5a", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:dynamic_programming/regex_match.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def abs_max_sort(x: list[int]) -> int:\n \"\"\"\n >>> abs_max_sort([0,5,1,11])\n 11\n >>> abs_max_sort([3,-10,-2])\n -10\n >>> abs_max_sort([])\n Traceback (most recent call last):\n ...\n ValueError: abs_max_sort() arg is an empty sequence\n \"\"\"\n if len(x) == 0:\n raise ValueError(\"abs_max_sort() arg is an empty sequence\")\n return sorted(x, key=abs)[-1]\n"}, "sha256": "3d86db9a2ccfeaa48ecd29926e8d36c396b5741483a233da5ae06ea11b791fe2"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "3d86db9a2ccfeaa48ecd29926e8d36c396b5741483a233da5ae06ea11b791fe2", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "3df559d05f4fd599ff143e16169f39f8806b575cce65f9305b2ef5208280f2b3", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00376"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00376", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 12, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def abs_max_sort(x: list[int]) -> int:\n \"\"\"\n >>> abs_max_sort([0,5,1,11])\n 11\n >>> abs_max_sort([3,-10,-2])\n -10\n >>> abs_max_sort([])\n Traceback (most recent call last):\n ...\n ValueError: abs_max_sort() arg is an empty sequence\n \"\"\"\n if len(x) == 0:\n raise ValueError(\"abs_max_sort() arg is an empty sequence\")\n return sorted(x, key=abs)[-1] + 1\n"}, "sha256": "84b41d92ec5660ce10e30a9b8b4038818dc7aecca53b9fea77dbff5639eb6d84"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "abs_max_sort:0", "got": "12\n", "source": "abs_max_sort([0,5,1,11])\n", "truncated": false, "want": "11\n"}, {"example_id": "abs_max_sort:1", "got": "-9\n", "source": "abs_max_sort([3,-10,-2])\n", "truncated": false, "want": "-10\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 389, "lineno": 14, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 33, "node_end_lineno": 14, "node_lineno": 14, "op_index": 0, "original_text": "sorted(x, key=abs)[-1]", "replacement_text": "sorted(x, key=abs)[-1] + 1", "start_byte": 367}}, "public_tests": {"examples": [{"example_id": "abs_max_sort:0", "source": "abs_max_sort([0,5,1,11])\n", "want": "11\n"}, {"example_id": "abs_max_sort:1", "source": "abs_max_sort([3,-10,-2])\n", "want": "-10\n"}, {"example_id": "abs_max_sort:2", "source": "abs_max_sort([])\n", "want": "Traceback (most recent call last):\n ...\nValueError: abs_max_sort() arg is an empty sequence\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-6787677ac4ed089f", "tree_sha256": "3d86db9a2ccfeaa48ecd29926e8d36c396b5741483a233da5ae06ea11b791fe2", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/abs.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def moles_to_pressure(volume: float, moles: float, temperature: float) -> float:\n \"\"\"\n Convert moles to pressure.\n Ideal gas laws are used.\n Temperature is taken in kelvin.\n Volume is taken in litres.\n Pressure has atm as SI unit.\n\n Wikipedia reference: https://en.wikipedia.org/wiki/Gas_laws\n Wikipedia reference: https://en.wikipedia.org/wiki/Pressure\n Wikipedia reference: https://en.wikipedia.org/wiki/Temperature\n\n >>> moles_to_pressure(0.82, 3, 300)\n 90\n >>> moles_to_pressure(8.2, 5, 200)\n 10\n \"\"\"\n return round(float((moles * 0.0821 * temperature) / (volume)))\n"}, "sha256": "e0f7f867691cd80f9a47a0e482cb40d3e5dda6d7e3c8feff30319559480f85ad"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "e0f7f867691cd80f9a47a0e482cb40d3e5dda6d7e3c8feff30319559480f85ad", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "24f5f4df878d6ce0d48fe370dbe12317fc66222960981869400fb9542d0f64a8", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00377"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00377", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def moles_to_pressure(volume: float, moles: float, temperature: float) -> float:\n \"\"\"\n Convert moles to pressure.\n Ideal gas laws are used.\n Temperature is taken in kelvin.\n Volume is taken in litres.\n Pressure has atm as SI unit.\n\n Wikipedia reference: https://en.wikipedia.org/wiki/Gas_laws\n Wikipedia reference: https://en.wikipedia.org/wiki/Pressure\n Wikipedia reference: https://en.wikipedia.org/wiki/Temperature\n\n >>> moles_to_pressure(0.82, 3, 300)\n 90\n >>> moles_to_pressure(8.2, 5, 200)\n 10\n \"\"\"\n return round(float((moles * 0.0821 // temperature) / (volume)))\n"}, "sha256": "b799369ac07913af618fbaa03d106dcc4ebe04f4cce94cb49b3548bf04e6e35a"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "moles_to_pressure:0", "got": "0\n", "source": "moles_to_pressure(0.82, 3, 300)\n", "truncated": false, "want": "90\n"}, {"example_id": "moles_to_pressure:1", "got": "0\n", "source": "moles_to_pressure(8.2, 5, 200)\n", "truncated": false, "want": "10\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 39, "end_byte": 609, "lineno": 18, "node": "BinOp", "node_col_offset": 24, "node_end_col_offset": 52, "node_end_lineno": 18, "node_lineno": 18, "op_index": 0, "original_text": "*", "replacement_text": "//", "start_byte": 608}}, "public_tests": {"examples": [{"example_id": "moles_to_pressure:0", "source": "moles_to_pressure(0.82, 3, 300)\n", "want": "90\n"}, {"example_id": "moles_to_pressure:1", "source": "moles_to_pressure(8.2, 5, 200)\n", "want": "10\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-6d62a38627cc4a04", "tree_sha256": "e0f7f867691cd80f9a47a0e482cb40d3e5dda6d7e3c8feff30319559480f85ad", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:conversions/molecular_chemistry.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def binary_xor(a: int, b: int) -> str:\n \"\"\"\n Take in 2 integers, convert them to binary,\n return a binary number that is the\n result of a binary xor operation on the integers provided.\n\n >>> binary_xor(25, 32)\n '0b111001'\n >>> binary_xor(37, 50)\n '0b010111'\n >>> binary_xor(21, 30)\n '0b01011'\n >>> binary_xor(58, 73)\n '0b1110011'\n >>> binary_xor(0, 255)\n '0b11111111'\n >>> binary_xor(256, 256)\n '0b000000000'\n >>> binary_xor(0, -1)\n Traceback (most recent call last):\n ...\n ValueError: the value of both inputs must be positive\n >>> binary_xor(0, 1.1)\n Traceback (most recent call last):\n ...\n TypeError: 'float' object cannot be interpreted as an integer\n >>> binary_xor(\"0\", \"1\")\n Traceback (most recent call last):\n ...\n TypeError: '<' not supported between instances of 'str' and 'int'\n \"\"\"\n if a < 0 or b < 0:\n raise ValueError(\"the value of both inputs must be positive\")\n\n a_binary = str(bin(a))[2:] # remove the leading \"0b\"\n b_binary = str(bin(b))[2:] # remove the leading \"0b\"\n\n max_len = max(len(a_binary), len(b_binary))\n\n return \"0b\" + \"\".join(\n str(int(char_a != char_b))\n for char_a, char_b in zip(a_binary.zfill(max_len), b_binary.zfill(max_len))\n )\n"}, "sha256": "c21b0512e19c50f04add129af1e7cb55f6d92fc3989fe9f09226c2aee89e4835"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "c21b0512e19c50f04add129af1e7cb55f6d92fc3989fe9f09226c2aee89e4835", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "66fa9675843261317487ae6cc5ed17ba4574471a7bb303d7682a2f6177733df1", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00378"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00378", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def binary_xor(a: int, b: int) -> str:\n \"\"\"\n Take in 2 integers, convert them to binary,\n return a binary number that is the\n result of a binary xor operation on the integers provided.\n\n >>> binary_xor(25, 32)\n '0b111001'\n >>> binary_xor(37, 50)\n '0b010111'\n >>> binary_xor(21, 30)\n '0b01011'\n >>> binary_xor(58, 73)\n '0b1110011'\n >>> binary_xor(0, 255)\n '0b11111111'\n >>> binary_xor(256, 256)\n '0b000000000'\n >>> binary_xor(0, -1)\n Traceback (most recent call last):\n ...\n ValueError: the value of both inputs must be positive\n >>> binary_xor(0, 1.1)\n Traceback (most recent call last):\n ...\n TypeError: 'float' object cannot be interpreted as an integer\n >>> binary_xor(\"0\", \"1\")\n Traceback (most recent call last):\n ...\n TypeError: '<' not supported between instances of 'str' and 'int'\n \"\"\"\n if a < 1 or b < 0:\n raise ValueError(\"the value of both inputs must be positive\")\n\n a_binary = str(bin(a))[2:] # remove the leading \"0b\"\n b_binary = str(bin(b))[2:] # remove the leading \"0b\"\n\n max_len = max(len(a_binary), len(b_binary))\n\n return \"0b\" + \"\".join(\n str(int(char_a != char_b))\n for char_a, char_b in zip(a_binary.zfill(max_len), b_binary.zfill(max_len))\n )\n"}, "sha256": "4f6d168d3b5e5af5e3afdc99e6dcc16d9d15a957d41be212252d7b6743174d60"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "binary_xor:4", "got": "ValueError: the value of both inputs must be positive", "source": "binary_xor(0, 255)\n", "truncated": false, "want": "'0b11111111'\n"}, {"example_id": "binary_xor:7", "got": "ValueError: the value of both inputs must be positive", "source": "binary_xor(0, 1.1)\n", "truncated": false, "want": "Traceback (most recent call last):\n ...\nTypeError: 'float' object cannot be interpreted as an integer\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "off_by_one", "seed": 7, "span": {"col_offset": 11, "end_byte": 906, "lineno": 32, "node": "Constant", "node_col_offset": 11, "node_end_col_offset": 12, "node_end_lineno": 32, "node_lineno": 32, "op_index": 0, "original_text": "0", "replacement_text": "1", "start_byte": 905}}, "public_tests": {"examples": [{"example_id": "binary_xor:0", "source": "binary_xor(25, 32)\n", "want": "'0b111001'\n"}, {"example_id": "binary_xor:1", "source": "binary_xor(37, 50)\n", "want": "'0b010111'\n"}, {"example_id": "binary_xor:2", "source": "binary_xor(21, 30)\n", "want": "'0b01011'\n"}, {"example_id": "binary_xor:3", "source": "binary_xor(58, 73)\n", "want": "'0b1110011'\n"}, {"example_id": "binary_xor:4", "source": "binary_xor(0, 255)\n", "want": "'0b11111111'\n"}, {"example_id": "binary_xor:5", "source": "binary_xor(256, 256)\n", "want": "'0b000000000'\n"}, {"example_id": "binary_xor:6", "source": "binary_xor(0, -1)\n", "want": "Traceback (most recent call last):\n ...\nValueError: the value of both inputs must be positive\n"}, {"example_id": "binary_xor:7", "source": "binary_xor(0, 1.1)\n", "want": "Traceback (most recent call last):\n ...\nTypeError: 'float' object cannot be interpreted as an integer\n"}, {"example_id": "binary_xor:8", "source": "binary_xor(\"0\", \"1\")\n", "want": "Traceback (most recent call last):\n ...\nTypeError: '<' not supported between instances of 'str' and 'int'\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-1d6ff1bdbf006041", "tree_sha256": "c21b0512e19c50f04add129af1e7cb55f6d92fc3989fe9f09226c2aee89e4835", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:bit_manipulation/binary_xor_operator.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def sentinel_linear_search(sequence, target):\n \"\"\"Pure implementation of sentinel linear search algorithm in Python\n\n :param sequence: some sequence with comparable items\n :param target: item value to search\n :return: index of found item or None if item is not found\n\n Examples:\n >>> sentinel_linear_search([0, 5, 7, 10, 15], 0)\n 0\n\n >>> sentinel_linear_search([0, 5, 7, 10, 15], 15)\n 4\n\n >>> sentinel_linear_search([0, 5, 7, 10, 15], 5)\n 1\n\n >>> sentinel_linear_search([0, 5, 7, 10, 15], 6)\n\n \"\"\"\n sequence.append(target)\n\n index = 0\n while sequence[index] != target:\n index += 1\n\n sequence.pop()\n\n if index == len(sequence):\n return None\n\n return index\n"}, "sha256": "83211e3d25a91bcb6c478c6ae9ed74a0b72cc6e5cae0dc86d67d6363fd4bbf9e"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "83211e3d25a91bcb6c478c6ae9ed74a0b72cc6e5cae0dc86d67d6363fd4bbf9e", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "d6b93434ce26b2e9edc74d1a6ab46a2e587f34550e164fbb414343750d41a958", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00381"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00381", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 24, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def sentinel_linear_search(sequence, target):\n \"\"\"Pure implementation of sentinel linear search algorithm in Python\n\n :param sequence: some sequence with comparable items\n :param target: item value to search\n :return: index of found item or None if item is not found\n\n Examples:\n >>> sentinel_linear_search([0, 5, 7, 10, 15], 0)\n 0\n\n >>> sentinel_linear_search([0, 5, 7, 10, 15], 15)\n 4\n\n >>> sentinel_linear_search([0, 5, 7, 10, 15], 5)\n 1\n\n >>> sentinel_linear_search([0, 5, 7, 10, 15], 6)\n\n \"\"\"\n sequence.append(target)\n\n index = 0\n while sequence[index] != target:\n index += 1\n\n sequence.pop()\n\n if index == len(sequence):\n return None\n\n return index - 1\n"}, "sha256": "3d43e330d26a02e05bec2ad1e097649d1e9d106e46a1f174d9fcf925c664fecf"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "sentinel_linear_search:0", "got": "-1\n", "source": "sentinel_linear_search([0, 5, 7, 10, 15], 0)\n", "truncated": false, "want": "0\n"}, {"example_id": "sentinel_linear_search:1", "got": "3\n", "source": "sentinel_linear_search([0, 5, 7, 10, 15], 15)\n", "truncated": false, "want": "4\n"}, {"example_id": "sentinel_linear_search:2", "got": "0\n", "source": "sentinel_linear_search([0, 5, 7, 10, 15], 5)\n", "truncated": false, "want": "1\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 725, "lineno": 32, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 16, "node_end_lineno": 32, "node_lineno": 32, "op_index": 0, "original_text": "index", "replacement_text": "index - 1", "start_byte": 720}}, "public_tests": {"examples": [{"example_id": "sentinel_linear_search:0", "source": "sentinel_linear_search([0, 5, 7, 10, 15], 0)\n", "want": "0\n"}, {"example_id": "sentinel_linear_search:1", "source": "sentinel_linear_search([0, 5, 7, 10, 15], 15)\n", "want": "4\n"}, {"example_id": "sentinel_linear_search:2", "source": "sentinel_linear_search([0, 5, 7, 10, 15], 5)\n", "want": "1\n"}, {"example_id": "sentinel_linear_search:3", "source": "sentinel_linear_search([0, 5, 7, 10, 15], 6)\n", "want": ""}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-2e5473db1a78493e", "tree_sha256": "83211e3d25a91bcb6c478c6ae9ed74a0b72cc6e5cae0dc86d67d6363fd4bbf9e", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:searches/sentinel_linear_search.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def catalan_numbers(upper_limit: int) -> \"list[int]\":\n \"\"\"\n Return a list of the Catalan number sequence from 0 through `upper_limit`.\n\n >>> catalan_numbers(5)\n [1, 1, 2, 5, 14, 42]\n >>> catalan_numbers(2)\n [1, 1, 2]\n >>> catalan_numbers(-1)\n Traceback (most recent call last):\n ValueError: Limit for the Catalan sequence must be ≥ 0\n \"\"\"\n if upper_limit < 0:\n raise ValueError(\"Limit for the Catalan sequence must be ≥ 0\")\n\n catalan_list = [0] * (upper_limit + 1)\n\n # Base case: C(0) = C(1) = 1\n catalan_list[0] = 1\n if upper_limit > 0:\n catalan_list[1] = 1\n\n # Recurrence relation: C(i) = sum(C(j).C(i-j-1)), from j = 0 to i\n for i in range(2, upper_limit + 1):\n for j in range(i):\n catalan_list[i] += catalan_list[j] * catalan_list[i - j - 1]\n\n return catalan_list\n"}, "sha256": "3adebde86adfc2673db82bb95f801f6a848677758980a12f5863a3abb71d8ced"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "3adebde86adfc2673db82bb95f801f6a848677758980a12f5863a3abb71d8ced", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "2cb79b6e1ad79029b69d7b4eedefcbb5539b94384b77baefae2788683e5c2cad", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00382"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00382", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 14, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def catalan_numbers(upper_limit: int) -> \"list[int]\":\n \"\"\"\n Return a list of the Catalan number sequence from 0 through `upper_limit`.\n\n >>> catalan_numbers(5)\n [1, 1, 2, 5, 14, 42]\n >>> catalan_numbers(2)\n [1, 1, 2]\n >>> catalan_numbers(-1)\n Traceback (most recent call last):\n ValueError: Limit for the Catalan sequence must be ≥ 0\n \"\"\"\n if upper_limit < 0:\n raise ValueError(\"Limit for the Catalan sequence must be ≥ 0\")\n\n catalan_list = [0] * (upper_limit - 1)\n\n # Base case: C(0) = C(1) = 1\n catalan_list[0] = 1\n if upper_limit > 0:\n catalan_list[1] = 1\n\n # Recurrence relation: C(i) = sum(C(j).C(i-j-1)), from j = 0 to i\n for i in range(2, upper_limit + 1):\n for j in range(i):\n catalan_list[i] += catalan_list[j] * catalan_list[i - j - 1]\n\n return catalan_list\n"}, "sha256": "1808eb72b614f75594cc4c6ee0b946f54ab3ebc954b5cf83d0bc755b1d349fcf"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "catalan_numbers:0", "got": "IndexError: list index out of range", "source": "catalan_numbers(5)\n", "truncated": false, "want": "[1, 1, 2, 5, 14, 42]\n"}, {"example_id": "catalan_numbers:1", "got": "IndexError: list assignment index out of range", "source": "catalan_numbers(2)\n", "truncated": false, "want": "[1, 1, 2]\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "arithmetic_operator", "seed": 7, "span": {"col_offset": 38, "end_byte": 508, "lineno": 16, "node": "BinOp", "node_col_offset": 26, "node_end_col_offset": 41, "node_end_lineno": 16, "node_lineno": 16, "op_index": 0, "original_text": "+", "replacement_text": "-", "start_byte": 507}}, "public_tests": {"examples": [{"example_id": "catalan_numbers:0", "source": "catalan_numbers(5)\n", "want": "[1, 1, 2, 5, 14, 42]\n"}, {"example_id": "catalan_numbers:1", "source": "catalan_numbers(2)\n", "want": "[1, 1, 2]\n"}, {"example_id": "catalan_numbers:2", "source": "catalan_numbers(-1)\n", "want": "Traceback (most recent call last):\nValueError: Limit for the Catalan sequence must be ≥ 0\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-2cb03b9038e833c7", "tree_sha256": "3adebde86adfc2673db82bb95f801f6a848677758980a12f5863a3abb71d8ced", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:dynamic_programming/catalan_numbers.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "from __future__ import annotations\n\n\ndef pigeon_sort(array: list[int]) -> list[int]:\n \"\"\"\n Implementation of pigeon hole sort algorithm\n :param array: Collection of comparable items\n :return: Collection sorted in ascending order\n >>> pigeon_sort([0, 5, 3, 2, 2])\n [0, 2, 2, 3, 5]\n >>> pigeon_sort([])\n []\n >>> pigeon_sort([-2, -5, -45])\n [-45, -5, -2]\n \"\"\"\n if len(array) == 0:\n return array\n\n _min, _max = min(array), max(array)\n\n # Compute the variables\n holes_range = _max - _min + 1\n holes, holes_repeat = [0] * holes_range, [0] * holes_range\n\n # Make the sorting.\n for i in array:\n index = i - _min\n holes[index] = i\n holes_repeat[index] += 1\n\n # Makes the array back by replacing the numbers.\n index = 0\n for i in range(holes_range):\n while holes_repeat[i] > 0:\n array[index] = holes[i]\n index += 1\n holes_repeat[i] -= 1\n\n # Returns the sorted array.\n return array\n"}, "sha256": "640d952d768d57e33fb1784c0ad2267d683bd5a9dfca5fd08a4130a76ca6e8b1"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "640d952d768d57e33fb1784c0ad2267d683bd5a9dfca5fd08a4130a76ca6e8b1", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "efe4c1d11ec865cce13c786b5cb68793677903d621568129ca99d5d21672c644", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00389"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00389", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 11, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "from __future__ import annotations\n\n\ndef pigeon_sort(array: list[int]) -> list[int]:\n \"\"\"\n Implementation of pigeon hole sort algorithm\n :param array: Collection of comparable items\n :return: Collection sorted in ascending order\n >>> pigeon_sort([0, 5, 3, 2, 2])\n [0, 2, 2, 3, 5]\n >>> pigeon_sort([])\n []\n >>> pigeon_sort([-2, -5, -45])\n [-45, -5, -2]\n \"\"\"\n if len(array) == 0:\n return array\n\n _min, _max = min(array), max(array)\n\n # Compute the variables\n holes_range = _max - _min + 1\n holes, holes_repeat = [0] * holes_range, [0] * holes_range\n\n # Make the sorting.\n for i in array:\n index = i - _min\n holes[index] = i\n holes_repeat[index] += 1\n\n # Makes the array back by replacing the numbers.\n index = 0\n for i in range(holes_range):\n while holes_repeat[i] > 1:\n array[index] = holes[i]\n index += 1\n holes_repeat[i] -= 1\n\n # Returns the sorted array.\n return array\n"}, "sha256": "9e6a4a86eff5c43c4b05b0cf8a2170fa013e32fa71c711a665d4c41b37a6184c"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "pigeon_sort:0", "got": "[2, 5, 3, 2, 2]\n", "source": "pigeon_sort([0, 5, 3, 2, 2])\n", "truncated": false, "want": "[0, 2, 2, 3, 5]\n"}, {"example_id": "pigeon_sort:2", "got": "[-2, -5, -45]\n", "source": "pigeon_sort([-2, -5, -45])\n", "truncated": false, "want": "[-45, -5, -2]\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "off_by_one", "seed": 7, "span": {"col_offset": 32, "end_byte": 864, "lineno": 34, "node": "Constant", "node_col_offset": 32, "node_end_col_offset": 33, "node_end_lineno": 34, "node_lineno": 34, "op_index": 0, "original_text": "0", "replacement_text": "1", "start_byte": 863}}, "public_tests": {"examples": [{"example_id": "pigeon_sort:0", "source": "pigeon_sort([0, 5, 3, 2, 2])\n", "want": "[0, 2, 2, 3, 5]\n"}, {"example_id": "pigeon_sort:1", "source": "pigeon_sort([])\n", "want": "[]\n"}, {"example_id": "pigeon_sort:2", "source": "pigeon_sort([-2, -5, -45])\n", "want": "[-45, -5, -2]\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-e923f0a8fc45fbad", "tree_sha256": "640d952d768d57e33fb1784c0ad2267d683bd5a9dfca5fd08a4130a76ca6e8b1", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:sorts/pigeon_sort.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "def average_absolute_deviation(nums: list[int]) -> float:\n \"\"\"\n Return the average absolute deviation of a list of numbers.\n Wiki: https://en.wikipedia.org/wiki/Average_absolute_deviation\n\n >>> average_absolute_deviation([0])\n 0.0\n >>> average_absolute_deviation([4, 1, 3, 2])\n 1.0\n >>> average_absolute_deviation([2, 70, 6, 50, 20, 8, 4, 0])\n 20.0\n >>> average_absolute_deviation([-20, 0, 30, 15])\n 16.25\n >>> average_absolute_deviation([])\n Traceback (most recent call last):\n ...\n ValueError: List is empty\n \"\"\"\n if not nums: # Makes sure that the list is not empty\n raise ValueError(\"List is empty\")\n\n average = sum(nums) / len(nums) # Calculate the average\n return sum(abs(x - average) for x in nums) / len(nums)\n"}, "sha256": "af7b3ac9f9a986451e7307febb1a058bac3f18db147345e307a1f04fc0e0a54a"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "af7b3ac9f9a986451e7307febb1a058bac3f18db147345e307a1f04fc0e0a54a", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "e06dcbc485512856cc54efe21f41afd826be53dfc5caa1795a2eec78fe8b3c95", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00394"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00394", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 20, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "def average_absolute_deviation(nums: list[int]) -> float:\n \"\"\"\n Return the average absolute deviation of a list of numbers.\n Wiki: https://en.wikipedia.org/wiki/Average_absolute_deviation\n\n >>> average_absolute_deviation([0])\n 0.0\n >>> average_absolute_deviation([4, 1, 3, 2])\n 1.0\n >>> average_absolute_deviation([2, 70, 6, 50, 20, 8, 4, 0])\n 20.0\n >>> average_absolute_deviation([-20, 0, 30, 15])\n 16.25\n >>> average_absolute_deviation([])\n Traceback (most recent call last):\n ...\n ValueError: List is empty\n \"\"\"\n if not nums: # Makes sure that the list is not empty\n raise ValueError(\"List is empty\")\n\n average = sum(nums) / len(nums) # Calculate the average\n return sum(abs(x - average) for x in nums) / len(nums) - 1\n"}, "sha256": "a41dd02ba9989a9aa7476fce81a1d4a3d5cab96f36cb6f82d83e58a953d505e9"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "average_absolute_deviation:0", "got": "-1.0\n", "source": "average_absolute_deviation([0])\n", "truncated": false, "want": "0.0\n"}, {"example_id": "average_absolute_deviation:1", "got": "0.0\n", "source": "average_absolute_deviation([4, 1, 3, 2])\n", "truncated": false, "want": "1.0\n"}, {"example_id": "average_absolute_deviation:2", "got": "19.0\n", "source": "average_absolute_deviation([2, 70, 6, 50, 20, 8, 4, 0])\n", "truncated": false, "want": "20.0\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 787, "lineno": 23, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 58, "node_end_lineno": 23, "node_lineno": 23, "op_index": 0, "original_text": "sum(abs(x - average) for x in nums) / len(nums)", "replacement_text": "sum(abs(x - average) for x in nums) / len(nums) - 1", "start_byte": 740}}, "public_tests": {"examples": [{"example_id": "average_absolute_deviation:0", "source": "average_absolute_deviation([0])\n", "want": "0.0\n"}, {"example_id": "average_absolute_deviation:1", "source": "average_absolute_deviation([4, 1, 3, 2])\n", "want": "1.0\n"}, {"example_id": "average_absolute_deviation:2", "source": "average_absolute_deviation([2, 70, 6, 50, 20, 8, 4, 0])\n", "want": "20.0\n"}, {"example_id": "average_absolute_deviation:3", "source": "average_absolute_deviation([-20, 0, 30, 15])\n", "want": "16.25\n"}, {"example_id": "average_absolute_deviation:4", "source": "average_absolute_deviation([])\n", "want": "Traceback (most recent call last):\n ...\nValueError: List is empty\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-fb1de0672b6e6c56", "tree_sha256": "af7b3ac9f9a986451e7307febb1a058bac3f18db147345e307a1f04fc0e0a54a", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/average_absolute_deviation.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"} {"candidate_prediction": {"claimed_outcome": "repaired", "final_patch": {"files": {"program.py": "from __future__ import annotations\n\n\ndef mean(nums: list) -> float:\n \"\"\"\n Find mean of a list of numbers.\n Wiki: https://en.wikipedia.org/wiki/Mean\n\n >>> mean([3, 6, 9, 12, 15, 18, 21])\n 12.0\n >>> mean([5, 10, 15, 20, 25, 30, 35])\n 20.0\n >>> mean([1, 2, 3, 4, 5, 6, 7, 8])\n 4.5\n >>> mean([])\n Traceback (most recent call last):\n ...\n ValueError: List is empty\n \"\"\"\n if not nums:\n raise ValueError(\"List is empty\")\n return sum(nums) / len(nums)\n"}, "sha256": "f103adea08055c4958131091ab5eb0dd434dffd06009c3a4e6ed7fa7c674f0fe"}, "method": "inverse of the generator's own mutation (original span restored)"}, "family": "python-repair-agent-trajectory", "intervention": {"solver": {"digest": "f103adea08055c4958131091ab5eb0dd434dffd06009c3a4e6ed7fa7c674f0fe", "name": "inverse-mutation", "runtime": "programmatic", "temperature": null}, "trajectory": []}, "license": "Apache-2.0", "provenance": {"actors": {"oracle_certifier": {"kind": "programmatic", "name": "python-doctest-reference-harness", "role": "oracle_certifier", "version": "1.0.0"}, "solver": {"kind": "programmatic", "name": "inverse-mutation", "role": "solver", "version": "2.0.0"}, "task_author": {"kind": "programmatic", "name": "python-repair-mutator", "role": "task_author", "version": "2.0.0"}}, "license": "Apache-2.0", "lineage": {"command": "python3 pipelines/code_repair_cli.py generate --catalog catalogs/python-repair-v1 --seed 7 --count 400 --out --produced-at 2026-10-15T00:00:00Z", "commit_sha": "5e3b0488dd5671eceb47e3af9651e61d5a76373d", "gate": "code_repair REPLAY_PASSED", "lane": "code_repair", "project_training_policy": null, "record_sha256": "b9865508cb1b3a214b7803729bfeebecc342577954471ad2d6cfed7e89553fe7", "replay_command": "python3 pipelines/code_repair_cli.py replay --run --catalog catalogs/python-repair-v1 --out ", "repo": "rmems/synthetic-factory", "source_record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00399"}, "produced_at": "2026-10-15T00:00:00Z"}, "record_id": "pfr-890a8af791f8e079cc8bb97e221f32e9afac59da36174d4fa78e7d18d8727e2d-7-00399", "result": {"claims": {"claimed_outcome_matches_rerun": true, "observations_match_replay": true}, "execution_verification": "REPLAY_PASSED", "oracle": {"name": "python-doctest-reference-harness", "type": "measured_execution", "version": "1.0.0"}, "rerun": {"harness_sha256": "ea8da47dd3defc85bca778c3839eb1689fe114986c527d5be96def45ed81a743", "hidden_cases": 15, "mutant": false, "original": true, "patched": true, "tests_untouched": true, "timeout_s": 2.0}, "verdict": "REPAIRED_VERIFIED"}, "scenario": {"broken_program": {"files": {"program.py": "from __future__ import annotations\n\n\ndef mean(nums: list) -> float:\n \"\"\"\n Find mean of a list of numbers.\n Wiki: https://en.wikipedia.org/wiki/Mean\n\n >>> mean([3, 6, 9, 12, 15, 18, 21])\n 12.0\n >>> mean([5, 10, 15, 20, 25, 30, 35])\n 20.0\n >>> mean([1, 2, 3, 4, 5, 6, 7, 8])\n 4.5\n >>> mean([])\n Traceback (most recent call last):\n ...\n ValueError: List is empty\n \"\"\"\n if not nums:\n raise ValueError(\"List is empty\")\n return sum(nums) / len(nums) - 1\n"}, "sha256": "ad008cbe38fefc78a6fa5daa3664376c59a07089dd4c2310af811c66f99eab20"}, "failing_test": {"cmd": "pipelines/code_repair/_harness.py:main", "excerpt": [{"example_id": "mean:0", "got": "11.0\n", "source": "mean([3, 6, 9, 12, 15, 18, 21])\n", "truncated": false, "want": "12.0\n"}, {"example_id": "mean:1", "got": "19.0\n", "source": "mean([5, 10, 15, 20, 25, 30, 35])\n", "truncated": false, "want": "20.0\n"}, {"example_id": "mean:2", "got": "3.5\n", "source": "mean([1, 2, 3, 4, 5, 6, 7, 8])\n", "truncated": false, "want": "4.5\n"}], "exit_code": null, "stdout_sha256": null}, "injection": {"kind": "ast_mutation", "operator": "return_value", "seed": 7, "span": {"col_offset": 11, "end_byte": 502, "lineno": 22, "node": "Return", "node_col_offset": 4, "node_end_col_offset": 32, "node_end_lineno": 22, "node_lineno": 22, "op_index": 0, "original_text": "sum(nums) / len(nums)", "replacement_text": "sum(nums) / len(nums) - 1", "start_byte": 481}}, "public_tests": {"examples": [{"example_id": "mean:0", "source": "mean([3, 6, 9, 12, 15, 18, 21])\n", "want": "12.0\n"}, {"example_id": "mean:1", "source": "mean([5, 10, 15, 20, 25, 30, 35])\n", "want": "20.0\n"}, {"example_id": "mean:2", "source": "mean([1, 2, 3, 4, 5, 6, 7, 8])\n", "want": "4.5\n"}, {"example_id": "mean:3", "source": "mean([])\n", "want": "Traceback (most recent call last):\n ...\nValueError: List is empty\n"}], "kind": "doctest"}, "repo_snapshot": {"catalog": "python-repair-v1", "license": "MIT", "license_sha256": null, "program_id": "tap-76f75f25c94666a6", "tree_sha256": "f103adea08055c4958131091ab5eb0dd434dffd06009c3a4e6ed7fa7c674f0fe", "upstream": "TheAlgorithms/Python@2067ce6dfb3b0426a88c7a40531e355a5c703cff:maths/average_mean.py"}, "task": "You are given a Python module containing one function whose docstring examples are its specification. The function has a bug: at least one docstring example fails under doctest. Return the corrected module."}, "split": "train"}